* gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
[bpt/emacs.git] / src / ChangeLog
1 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4 does not become zero (Bug#12234).
5
6 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7
8 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
9 for GCC 4.7.1 x86-64.
10
11 2012-08-30 Glenn Morris <rgm@gnu.org>
12
13 * lread.c (init_lread): For out-of-tree builds, only add the
14 source directory's site-lisp dir to the load-path if it exists,
15 consistent with in-tree builds. (Bug#12302)
16
17 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
18
19 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
20 button_values to NULL. Call setStykeMask so dialogs get a close button.
21 (windowShouldClose:): Set window_closed.
22 (dealloc): New member, free button_values.
23 (process_dialog:): Make member function. Remove window argument,
24 replace window with self. Count buttons and allocate and store values
25 in button_values.
26 (addButton:value:row:): value is int with the name tag. Call setTag
27 with tag. Remove return self, declare return value as void.
28 (addString:row:): Remove return self, declare return value as void.
29 (addSplit): Remove return self, declare return value as void.
30 (clicked:): Remove return self, declare return value as void.
31 Set dialog_return to button_values[seltag]. Code formatting change.
32 (initFromContents:isQuestion:): Adjust call to process_dialog.
33 Code formatting change.
34 (timeout_handler:): Set timer_fired to YES.
35 (runDialogAt:): Set timer_fired to NO.
36 Handle click on close button as quit.
37
38 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
39 Add window_closed and button_values. Add void as return value for
40 add(Button|String|Split). addButton takes int instead of Lisp_Object.
41 Add process_dialog as new member.
42
43 2012-08-28 Eli Zaretskii <eliz@gnu.org>
44
45 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
46 is not one of the heaps we manage. (Bug#12242)
47
48 2012-08-28 Glenn Morris <rgm@gnu.org>
49
50 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
51
52 2012-08-28 Martin Rudalics <rudalics@gmx.at>
53
54 * window.c (Fset_window_configuration): Remove handling of
55 auto-buffer-name window parameter. Install revision of reverted
56 fix.
57
58 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
59
60 Do not allow to set major mode for a dead buffer.
61 * buffer.c (Fset_buffer_major_mode): Signal an error
62 if the buffer is dead.
63 (Fother_buffer, other_buffer_safely): Remove redundant
64 nested declaration.
65
66 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
67
68 Always use set_buffer_if_live to restore original buffer at unwind.
69 * buffer.h (record_unwind_current_buffer): New function.
70 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
71 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
72 * undo.c, window.c: Adjust users.
73 * buffer.c (set_buffer_if_live): Fix comment.
74
75 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
76
77 Fix usage of set_buffer_internal.
78 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
79 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
80 * coding.c (decode_coding): Omit redundant test.
81 * fileio.c (decide_coding_unwind): Likewise.
82 * fns.c (secure_hash): Likewise.
83 * insdel.c (modify_region): Likewise.
84 * keyboard.c (command_loop_1): Likewise.
85 * print.c (PRINTFINISH): Likewise.
86 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
87
88 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
89
90 * dispnew.c: Use bool for boolean.
91 (frame_garbaged, display_completed, delayed_size_change)
92 (fonts_changed_p, add_window_display_history)
93 (add_frame_display_history, verify_row_hash)
94 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
95 (row_equal_p, realloc_glyph_pool)
96 (allocate_matrices_for_frame_redisplay)
97 (showing_window_margins_p)
98 (adjust_frame_glyphs_for_frame_redisplay)
99 (build_frame_matrix_from_leaf_window, make_current)
100 (mirrored_line_dance, mirror_line_dance, update_frame)
101 (update_window_tree, update_single_window)
102 (check_current_matrix_flags, update_window, update_text_area)
103 (update_window_line, set_window_update_flags, scrolling_window)
104 (update_frame_1, scrolling, buffer_posn_from_coords)
105 (do_pending_window_change, change_frame_size)
106 (change_frame_size_1, sit_for):
107 Use bool for boolean.
108 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
109 and remove last int (actually boolean) argument, which was always 0.
110 All callers changed.
111 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
112 * dispextern.h (struct composition_it): Use bool for boolean.
113 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
114 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
115 * dired.c (file_name_completion):
116 Use bool for boolean. (This was missed in an earlier change.)
117
118 2012-08-27 Martin Rudalics <rudalics@gmx.at>
119
120 * window.c (Fset_window_configuration): Revert first part of
121 last change.
122
123 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
124
125 * nsterm.h (NSPanel): New class variable dialog_return.
126
127 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
128 dialog_return.
129 (windowShouldClose:): Use stop instead of stopModalWithCode.
130 (clicked:): Ditto, and also set dialog_return (Bug#12258).
131 (timeout_handler:): Use stop instead of abortModal. Send a dummy
132 event.
133 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
134 modal loop returns.
135
136 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
137
138 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
139 * composite.c (find_composition, composition_gstring_p)
140 (composition_reseat_it, find_automatic_composition):
141 * data.c (let_shadows_buffer_binding_p)
142 (let_shadows_global_binding_p, set_internal, make_blv)
143 (Fmake_variable_buffer_local, Fmake_local_variable)
144 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
145 (cons_to_signed, arith_driver):
146 * dbusbind.c (xd_in_read_queued_messages):
147 * dired.c (directory_files_internal, file_name_completion):
148 Use bool for booleans.
149 * dired.c (file_name_completion):
150 * process.h (fd_callback):
151 Omit int (actually boolean) argument. It wasn't being used.
152 All uses changed.
153 * composite.h, lisp.h: Reflect above API changes.
154
155 * cmds.c, coding.c: Use bool for booleans.
156 * cmds.c (move_point, Fself_insert_command):
157 * coding.h (struct composition status, struct coding_system):
158 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
159 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
160 (emacs_mule_char, decode_coding_emacs_mule)
161 (encode_coding_emacs_mule, detect_coding_iso_2022)
162 (decode_coding_iso_2022, encode_invocation_designation)
163 (encode_designation_at_bol, encode_coding_iso_2022)
164 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
165 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
166 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
167 (encode_coding_raw_text, detect_coding_charset)
168 (decode_coding_charset, encode_coding_charset, detect_eol)
169 (detect_coding, get_translation_table, produce_chars)
170 (consume_chars, reused_workbuf_in_use)
171 (make_conversion_work_buffer, code_conversion_save)
172 (decode_coding_object, encode_coding_object)
173 (detect_coding_system, char_encodable_p)
174 (Funencodable_char_position, code_convert_region)
175 (code_convert_string, code_convert_string_norecord)
176 (Fset_coding_system_priority):
177 * fileio.c (Finsert_file_contents):
178 Use bool for booleans.
179 * coding.h, lisp.h: Reflect above API changes.
180 * coding.c: Remove unnecessary static function decls.
181 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
182 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
183 not a boolean 'int', since callers never look at the return value.
184 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
185 * coding.h (decoding_buffer_size, encoding_buffer_size)
186 (emacs_mule_string_char): Remove unused extern decls.
187 (struct iso_2022_spec, struct coding_system):
188 Use 'unsigned int : 1' for boolean fields, since there's more than one.
189 (struct emacs_mule_spec): Remove unused field 'full_support'.
190 All initializations removed.
191 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
192
193 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
194
195 Fix spare memory change (Bug#12286).
196 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
197 (valid_lisp_object_p): Likewise.
198
199 2012-08-27 Martin Rudalics <rudalics@gmx.at>
200
201 * window.c (Fset_window_configuration): Record any window's old
202 buffer if it's replaced (see Bug#8789). If the new current
203 buffer doesn't appear in the selected window, go to its old
204 point (Bug#12208).
205
206 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
207
208 Special MEM_TYPE_SPARE to denote reserved memory.
209 * alloc.c (enum mem_type): New memory type.
210 (refill_memory_reserve): Use new type for spare memory.
211 This prevents live_cons_p and live_string_p from incorrect
212 detection of uninitialized objects from spare memory as live.
213
214 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
215
216 Spelling fixes.
217 * Makefile.in (.PHONY): versioclean -> versionclean.
218
219 Remove unused external symbols.
220 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
221 * window.c (Qwindow_valid_p, decode_valid_window):
222 Now static, not extern.
223 * data.c (Qinterval): Remove; unused.
224 (syms_of_data): Do not define 'interval'.
225 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
226 * window.h (decode_valid_window):
227 Remove decls.
228
229 * character.c, charset.c, chartab.c: Use bool for booleans.
230 * character.c (lisp_string_width, string_count_byte8)
231 (string_escape_byte8):
232 * charset.c (charset_map_loaded, load_charset_map, read_hex):
233 (load_charset_map_from_file, map_charset_chars)
234 (Fdefine_charset_internal, define_charset_internal)
235 (Fdeclare_equiv_charset, find_charsets_in_text)
236 (Ffind_charset_region, char_charset, Fiso_charset):
237 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
238 (sub_char_table_set, sub_char_table_set_range)
239 (char_table_set_range, optimize_sub_char_table)
240 (map_sub_char_table):
241 Use bool for boolean.
242 * character.c (str_to_unibyte): Omit last boolean argument; it was
243 always 0. All callers changed.
244 * character.h, charset.h: Adjust to match previous changes.
245 * character.h (char_printable_p): Remove decl of nonexistent function.
246 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
247 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
248 are all boolean, so make them single-bit bitfields.
249
250 * lisp.h (ASET): Remove attempt to detect side effects.
251 It was meant to be temporary and it often doesn't work,
252 because when IDX has side effects the behavior of IDX==IDX
253 is undefined. See Stefan Monnier in
254 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
255
256 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
257
258 * lisp.h (functionp): New function (extracted from Ffunctionp).
259 (FUNCTIONP): Use it.
260 * eval.c (Ffunctionp): Use it.
261
262 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
263
264 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
265 as that's faster and simpler than static storage. Don't bother
266 with the g_main_context_query overhead if g_main_context_pending
267 says no events are pending.
268 (gfds, gfds_size): Remove these static vars.
269 (xgselect_initialize): Remove; no longer needed.
270 All uses and decls removed.
271
272 * emacs.c (fatal_error_signal_hook): Remove.
273 All uses removed. This leftover from old code was always 0.
274
275 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
276 * casefiddle.c (casify_object, casify_region):
277 * casetab.c (set_case_table):
278 * category.c, category.h (word_boundary_p):
279 * category.h (CHAR_HAS_CATEGORY):
280 Use bool for booleans, instead of int.
281
282 2012-08-25 Eli Zaretskii <eliz@gnu.org>
283
284 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
285
286 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
287
288 On assertion failure, print backtrace if available.
289 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
290 (die) [ENABLE_CHECKING]: Print a backtrace if available.
291 * Makefile.in (LIB_EXECINFO): New macro.
292 (LIBES): Use it.
293
294 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
295 * bytecode.c (exec_byte_code):
296 * callint.c (check_mark, Fcall_interactively):
297 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
298 (getenv_internal, sync_process_alive, call_process_exited):
299 * lisp.h (USE_SAFE_ALLOCA):
300 Use bool for booleans, instead of int.
301 * lisp.h, process.h: Adjust prototypes to match above changes.
302 * callint.c (Fcall_interactively): Don't assume the mark's
303 offset fits in 'int'.
304
305 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
306
307 * buffer.c, buffer.h: Use bool for boolean.
308 * buffer.c (reset_buffer_local_variables)
309 (buffer_lisp_local_variables, Fset_buffer_modified_p)
310 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
311 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
312 (overlay_touches_p, overlay_strings, Foverlay_put)
313 (report_overlay_modification, call_overlay_mod_hooks):
314 (mmap_enlarge, mmap_set_vars):
315 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
316 Use bool for booleans, instead of int.
317 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
318 since the 1-or-0 return value is always ignored anyway.
319 (mmap_initialized_p):
320 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
321 * buffer.h, lisp.h: Adjust prototypes to match above changes.
322
323 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
324
325 * bidi.c: Use bool for boolean.
326 This is a bit more readable, and makes the text segment of bidi.o
327 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
328 Presumably it's faster too.
329 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
330 Now bool.
331 (bidi_cache_find_level_change, bidi_cache_iterator_state)
332 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
333 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
334 (bidi_explicit_dir_char, bidi_level_of_next_char)
335 (bidi_find_other_level_edge, bidi_move_to_visually_next):
336 Use bool for booleans, instead of int.
337 * dispextern.h (bidi_init_it, bidi_paragraph_init)
338 (bidi_unshelve_cache): Adjust decls to match code.
339
340 2012-08-23 Martin Rudalics <rudalics@gmx.at>
341
342 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
343 argument.
344
345 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
346
347 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
348 * atimer.h: Include <stdbool.h>.
349
350 2012-08-22 Dan Nicolaescu <dann@gnu.org>
351
352 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
353 compile time tests instead of run time tests on systems that do
354 not use them.
355 (FRAME_MAC_P): Remove leftover from deleted code.
356 * frame.c (syms_of_frame): Remove leftover from deleted code.
357
358 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
359
360 * nsterm.m (insertText:): Don't clear modifiers if code is space.
361
362 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
363
364 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
365 Otherwise, the compiler complains about (A?B:C) where B is void
366 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
367 (fontset_add): Return void, for FONTSET_ADD.
368
369 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
370
371 * alloc.c: Use bool for booleans.
372 (gc_in_progress, abort_on_gc)
373 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
374 (dont_register_blocks) [GC_MALLOC_CHECK]:
375 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
376 (check_string_bytes, make_specified_string, memory_full)
377 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
378 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
379 (mark_stack, valid_pointer_p, make_pure_string)
380 (Fgarbage_collect, survives_gc_p, gc_sweep):
381 Use bool for booleans, instead of int.
382 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
383 Remove unused local.
384 * alloc.c (PURE_POINTER_P):
385 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
386 * editfns.c (Fformat):
387 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
388 (Fdo_auto_save):
389 * fns.c (sweep_weak_table):
390 * lisp.h (suppress_checking, push_message, survives_gc_p)
391 (make_pure_string, gc_in_progress, abort_on_gc):
392 * lread.c (readchar, read1):
393 * print.c (Fprin1_to_string):
394 * xdisp.c (push_message):
395 Use bool for booleans affected directly or indirectly by
396 alloc.c's changes.
397
398 Make recently-introduced setters macros.
399 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
400 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
401 (set_fontset_default, set_fontset_fallback): Rename from their
402 upper-case counterparts, and make them functions rather than macros.
403 This is more consistent with the other recently-introduced setters.
404 These don't need to be inline, since they're local.
405
406 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
407
408 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
409 the loop (Bug#12247).
410
411 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
412
413 * lisp.h (vcopy): Use memcpy rather than our own loop.
414 This fixes a performance regression introduced by the recent
415 addition of vcopy. This means 'vcopy' will need to be modified
416 for a copying collector, but that's OK. Also, tighten the
417 checking in the assertion.
418
419 2012-08-21 Eli Zaretskii <eliz@gnu.org>
420
421 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
422 components for RTL text (Bug#11860). Adjust X-OFFSET of each
423 non-base glyph for the width of the base character, according to
424 what x_draw_composite_glyph_string_foreground expects.
425 Generate WADJUST value according to composition_gstring_width's
426 expectations, to produce correct width of the composed character.
427 Reverse the sign of the DU offset produced by ScriptPlace.
428
429 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
430
431 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
432
433 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
434
435 Avoid direct writes to contents member of struct Lisp_Vector.
436 * lisp.h (vcopy): New function to copy data into vector.
437 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
438 * fns.c (Ffillarray): Use ASET.
439 * keyboard.c (timer_check_2): Use AREF and ASET.
440 (append_tool_bar_item, Frecent_keys): Use vcopy.
441 * lread.c (read_vector): Use ASET.
442 * msdos.c (Frecent_doskeys): Use vcopy.
443 * xface.c (Finternal_copy_lisp_face): Use vcopy.
444 (Finternal_merge_in_global_face): Use ASET and vcopy.
445 * xfont.c (xfont_list_pattern): Likewise.
446
447 2012-08-21 Martin Rudalics <rudalics@gmx.at>
448
449 * window.c (Fwindow_point): For the selected window always return
450 the position of its buffer's point.
451 (Fset_window_point): For the selected window always go in its
452 buffer to the specified position.
453
454 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
455
456 Setter macros for fontsets.
457 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
458 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
459 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
460 Adjust users.
461
462 2012-08-20 Glenn Morris <rgm@gnu.org>
463
464 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
465 Don't assume that `ln -f' works.
466
467 2012-08-20 Eli Zaretskii <eliz@gnu.org>
468
469 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
470 and later about non-assignments with no effect. See discussion at
471 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
472 details.
473
474 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
475
476 Inline setter functions for Lisp_Objects slots of struct specbinding.
477 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
478 Adjust users.
479
480 2012-08-20 Martin Rudalics <rudalics@gmx.at>
481
482 * window.c (select_window): Always make selected window's buffer
483 current.
484
485 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
486
487 Use AREF and ASET for docstrings of category tables.
488 * category.h (CATEGORY_DOCSTRING): Use AREF.
489 (SET_CATEGORY_DOCSTRING): Use ASET.
490 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
491
492 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
493
494 Inline setter functions for hash table members.
495 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
496 (set_hash_hash, set_hash_index): Rename with _slot suffix.
497 (set_hash_key_and_value, set_hash_index, set_hash_next)
498 (set_hash_hash): New functions.
499 * charset.c, fns.c: Adjust users.
500
501 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
502
503 Inline getter and setter functions for per-buffer values.
504 * buffer.h (per_buffer_default, set_per_buffer_default)
505 (per_buffer_value, set_per_buffer_value): New functions.
506 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
507 * buffer.c, data.c: Adjust users.
508
509 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
510
511 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
512
513 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
514
515 Rely on <config.h> + <unistd.h> to declare 'environ',
516 as gnulib does this if the system doesn't.
517 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
518 Remove declaration. MS-Windows declares it on stdlib.h which is
519 included by conf_post.h.
520 * emacs.c (environ) [DOUG_LEA_MALLOC]:
521 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
522 * vm-limit.c: Include <unistd.h>, for 'environ'.
523
524 * unexaix.c, unexcoff.c: Include "mem-limits.h".
525 (start_of_data): Remove decl; mem-limits.h provides it.
526
527 * xdisp.c (handle_invisible_prop): Make it a bit faster
528 and avoid a gcc -Wmaybe-uninitialized diagnostic.
529
530 2012-08-19 Chong Yidong <cyd@gnu.org>
531
532 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
533 ends (Bug#3874).
534
535 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
536
537 * .gdbinit: Use call instead of set when calling a function in the
538 inferior.
539
540 * data.c (set_internal): Don't use set_blv_found.
541 (Fkill_local_variable): Likewise.
542
543 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
544
545 * nsfont.m (ns_ascii_average_width): Ensure the string
546 ascii_printable is initialized with a null-terminated character
547 array. Otherwise, it can contain undesired extra characters.
548
549 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
550
551 port new setting code to Sun C 5.8 2005/10/13
552 * chartab.c, lisp.h (char_table_set, char_table_set_range):
553 Return void, not Lisp_Object. Otherwise, the compiler
554 complains about (A?B:C) where B is void and C is Lisp_Object
555 when compiling CHAR_TABLE_SET, due to the recent change to
556 the API of sub_char_table_set_contents.
557
558 2012-08-18 Chong Yidong <cyd@gnu.org>
559
560 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
561 for the string case (Bug#3874).
562
563 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
564
565 * buffer.h (BSET): Remove (Bug#12215).
566 Replace all uses with calls to new setter functions.
567 (bset_bidi_paragraph_direction, bset_case_canon_table)
568 (bset_case_eqv_table, bset_directory, bset_display_count)
569 (bset_display_time, bset_downcase_table)
570 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
571 (bset_last_selected_window, bset_local_var_alist)
572 (bset_mark_active, bset_point_before_scroll, bset_read_only)
573 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
574 (bset_width_table):
575 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
576 (bset_auto_fill_function, bset_auto_save_file_format)
577 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
578 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
579 (bset_cache_long_line_scans, bset_case_fold_search)
580 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
581 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
582 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
583 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
584 (bset_header_line_format, bset_indicate_buffer_boundaries)
585 (bset_indicate_empty_lines, bset_invisibility_spec)
586 (bset_left_fringe_width, bset_major_mode, bset_mark)
587 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
588 (bset_name, bset_overwrite_mode, bset_pt_marker)
589 (bset_right_fringe_width, bset_save_length)
590 (bset_scroll_bar_width, bset_scroll_down_aggressively)
591 (bset_scroll_up_aggressively, bset_selective_display)
592 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
593 (bset_word_wrap, bset_zv_marker):
594 * category.c (bset_category_table):
595 * syntax.c (bset_syntax_table):
596 New setter functions.
597
598 * process.h (PSET): Remove (Bug#12215).
599 Replace all uses with calls to new setter functions.
600 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
601 (PROCESS_INLINE): New macro.
602 (pset_childp): New setter function.
603 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
604 * process.c (PROCESS_INLINE):
605 Define to EXTERN_INLINE, so that the corresponding functions
606 are compiled into code.
607 (pset_buffer, pset_command, pset_decode_coding_system)
608 (pset_decoding_buf, pset_encode_coding_system)
609 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
610 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
611 (pset_type, pset_write_queue): New setter functions.
612
613 * window.h (WSET): Remove (Bug#12215).
614 Replace all uses with calls to new setter functions.
615 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
616 (WINDOW_INLINE): New macro.
617 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
618 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
619 (wset_total_lines, wset_vertical_scroll_bar)
620 (wset_window_end_pos, wset_window_end_valid)
621 (wset_window_end_vpos): New setter functions.
622 * window.c (WINDOW_INLINE):
623 Define to EXTERN_INLINE, so that the corresponding functions
624 are compiled into code.
625 (wset_combination_limit, wset_dedicated, wset_display_table)
626 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
627 (wset_new_normal, wset_new_total, wset_next_buffers)
628 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
629 (wset_prev_buffers, wset_right_fringe_width)
630 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
631 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
632 (wset_window_parameters):
633 * xdisp.c (wset_base_line_number, wset_base_line_pos)
634 (wset_column_number_displayed, wset_region_showing):
635 New setter functions.
636
637 * termhooks.h (TSET): Remove (Bug#12215).
638 Replace all uses with calls to new setter functions.
639 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
640 (TERMHOOKS_INLINE): New macro.
641 (tset_charset_list, tset_selection_alist): New setter functions.
642 * terminal.c (TERMHOOKS_INLINE):
643 Define to EXTERN_INLINE, so that the corresponding functions
644 are compiled into code.
645 (tset_param_alist): New setter function.
646
647 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
648
649 * keyboard.h (KSET): Remove (Bug#12215).
650 Replace all uses with calls to new setter functions.
651 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
652 (KEYBOARD_INLINE): New macro.
653 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
654 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
655 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
656 New setter functions.
657 * keyboard.c (KEYBOARD_INLINE):
658 Define to EXTERN_INLINE, so that the corresponding functions
659 are compiled into code.
660 (kset_echo_string, kset_kbd_queue)
661 (kset_keyboard_translate_table, kset_last_prefix_arg)
662 (kset_last_repeatable_command, kset_local_function_key_map)
663 (kset_overriding_terminal_local_map, kset_real_last_command)
664 (kset_system_key_syms): New setter functions.
665
666 * frame.h (FSET): Remove (Bug#12215).
667 Replace all uses with calls to new setter functions.
668 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
669 (FRAME_INLINE): New macro.
670 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
671 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
672 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
673 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
674 (fset_param_alist, fset_root_window, fset_scroll_bars)
675 (fset_selected_window, fset_title, fset_tool_bar_items)
676 (fset_tool_bar_position, fset_tool_bar_window): New functions.
677 * frame.c (FRAME_INLINE):
678 Define to EXTERN_INLINE, so that the corresponding functions
679 are compiled into code.
680 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
681
682 A few more naming-convention fixes for getters and setters.
683 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
684 and rename from buffer_overlays_set_before.
685 (set_buffer_overlays_after): Move here from buffer.h, and rename
686 from buffer_overlays_set_after.
687 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
688 All uses changed.
689 (set_buffer_intervals): Rename from buffer_set_intervals.
690 * intervals.c (set_interval_object): Move here from intervals.h,
691 and rename from interval_set_object.
692 (set_interval_left): Move here from intervals.h, and rename from
693 interval_set_left.
694 (set_interval_right): Move here from intervals.h, and rename from
695 interval_set_right.
696 (copy_interval_parent): Move here from intervals.h, and rename from
697 interval_copy_parent.
698 * intervals.h (set_interval_parent): Rename from interval_set_parent.
699 (set_interval_plist): Rename from interval_set_plist.
700 Return void, not Lisp_Object, since no caller uses the result.
701 * lisp.h (string_intervals): Rename from string_get_intervals.
702 (set_string_intervals): Rename from string_set_intervals.
703
704 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
705 (set_char_table_contents): Rename from char_table_set_contents.
706 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
707 All uses changed. See the end of
708 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
709
710 * lisp.h (CSET): Remove (Bug#12215).
711 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
712 (set_char_table_purpose): New functions,
713 replacing CSET. All uses changed. For example, replace
714 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
715 "set_char_table_parent (char_table, parent);".
716 The old version was confusing because it used the same name
717 'parent' for two different things.
718
719 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
720
721 Functions to get and set Lisp_Object fields of buffer-local variables.
722 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
723 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
724 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
725 * data.c, eval.c, frame.c: Adjust users.
726
727 2012-08-17 Chong Yidong <cyd@gnu.org>
728
729 * xfaces.c (merge_face_vectors): If the target font specfies a
730 font spec, make the font's attributes take precedence over
731 directly-specified attributes.
732 (merge_face_ref): Recognize :font.
733
734 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
735
736 Do not use memcpy for copying intervals.
737 * intervals.c (reproduce_interval): New function.
738 (reproduce_tree, reproduce_tree_obj): Use it.
739 (reproduce_tree_obj): Remove prototype.
740
741 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
742
743 * lisp.h (duration_to_sec_usec): Remove unused decl.
744
745 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
746
747 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
748 to an allocated instance of NSString, not to the class itself.
749
750 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
751
752 * makefile.w32-in (C_CTYPE_H): New macro.
753 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
754 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
755 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
756
757 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
758
759 Use ASCII tests for character types.
760 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
761 * xfns.c, xterm.c:
762 Don't include <ctype.h>; was not needed.
763 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
764 * sysdep.c, xfaces.c:
765 Include <c-ctype.h> instead of <ctype.h>.
766 * nsterm.m: Include <c-ctype.h>.
767 * charset.c (read_hex):
768 * doc.c (Fsnarf_documentation):
769 * fileio.c (IS_DRIVE) [WINDOWSNT]:
770 (DRIVE_LETTER) [DOS_NT]:
771 (Ffile_name_directory, Fexpand_file_name)
772 (Fsubstitute_in_file_name):
773 * font.c (font_parse_xlfd, font_parse_fcname):
774 * frame.c (x_set_font_backend):
775 * gtkutil.c (xg_get_font):
776 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
777 * nsimage.m (hexchar):
778 * nsterm.m (ns_xlfd_to_fontname):
779 * sysdep.c (system_process_attributes):
780 * xfaces.c (hash_string_case_insensitive):
781 Use C-locale tests instead of locale-specific tests for character
782 types, since we want the ASCII interpretation here, not the
783 interpretation suitable for whatever happens to be the current locale.
784
785 2012-08-16 Martin Rudalics <rudalics@gmx.at>
786
787 Consistently check windows for validity/liveness
788 (Bug#11984, Bug#12025, Bug#12026).
789 * lisp.h (CHECK_VALID_WINDOW): New macro.
790 * window.c (decode_window): Rename to decode_live_window.
791 (decode_valid_window, Fwindow_valid_p): New functions.
792 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
793 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
794 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
795 (Fwindow_prev_sibling, Fwindow_combination_limit)
796 (Fset_window_combination_limit, Fwindow_use_time)
797 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
798 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
799 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
800 (Fwindow_hscroll, Fset_window_hscroll)
801 (Fwindow_redisplay_end_trigger)
802 (Fset_window_redisplay_end_trigger, Fwindow_edges)
803 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
804 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
805 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
806 (Fwindow_end, Fset_window_point, Fset_window_start)
807 (Fpos_visible_in_window_p, Fwindow_line_height)
808 (Fwindow_dedicated_p, Fset_window_dedicated_p)
809 (Fwindow_prev_buffers, Fset_window_prev_buffers)
810 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
811 (Fset_window_parameter, Fwindow_display_table)
812 (Fset_window_display_table, Fdelete_other_windows_internal)
813 (Fset_window_buffer, Fset_window_new_total)
814 (Fset_window_new_normal, Fdelete_window_internal)
815 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
816 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
817 (Fwindow_scroll_bars): Check whether argument window is a valid or
818 live window. Update doc-strings.
819 (syms_of_window): New symbol Qwindow_valid_p.
820 * keyboard.c (Fposn_at_x_y): Check whether argument
821 frame_or_window denotes a valid window.
822
823 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
824
825 Fix previous char table change.
826 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
827 * chartab.c (optimize_sub_char_table): Likewise.
828
829 2012-08-16 Chong Yidong <cyd@gnu.org>
830
831 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
832
833 * xfont.c (xfont_open):
834 * xftfont.c (xftfont_open): Set the font's max_width field.
835
836 * nsfont.m (nsfont_open): Similar to the Xft backend, set
837 min_width to space_width and average_width to the average over
838 printable ASCII characters.
839 (ns_char_width): Code cleanup.
840 (ns_ascii_average_width): New utility function.
841
842 * font.h (struct font): Update comments.
843
844 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
845
846 Simple interface to set Lisp_Object fields of character tables.
847 * lisp.h (CSET): New macro.
848 (char_table_set_extras, char_table_set_contents)
849 (sub_char_table_set_contents): New function.
850 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
851 * syntax.c: Adjust users.
852
853 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
854
855 * eval.c (eval_sub): Bind lexical-binding.
856 * lread.c (Qlexical_binding): Make non-static.
857
858 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
859
860 * nsmenu.m (popupSession): Remove.
861 (pop_down_menu): Remove endModalSession.
862 (timeout_handler:): New method.
863 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
864 Call runModalForWindow. Check timer_fired when it returns.
865 If not set, cancel timer and break out of loop.
866 Otherwise loop again, with a new timeout.
867
868 * nsterm.m: Include fcntl.h if present.
869 (fd_entry, t_readfds, inNsSelect): Remove.
870 (select_writefds, select_valid, select_timeout, selfds)
871 (select_mutex, apploopnr): Add.
872 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
873 Otherwise call kbd_buffer_store_event.
874 (ns_send_appdefined): Remove release of fd_entry.
875 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
876 Increment and decrement apploopnr.
877 (ns_select): If no file descriptors, just do a NSTimer.
878 Otherwise copy read/write masks and start select thread (fd_handler).
879 Start main loop and wait for application defined event.
880 Inform select thread to stop selecting after main loop is exited.
881 (ns_term_init): Create selfds pipe and set non-blocking.
882 Initialize select_mutex. Start the select thread (fd_handler).
883 (fd_handler:): Loop forever, wait for info from the main thread
884 to either start or stop selecting. When select returns, send
885 and appdefined event.
886 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
887 If not call kbd_buffer_store_event.
888
889 * nsterm.h (EmacsApp): fd_handler takes id argument.
890 (EmacsDialogPanel): Add timer_fired and timeout_handler.
891
892 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
893
894 2012-08-15 Eli Zaretskii <eliz@gnu.org>
895
896 * region-cache.c (move_cache_gap): Update gap_len using the actual
897 growth of the boundaries array. Do not change cache_len.
898 (Bug#12196)
899
900 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
901
902 Generalize and cleanup font subsystem checks.
903 * font.h (FONT_DEBUG, font_assert): Remove.
904 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
905 Change font_assert to eassert. Use eassert where appropriate.
906
907 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
908
909 * gtkutil.c (xg_get_font): Use pango_units_to_double.
910
911 2012-08-15 Chong Yidong <cyd@gnu.org>
912
913 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
914 When using the new font chooser, use gtk_font_chooser_get_font_desc to
915 extract the font descriptor instead of just the font name.
916 In that case, return a font spec instead of a string.
917 (x_last_font_name): Move to this file from xfns.c.
918
919 * xfns.c (Fx_select_font): The return value can also be a font
920 spec. Move x_last_font_name management to gtkutil.c.
921
922 * xfaces.c: Make font weight and style symbols non-static.
923
924 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
925
926 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
927 (bug#12117).
928
929 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
930
931 * alloc.c (Fgarbage_collect): Use plural form consistently.
932
933 2012-08-14 Eli Zaretskii <eliz@gnu.org>
934
935 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
936 iteration through the command loop. Fixes a problem whereby mouse
937 movements are ignored until the first mouse click.
938
939 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
940
941 Use bool, not int, for Lisp booleans.
942 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
943 makes Emacs a bit smaller and presumably a bit faster.
944 * lisp.h: Include <stdbool.h>.
945 (struct Lisp_Boolfwd, defvar_bool):
946 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
947 * regex.c [!emacs]: Include <stdbool.h>.
948 (false, true): Remove; <stdbool.h> does this for us now.
949
950 2012-08-14 Chong Yidong <cyd@gnu.org>
951
952 * character.c (Fcharacterp): Doc fix (Bug#12076).
953
954 * data.c (Findirect_variable): Doc fix (Bug#11040).
955
956 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
957
958 * editfns.c (Fformat): Doc fix (Bug#12059).
959 (Fsave_current_buffer): Doc fix (Bug#11542).
960
961 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
962
963 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
964 (bug#12022).
965
966 2012-08-14 Martin Rudalics <rudalics@gmx.at>
967
968 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
969 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
970 * minibuf.c (choose_minibuf_frame, read_minibuf):
971 * w32fns.c (x_create_tip_frame):
972 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
973 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
974
975 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
976
977 * intervals.c (offset_intervals): Remove obsolete comment.
978
979 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
980
981 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
982
983 2012-08-14 Gergely Risko <gergely@risko.hu>
984
985 * coding.c (decode_coding): Record buffer modification before
986 disabling undo_list (Bug#11773).
987
988 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
989
990 Revert and cleanup some recent overlay changes.
991 * buffer.h (enum overlay_type): Remove.
992 (buffer_get_overlays, buffer_set_overlays): Likewise.
993 (buffer_set_overlays_before, buffer_set_overlays_after):
994 New function. Adjust users.
995 (unchain_both): Add eassert.
996
997 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
998
999 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1000
1001 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1002
1003 * gtkutil.c (xg_mark_data): Don't assume C99.
1004
1005 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1006
1007 * gtkutil.c (xg_frame_tb_info): New struct.
1008 (TB_INFO_KEY): New define.
1009 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1010 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1011 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1012 if not present.
1013 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1014 is up to date. Otherwise store new data.
1015 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1016
1017 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1018
1019 Use KSET for write access to Lisp_Object members of struct kboard.
1020 * keyboard.h (KSET): New macro.
1021 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1022 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1023 * xterm.c: Adjust users.
1024
1025 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1026
1027 Use BSET for write access to Lisp_Object members of struct buffer.
1028 * buffer.h (BSET): New macro.
1029 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1030 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1031 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1032 * window.c, xdisp.c, xfns.c: Adjust users.
1033
1034 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1035
1036 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1037
1038 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1039
1040 * nsterm.m (not_in_argv): New function.
1041 (application:openFile, application:openTempFile:):
1042 (application:openFileWithoutUI:, application:openFiles:): Open file
1043 if not_in_argv returns non-zero (bug#12171).
1044
1045 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1046 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1047 Define for Gtk+ versions less than 3.2.
1048 (xg_get_font_name): Use those functions/macros here.
1049 Reported by Frans Oilinki <moilinki@gmail.com>.
1050
1051 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1052
1053 * unexmacosx.c (copy_data_segment): Copy initialized data in
1054 statically linked libraries from input file rather than memory.
1055
1056 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1057 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1058 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1059
1060 2012-08-10 Glenn Morris <rgm@gnu.org>
1061
1062 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1063 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1064
1065 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1066
1067 Fix last change to allow compilation with low optimization levels.
1068 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1069 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1070
1071 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1072
1073 Use common inline syntax in intervals.h.
1074 * intervals.h (INTERVALS_INLINE): New macro.
1075 Change all users from LISP_INLINE.
1076
1077 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1078
1079 Define Qnone once for all platforms.
1080 * frame.c (Qnone): Define here.
1081 (syms_of_frame): DEFSYM it.
1082 * lisp.h (Qnone): New declaration.
1083 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1084 * xfns.c: Remove duplication. Adjust users.
1085
1086 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1087
1088 Remove unused macros from intervals.h.
1089 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1090 * intervals.c: Adjust comment.
1091
1092 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1093
1094 * w32fns.c <w32_unicode_gui>: New static variable.
1095 (globals_of_w32fns): Initialize it according to os_subtype.
1096 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1097 testing os_subtype.
1098
1099 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1100 Eli Zaretskii <eliz@gnu.org>
1101
1102 Fix bug #10299 with Unicode characters sent by customized
1103 keyboards created by MSKLC.
1104 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1105 (w32_init_class): Use it to initialize the Emacs class with either
1106 ANSI or Unicode API calls.
1107 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1108 later.
1109 (w32_wnd_proc): If the character code sent by WM_CHAR or
1110 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1111 original message. Call DefWindowProcW on NT and later.
1112
1113 2012-08-10 Glenn Morris <rgm@gnu.org>
1114
1115 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1116
1117 * lisp.h (DIRECTORY_SEP): Let configure set it.
1118
1119 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1120
1121 Use TSET for write access to Lisp_Object slots of struct terminal.
1122 * termhooks.h (TSET): New macro.
1123 * coding.c, terminal.c, xselect.c: Adjust users.
1124
1125 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1126
1127 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1128 the failing expression, include them in the error message.
1129 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1130 * lisp.h (internal_condition_case_n): Update declaration.
1131
1132 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1133
1134 Inline functions to examine and change buffer overlays.
1135 * buffer.c (unchain_both): New function.
1136 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1137 (buffer_has_overlays): New function.
1138 (enum overlay_type): New enum.
1139 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1140 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1141
1142 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1143
1144 Inline functions to examine and change buffer intervals.
1145 * alloc.c (mark_interval_tree): Remove.
1146 (MARK_INTERVAL_TREE): Simplify.
1147 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1148 * intervals.c (buffer_balance_intervals): New function.
1149 (graft_intervals_into_buffer): Adjust indentation.
1150 (set_intervals_multibyte): Simplify.
1151 * buffer.h (BUF_INTERVALS): Remove.
1152 (buffer_get_intervals, buffer_set_intervals): New function.
1153 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1154 * intervals.c, textprop.c: Adjust users.
1155
1156 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1157
1158 Inline functions to examine and change string intervals.
1159 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1160 (string_get_intervals, string_set_intervals): New function.
1161 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1162 * lread.c, print.c, textprop.c: Adjust users.
1163
1164 2012-08-08 Glenn Morris <rgm@gnu.org>
1165
1166 * lisp.mk (lisp): Remove language/persian.elc.
1167
1168 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1169
1170 Cleanup intervals.
1171 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1172 (NULL_INTERVAL_P): Likewise. Adjust users.
1173 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1174 Adjust comment. Move under #if 0.
1175 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1176 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1177
1178 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1179
1180 Check total length of intervals with eassert.
1181 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1182 * intervals.c: Change all users to eassert.
1183
1184 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1185
1186 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1187 Rename fields to match removal of FGET and WGET and disuse of
1188 INTERNAL_FIELD in Lisp_Cons.
1189
1190 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1191
1192 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1193 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1194 name since all xname users are fixed long time ago. Do not
1195 use INTERNAL_FIELD.
1196 (set_symbol_name, set_symbol_function, set_symbol_plist):
1197 (set_symbol_next, set_overlay_plist): New function.
1198 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1199 (struct Lisp_Overlay): Likewise.
1200 (CVAR, MVAR, SVAR): Remove.
1201 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1202 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1203 * xterm.c: Adjust users.
1204 * .gdbinit: Change to use name field of struct Lisp_Symbol
1205 where appropriate.
1206
1207 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1208
1209 Basic functions to set Lisp_Object and pointer slots of intervals.
1210 * intervals.h (interval_set_parent, interval_set_object):
1211 (interval_set_left, interval_set_right, interval_set_plist):
1212 (interval_copy_parent): New function.
1213 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1214 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1215 Adjust indentation.
1216 (INTERVAL_SIZE): Remove. Adjust users.
1217 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1218
1219 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1220
1221 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1222 * process.h (PGET): Remove.
1223 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1224 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1225
1226 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1227
1228 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1229 * window.h (WGET): Remove.
1230 (struct window): Do not use INTERNAL_FIELD.
1231 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1232 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1233 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1234 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1235 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1236 Adjust users.
1237
1238 2012-08-07 Chong Yidong <cyd@gnu.org>
1239
1240 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1241 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1242 (Fdelete_window_internal): Signal an error if the window is not on
1243 a live frame (Bug#12025).
1244
1245 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1246
1247 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1248 * frame.h (FGET): Remove.
1249 (struct frame): Do not use INTERNAL_FIELD.
1250 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1251 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1252 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1253 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1254
1255 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1256
1257 * w32.c: Silence compiler warnings.
1258 (map_w32_filename): Remove unused variable `is_fat'.
1259 (chase_symlinks): Add parentheses around expression.
1260
1261 2012-08-06 Glenn Morris <rgm@gnu.org>
1262
1263 * sysdep.c: Respect BROKEN_GETWD.
1264
1265 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1266 Let configure handle it.
1267 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1268
1269 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1270
1271 Use GCALIGNMENT where appropriate.
1272 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1273 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1274 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1275
1276 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1277
1278 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1279 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1280
1281 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1282
1283 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1284 that should be sufficient for everyone.
1285
1286 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1287
1288 * keyboard.c (timer_check_2): Add break so timer_check returns next
1289 timeout.
1290
1291 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1292
1293 Fix Windows build errors introduced after converting to WGET and WSET.
1294 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1295 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1296
1297 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1298
1299 * nsterm.m (ns_frame_rehighlight): Use FSET.
1300
1301 * nsmenu.m (ns_update_menubar): Use FSET.
1302
1303 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1304
1305 Separate read and write access to Lisp_Object slots of Lisp_Process.
1306 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1307 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1308
1309 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1310
1311 Separate read and write access to Lisp_Object slots of struct window.
1312 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1313 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1314 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1315 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1316 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1317 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1318 Adjust users.
1319
1320 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1321
1322 Fix Windows build errors introduced after converting to FGET and FSET.
1323 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1324 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1325 (w32_judge_scroll_bars): Change to use FSET.
1326 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1327
1328 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1329
1330 Fix replacement typo.
1331 * window.c (replace_window): Set root_window instead of
1332 selected_window. This fixes a total window subsystem
1333 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1334
1335 2012-08-06 Glenn Morris <rgm@gnu.org>
1336
1337 * lisp.mk (lisp): Add language/persian.elc.
1338
1339 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1340
1341 Separate read and write access to Lisp_Object slots of struct frame.
1342 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1343 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1344 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1345 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1346 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1347
1348 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1349
1350 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1351
1352 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1353
1354 Generalize common compile-time constants.
1355 * lisp.h (header_size, bool_header_size, word_size): Now here.
1356 (struct Lisp_Vector): Add comment.
1357 (struct Lisp_Bool_Vector): Move up to define handy constants.
1358 (VECSIZE, PSEUDOVECSIZE): Simplify.
1359 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1360 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1361 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1362 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1363 * xfont.c, xmenu.c: Use word_size where appropriate.
1364
1365 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1366
1367 * search.c (Freplace_match): Treat \? in the replacement text
1368 literally (Bug#8161).
1369
1370 2012-08-05 Chong Yidong <cyd@gnu.org>
1371
1372 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1373 * frame.c (Vdelete_frame_functions):
1374 * emacs.c (Vkill_emacs_hook): Doc fix.
1375
1376 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1377
1378 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1379 --with-x-toolkit=no builds.
1380 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1381
1382 2012-08-04 Chong Yidong <cyd@gnu.org>
1383
1384 * syntax.c (Fmodify_syntax_entry): Doc fix.
1385
1386 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1387
1388 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1389 * w32.c (init_environment): Change the default values of many
1390 environment variables in dflt_envvars[] to NULL, to avoid pushing
1391 them into environment when they were not already defined.
1392 Remove the code that deletes site-lisp subdirectories from the default
1393 value of EMACSLOADPATH, as it is no longer needed.
1394 (check_windows_init_file): Now external, not static.
1395 Use Vload_path as is, without adding anything, as this function is now
1396 called when Vload_path is already set up.
1397
1398 * w32.h (check_windows_init_file): Add prototype.
1399
1400 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1401 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1402 compatibility with Posix platforms.
1403 (main): Move the call to check_windows_init_file to here from
1404 w32.c.
1405 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1406 any, in the DEFALT argument into the root of the Emacs build or
1407 installation tree, as appropriate.
1408
1409 * callproc.c (init_callproc_1): Call decode_env_path instead of
1410 doing its equivalent by hand.
1411 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1412 the code that sets Vexec_path run on MS-Windows.
1413
1414 * lread.c (init_lread): Add comments to #ifdef's.
1415
1416 * msdos.c (dos_set_window_size, IT_update_begin)
1417 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1418 instead of direct references.
1419
1420 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1421
1422 Export DEFAULT_REHASH_* to GDB.
1423 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1424 Now constants, not macros.
1425
1426 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1427
1428 Remove unnecessary casts involving pointers.
1429 These casts are no longer needed now that we assume C89 or later,
1430 since they involve casting to or from void *.
1431 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1432 (make_pure_float, make_pure_vector):
1433 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1434 * macros.c (Fstart_kbd_macro):
1435 * menu.c (find_and_return_menu_selection):
1436 * minibuf.c (read_minibuf_noninteractive):
1437 * sysdep.c (closedir):
1438 * xdisp.c (x_produce_glyphs):
1439 * xfaces.c (compare_fonts_by_sort_order):
1440 * xfns.c (x_real_positions, select_visual):
1441 * xselect.c (x_stop_queuing_selection_requests)
1442 (x_get_window_property, x_get_window_property_as_lisp_data):
1443 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1444 Remove unnecessary pointer casts.
1445 * alloc.c (record_xmalloc): New function.
1446 * lisp.h (record_xmalloc): New decl.
1447 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1448 more like a function. This is because the pointer cast is not
1449 needed. All uses changed.
1450 * print.c (print_string, print_error_message): Avoid length recalc.
1451
1452 Improve fix for macroexp crash with debugging (Bug#12118).
1453 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1454 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1455 not supposed to be invoked from the garbage collector.
1456 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1457 (gc_aset): New function, which is like ASET but can be
1458 used in the garbage collector.
1459 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1460 (set_hash_index): Use it instead of ASET.
1461
1462 2012-08-03 Eli Zaretskii <eliz@gnu.org>
1463
1464 Support symlinks on latest versions of MS-Windows.
1465 * w32.c: Include winioctl.h and aclapi.h.
1466 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1467 (revert_to_self): Forward declarations of static functions.
1468 <static BOOL g_b_init_get_security_info>:
1469 <g_b_init_create_symbolic_link>: New static flags.
1470 (globals_of_w32): Initialize them to zero.
1471 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1472 (map_w32_filename): Improve commentary. Simplify switch.
1473 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1474 headers (most versions of MinGW w32api don't).
1475 (get_security_info, create_symbolic_link)
1476 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1477 New functions.
1478 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1479 in the argument file name.
1480 (sys_access): Call unc_volume_file_attributes only if
1481 GetFileAttributes fails with network-related error codes.
1482 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1483 have the required privileges.
1484 (get_file_security_desc_by_name): Rename from
1485 get_file_security_desc.
1486 (stat_worker): New function, with most of the guts of 'stat', and
1487 with addition of handling of symlinks and support for 'lstat'.
1488 If possible, get file's attributes and security information by
1489 handle, not by name. Produce S_IFLNK bit for symlinks, when
1490 called from 'lstat'.
1491 (stat, lstat): New functions, call 'stat_worker'.
1492 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1493 symlinks when the underlying filesystem supports them.
1494
1495 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1496
1497 Fix macroexp crash on Windows with debugging (Bug#12118).
1498 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1499 checking subscripts; problem introduced with the recent
1500 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1501 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1502 since it's used in non-static inline functions now.
1503
1504 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1505 Don't assume buffer size fits in 'int'. Remove unused local.
1506
1507 Use C99-style 'extern inline' if available.
1508 * buffer.h (BUFFER_INLINE):
1509 * category.h (CATEGORY_INLINE):
1510 * character.h (CHARACTER_INLINE):
1511 * charset.h (CHARSET_INLINE):
1512 * composite.h (COMPOSITE_INLINE):
1513 * dispextern.h (DISPEXTERN_INLINE):
1514 * lisp.h (LISP_INLINE):
1515 * systime.h (SYSTIME_INLINE):
1516 New macro, replacing 'static inline' in this header.
1517 * buffer.h, category.h, character.h, charset.h, composite.h:
1518 * dispextern.h, lisp.h, systime.h:
1519 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1520 * alloc.c (LISP_INLINE):
1521 * buffer.c (BUFFER_INLINE):
1522 * category.c (CATEGORY_INLINE):
1523 * character.c (CHARACTER_INLINE):
1524 * charset.c (CHARSET_INLINE):
1525 * composite.c (COMPOSITE_INLINE):
1526 * dispnew.c (DISPEXTERN_INLINE):
1527 * sysdep.c (SYSTIME_INLINE):
1528 Define to EXTERN_INLINE, so that the corresponding functions
1529 are compiled into code.
1530 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1531 (INLINE_HEADER_END): New macros.
1532 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1533 since it's used in non-static inline functions now.
1534 (VALMASK) [!USE_LSB_TAG]: Likewise.
1535
1536 2012-08-02 Glenn Morris <rgm@gnu.org>
1537
1538 * s/: Remove empty directory.
1539
1540 * s/ms-w32.h: Move to ../nt/inc.
1541 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1542 Update for new ms-w32.h location.
1543
1544 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1545
1546 Port to Solaris 8.
1547 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1548
1549 2012-08-02 Glenn Morris <rgm@gnu.org>
1550
1551 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1552 hard-coding the path separator.
1553
1554 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1557 This how ASET and AREF are supposed to work, and makes
1558 it easier to think about future improvements. See
1559 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1560 * charset.h (set_charset_attr): New function.
1561 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1562 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1563 (aref_addr): New function. All uses of &AREF(...) changed.
1564 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1565 (set_hash_index): New functions. All lvalue-style uses of
1566 HASH_KEY etc. changed.
1567 * keyboard.c (set_prop): New function. All lvalue-style uses
1568 of PROP changed.
1569
1570 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1571
1572 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1573 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1574 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1575 * nsfns.m (ns_set_name_as_filename): Likewise.
1576 * nsmenu.m (ns_update_menubar): Likewise.
1577 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1578
1579 2012-08-01 Eli Zaretskii <eliz@gnu.org>
1580
1581 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1582 Adapt to latest changes in field names of the corresponding Lisp
1583 objects.
1584
1585 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1586
1587 2012-08-01 Glenn Morris <rgm@gnu.org>
1588
1589 * s/msdos.h: Remove file.
1590 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1591 * Makefile.in (S_FILE): Remove.
1592 (config_h): Remove S_FILE.
1593
1594 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1595
1596 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1597 Remove; moved to nt/config.nt.
1598
1599 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1600
1601 Use INTERNAL_FIELD for conses and overlays.
1602 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1603 Remove obsolete comment.
1604 (MVAR): New macro.
1605 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1606 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1607
1608 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1609
1610 Use INTERNAL_FIELD for symbols.
1611 * lisp.h (SVAR): New macro. Adjust users.
1612 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1613 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1614
1615 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1616
1617 Use INTERNAL_FIELD for processes.
1618 * process.h (PVAR): New macro. Adjust style.
1619 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1620 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1621
1622 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1623
1624 Use INTERNAL_FIELD for windows.
1625 * window.h (WVAR): New macro.
1626 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1627 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1628 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1629 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1630 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1631 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1632
1633 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1634
1635 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1636
1637 2012-08-01 Glenn Morris <rgm@gnu.org>
1638
1639 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1640 Move to configure.ac.
1641
1642 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1643
1644 * makefile.w32-in (CONFIG_H): Update dependencies.
1645 (CONF_POST_H): New macro.
1646
1647 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1648
1649 2012-07-31 Glenn Morris <rgm@gnu.org>
1650
1651 * Makefile.in (S_FILE): No longer set by configure.
1652
1653 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1654 is available.
1655 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1656
1657 * process.h (NULL_DEVICE):
1658 * emacs.c (SEPCHAR):
1659 * editfns.c (USER_FULL_NAME): Let configure set them.
1660
1661 * s/README, s/template.h: Remove files.
1662
1663 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1664
1665 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1666 Move to configure.ac.
1667
1668 2012-07-31 Eli Zaretskii <eliz@gnu.org>
1669
1670 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1671 resulting renaming of 'struct frame' members.
1672
1673 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1674
1675 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1676 after introduction of FVAR.
1677
1678 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1679
1680 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1681
1682 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1683 instead of compositeToPoint.
1684 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1685
1686 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
1687
1688 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1689
1690 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1691 * lisp.h (INTERNAL_FIELD): New macro.
1692 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
1693 (BVAR): Change to use INTERNAL_FIELD.
1694 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1695 (KVAR): Change to use INTERNAL_FIELD.
1696 * frame.h (FVAR): New macro.
1697 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
1698 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1699 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1700 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1701 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1702
1703 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1704
1705 Miscellaneous fixes for non-default X toolkits.
1706 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1707 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1708 Move under #ifdef USE_LUCID.
1709 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1710 definition and usage to avoid warnings.
1711
1712 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1713
1714 * nsterm.m (openFiles): Fix previous checkin.
1715
1716 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1717
1718 * indent.c (compute_motion): Remove unused local.
1719
1720 2012-07-31 Glenn Morris <rgm@gnu.org>
1721
1722 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1723
1724 * conf_post.h [USG5_4]:
1725 Move remaining contents of s/usg5-4-common.h here.
1726 * s/usg5-4-common.h: Remove file.
1727
1728 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1729 * s/irix6-5.h: Remove file.
1730
1731 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1732 * s/darwin.h: Remove file.
1733
1734 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1735 * s/hpux10-20.h: Remove file, which is now empty.
1736
1737 2012-07-30 Glenn Morris <rgm@gnu.org>
1738
1739 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1740 * Makefile.in (config_h): Add conf_post.h.
1741 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1742
1743 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1744
1745 * nsterm.m (ns_do_open_file): New variable.
1746 (ns_term_init): Set ns_do_open_file to YES after run returns.
1747 (openFile, openTempFile, openFileWithoutUI, openFiles):
1748 Open files only if ns_do_open_file.
1749
1750 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1751
1752 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1753 This no-op macro hasn't been needed for many years.
1754 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1755
1756 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1757 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1758 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1759 gdb_make_enums_visible.
1760 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1761 (DIRECTORY_SEP): Now a constant, not a macro.
1762
1763 2012-07-30 Eli Zaretskii <eliz@gnu.org>
1764
1765 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1766 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1767
1768 * w32term.c <w32_keyboard_codepage>: Renamed from
1769 keyboard_codepage and now external. All users changed.
1770
1771 * w32term.h: Add declaration of w32_keyboard_codepage.
1772
1773 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1774 the codepage to translate keys to Unicode. If this argument is
1775 -1, use the value returned by GetConsoleCP. All callers changed.
1776
1777 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1778
1779 Update .PHONY listings in makefiles.
1780 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1781 bootstrap-clean, distclean, maintainer-clean, versioclean,
1782 extraclean, frc.
1783
1784 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1785 This is a bit clearer. Fix some commentary typos.
1786
1787 2012-07-30 Glenn Morris <rgm@gnu.org>
1788
1789 * s/netbsd.h: Let configure include signal.h if needed.
1790 Remove file, which is now empty.
1791
1792 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1793 Let configure set them.
1794 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1795 No more need to undefine.
1796
1797 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1798
1799 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1800 non-single-byte char when adding meta modifier. (Bug#12090)
1801
1802 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1803
1804 Convert safe_call to use variable number of arguments.
1805 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1806 (safe_call2): Fix comment.
1807 * lisp.h (safe_call): Adjust prototype.
1808 * coding.c (encode_coding_object): Change to use safe_call2.
1809 * xfaces.c (merge_face_heights): Change to use safe_call1.
1810
1811 2012-07-30 Glenn Morris <rgm@gnu.org>
1812
1813 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
1814 does that unconditionally. Remove file, which is now empty.
1815
1816 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1817 Remove empty files.
1818
1819 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1820
1821 Export to GDB most of lisp.h's remaining object-like macros.
1822 * lisp.h (min, max): Move earlier, because they're used earlier now.
1823 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1824 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1825 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1826 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1827 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1828 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1829 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1830 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1831 Now constants, for GDB. They need not be macros.
1832 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1833 Now constants, for GDB, as well as macros, for static initializers.
1834 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1835 Move to after the definition of struct Lisp_Char_Table,
1836 since the former now needs that type defined.
1837 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1838 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1839 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1840 New enums, for gdb_make_enums_visible.
1841 (GLYPH_MODE_LINE_FACE): Remove; unused.
1842 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
1843 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1844 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1845 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1846 enum maxargs, enum MAX_ALLOCA.
1847 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1848 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1849 no longer needed, now that they are done in lisp.h.
1850
1851 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1852
1853 Cleanup string bytes checking.
1854 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1855 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1856 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1857 (check_sblock, compact_small_strings): Simplify.
1858
1859 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1860
1861 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1862 These macros are confusing and no longer need to be defined, as
1863 the enum values now suffice. All uses replaced with definiens.
1864 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1865
1866 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
1867
1868 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1869 ($(BLD)/w32console.$(O)): Update dependencies.
1870
1871 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1872
1873 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1874 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1875 time. Adjust users.
1876 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1877
1878 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1879
1880 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1881 setting sitelisp (Bug#12010).
1882
1883 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1884
1885 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
1886
1887 * w32heap.c (cache_system_info):
1888 * w32.c (sys_rename):
1889 * w32proc.c (find_child_console, sys_kill): All users changed.
1890
1891 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1892
1893 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1894
1895 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1896
1897 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1898
1899 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1900
1901 Cleanup statistics calculation in Fgarbage_collect.
1902 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1903 Fix zombies percentage calculation. Simplify elapsed time calculation.
1904
1905 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1906
1907 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1908 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1909 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1910 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1911 (replace_range, replace_range_2, del_range_2): Change to eassert.
1912 * marker.c (byte_char_debug_check): Adjust style.
1913
1914 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1915
1916 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1917 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1918 long-ago-commented-out code that talks about "WIN32".
1919 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1920 All uses changed.
1921
1922 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1923
1924 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1925 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1926 Simplify by using alignof.
1927 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1928 * lisp.h: Include <stdalign.h>.
1929 (GCALIGNMENT): New macro and constant.
1930 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1931 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1932 (stdalign): New macro, if not already defined.
1933
1934 2012-07-28 Eli Zaretskii <eliz@gnu.org>
1935
1936 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1937 * w32inevt.c: Include w32inevt.h.
1938 (w32_read_console_input): New inline function, calls either
1939 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1940 w32_console_unicode_input.
1941 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1942 (w32_kbd_patch_key, key_event): Use the codepage returned by
1943 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1944 (key_event): use uChar.UnicodeChar only if
1945 w32_console_unicode_input is non-zero.
1946
1947 * w32console.c: Include w32heap.h.
1948 <w32_console_unicode_input>: New global variable.
1949 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1950 family of Windows, zero otherwise.
1951
1952 * w32inevt.h: Declare w32_console_unicode_input.
1953
1954 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1955 --without-x. (Bug#11742)
1956
1957 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1958
1959 Adjust GDB to reflect pvec_type changes (Bug#12036).
1960 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
1961 2012-07-04 changes to pseudovector representation.
1962 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
1963
1964 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
1965
1966 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1967 bus address.
1968 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1969
1970 2012-07-27 Eli Zaretskii <eliz@gnu.org>
1971
1972 * alloc.c (listn): Fix the order the arguments are consed onto the
1973 list.
1974
1975 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1976 enumeration constants, as PURE and HEAP are too general, and clash
1977 with other headers and sources, such as gmalloc.c and the
1978 MS-Windows system headers. All users changed.
1979
1980 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1981
1982 Revert last save_excursion_save and save_excursion_restore changes.
1983 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1984 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1985
1986 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1987
1988 Fix recently-introduced typos in Windows port.
1989 Reported by Martin Rudalics <rudalics@gmx.at>.
1990 * w32.c (init_environment): Replace comma with semicolon.
1991 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
1992
1993 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 Improve GDB symbol export (Bug#12036).
1996 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1997 arms of an 'if', not using conditional expressions; otherwise GDB
1998 complains about the types in the unevaluated arm when the argument
1999 is an integer literal.
2000 (xgetint): Simplify expression.
2001 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2002 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2003 Zaretskii in <http://bugs.gnu.org/12036#13>.
2004 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2005 needed now that we have gdb_make_enums_visible.
2006 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2007 (enum enum_USE_LSB_TAG):
2008 New enum types, packaging up enums that need to be exported to GDB.
2009
2010 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2011
2012 Utility function to make a list from specified amount of objects.
2013 * lisp.h (enum constype): New datatype.
2014 (listn): New prototype.
2015 * alloc.c (listn): New function.
2016 (Fmemory_use_count, syms_of_alloc): Use it.
2017 * buffer.c (syms_of_buffer): Likewise.
2018 * callint.c (syms_of_callint): Likewise.
2019 * charset.c (define_charset_internal): Likewise.
2020 * coding.c (syms_of_coding): Likewise.
2021 * keymap.c (syms_of_keymap): Likewise.
2022 * search.c (syms_of_search): Likewise.
2023 * syntax.c (syms_of_syntax): Likewise.
2024 * w32.c (init_environment): Likewise.
2025 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2026 * xdisp.c (syms_of_xdisp): Likewise.
2027 * xfns.c (syms_of_xfns): Likewise.
2028
2029 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2030
2031 Fast save_excursion_save and save_excursion_restore.
2032 * lisp.h (struct Lisp_Excursion): New data type.
2033 (PVEC_EXCURSION): New pseudovector type.
2034 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2035 to deal with it. Adjust comments.
2036 (init_marker, attach_marker): New prototype.
2037 (unchain_marker): Adjust prototype.
2038 * marker.c (attach_marker): Change to global.
2039 (init_marker): New function.
2040 * alloc.c (Fmake_marker, build_marker): Use it.
2041 (build_marker): More easserts.
2042 (mark_object): Handle struct Lisp_Excursion.
2043 * editfns.c (save_excursion_save, save_excursion_restore):
2044 Reimplement to use struct Lisp_Excursion. Add comments.
2045
2046 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2047
2048 Fix export of symbols to GDB (Bug#12036).
2049 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2050 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2051 emacs.c, as this is a more-suitable home. Had this been done earlier
2052 the fix for 12036 would have avoided some of the problems noted in
2053 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2054 would have been more obvious.
2055 * emacs.c: Do not include <verify.h>; no longer needed.
2056 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2057 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2058 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2059 Remove; now done in lisp.h.
2060 * lisp.h (PUBLISH_TO_GDB): New macro.
2061 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2062 (DATA_SEG_BITS): Use it.
2063 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2064 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2065 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2066 not be usable in #if. This simplifies things.
2067
2068 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2069
2070 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2071
2072 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2073
2074 Simplify export of symbols to GDB (Bug#12036).
2075 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2076 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2077 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2078 Adjust to changes in lisp.h and emacs.c, by using
2079 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2080 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2081 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2082 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2083 instead of gdb_valbits.
2084 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2085 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2086 instead of gdb_array_mark_flag.
2087 (xboolvector): Get size from $->size, not $->header.size.
2088 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2089 (xreload, hook-run, hookpost-run): Remove.
2090 * emacs.c: Include <verify.h>.
2091 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2092 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2093 Remove.
2094 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2095 (gdb_USE_LSB_TAG): New enum constants.
2096 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2097 Also define these as enum constants, so they're visible to GDB.
2098 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2099 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2100 as constants, so they're visible to GDB.
2101 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2102 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2103 Now enum constants, not macros, so they're visible to GDB.
2104 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2105 more convenient now. All uses changed.
2106 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2107 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2108
2109 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2110
2111 Explicitly free restriction data that are not needed anymore.
2112 * editfns.c (save_restriction_restore): Free restriction data.
2113
2114 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2115
2116 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2117 add argument, tune behavior, and adjust all callers.
2118
2119 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2120
2121 Use typedef for EMACS_INT, EMACS_UINT.
2122 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2123 than macros. This simplifies debugging in the usual case, since
2124 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2125 and it allows expressions involving EMACS_INT casts.
2126 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2127
2128 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2129
2130 * nsterm.m (ns_read_socket): Return early if there is a modal
2131 window (Bug#12043).
2132
2133 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2134
2135 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2136 that FOCUS-FRAME can be omitted.
2137
2138 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2139
2140 Adjust buffer text indirection counters at the end of Fkill_buffer.
2141 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2142 buffer is definitely dead. This should really fix an issue reported
2143 by Christoph Scholtes again. (Bug#12007).
2144 (init_buffer_once): Initialize indirection counters of
2145 buffer_defaults and buffer_local_symbols (for sanity and safety).
2146
2147 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2148
2149 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2150 and continuation glyphs on tooltip frames, leave them at zero.
2151 Avoids continued lines in tooltips. (Bug#11832)
2152
2153 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2154
2155 Simplify copy_overlay.
2156 * buffer.c (copy_overlay): Simplify. Use build_marker.
2157 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2158
2159 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2160
2161 * print.c (print_object): Don't crash when a frame's name is nil
2162 or invalid. (Bug#12025)
2163
2164 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2165 it signals an error when a tooltip frame is being created.
2166
2167 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2168
2169 Cleanup miscellaneous objects allocation and initialization.
2170 * alloc.c (allocate_misc): Change to static. Add argument to
2171 specify the subtype. Adjust comment and users.
2172 (build_overlay): New function.
2173 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2174 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2175 (allocate_misc): Remove prototype.
2176 (build_overlay): Add prototype.
2177
2178 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2179
2180 Swap buffer text indirection counters in Fbuffer_swap_text.
2181 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2182 This avoids crash reported by Christoph Scholtes at
2183 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2184
2185 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2186
2187 * nsmenu.m (Popdown_data): New struct.
2188 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2189 free Popdown_data.
2190 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2191 (initWithContentRect): Make imgView and contentView non-static
2192 and autorelease them. Also autorelease img and matrix (Bug#12005).
2193 (dealloc): Remove (Bug#12005).
2194
2195 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2196
2197 Adjust consing_since_gc when objects are explicitly freed.
2198 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2199 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2200 (free_cons, free_misc): Subtract object size from consing_since_gc.
2201
2202 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2203
2204 Simplify and cleanup markers positioning code.
2205 * marker.c (attach_marker): More useful eassert.
2206 (live_buffer, set_marker_internal): New function.
2207 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2208 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2209
2210 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2211
2212 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2213 as it's limited by the amount of memory, not by INT_MAX.
2214
2215 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2216
2217 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2218 in special-event-map. See the discussion at
2219 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2220 for the reasons.
2221
2222 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2223 info.dwItemData. Fixes crashes on 64-bit Windows.
2224 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2225
2226 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2227
2228 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2229 (conversationIdentifier): Return value is NSInteger.
2230 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2231
2232 2012-07-21 Chong Yidong <cyd@gnu.org>
2233
2234 * window.c (decode_any_window): Signal an error if the window is
2235 on a dead frame (Bug#11984).
2236
2237 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2238
2239 Add indirection counting to speed up Fkill_buffer.
2240 * buffer.h (struct buffer): New member.
2241 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2242 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2243 base buffer indirection counter.
2244 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2245 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2246 through buffer list if indirection counter is 0.
2247
2248 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2249
2250 Extend the value returned by Fgarbage_collect with heap statistics.
2251 * alloc.c (Qheap): New symbol.
2252 (syms_of_alloc): DEFSYM it.
2253 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2254 (Fmemory_free): Remove.
2255 (syms_of_alloc): Don't defsubr it.
2256 * buffer.c (Fcompact_buffer): Remove.
2257 (syms_of_buffer): Don't defsubr it.
2258
2259 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2260
2261 Make maybe_gc inline.
2262 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2263 * lisp.h (consing_since_gc, gc_relative_threshold)
2264 (memory_full_cons_threshold): Revert declaration.
2265 (maybe_gc): Remove prototype, define as inline.
2266 * alloc.c: Remove old commented-out code.
2267 (consing_since_gc, gc_relative_threshold)
2268 (memory_full_cons_threshold): Revert to global.
2269 (maybe_gc): Remove.
2270
2271 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2272
2273 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2274 * lisp.h (build_unibyte_string): New function.
2275 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2276 * sysdep.c, w32fns.c, xfns.c: Use it.
2277 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2278 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2279 Adjust users accordingly.
2280 * font.h (font_open_by_name): Adjust prototype.
2281
2282 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2283
2284 Cleanup calls to Fgarbage_collect.
2285 * lisp.h (maybe_gc): New prototype.
2286 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2287 Remove declarations.
2288 * alloc.c (maybe_gc): New function.
2289 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2290 Make them static.
2291 * bytecode.c (MAYBE_GC): Use maybe_gc.
2292 * eval.c (eval_sub, Ffuncall): Likewise.
2293 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2294 to avoid dependency from auto-save feature.
2295
2296 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2297
2298 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2299 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2300 'for_each_per_buffer_object_at'.
2301 All uses changed. It's better to use upper-case for macros that
2302 cannot be implemented as functions, to give the reader a clue
2303 that they're special.
2304
2305 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2306
2307 * alloc.c (Fgarbage_collect): Tweak docstring.
2308
2309 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2310
2311 Tweak the value returned from Fgarbage_collect again.
2312 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2313 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2314 Adjust documentation.
2315 (total_vector_bytes): Rename to total_vector_slots, adjust
2316 accounting.
2317 (total_free_vector_bytes): Rename to total_free_vector_slots,
2318 adjust accounting.
2319 (Qstring_bytes, Qvector_slots): New symbols.
2320 (syms_of_alloc): DEFSYM them.
2321
2322 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2323
2324 Buffer compaction primitive which may be used from Lisp.
2325 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2326 (syms_of_buffer): Register Fcompact_buffer.
2327 * alloc.c (Fgarbage_collect): Use compact_buffer.
2328 * buffer.h (compact_buffer): New prototype.
2329 (struct buffer_text): New member.
2330
2331 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2332
2333 New macro to iterate over all buffers, miscellaneous cleanups.
2334 * lisp.h (all_buffers): Remove declaration.
2335 * buffer.h (all_buffers): Add declaration, with comment.
2336 (for_each_buffer): New macro.
2337 * alloc.c (Fgarbage_collect, mark_object): Use it.
2338 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2339 (init_buffer): Likewise.
2340 * data.c (Fset_default): Likewise.
2341 * coding.c (code_conversion_restore): Remove redundant check
2342 for dead buffer.
2343 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2344
2345 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2346
2347 Fix bug that created negative-length intervals.
2348 * intervals.c (merge_interval_right, merge_interval_left):
2349 Do not zero out this interval if it is absorbed by its children,
2350 as this interval's total length doesn't change in that case. See
2351 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2352
2353 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2354
2355 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2356 when invoking (make-bool-vector N t) and N is a positive
2357 multiple of 8 -- the last 8 bits were mistakenly cleared.
2358
2359 Remove some struct layout assumptions in bool vectors.
2360 * alloc.c (bool_header_size): New constant.
2361 (header_size, word_size): Move earlier, as they're now used earlier.
2362 Use 'word_size' in a few more places, where it's appropriate.
2363 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2364 padding before the data member of a bool vector.
2365 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2366 than doing the check by hand with an abort ().
2367
2368 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2369
2370 * eval.c (Fdefvar): Don't check constants since we only set the var if
2371 it's not yet defined anyway (bug#11904).
2372
2373 * lisp.h (last_undo_boundary): Declare new var.
2374 * keyboard.c (command_loop_1): Set it.
2375 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2376 were auto-added by the command loop (bug#11774).
2377
2378 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2379
2380 * w32font.c (Qsymbol): Remove local definition.
2381 (syms_of_w32font): Don't DEFSYM it.
2382
2383 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2384
2385 Fix sweep_vectors to handle large bool vectors correctly.
2386 * alloc.c (sweep_vectors): Account total_vector_bytes for
2387 bool vectors larger than VBLOCK_BYTES_MAX.
2388
2389 2012-07-18 Chong Yidong <cyd@gnu.org>
2390
2391 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2392 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2393
2394 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2395
2396 Return more descriptive data from Fgarbage_collect.
2397 Suggested by Stefan Monnier in
2398 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2399 * alloc.c (bounded_number): New function.
2400 (total_buffers, total_vectors): New variable.
2401 (total_string_size): Rename to total_string_bytes, adjust users.
2402 (total_vector_size): Rename to total_vector_bytes, adjust users.
2403 (sweep_vectors): Account total_vectors and total_vector_bytes.
2404 (Fgarbage_collect): New return value. Adjust documentation.
2405 (gc_sweep): Account total_buffers.
2406 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2407 (VECTOR_SIZE): Remove.
2408 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2409 (Qinterval, Qmisc): New symbols.
2410 (syms_of_data): Initialize them.
2411 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2412 (Qcons, Qbuffer): New declarations.
2413
2414 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2415
2416 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2417 Round up, not down. Improve doc.
2418
2419 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2420
2421 Restore old code in allocate_string_data to avoid Faset breakage.
2422 Reported by Julien Danjou <julien@danjou.info> in
2423 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2424 * alloc.c (allocate_string_data): Restore old code with minor
2425 adjustments, fix comment to explain this subtle issue.
2426
2427 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2428
2429 Remove FILE_SYSTEM_CASE.
2430 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2431
2432 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2433 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2434 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2435 call-process-region passes it through expand-file-name.
2436
2437 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2438
2439 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2440
2441 Fix crash when creating indirect buffer (Bug#11917)
2442 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2443 Don't handle unbound variables specially if non-zero.
2444 (Fbuffer_local_variables): Pass zero.
2445 (clone_per_buffer_values): Pass non-zero.
2446
2447 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2448
2449 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2450 to make the loop interruptible.
2451
2452 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2453
2454 * gnutls.c (emacs_gnutls_handshake): Only retry if
2455 GNUTLS_E_INTERRUPTED.
2456
2457 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2458
2459 Cleanup and convert miscellaneous checks to eassert.
2460 * alloc.c (mark_interval): Fix comment, partially rephrase
2461 old comment from intervals.h (see below).
2462 * intervals.c (find_interval, adjust_intervals_for_insertion)
2463 (delete_interval, adjust_intervals_for_deletion)
2464 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2465 Convert to eassert.
2466 (adjust_intervals_for_insertion, make_new_interval):
2467 Remove obsolete and unused code.
2468 * intervals.h (struct interval): Remove obsolete comment.
2469 * textprotp.c (erase_properties): Remove unused code.
2470 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2471 (Fremove_list_of_text_properties): Convert to eassert.
2472
2473 2012-07-17 Chong Yidong <cyd@gnu.org>
2474
2475 * editfns.c (Finsert_char): Doc fix.
2476
2477 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 Fix previous change to make Fmemory_free always accurate.
2480 * alloc.c (make_interval): Update total_free_intervals.
2481 (make_float): Likewise for total_free_floats.
2482 (free_cons, Fcons): Likewise for total_free_conses.
2483 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2484 Likewise for total_free_vector_bytes.
2485 (Fmake_symbol): Likewise for total_free_symbols.
2486 (bytes_free): Remove.
2487
2488 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2489
2490 Simple free memory accounting feature.
2491 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2492 (sweep_vectors): Accumulate size of free vectors.
2493 (Fgarbage_collect): Setup bytes_free.
2494 (Fmemory_free): New function.
2495 (syms_of_alloc): Register it.
2496
2497 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2498
2499 Cleanup overlays checking.
2500 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2501 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2502 eassert and OVERLAYP.
2503 (sort_overlays): Change to use OVERLAYP.
2504
2505 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2506
2507 * editfns.c (Finsert_char): Make it interactive, and make the
2508 second arg optional. Copy interactive spec and docstring from
2509 ucs-insert.
2510
2511 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2512
2513 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2514 Unlike the other wrapped functions, fabs has an unspecified
2515 effect on errno.
2516
2517 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2518
2519 * nsterm.m (keyDown): Interpret flags without left/right bits
2520 as the left key (Bug#11670).
2521
2522 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2523
2524 Remove empty and useless init functions.
2525 * lisp.h (init_character_once, init_fns, init_image)
2526 (init_filelock, init_sound): Remove prototype.
2527 * character.c (init_character_once): Remove.
2528 * filelock.c (init_filelock): Likewise.
2529 * fns.c (init_fns): Likewise.
2530 * image.c (init_image): Likewise.
2531 * sound.c (init_sound): Likewise.
2532 * emacs.c (main): Adjust accordingly.
2533
2534 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2535
2536 * gtkutil.h: Tiny cleanups.
2537 (use_old_gtk_file_dialog): Remove useless declaration.
2538 (xg_uses_old_file_dialog): Add suggested const attribute.
2539
2540 2012-07-15 Eli Zaretskii <eliz@gnu.org>
2541
2542 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2543 (bidi_paragraph_init): Use it to limit search forward for a strong
2544 directional character in abnormally large paragraphs full of
2545 neutral or weak characters. (Bug#11943)
2546
2547 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2548
2549 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2550 the toolbar (Bug#9451).
2551 (xg_make_tool_item): Give the widget event box a transparent
2552 background.
2553
2554 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2555
2556 Cleanup basic allocation variables and functions.
2557 * alloc.c (ignore_warnings, init_intervals, init_float)
2558 (init_cons, init_symbol, init_marker): Remove.
2559 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2560 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2561 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2562 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2563 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2564 (staticidx, init_alloc_once, init_strings, free_ablock):
2565 Remove redundant initialization.
2566 * fns.c (init_weak_hash_tables): Remove.
2567 * lisp.h (init_weak_hash_tables): Remove prototype.
2568
2569 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2570
2571 Use zero_vector where appropriate.
2572 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2573 accordingly.
2574 * lisp.h (zero_vector): New declaration.
2575 * font.c (null_vector): Remove.
2576 (syms_of_font): Remove initialization and staticpro.
2577 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2578 * keymap.c (Faccessible_keymaps): Likewise.
2579
2580 2012-07-15 Leo Liu <sdl.web@gmail.com>
2581
2582 * fringe.c: Fix typo in comments.
2583
2584 2012-07-14 Leo Liu <sdl.web@gmail.com>
2585
2586 * fringe.c: Add a new bitmap exclamation-mark.
2587
2588 2012-07-14 Eli Zaretskii <eliz@gnu.org>
2589
2590 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2591
2592 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2593 (HAVE_MENUS): Don't define, defined by editing config.in with
2594 msdos/sed2v2.inp.
2595 (GMALLOC_INHIBIT_VALLOC): Don't define.
2596 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2597
2598 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
2599
2600 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2601
2602 2012-07-14 Glenn Morris <rgm@gnu.org>
2603
2604 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2605 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2606 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2607
2608 2012-07-13 Glenn Morris <rgm@gnu.org>
2609
2610 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2611
2612 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2613 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2614
2615 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2616
2617 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2618 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2619 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2620 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2621 where appropriate.
2622 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2623 as boolean expression.
2624 (x_set_window_size): Remove unused variable toolbar.
2625 (ns_get_color_default, ns_mod_to_lisp): Remove.
2626 (ns_mouse_position): Remove unused variables xchar and ychar.
2627 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2628 (ns_set_vertical_scroll_bar): Remove unused variable count.
2629 (ns_delete_terminal): Remove unused variable i.
2630 (ns_term_init): Remove unused variables r, g and b.
2631 (mouseDown): Remove unused variable window.
2632 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2633 (initFrameFromEmacs): Remove unused variable vbextra.
2634 (mouseEntered): Remove unused variables p and dpyinfo.
2635 (mouseExited): Remove unused variables p and r.
2636 (ns_define_frame_cursor, ns_clear_frame_area)
2637 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2638 (menuDown): Assign [sender tag] to variable and cast the variable.
2639
2640 * nsterm.h (menuDown): Add id as type to argument sender.
2641 (ns_display_info_for_name): Add Lisp_Object argument.
2642 (ns_term_init): Add Lisp_Object argument.
2643 (ns_map_event_to_object): Add void argument.
2644 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2645 prototype with arguments and only declare if __OBJC__.
2646 (nxatoms_of_nsselect): Add void argument.
2647 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2648 (ns_alloc_autorelease_pool): Add void argument.
2649 (ns_release_autorelease_pool): Add void* argument.
2650 (ns_get_defaults_value): Add const char* argument.
2651
2652 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2653 (initFromContents): Use SSDATA where appropriate.
2654 (ns_update_menubar): Add braces to ambigous if-else.
2655 (initWithTitle): Put () around assignment in if statement.
2656 (ns_menu_show): Remove unused variables window and keymap.
2657 (update_frame_tool_bar): Remove unused variable selected_p.
2658 (initWithContentRect): Remove unused variable this_cmd_name.
2659
2660 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2661 appropriate.
2662 (setXBMColor): Remove unused variable len.
2663 (setPixmapData): Put () around assignment in loop statement.
2664
2665 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2666 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2667 where appropriate.
2668 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2669 around assignment in loop statement.
2670 (nsfont_open): Remove unused variable i.
2671 (nsfont_open): Remove unused variable len.
2672 (nsfont_draw): Remove unused variable cs.
2673
2674 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2675 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2676 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2677 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2678 (Fns_font_name, Fns_perform_service)
2679 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2680 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2681 (ns_set_name): Remove unused variable view.
2682 (x_set_menu_bar_lines): Remove unused variable olines.
2683 (x_set_tool_bar_lines): Remove unused variable root_window.
2684 (Fns_list_colors): Put () around assignment in while statement.
2685 (Fns_perform_service): Remove unused variable len.
2686 (Fns_display_usable_bounds): Remove unused variable top.
2687 (syms_of_nsfns): Remove unused variable i.
2688
2689 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2690 memcpy (Bug#11907).
2691
2692 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2693
2694 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2695 and free it with DestroyExceptionInfo (Bug#11558).
2696
2697 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
2698
2699 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2700 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2701 Set here, not in nt/config.nt.
2702
2703 2012-07-13 Eli Zaretskii <eliz@gnu.org>
2704
2705 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2706 cursor overflow into the last glyph on display line when the right
2707 fringe is off. (Bug#11832)
2708
2709 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2710
2711 * xdisp.c (produce_special_glyphs): Now static.
2712 * dispextern.h (produce_special_glyphs): Remove decl.
2713
2714 2012-07-13 Glenn Morris <rgm@gnu.org>
2715
2716 * s/bsd-common.h, s/cygwin.h: Remove empty files.
2717 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2718
2719 * s/usg5-4-common.h (USG, USG5):
2720 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2721 * s/sol2-6.h (SOLARIS2):
2722 * s/irix6-5.h (IRIX6_5):
2723 * s/hpux10-20.h (USG, USG5, HPUX):
2724 * s/gnu-linux.h (USG, GNU_LINUX):
2725 * s/freebsd.h (BSD_SYSTEM):
2726 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2727 * s/cygwin.h (CYGWIN):
2728 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2729 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2730
2731 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
2732
2733 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
2734
2735 2012-07-13 Glenn Morris <rgm@gnu.org>
2736
2737 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2738
2739 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2740
2741 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2742 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2743
2744 2012-07-12 Glenn Morris <rgm@gnu.org>
2745
2746 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
2747
2748 * process.c (init_process_emacs): Rename from init_process.
2749 The old name is also the name of a Mach system call.
2750 * lisp.h, emacs.c: Update for this name change.
2751 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2752 longer needed.
2753
2754 2012-07-12 Eli Zaretskii <eliz@gnu.org>
2755
2756 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2757 memmove call that removes glyphs covered by the left truncation
2758 glyph. Improve commentary.
2759 (display_line): Fix display of continuation glyphs on GUI frames
2760 when the right fringe is turned off and variable-size fonts are
2761 used in the window. Move the code that appends a stretch glyph to
2762 produce_special_glyphs, so that it could be used for truncation
2763 and continuation glyphs alike.
2764 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2765 glyph of a suitably computed width, to align the special glyphs at
2766 the window margin. Code moved from display_line. (Bug#11832)
2767
2768 2012-07-12 Glenn Morris <rgm@gnu.org>
2769
2770 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2771
2772 * s/gnu-linux.h, s/hpux10-20.h:
2773 Do not unconditionally define HAVE_XRMSETDATABASE.
2774
2775 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2776
2777 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2778
2779 Fix typos that broke OS X build.
2780 Reported by Randal L. Schwartz in
2781 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2782 * nsterm.m (ns_timeout): Add missing local decl.
2783 (ns_get_color): snprintf -> sprintf, to fix typo.
2784
2785 2012-07-12 Glenn Morris <rgm@gnu.org>
2786
2787 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2788 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2789 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2790 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2791
2792 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2793 Move PTY_OPEN to configure.
2794
2795 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2796 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2797 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2798
2799 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2800
2801 Use empty_unibyte_string where applicable.
2802 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2803 * lread.c (read1): Likewise.
2804 * xsettings.c (syms_of_xsettings): Likewise.
2805
2806 2012-07-12 Glenn Morris <rgm@gnu.org>
2807
2808 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2809 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
2810 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2811 * s/hpux10-20.h (RUN_TIME_REMAP):
2812 * s/bsd-common.h (TABDLY): Move to configure.
2813
2814 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2815
2816 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2817
2818 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2819 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
2820
2821 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
2822
2823 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2824 * s/template.h: Move NARROWPROTO to configure.
2825
2826 2012-07-11 Glenn Morris <rgm@gnu.org>
2827
2828 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2829 unused since 2011-01-17 change to systty.h.
2830
2831 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2832 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2833 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2834
2835 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2836
2837 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2838
2839 2012-07-11 Glenn Morris <rgm@gnu.org>
2840
2841 * s/darwin.h, s/gnu-linux.h, s/template.h:
2842 Move INTERRUPT_INPUT to configure.
2843
2844 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2845
2846 Minor adjustments to interning code.
2847 * lisp.h (intern, intern_c_string): Redefine as static inline
2848 wrappers for intern_1 and intern_c_string_1, respectively.
2849 (intern_1, intern_c_string_1): Rename prototypes.
2850 * lread.c (intern_1, intern_c_string_1, oblookup):
2851 Simplify Vobarray checking.
2852 * font.c (font_intern_prop): Likewise. Adjust comment.
2853 * w32font.c (intern_font_name): Likewise.
2854
2855 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2856
2857 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2858
2859 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2860 of Fcar/Fcdr if possible.
2861 * font.c (check_otf_features): Likewise.
2862 * fontset.c (Fnew_fontset): Likewise.
2863 * gnutls.c (Fgnutls_boot): Likewise.
2864 * minibuf.c (read_minibuf): Likewise.
2865 * msdos.c (IT_set_frame_parameters): Likewise.
2866 * xmenu.c (Fx_popup_dialog): Likewise.
2867 * w32menu.c (Fx_popup_dialog): Likewise.
2868
2869 2012-07-11 Glenn Morris <rgm@gnu.org>
2870
2871 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2872 since nothing has defined it on these platforms.
2873
2874 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2875 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2876
2877 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2878 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2879 Move CLASH_DETECTION to configure.
2880
2881 * s/gnu.h: Remove file, which is now empty.
2882
2883 * s/gnu.h, s/gnu-linux.h:
2884 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2885
2886 2012-07-11 John Wiegley <johnw@newartisans.com>
2887
2888 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2889 function attribute, so we only use it if it exists in the
2890 compiler.
2891
2892 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Avoid call to strlen in fast_c_string_match_ignore_case.
2895 * search.c (fast_c_string_match_ignore_case): Change to use
2896 length argument. Adjust users accordingly.
2897 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2898
2899 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2900
2901 Assume mkdir, rmdir.
2902 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2903 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2904
2905 Assume rename.
2906 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2907
2908 Assume perror.
2909 * s/hpux10-20.h (HAVE_PERROR): Remove.
2910 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2911 Remove dummy definition, as this problem was obsolete long ago.
2912
2913 Assume strerror.
2914 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2915
2916 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2917
2918 Avoid calls to strlen in font processing functions.
2919 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
2920 (font_open_by_name): Change to use length argument.
2921 Adjust users accordingly.
2922 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2923 Adjust prototypes.
2924 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2925 Change to return ptrdiff_t.
2926 (xfont_list_pattern, xfont_match): Use length returned by
2927 xfont_decode_coding_xlfd.
2928 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2929
2930 2012-07-11 Glenn Morris <rgm@gnu.org>
2931
2932 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2933 Move DONT_REOPEN_PTY to configure.
2934
2935 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2936 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2937
2938 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2939
2940 Remove "#define unix" that is no longer needed (Bug#11905).
2941 * s/aix4-2.h (unix): Remove; no longer needed.
2942
2943 EMACS_TIME simplification (Bug#11875).
2944 This replaces macros (which typically do not work in GDB)
2945 with functions, typedefs and enums, making the code easier to debug.
2946 The functional style also makes code easier to read and maintain.
2947 * systime.h: Include <sys/time.h> on all hosts, not just if
2948 WINDOWSNT, since 'struct timeval' is needed in general.
2949 (EMACS_TIME): Now a typedef, not a macro.
2950 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2951 not macros.
2952 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2953 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2954 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2955 (EMACS_TIME_LE): Now functions, not macros.
2956 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2957 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2958 which are not functions. All uses rewritten to use:
2959 (make_emacs_time): New function.
2960 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2961 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2962 not functions. All uses rewritten to use the following, respectively:
2963 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2964 (add_emacs_time, sub_emacs_time): New functions.
2965 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
2966 * fileio.c (Fcopy_file):
2967 * xterm.c (XTflash): Get the current time closer to when it's used.
2968 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2969
2970 * bytecode.c (targets): Suppress -Woverride-init warnings.
2971
2972 Simplify by avoiding confusing use of strncpy etc.
2973 * doc.c (Fsnarf_documentation):
2974 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2975 * frame.c (Fmake_terminal_frame):
2976 * gtkutil.c (get_utf8_string):
2977 * lread.c (openp):
2978 * nsmenu.m (ns_update_menubar):
2979 * regex.c (regerror):
2980 Prefer memcpy to strncpy and strncat when either will do.
2981 * fileio.c (Fsubstitute_in_file_name):
2982 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2983 (menu_separator_name_p):
2984 * nsmenu.m (ns_update_menubar):
2985 Prefer memcmp to strncmp when either will do.
2986 * nsterm.m: Include <ftoastr.h>.
2987 (ns_get_color):
2988 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2989 Prefer snprintf to strncpy.
2990 * nsterm.m (ns_term_init):
2991 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2992 * nsterm.m (ns_term_init):
2993 Avoid the need for strncpy, by using build_string or
2994 make_unibyte_string directly. Use dtoastr, not snprintf.
2995 * process.c (Fmake_network_process): Diagnose service names that
2996 are too long, rather than silently truncating them or creating
2997 non-null-terminated names.
2998 (Fnetwork_interface_info): Likewise, for interface names.
2999 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3000 Prefer sprintf to strncat.
3001 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3002 Prefer vsnprintf to vsprintf + strncpy.
3003
3004 2012-07-10 Glenn Morris <rgm@gnu.org>
3005
3006 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3007 Clarify fallback case.
3008
3009 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3010
3011 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3012 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3013 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3014 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3015 where argument type is known to be a Lisp_Cons.
3016
3017 2012-07-10 Tom Tromey <tromey@redhat.com>
3018
3019 * bytecode.c (BYTE_CODE_THREADED): New macro.
3020 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3021 (enum byte_code_op): New type.
3022 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3023 (exec_byte_code): Use them. Use token threading when applicable.
3024
3025 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3026
3027 Optimize pure C strings initialization.
3028 * lisp.h (make_pure_string): Fix prototype.
3029 (build_pure_c_string): New function, defined as static inline. This
3030 provides a better opportunity to optimize away calls to strlen when
3031 the function is called with compile-time constant argument.
3032 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3033 argument, adjust users accordingly. Use build_pure_c_string where
3034 appropriate.
3035 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3036 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3037 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3038
3039 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3040
3041 Avoid calls to strlen in miscellaneous functions.
3042 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3043 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3044 * lread.c (openp): Likewise.
3045
3046 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3047
3048 Avoid calls to strlen in path processing functions.
3049 * fileio.c (file_name_as_directory): Add comment. Change to add
3050 srclen argument and return the length of result. Adjust users
3051 accordingly.
3052 (directory_file_name): Fix comment. Change to add srclen argument,
3053 swap 1st and 2nd arguments to obey the common convention.
3054 Adjust users accordingly.
3055 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3056
3057 2012-07-10 Glenn Morris <rgm@gnu.org>
3058
3059 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3060 Move PENDING_OUTPUT_COUNT definition to configure.
3061
3062 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3063 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3064 * s/gnu.h (DATA_START): Move definitions to configure.
3065
3066 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3067 We include usg5-4-common.h, which defines them both.
3068
3069 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3070 O_RDONLY already includes it).
3071
3072 Stop ns builds setting the EMACSLOADPATH environment variable.
3073 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3074 Now it does not set EMACSLOADPATH, just returns the load-path string.
3075 * nsterm.h: Update accordingly.
3076 * lread.c [HAVE_NS]: Include nsterm.h.
3077 (init_lread) [HAVE_NS]: Use ns_load_path.
3078 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3079
3080 2012-07-09 Glenn Morris <rgm@gnu.org>
3081
3082 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3083 since the included bsd-common.h does so.
3084
3085 Stop ns builds setting the EMACSPATH environment variable.
3086 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3087 (ns_init_paths): Do not set EMACSPATH.
3088 * nsterm.h (ns_exec_path): Add it.
3089 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3090 Use ns_exec_path.
3091
3092 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3093
3094 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3095
3096 * process.c (wait_reading_process_output): 'waitchannels' was unset
3097 when read_kbd || !NILP (wait_for_cell); fix this.
3098
3099 Add GCC-style 'const' attribute to functions that can use it.
3100 * character.h (char_resolve_modifier_mask):
3101 * keyboard.h (make_ctrl_char):
3102 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3103 (init_character_once, next_almost_prime, init_fns, init_image)
3104 (flush_pending_output, init_sound):
3105 * mem-limits.h (start_of_data):
3106 * menu.h (finish_menu_items):
3107 Add ATTRIBUTE_CONST.
3108 * emacs.c (DEFINE_DUMMY_FUNCTION):
3109 Declare the dummy function with ATTRIBUTE_CONST.
3110 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3111 Add decls with ATTRIBUTE_CONST.
3112
3113 Minor improvements to make_formatted_string.
3114 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3115 where int is good enough, as vsprintf returns an int.
3116 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3117
3118 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3119
3120 Use make_formatted_string to avoid double length calculation.
3121 * lisp.h (make_formatted_string): New prototype.
3122 * alloc.c (make_formatted_string): New function.
3123 * buffer.c (Fgenerate_new_buffer_name): Use it.
3124 * dbus.c (syms_of_dbusbind): Likewise.
3125 * editfns.c (Fcurrent_time_zone): Likewise.
3126 * filelock.c (get_boot_time): Likewise.
3127 * frame.c (make_terminal_frame, set_term_frame_name)
3128 (x_report_frame_params): Likewise.
3129 * image.c (gs_load): Likewise.
3130 * minibuf.c (get_minibuffer): Likewise.
3131 * msdos.c (dos_set_window_size): Likewise.
3132 * process.c (make_process): Likewise.
3133 * xdisp.c (ensure_echo_area_buffers): Likewise.
3134 * xsettings.c (apply_xft_settings): Likewise.
3135
3136 2012-07-09 Glenn Morris <rgm@gnu.org>
3137
3138 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3139 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3140 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3141 * nsterm.h (ns_etc_directory): Add it.
3142 * callproc.c [HAVE_NS]: Include nsterm.h.
3143 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3144
3145 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3146
3147 Move marker debugging code under MARKER_DEBUG.
3148 * marker.c (MARKER_DEBUG): Move marker debugging code under
3149 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3150 for bootstrap with --enable-checking (~3x slowdown reported
3151 by Juanma Barranquero <lekktu@gmail.com>).
3152 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3153
3154 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3155
3156 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3157 See <http://bugs.gnu.org/11825#29>.
3158
3159 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3160
3161 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3162 has no font, use the frame's font. (Bug#11813)
3163 (display_line): Add commentary about displaying truncation glyphs
3164 on GUI frames.
3165 (produce_special_glyphs): Move here from term.c.
3166
3167 * term.c (produce_special_glyphs): Move to xdisp.c.
3168
3169 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3170 section.
3171
3172 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3173
3174 * xdisp.c (display_line): Avoid warning about implicit declaration
3175 of FRAME_FONT.
3176
3177 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3178
3179 * lisp.h: Remove empty conditional.
3180
3181 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3182
3183 * lread.c (load_path_check): Now static.
3184
3185 Fix some minor --with-ns problems found by static checking.
3186 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3187 (x_set_font) [!HAVE_X_WINDOWS]:
3188 * image.c (xpm_load_image) [HAVE_NS]:
3189 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3190 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3191 Remove unused local.
3192 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3193 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3194 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3195 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3196 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3197 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3198 Fix pointer signedness problem.
3199 * xfaces.c (FRAME_X_FONT_TABLE):
3200 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3201
3202 2012-07-07 Glenn Morris <rgm@gnu.org>
3203
3204 * lread.c (load_path_check): New function, split from init_lread.
3205 (init_lread): Reorganize. Motivation:
3206 If EMACSLOADPATH is set, check/warn about that rather than the
3207 defaults, which we are not going to use. Hence we can remove
3208 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3209 Don't warn if site-lisp directories are missing.
3210 If not installed, start from a blank load-path, since
3211 PATH_LOADSEARCH refers to the eventual installation directories.
3212
3213 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3214
3215 Support truncation and continuation glyphs on GUI frames, when
3216 fringes are disabled. (Bug#11832)
3217 * xdisp.c (init_iterator): Get dimensions of truncation and
3218 continuation glyphs even if on GUI frames.
3219 Adjust it->last_visible_x on GUI frames when the left or right fringes,
3220 or both, are absent.
3221 (start_display, move_it_in_display_line_to): Handle the case of a
3222 GUI frame without a fringe to display continuation or truncation
3223 glyphs.
3224 (insert_left_trunc_glyphs): Support GUI frames: make sure
3225 truncation glyphs overwrite enough glyphs from the current line to
3226 have sufficient space in pixels.
3227 (display_line): Support truncation and continuation glyphs on GUI
3228 frames. If some spare pixels are left on the line after inserting
3229 the truncation glyphs, fill that space with a stretch glyph of a
3230 suitably computed width.
3231
3232 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3233 produce_glyphs, to support GUI sessions.
3234
3235 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3236
3237 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3238
3239 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3240
3241 Do not require float-time's arg to fit in time_t (Bug#11825).
3242 This works better on hosts where time_t is unsigned, and where
3243 float-time is applied to the (negative) difference between two times.
3244 * editfns.c (decode_time_components): Last arg is now double *,
3245 not int *, and means to store all the result as a double, without
3246 worrying about whether the seconds part fits in time_t.
3247 All callers changed.
3248 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3249 All callers changed.
3250 (Ffloat_time): Do not fail merely because the specified time falls
3251 outside of time_t range.
3252
3253 2012-07-07 Glenn Morris <rgm@gnu.org>
3254
3255 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3256 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3257 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3258
3259 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3260
3261 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3262 Update dependencies.
3263
3264 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3265
3266 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3267
3268 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3269 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3270 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3271 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3272 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3273 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3274
3275 * xfont.c (compare_font_names): Redo to omit the need for casts.
3276
3277 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3278
3279 * xfns.c (Fx_change_window_property): Doc fix.
3280 * w32fns.c (Fx_change_window_property): Doc fix.
3281
3282 * w32fns.c (Fx_window_property): Accept the same arguments as the
3283 X Windows version. Doc fix.
3284 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3285
3286 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3287 Eli Zaretskii <eliz@gnu.org>
3288
3289 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3290 Windows-specific code from nt/config.nt moved here.
3291 Obsolete settings removed.
3292
3293 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3294
3295 * process.c: Avoid unnecessary calls to gettime.
3296 (wait_reading_process_output): Don't get the time of day
3297 when gobbling data immediately and not waiting, as there's no need
3298 for it in that case. This removes a FIXME.
3299
3300 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3301
3302 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3303 is defined (Bug#11768).
3304
3305 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Fix marker debugging code.
3308 * marker.c (byte_char_debug_check): Do not perform the check
3309 if buffer is not multibyte.
3310 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3311 Call byte_char_debug_check with correct arguments.
3312
3313 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3314
3315 Compile marker debugging code only if ENABLE_CHECKING is defined.
3316 * marker.c (byte_char_debug_check, count_markers):
3317 Use only if ENABLE_CHECKING is defined.
3318 (byte_debug_flag): Remove.
3319 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3320 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3321
3322 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3323
3324 Avoid code repetition in marker-related functions.
3325 * marker.c (attach_marker): New function.
3326 (Fset_marker, set_marker_restricted, set_marker_both)
3327 (set_marker_restricted_both): Use it.
3328 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3329 Consistently rename charno to charpos.
3330 (marker_position): Add eassert.
3331 (marker_byte_position): Convert to eassert.
3332
3333 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3334
3335 Simplify list operations in unchain_overlay and unchain_marker.
3336 * buffer.c (unchain_overlay): Simplify. Add comment.
3337 * marker.c (unchain_marker): Simplify. Fix comments.
3338
3339 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3340
3341 Introduce fast path for the widely used marker operation.
3342 * alloc.c (build_marker): New function.
3343 * lisp.h (build_marker): New prototype.
3344 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3345 * composite.c (autocmp_chars): Likewise.
3346 * editfns.c (buildmark): Remove.
3347 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3348 (save_restriction_save): Use build_marker.
3349 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3350 * window.c (save_window_save): Likewise.
3351
3352 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3353
3354 Do not use Fdelete_overlay in delete_all_overlays
3355 to avoid redundant calls to unchain_overlay.
3356 * buffer.c (drop_overlay): New function.
3357 (delete_all_overlays, Fdelete_overlay): Use it.
3358 * minibuf.c (get_minibuffer): Fix comment.
3359
3360 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3361
3362 Port to OpenBSD 5.1 amd64.
3363 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3364 This is needed for OpenBSD, and should be harmless on all BSD systems.
3365 Also, include <sys/sysctl.h>, as it should be available on all
3366 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3367 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3368 use p_pid member, not kp_proc.pid.
3369
3370 2012-07-06 Glenn Morris <rgm@gnu.org>
3371
3372 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3373
3374 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3375
3376 More xmalloc and related cleanup.
3377 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3378 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3379 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3380 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3381 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3382 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3383 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3384 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3385 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3386 * xterm.c:
3387 Omit needless casts involving void * pointers and allocation.
3388 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3389 as the former is more robust if P's type is changed.
3390 Prefer xzalloc to xmalloc + memset 0.
3391 Simplify malloc-or-realloc to realloc.
3392 Don't worry about xmalloc returning a null pointer.
3393 Prefer xstrdup to xmalloc + strcpy.
3394 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3395 growing it.
3396 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3397 alloca of a constant.
3398
3399 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3400
3401 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3402 hscroll is larger than the line width. Fixes long and futile
3403 looping inside extend_face_to_end_of_line (on a TTY) producing
3404 glyphs that are not needed and thrown away.
3405
3406 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3407
3408 * marker.c (set_marker_restricted_both): Simplify by using
3409 clip_to_bounds.
3410
3411 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3412
3413 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3414
3415 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3416
3417 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3418 not defined (Bug#11768).
3419 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3420 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3421 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3422 followed by gtk_box_set_homogeneous (Bug#11768).
3423 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3424 (update_theme_scrollbar_width, xg_create_scroll_bar):
3425 Use gtk_scrollbar_new (Bug#11768).
3426 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3427 (is_box_type): New function (Bug#11768).
3428 (xg_tool_item_stale_p): Call is_box_type.
3429 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3430 with default display (Bug#11768).
3431
3432 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3433
3434 * xdisp.c (window_hscroll_limited): New function.
3435 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3436 coordinates when window's hscroll is set to insanely large
3437 values. (Bug#11857)
3438
3439 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
3440
3441 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3442 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3443
3444 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3445
3446 Cleanup xmalloc.
3447 * lisp.h (xzalloc): New prototype. Omit needless casts.
3448 * alloc.c (xzalloc): New function. Omit needless casts.
3449 * charset.c: Omit needless casts. Convert all calls to
3450 xmalloc with following memset to xzalloc.
3451 * dispnew.c: Likewise.
3452 * fringe.c: Likewise.
3453 * image.c: Likewise.
3454 * sound.c: Likewise.
3455 * term.c: Likewise.
3456 * w32fns.c: Likewise.
3457 * w32font.c: Likewise.
3458 * w32term.c: Likewise.
3459 * xfaces.c: Likewise.
3460 * xfns.c: Likewise.
3461 * xterm.c: Likewise.
3462 * atimer.c: Omit needless casts.
3463 * buffer.c: Likewise.
3464 * callproc.c: Likewise.
3465 * ccl.c: Likewise.
3466 * coding.c: Likewise.
3467 * composite.c: Likewise.
3468 * doc.c: Likewise.
3469 * doprnt.c: Likewise.
3470 * editfns.c: Likewise.
3471 * emacs.c: Likewise.
3472 * eval.c: Likewise.
3473 * filelock.c: Likewise.
3474 * fns.c: Likewise.
3475 * gtkutil.c: Likewise.
3476 * keyboard.c: Likewise.
3477 * lisp.h: Likewise.
3478 * lread.c: Likewise.
3479 * minibuf.c: Likewise.
3480 * msdos.c: Likewise.
3481 * print.c: Likewise.
3482 * process.c: Likewise.
3483 * region-cache.c: Likewise.
3484 * search.c: Likewise.
3485 * sysdep.c: Likewise.
3486 * termcap.c: Likewise.
3487 * terminal.c: Likewise.
3488 * tparam.c: Likewise.
3489 * w16select.c: Likewise.
3490 * w32.c: Likewise.
3491 * w32reg.c: Likewise.
3492 * w32select.c: Likewise.
3493 * w32uniscribe.c: Likewise.
3494 * widget.c: Likewise.
3495 * xdisp.c: Likewise.
3496 * xmenu.c: Likewise.
3497 * xrdb.c: Likewise.
3498 * xselect.c: Likewise.
3499
3500 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3501
3502 * fileio.c (time_error_value): Check the right error number.
3503 Problem reported by Troels Nielsen in
3504 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3505
3506 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3507
3508 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3509 This should be fixed in a better way; see Eli Zaretskii in
3510 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3511 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3512
3513 * fileio.c (time_error_value): Rename from special_mtime.
3514 The old name's problems were noted by Eli Zaretskii in
3515 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3516
3517 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3518 This variable's comment says Emacs needs at least one GDB-visible
3519 symbol of type enum pvec_type, to work around GDB problems.
3520 The symbol's value doesn't matter.
3521
3522 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3523 that causes compilation to fail on pre-C99 compilers.
3524
3525 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
3526
3527 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3528 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3529
3530 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3531
3532 * buffer.c (init_buffer_once): Fix initialization of
3533 headers for buffer_defaults and buffer_local_symbols.
3534 Reported by Juanma Barranquero <lekktu@gmail.com>.
3535
3536 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3537
3538 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3539 * lisp.h (enum pvec_type): Use fewer bits.
3540 (PSEUDOVECTOR_SIZE_BITS): New constant.
3541 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3542 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3543 change in pvec_type.
3544 (PSEUDOVECTOR_TYPEP): New macro.
3545 (TYPED_PSEUDOVECTORP): Use it.
3546 * fns.c (internal_equal): Adapt code to extract pvectype.
3547 * emacs.c (gdb_pvec_type): Update type.
3548 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3549 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3550 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3551 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3552 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3553 abusing vector->header.next.nbytes.
3554 (live_vector_p): Use PVEC_TYPE.
3555 (mark_object): Adapt code to extract pvectype. Use switch.
3556
3557 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3558
3559 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3560 Tighten new eassert a bit.
3561
3562 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3563
3564 Fix compilation with --enable-gcc-warnings and -O1
3565 optimization level.
3566 * doprnt.c (doprnt): Change type of tem to int, initialize
3567 to avoid compiler warning. Add eassert.
3568 * search.c (simple_search): Initialize match_byte to avoid
3569 compiler warning. Add eassert.
3570
3571 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3572
3573 Avoid weird behavior with large horizontal scrolls.
3574 Without this change, for example, large hscroll values would
3575 mess up Emacs's display on Fedora 15 x86, presumably due to
3576 overflows in int calculations in the display code.
3577 Also, if buffers had long lines, Emacs would freeze.
3578 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3579 (set_window_hscroll): New function, containing the old guts of
3580 Fset_window_hscroll. Return the clipped value.
3581 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3582 This avoids the need to check against PTRDIFF_MAX.
3583
3584 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3585
3586 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3587
3588 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3589
3590 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3591
3592 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3593 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3594 since GCC 4.4.6 issues a bogus warning for them.
3595
3596 Fix bugs in file timestamp newness comparisons.
3597 * fileio.c (Ffile_newer_than_file_p):
3598 * lread.c (Fload): Use full timestamp resolution of files,
3599 not just the 1-second resolution, so that files that are only
3600 slightly newer still count as newer.
3601 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3602 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3603
3604 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3605
3606 * fileio.c: Improve handling of file time marker. (Bug#11852)
3607 (special_mtime): New function.
3608 (Finsert_file_contents, Fverify_visited_file_modtime):
3609 Use it to set special mtime values consistently.
3610
3611 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3612
3613 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3614 marker for non-existing file. (Bug#11852)
3615
3616 2012-07-03 Glenn Morris <rgm@gnu.org>
3617
3618 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3619 and did not make it into globals.h).
3620
3621 2012-07-03 Tom Tromey <tromey@redhat.com>
3622
3623 * window.c (Fset_window_margins, Fset_window_fringes)
3624 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3625 * textprop.c (Fprevious_property_change): No longer static.
3626 * syntax.c (Fsyntax_table_p): No longer static.
3627 * process.c (Fget_process, Fprocess_datagram_address): No longer
3628 static.
3629 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3630 * keyboard.c (Fcommand_execute): No longer static.
3631 Remove EXFUN.
3632 * insdel.c (Fcombine_after_change_execute): No longer static.
3633 * image.c (Finit_image_library): No longer static.
3634 * fileio.c (Fmake_symbolic_link): No longer static.
3635 * eval.c (Ffetch_bytecode): No longer static.
3636 * editfns.c (Fuser_full_name): No longer static.
3637 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3638 No longer static.
3639 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3640 static.
3641 * dired.c (Ffile_attributes): No longer static.
3642 * composite.c (Fcomposition_get_gstring): No longer static.
3643 * callproc.c (Fgetenv_internal): No longer static.
3644
3645 * ccl.h: Remove EXFUNs.
3646 * buffer.h: Remove EXFUNs.
3647 * dispextern.h: Remove EXFUNs.
3648 * intervals.h: Remove EXFUNs.
3649 * fontset.h: Remove EXFUN.
3650 * font.h: Remove EXFUNs.
3651 * dosfns.c (system_process_attributes): Remove EXFUN.
3652 * keymap.h: Remove EXFUNs.
3653 * lisp.h: Remove EXFUNs.
3654 * w32term.h: Remove EXFUNs.
3655 * window.h: Remove EXFUNs.
3656 * xsettings.h: Remove EXFUN.
3657 * xterm.h: Remove EXFUN.
3658
3659 2012-07-03 Glenn Morris <rgm@gnu.org>
3660
3661 * lisp.h (Frandom): Make it visible to C.
3662 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3663 buffer for invisible buffers. (Bug#1229)
3664
3665 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3666
3667 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3668 values which aren't power of 2.
3669 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3670 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
3671 accordingly.
3672
3673 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3674
3675 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3676
3677 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3678
3679 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3680
3681 * alloc.c (allocate_vector_block): Remove redundant
3682 calls to mallopt if DOUG_LEA_MALLOC is defined.
3683 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3684 avoid calls to mallopt if zero_vector is returned.
3685
3686 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3687
3688 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3689 is enabled, avoid dereferencing NULL current_sblock if
3690 running undumped.
3691
3692 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3693
3694 Cleanup basic buffer management.
3695 * buffer.h (struct buffer): Change layout to use generic vector
3696 marking code. Fix some comments. Change type of 'clip_changed'
3697 to bitfield. Remove unused #ifndef old.
3698 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3699 (GET_OVERLAYS_AT): Fix indentation.
3700 (for_each_per_buffer_object_at): New macro.
3701 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3702 (Fbuffer_local_variables): Use it.
3703 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3704 * alloc.c (allocate_buffer): Adjust to match new layout of
3705 struct buffer. Fix comment.
3706 (mark_overlay): New function.
3707 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3708 Lisp area of struct buffer.
3709 (mark_object): Use it. Adjust marking of misc objects
3710 and related comments.
3711
3712 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3713
3714 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3715 wrapper that is not needed because the wrapped code is a no-op (zero
3716 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3717 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3718
3719 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3720
3721 * alloc.c (mark_buffer): Simplify. Remove prototype.
3722 (mark_object): Add comment. Reorganize marking of vector-like
3723 objects. Use CHECK_LIVE for all vector-like objects except buffers
3724 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3725 Avoid redundant calls to mark_vectorlike for bool vectors.
3726
3727 2012-06-30 Glenn Morris <rgm@gnu.org>
3728
3729 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3730
3731 * epaths.in (PATH_SITELOADSEARCH): New.
3732 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3733 This is rather than relying on --enable-locallisppath elements
3734 having "site-lisp" in their names. (Bug#10208#25, 11658)
3735
3736 2012-06-30 Eli Zaretskii <eliz@gnu.org>
3737
3738 * w32proc.c (sys_select): Accept and ignore one more argument.
3739
3740 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3741
3742 * sysselect.h [DOS_NT]: Don't include sys/select.h.
3743 (pselect) [!MS_DOS]: Redirect to sys_select.
3744
3745 * sysdep.c: Don't include dos.h and dosfns.h.
3746
3747 * process.c (sys_select):
3748 * msdos.c (sys_select): Accept one more argument and ignore it.
3749
3750 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3751 adapt data types and code to that.
3752
3753 * dosfns.c:
3754 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3755 which clashes with the gnulib function of the same name.
3756
3757 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3758
3759 * font.c (font_style_to_value, font_style_symbolic)
3760 (font_prop_validate_style): Add type checks for values in
3761 font_style_table.
3762
3763 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3764 argument.
3765 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3766 uses.
3767
3768 2012-06-29 Eli Zaretskii <eliz@gnu.org>
3769
3770 * xdisp.c (try_window_id): Undo last change.
3771
3772 * w32.c (getwd): Adjust commentary about startup_dir.
3773 (init_environment): Always call sys_access, even in non-MSVC
3774 builds. Don't chdir to the directory of the Emacs executable.
3775 This undoes code from 1997 which was justified by the need to
3776 "avoid conflicts when removing and renaming directories". But its
3777 downside was that every relative file name was being interpreted
3778 relative to the directory of the Emacs executable, which can never
3779 be TRT. In particular, it broke sys_access when called with
3780 relative file names.
3781 (sys_access): Map GetLastError to errno.
3782
3783 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3784
3785 * window.h (struct window): Change type of 'fringes_outside_margins'
3786 to bitfield. Fix comment. Adjust users accordingly.
3787 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
3788 Adjust comment.
3789 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3790 to ptrdiff_t.
3791
3792 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
3793
3794 * gnutls.c (emacs_gnutls_handshake):
3795 Add QUIT to make the loop interruptible.
3796
3797 2012-06-29 Glenn Morris <rgm@gnu.org>
3798
3799 * charset.c (init_charset): Make lack of etc/charsets fatal.
3800
3801 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3802
3803 * editfns.c (region_limit): Fix type mismatch.
3804
3805 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3806
3807 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3808 undefined. Convert from xassert to eassert.
3809 * nsmenu.m: Convert from xassert to eassert.
3810 * nsterm.m: Likewise.
3811
3812 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3813
3814 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3815
3816 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3817
3818 Avoid integer overflow on scroll-left and scroll-right.
3819 * window.c (HSCROLL_MAX): New macro.
3820 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3821 overflow when requested scroll falls outside ptrdiff_t range.
3822
3823 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3824
3825 * window.h (struct window): Change type of 'hscroll',
3826 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3827 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3828 Adjust users accordingly.
3829 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3830 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3831 from EMACS_INT to ptrdiff_t.
3832 (make_window): Omit redundant initialization.
3833
3834 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
3835
3836 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3837
3838 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3839
3840 * window.h (struct window): Change type of 'use_time' and
3841 'sequence_number' from Lisp_Object to int.
3842 * frame.c (make_frame): Adjust users accordingly.
3843 * print.c (print_object): Likewise.
3844 * window.c (select_window, Fwindow_use_time, make_parent_window)
3845 (make_window): Likewise.
3846
3847 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3850 enabled with --enable-checking=[all,glyphs] configure option.
3851 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3852 adjust comments accordingly.
3853 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3854 undefined, adjust comments accordingly.
3855 * image.c: Likewise.
3856 * scroll.c: Likewise.
3857 * w32fns.c: Likewise.
3858 * w32term.c: Likewise.
3859 * xdisp.c: Likewise.
3860 * xfaces.c: Likewise.
3861 * xfns.c: Likewise.
3862 * xterm.c: Likewise.
3863
3864 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3865
3866 Generalize run-time debugging checks.
3867 * dispextern.h (XASSERTS): Remove.
3868 * fontset.c (xassert): Remove.
3869 Convert from xassert to eassert.
3870 * alloc.c: Convert from xassert to eassert.
3871 * bidi.c: Likewise.
3872 * dispnew.c: Likewise.
3873 * fns.c: Likewise.
3874 * fringe.c: Likewise.
3875 * ftfont.c: Likewise.
3876 * gtkutil.c: Likewise.
3877 * image.c: Likewise.
3878 * keyboard.c: Likewise.
3879 * menu.c: Likewise.
3880 * process.c: Likewise.
3881 * scroll.c: Likewise.
3882 * sound.c: Likewise.
3883 * term.c: Likewise.
3884 * w32console.c: Likewise.
3885 * w32fns.c: Likewise.
3886 * w32term.c: Likewise.
3887 * window.c: Likewise.
3888 * xdisp.c: Likewise.
3889 * xfaces.c: Likewise.
3890 * xfns.c: Likewise.
3891 * xselect.c: Likewise.
3892 * xterm.c: Likewise.
3893
3894 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3895
3896 * fns.c (maybe_resize_hash_table): Output message when growing the
3897 purify-hashtable.
3898
3899 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3900
3901 * alloc.c (allocate_string_data): Remove dead code.
3902 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3903 avoid GCC warning about unused macro.
3904
3905 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3906
3907 * alloc.c (allocate_string): Omit intervals initialization.
3908 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3909 as in make_pure_string and make_pure_c_string.
3910
3911 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3912
3913 * alloc.c (allocate_string): Fix last change.
3914
3915 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3916
3917 * alloc.c (allocate_string): Remove two redundant calls
3918 to memset, add explicit initialization where appropriate.
3919
3920 2012-06-27 Glenn Morris <rgm@gnu.org>
3921
3922 * lisp.mk (lisp): Remove paths.elc.
3923
3924 2012-06-27 Chong Yidong <cyd@gnu.org>
3925
3926 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3927
3928 2012-06-26 John Wiegley <johnw@newartisans.com>
3929
3930 * unexmacosx.c (copy_data_segment): Add two section names used
3931 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3932
3933 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3934 when building with Clang.
3935
3936 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3937
3938 * eval.c (Fapply): Allow calling it with a single argument.
3939
3940 2012-06-26 Eli Zaretskii <eliz@gnu.org>
3941
3942 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3943 _stricmp and _strnicmp.
3944 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3945
3946 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3947
3948 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3949 allocated window.
3950 (allocate_process): Likewise for new process.
3951 (allocate_terminal): Change to use offsetof.
3952 (allocate_frame): Likewise.
3953 * frame.c (make_frame): Omit redundant initialization.
3954 * window.c (make_parent_window): Use memset.
3955 (make_window): Omit redundant initialization.
3956 * process.c (make_process): Omit redundant initialization.
3957 * terminal.c (create_terminal): Likewise.
3958
3959 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3960
3961 * term.c (delete_tty): Remove redundant call to memset.
3962
3963 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3964
3965 * alloc.c: Remove build_string.
3966 * lisp.h: Define build_string as static inline. This provides
3967 a better opportunity to optimize away calls to strlen when the
3968 function is called with compile-time constant argument.
3969 * image.c (imagemagick_error): Convert to build_string.
3970 * w32proc.c (sys_spawnve): Likewise.
3971 * xterm.c (x_term_init): Likewise.
3972
3973 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3974
3975 Use sprintf return value instead of invoking strlen on result.
3976 In the old days this wasn't portable, since some sprintf
3977 implementations returned char *. But they died out years ago and
3978 Emacs already assumes sprintf returns int.
3979 Similarly for float_to_string.
3980 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3981 * ccl.c (ccl_driver):
3982 * character.c (string_escape_byte8):
3983 * data.c (Fnumber_to_string):
3984 * doprnt.c (doprnt):
3985 * print.c (print_object):
3986 * xdisp.c (message_dolog):
3987 * xfns.c (syms_of_xfns):
3988 Use sprintf or float_to_string result to avoid need to call strlen.
3989 * data.c (Fnumber_to_string):
3990 Use make_unibyte_string, since the string must be ASCII.
3991 * lisp.h, print.c (float_to_string): Now returns int length.
3992 * term.c (produce_glyphless_glyph):
3993 Use sprintf result rather than recomputing it.
3994
3995 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3996 * Makefile.in (ALL_CFLAGS):
3997 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3998 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3999
4000 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4001
4002 * dispextern.h (xstrcasecmp): Define to library function
4003 strcasecmp if available.
4004 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4005
4006 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4007
4008 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4009 Avoid comma operator.
4010 * menu.c (push_submenu_start, push_submenu_end)
4011 (push_left_right_boundary, push_menu_pane): Likewise.
4012 * msdos.c (dos_rawgetc): Likewise.
4013
4014 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4015
4016 * xfns.c (xic_create_fontsetname): Remove redundant calls
4017 to memset.
4018
4019 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4020
4021 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4022 sprintf already null-terminates its output.
4023
4024 * xfns.c (x_window): Remove redundant cast.
4025
4026 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4027
4028 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4029 `const char *' to `char *' to avoid compiler warning.
4030
4031 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4032
4033 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4034 instead of truncating it to 63 (admittedly a generous limit).
4035
4036 * process.c: Fix spelling and caps in comments.
4037
4038 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4039
4040 * emacs.c (setpgrp): Remove definition, unused.
4041 * sysdep.c (setpgrp): Remove definition, not used in this file.
4042
4043 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4044
4045 * makefile.w32-in: Update dependencies.
4046
4047 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4048
4049 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4050 (SYSTIME_H): Add nt/inc/sys/time.h.
4051
4052 * systime.h [WINDOWSNT]: Include sys/time.h.
4053
4054 * s/ms-w32.h (struct timespec): Definition moved from
4055 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4056
4057 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4058
4059 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4060 * buffer.h (buffer_slot_type_mismatch):
4061 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4062 * eval.c (unwind_to_catch):
4063 * image.c (my_png_error, my_error_exit):
4064 * keyboard.c (quit_throw_to_read_char, user_error)
4065 (Fexit_recursive_edit, Fabort_recursive_edit):
4066 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4067 (wrong_type_argument, buffer_overflow, __executable_start)
4068 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4069 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4070 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4071 (fatal):
4072 (child_setup) [!DOS_NT]:
4073 * lread.c (end_of_file_error, invalid_syntax):
4074 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4075 * puresize.h (pure_write_error):
4076 * search.c (matcher_overflow):
4077 * sound.c (sound_perror, alsa_sound_perror):
4078 * sysdep.c, syssignal.h (croak):
4079 * term.c (maybe_fatal, vfatal):
4080 * textprop.c (text_read_only):
4081 * undo.c (user_error):
4082 * unexmacosx.c (unexec_error):
4083 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4084 Use _Noreturn rather than NO_RETURN.
4085 No need for separate decl merely because of _Noreturn.
4086 * sound.c (sound_warning, parse_sound):
4087 Remove unnecessary forward decls.
4088
4089 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4090
4091 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4092 * lisp.h (WAIT_READING_MAX): New macro.
4093 * dispnew.c (Fsleep_for, sit_for):
4094 * keyboard.c (kbd_buffer_get_event):
4095 * process.c (Faccept_process_output):
4096 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4097 This improves on the previous patch, which introduced a bug
4098 when time_t is unsigned and as wide as intmax_t.
4099 See <http://bugs.gnu.org/9000#51>.
4100
4101 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4102
4103 * dispnew.c (sit_for, Fsleep_for):
4104 * keyboard.c (kbd_buffer_get_event):
4105 * process.c (Faccept_process_output): Avoid compiler warnings when
4106 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4107
4108 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4109
4110 * makefile.w32-in: Update dependencies.
4111
4112 * w32.c (ltime): Add return type and declare static.
4113 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4114
4115 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4116
4117 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4118 Privately reported by Herbert J. Skuhra.
4119 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4120 All uses changed.
4121 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4122 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4123
4124 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4125
4126 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4127 last argument of make_unibyte_string.
4128
4129 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4130 language ID in the event parameters.
4131
4132 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4133 event.code, not the obscure "character set ID".
4134
4135 2012-06-23 Chong Yidong <cyd@gnu.org>
4136
4137 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4138
4139 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4140
4141 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4142 * w32.c (fdutimens): New function.
4143
4144 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4145
4146 * s/ms-w32.h (pselect): Redirect to sys_select.
4147
4148 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4149
4150 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4151 in the logic of incrementing and decrementing the value of
4152 use_relocatable_buffers.
4153
4154 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4155
4156 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4157 Privately reported by Herbert J. Skuhra.
4158 [__FreeBSD__]: Remove "*/" typo after "#include".
4159 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4160 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4161 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4162 Don't assume EMACS_TIME and struct timeval are the same type.
4163
4164 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4165
4166 Support higher-resolution time stamps (Bug#9000).
4167 The time stamps are only nanosecond-resolution at the C level,
4168 since that's the best that any real-world system supports now.
4169 But they are picosecond-resolution at the Lisp level, as that's
4170 easy, and leaves room for future OS improvements.
4171
4172 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4173 (LIBES): Use it.
4174
4175 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4176 Don't get current time unless it's needed.
4177
4178 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4179 now provides it if it's absent.
4180 (start_atimer): Port to higher-res time stamps.
4181 Check for time stamp overflow. Don't get current time more
4182 often than is needed.
4183
4184 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4185 Include systime.h, not time.h.
4186 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4187
4188 * dired.c: Include stat-time.h.
4189 (Ffile-attributes): File times now have higher resolution.
4190
4191 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4192 (struct image): Timestamp now has higher resolution.
4193
4194 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4195 has at least microseconds now. All uses removed.
4196 (update_frame, update_single_window, update_window, update_frame_1)
4197 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4198 (duration_to_sec_usec): Remove; no longer needed.
4199
4200 * editfns.c (time_overflow): Now extern.
4201 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4202 (float-time, Fformat_time_string, Fcurrent_time_string)
4203 (Fcurrent_time_zone): Accept and generate higher-resolution
4204 time stamps.
4205 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4206 (decode_time_components, lisp_seconds_argument): New functions.
4207 (make_time): Now static.
4208 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4209 Report an error if the time is invalid, rather than having the caller
4210 do that.
4211
4212 * fileio.c: Include <stat-time.h>
4213 (Fcopy_file): Copy higher-resolution time stamps.
4214 Prefer to set the time stamp via a file descriptor if that works.
4215 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4216 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4217 (Fvisited_file_modtime, Fset_visited_file_modtime):
4218 Support higher-resolution time stamps.
4219
4220 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4221
4222 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4223
4224 * image.c (prepare_image_for_display, clear_image_cache)
4225 (lookup_image): Port to higer-resolution time stamps.
4226
4227 * keyboard.c (start_polling, bind_polling_period):
4228 Check for time stamp overflow.
4229 (read_char, kbd_buffer_get_event, timer_start_idle)
4230 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4231 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4232 Port to higher-resolution time stamps. Do not assume time_t is signed.
4233 (decode_timer): New function. Timers are now vectors of length 9,
4234 not 8, to accommodate the picosecond component.
4235 (timer_check_2): Use it.
4236
4237 * nsterm.m (select_timeout, timeval_subtract): Remove.
4238 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4239 as they're a bit more accurate and handle overflow better.
4240 (ns_select): Change prototype to be compatible with pselect.
4241 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4242 * nsterm.h (ns_select): Adjust prototype.
4243
4244 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4245 us-resolution time stamps.
4246 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4247
4248 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4249
4250 * lisp.h (time_overflow): New decl.
4251 (wait_reading_process_output): First arg is now intmax_t, not int,
4252 to accommodate larger waits.
4253
4254 * process.h (struct Lisp_Process.read_output_delay):
4255 Now counts nanoseconds, not microseconds.
4256 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4257 EMACS_HAS_USECS.
4258 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4259 (wait_reading_process_output):
4260 Port to ns-resolution time stamps.
4261 (Faccept_process_output, wait_reading_process_output):
4262 Check for time stamp overflow. Do not assume time_t is signed.
4263 (select_wrapper): Remove; we now use pselect.
4264 (Fprocess_attributes): Now generates ns-resolution time stamps.
4265
4266 * sysdep.c: Include utimens.h. Don't include utime.h
4267 or worry about struct utimbuf; gnulib does that for us now.
4268 (gettimeofday): Remove; gnulib provides a substitute.
4269 (make_timeval): New function.
4270 (set_file_times): Now sets ns-resolution time stamps.
4271 New arg FD; all uses changed.
4272 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4273 (system_process_attributes):
4274 Now returns ns-resolution time stamp. All uses changed.
4275 Check for time stamp overflow.
4276
4277 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4278 provides a substitute now.
4279
4280 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4281 since it guarantees struct timespec.
4282 (EMACS_TIME): Now struct timespec, so that we can support
4283 ns-resolution time stamps.
4284 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4285 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4286 (EMACS_USECS): Remove.
4287 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4288 so multiply the arg by 1000 before storing it.
4289 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4290 New macros.
4291 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4292 Port to ns-resolution time stamps.
4293 (EMACS_TIME_NEG_P): Remove; replaced by....
4294 (EMACS_TIME_SIGN): New macro.
4295 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4296 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4297 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4298 (make_timeval, make_lisp_time, decode_time_components): New decls.
4299 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4300 that it mishandled time_t overflow. You can't compare by subtracting!
4301 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4302 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4303
4304 * term.c: Include <sys/time.h>.
4305 (timeval_to_Time): New function, for proper overflow wraparound.
4306 (term_mouse_position, term_mouse_click): Use it.
4307
4308 * undo.c (record_first_change): Support higher-resolution time stamps
4309 in the undo buffer.
4310 (Fprimitive_undo): Use them when restoring time stamps.
4311
4312 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4313 (w32_get_internal_run_time):
4314 Port to higher-resolution Emacs time stamps.
4315 (ltime): Now accepts single 64-bit integer, as that's more convenient
4316 for callers.
4317
4318 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4319
4320 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4321 for compatibility with pselect. Support ns-resolution time stamps.
4322
4323 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4324
4325 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4326 Check for time stamp overflow, and support ns-resolution time stamps.
4327
4328 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4329 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4330 (timeval_subtract): Remove; no longer needed.
4331 (XTflash, XTring_bell, x_wait_for_event):
4332 Port to ns-resolution time stamps. Don't assume time_t is signed.
4333
4334 2012-06-22 Chong Yidong <cyd@gnu.org>
4335
4336 * xdisp.c (x_consider_frame_title): Revert last change.
4337
4338 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4339
4340 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4341 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4342 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4343 staticidx goes up to 1597 out of 1600 = 0x640.)
4344
4345 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4346
4347 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4348 Otherwise, the umask might be mistakenly 0 while handling input signals.
4349
4350 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4351
4352 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4353
4354 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4355
4356 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4357 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4358 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4359 access to `contents' member of Lisp_Vector objects with AREF and ASET
4360 where appropriate.
4361
4362 2012-06-19 Chong Yidong <cyd@gnu.org>
4363
4364 * frame.c (delete_frame): When selecting a frame on a different
4365 text terminal, do not alter the terminal's top-frame.
4366
4367 * xdisp.c (format_mode_line_unwind_data): Record the target
4368 frame's selected window and its terminal's top-frame.
4369 (unwind_format_mode_line): Restore them.
4370 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4371 Callers changed.
4372 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4373 since tty frames can be explicitly named.
4374 (prepare_menu_bars): Likewise.
4375
4376 * term.c (Ftty_top_frame): New function.
4377
4378 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4379
4380 Port byte-code-meter to modern targets.
4381 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4382 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4383 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4384 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4385 (METER_1, METER_2): Simplify.
4386
4387 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4388
4389 * data.c (Fdefalias): Return `symbol' (bug#11686).
4390
4391 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4392
4393 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4394 gets killed during executing of this function (Bug#11665).
4395 Try to always return Qt when the buffer has been actually killed.
4396 (Vkill_buffer_query_functions): In doc-string say that functions
4397 run by this hook should not change the current buffer.
4398
4399 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4400
4401 Fix recently-introduced process.c problems found by static checking.
4402 * process.c (write_queue_push, write_queue_pop, send_process):
4403 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4404 (write_queue_pop): Fix pointer signedness problem.
4405 (send_process): Remove unused local.
4406
4407 2012-06-17 Chong Yidong <cyd@gnu.org>
4408
4409 * xdisp.c (redisplay_internal): No need to redisplay terminal
4410 frames that are not on top.
4411
4412 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4413
4414 * process.c (make_process): Initialize write_queue.
4415 (write_queue_push, write_queue_pop): New functions.
4416 (send_process): Use them to maintain correct ordering of process
4417 writes (Bug#10815).
4418
4419 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4420
4421 * lisp.h (eassert): Assume C89 or later.
4422 This removes the need for CHECK.
4423 (CHECK): Remove. Its comments about always evaluating its
4424 argument were confusing, as 'eassert' typically does not evaluate
4425 its argument.
4426
4427 * coding.c (produce_chars): Use ptrdiff_t, not int.
4428
4429 * xterm.c (x_draw_underwave): Check for integer overflow.
4430 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4431
4432 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
4433
4434 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4435 referenced (Bug#11583).
4436
4437 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4438
4439 Implement wave-style variant of underlining.
4440 * dispextern.h (face_underline_type): New enum.
4441 (face): Add field for underline type.
4442 * nsterm.m (ns_draw_underwave): New function.
4443 (ns_draw_text_decoration): Use it.
4444 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4445 New functions.
4446 (x_draw_glyph_string): Use them.
4447 * xfaces.c (Qline, Qwave): New Lisp objects.
4448 (check_lface_attrs, merge_face_ref)
4449 (Finternal_set_lisp_face_attribute, realize_x_face):
4450 Handle wave-style underline face attributes.
4451 * xterm.c (x_draw_underwave): New function.
4452 (x_draw_glyph_string): Use it.
4453
4454 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
4455
4456 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4457 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4458 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4459 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4460 ($(BLD)/w32select.$(O)): Update dependencies.
4461
4462 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4463
4464 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4465 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4466 * character.c (_fetch_multibyte_char_p): Remove.
4467 * alloc.c: Include "character.h" before "buffer.h".
4468 * bidi.c: Likewise.
4469 * buffer.c: Likewise.
4470 * bytecode.c: Likewise.
4471 * callint.c: Likewise.
4472 * callproc.c: Likewise.
4473 * casefiddle.c: Likewise.
4474 * casetab.c: Likewise.
4475 * category.c: Likewise.
4476 * cmds.c: Likewise.
4477 * coding.c: Likewise.
4478 * composite.c: Likewise.
4479 * dired.c: Likewise.
4480 * dispnew.c: Likewise.
4481 * doc.c: Likewise.
4482 * dosfns.c: Likewise.
4483 * editfns.c: Likewise.
4484 * emacs.c: Likewise.
4485 * fileio.c: Likewise.
4486 * filelock.c: Likewise.
4487 * font.c: Likewise.
4488 * fontset.c: Likewise.
4489 * fringe.c: Likewise.
4490 * indent.c: Likewise.
4491 * insdel.c: Likewise.
4492 * intervals.c: Likewise.
4493 * keyboard.c: Likewise.
4494 * keymap.c: Likewise.
4495 * lread.c: Likewise.
4496 * macros.c: Likewise.
4497 * marker.c: Likewise.
4498 * minibuf.c: Likewise.
4499 * nsfns.m: Likewise.
4500 * nsmenu.m: Likewise.
4501 * print.c: Likewise.
4502 * process.c: Likewise.
4503 * regex.c: Likewise.
4504 * region-cache.c: Likewise.
4505 * search.c: Likewise.
4506 * syntax.c: Likewise.
4507 * term.c: Likewise.
4508 * textprop.c: Likewise.
4509 * undo.c: Likewise.
4510 * unexsol.c: Likewise.
4511 * w16select.c: Likewise.
4512 * w32fns.c: Likewise.
4513 * w32menu.c: Likewise.
4514 * window.c: Likewise.
4515 * xdisp.c: Likewise.
4516 * xfns.c: Likewise.
4517 * xmenu.c: Likewise.
4518 * xml.c: Likewise.
4519 * xselect.c: Likewise.
4520
4521 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4522
4523 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4524 If all the glyphs of the glyph row came from strings, and we have no
4525 cursor positioning clues, put the cursor on the first glyph of the
4526 row.
4527 (handle_face_prop): Use chunk-relative overlay string index when
4528 indexing into it->string_overlays array. (Bug#11653)
4529 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4530 the rightmost. (Bug#11720)
4531
4532 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4533
4534 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4535 (CATEGORY_MEMBER): Enforce 1/0 value.
4536 * category.c (_temp_category_set): Remove.
4537
4538 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4539
4540 * window.c (Fdelete_other_windows_internal)
4541 (Fdelete_window_internal): Don't access frame's mouse highlight
4542 info of the initial frame. (Bug#11677)
4543
4544 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4545
4546 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4547 Assume USE_2_TAGS_FOR_INTS.
4548 (xreload): Adjust $tagmask width to match recent lisp.h change.
4549
4550 Simplify lisp.h in minor ways that should not affect code.
4551 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4552 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4553 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4554 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4555 (INTTYPEBITS): New macro, for clarity.
4556 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
4557 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4558 Simplify now that USE_LSB_TAG is always defined.
4559 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4560 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4561
4562 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
4563
4564 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4565
4566 2012-06-13 Glenn Morris <rgm@gnu.org>
4567
4568 * s/bsd-common.h (BSD4_3):
4569 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4570
4571 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4572
4573 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4574 instead of union.
4575 (XLI, XIL): Define.
4576 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4577 Use them.
4578 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
4579 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
4580 * alloc.c (widen_to_Lisp_Object): Remove.
4581 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4582 * frame.c (delete_frame): Remove outdated comment.
4583 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4584 USE_LISP_UNION_TYPE.
4585 (Fw32_unregister_hot_key): Likewise.
4586 (Fw32_toggle_lock_key): Likewise.
4587 * w32menu.c (add_menu_item): Likewise.
4588 (w32_menu_display_help): Use XIL instead of checking
4589 USE_LISP_UNION_TYPE.
4590 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4591 (init_heap): Likewise.
4592 * w32term.c (w32_read_socket): Update comment.
4593
4594 2012-06-13 Glenn Morris <rgm@gnu.org>
4595
4596 * s/usg5-4-common.h, src/s/unixware.h:
4597 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4598
4599 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4600
4601 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4604 * alloc.c (make_number) [!defined make_number]:
4605 Remove, as lisp.h always defines this now.
4606 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4607 (roundup_size): Verify that it is a power of 2.
4608 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4609 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4610 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4611 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4612 USE_LSB_TAG now is always defined to be either 0 or 1.
4613 All uses changed.
4614 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4615 code works fine either way, and efficiency is not a concern here,
4616 as the union type is for debugging, not for production.
4617 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4618 Use an inline function on all platforms when using the union type,
4619 since this is simpler and 'static inline' can be used portably
4620 within Emacs now.
4621 (LISP_INITIALLY_ZERO): New macro.
4622 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4623 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4624
4625 2012-06-12 Glenn Morris <rgm@gnu.org>
4626
4627 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4628
4629 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
4630
4631 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4632 Move BROKEN_SIGIO to configure.
4633
4634 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4635 Move NO_TERMIO to configure.
4636
4637 2012-06-12 Chong Yidong <cyd@gnu.org>
4638
4639 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4640 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4641 MagickExportImagePixels is undefined.
4642
4643 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4644
4645 * image.c (imagemagick_load_image): Remove unused label.
4646
4647 2012-06-11 Glenn Morris <rgm@gnu.org>
4648
4649 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4650 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4651 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4652 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4653
4654 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4655
4656 * alloc.c (make_byte_code): New function.
4657 (Fmake_byte_code): Use it. Don't purify here.
4658 * lread.c (read1): Use it as well to avoid extra allocation.
4659
4660 2012-06-11 Chong Yidong <cyd@gnu.org>
4661
4662 * image.c (imagemagick_load_image): Implement transparency.
4663
4664 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4665
4666 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4667 account for preceding backslashes. (Bug#11663)
4668
4669 2012-06-09 Chong Yidong <cyd@gnu.org>
4670
4671 * term.c: Support italics in capable terminals (Bug#9652).
4672 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4673 (turn_on_face): Output using TS_enter_italic_mode if available.
4674 Don't handle unused blinking and alt-charset cases.
4675 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4676 and tty_alt_charset_p cases.
4677 (tty_capable_p, init_tty): Support italics.
4678
4679 * termchar.h (struct tty_display_info): Add field for italics.
4680 Remove unused blink field.
4681
4682 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4683 Handle slant.
4684
4685 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4686 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4687 tty_alt_charset_p. Add tty_italic_p.
4688
4689 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
4690
4691 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4692 dbus_type_is_basic if available.
4693 (xd_extract_signed, xd_extract_unsigned): Rename from
4694 extract_signed and extract_unsigned, respectively. Adapt callers.
4695
4696 2012-06-09 Chong Yidong <cyd@gnu.org>
4697
4698 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4699
4700 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4701 case (Bug#9752).
4702
4703 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4704
4705 * xdisp.c (vmessage): Treat frame message as multibyte.
4706 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4707 would generate the diagnostic "Making \302\247 buffer-local while
4708 let-bound!".
4709
4710 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4711
4712 * dispnew.c (showing_window_margins_p): Undo last change, which
4713 was done due to an inadvertent commit.
4714 (adjust_frame_glyphs_for_frame_redisplay): Do call
4715 showing_window_margins_p.
4716
4717 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4718
4719 * eval.c (Fmake_var_non_special): New primitive.
4720 (syms_of_eval): Defsubr it.
4721 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4722
4723 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
4724
4725 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4726 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4727
4728 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4729
4730 * alloc.c (allocate_vectorlike): Fix last change.
4731
4732 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4733
4734 Block-based vector allocation of small vectors.
4735 * lisp.h (struct vectorlike_header): New field `nbytes',
4736 adjust comment accordingly.
4737 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4738 to denote vector blocks. Adjust users (live_vector_p,
4739 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4740 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4741 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4742 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4743 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4744 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4745 (roundup_size): New constant.
4746 (struct vector_block): New data type.
4747 (vector_blocks, vector_free_lists, zero_vector): New variables.
4748 (all_vectors): Rename to `large_vectors'.
4749 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4750 (sweep_vectors): New functions.
4751 (allocate_vectorlike): Return `zero_vector' as the only vector of
4752 0 items. Allocate new vector from block if vector size is less than
4753 or equal to VBLOCK_BYTES_MAX.
4754 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4755 (init_alloc_once): Add call to init_vectors.
4756
4757 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4758
4759 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4760
4761 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4762
4763 * doprnt.c (doprnt): Truncate multibyte char correctly.
4764 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4765 would mishandle a string argument "Xc" if X was a multibyte
4766 character of length 2: it would truncate after X's first byte
4767 rather than including all of X.
4768
4769 2012-06-06 Chong Yidong <cyd@gnu.org>
4770
4771 * buffer.c (word_wrap): Doc fix.
4772
4773 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4774
4775 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4776
4777 2012-06-03 Glenn Morris <rgm@gnu.org>
4778
4779 * xdisp.c (tool-bar-style): Doc fix.
4780
4781 2012-06-03 Ulrich Müller <ulm@gentoo.org>
4782
4783 * Makefile.in (PAXCTL): Define.
4784 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4785 binary via PaX flags if the paxctl utility is available.
4786 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4787 Restore PaX flags to their default. (Bug#11398)
4788
4789 2012-06-03 Chong Yidong <cyd@gnu.org>
4790
4791 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4792 buffer (Bug#11226).
4793
4794 2012-06-03 Chong Yidong <cyd@gnu.org>
4795
4796 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4797 (note_mode_line_or_margin_highlight): If there is no help echo,
4798 use mode-line-default-help-echo. Handle the case where the mouse
4799 position is past the end of the mode line string.
4800
4801 * buffer.c (buffer_local_value_1): New function, split from
4802 Fbuffer_local_value; can return Qunbound.
4803 (Fbuffer_local_value): Use it.
4804 (Vmode_line_format): Docstring tweaks.
4805
4806 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4807
4808 * sysdep.c (system_process_attributes): Improve comment.
4809
4810 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4811
4812 * keyboard.c: Export real-this-command to Elisp.
4813 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4814 and DEFVAR it. Update all users.
4815
4816 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4817
4818 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4819
4820 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4821 Convert pctcpu and pctmem to Lisp float properly.
4822 Let the compiler fold better, as 100.0/0x8000 is exact.
4823
4824 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4825
4826 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4827 cons_block.
4828
4829 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4830
4831 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4832
4833 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4834
4835 For a 'struct window', replace some Lisp_Object fields to
4836 bitfields where appropriate, remove unused fields.
4837 * window.h (struct window): Remove unused 'last_mark_x' and
4838 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4839 change it's type from Lisp_Object to bitfield.
4840 Change type of 'force_start', 'optional_new_start',
4841 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4842 fields from Lisp_Object to bitfield. Adjust users accordingly.
4843
4844 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4845
4846 Pacify gcc -Wdouble-precision when using Xaw.
4847 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4848 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4849 Use 'float' consistently, rather than 'float' in most places
4850 and 'double' in a couple of places.
4851
4852 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4853
4854 * xdisp.c (handle_stop): Detect whether we have overlay strings
4855 loaded by testing it->current.overlay_string_index to be
4856 non-negative, instead of checking whether n_overlay_strings is
4857 positive. (Bug#11587)
4858
4859 2012-05-31 Chong Yidong <cyd@gnu.org>
4860
4861 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4862
4863 * doc.c (Fsubstitute_command_keys): Doc fix.
4864
4865 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4866
4867 * search.c (search_buffer): Remove calls to
4868 r_alloc_inhibit_buffer_relocation, as it is now called by
4869 maybe_unify_char, which was the cause of relocation of buffer text
4870 in bug#11519.
4871
4872 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4873
4874 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4875 for the duration of call to load_charset, to avoid problems with
4876 callers of maybe_unify_char that access buffer text through C
4877 pointers.
4878
4879 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4880 decrement the inhibition flag, instead of just setting or
4881 resetting it.
4882
4883 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4884
4885 Remove obsolete '#define static' cruft.
4886 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4887 This #undef was "temporary" in 2000; it is no longer needed
4888 now that '#define static' has gone away.
4889 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4890 (gray_bitmap_bits): Remove; no longer needed.
4891 All uses replaced with definiens.
4892 * xterm.c: Include "bitmaps/gray.xbm".
4893
4894 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 Clean up __executable_start, monstartup when --enable-profiling.
4897 The following changes affect the code only when profiling.
4898 * dispnew.c (__executable_start): Rename from safe_bcopy.
4899 Define only on platforms that need it.
4900 * emacs.c: Include <sys/gmon.h> when profiling.
4901 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4902 (__executable_start): Remove decl, since lisp.h does it now.
4903 (safe_bcopy): Remove decl; no longer has that name.
4904 (main): Coalesce #if into single bit of code, for simplicity.
4905 Cast pointers to uintptr_t, since standard libraries want integers
4906 and not pointers.
4907 * lisp.h (__executable_start): New decl.
4908
4909 2012-05-31 Glenn Morris <rgm@gnu.org>
4910
4911 * image.c (Fimagemagick_types): Doc fix.
4912
4913 2012-05-30 Jim Meyering <meyering@redhat.com>
4914
4915 * callproc.c (Fcall_process_region): Include directory component
4916 in mkstemp error message (Bug#11586).
4917
4918 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4919
4920 * alloc.c, lisp.h (make_pure_vector): Now static.
4921
4922 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4923
4924 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4925 Move to byte-run.el.
4926 (Fautoload): Do the hash-doc more carefully.
4927 * data.c (Fdefalias): Purify definition, except for keymaps.
4928 (Qdefun): Move from eval.c.
4929 * lisp.h (Qdefun): Remove.
4930 * lread.c (read1): Tiny simplification.
4931
4932 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
4933
4934 Do not create empty overlays with the evaporate property (Bug#9642).
4935 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4936 Bug#9642, but explicitly check that the buffer the overlay would
4937 be moved to is live and rearrange lines to make sure that errors
4938 will not put the overlay in an inconsistent state.
4939 (Fdelete_overlay): Cosmetics.
4940
4941 2012-05-28 Eli Zaretskii <eliz@gnu.org>
4942
4943 * w32term.c (my_bring_window_to_top): New function.
4944 (x_raise_frame): Use handle returned by DeferWindowPos, which
4945 could be different from the original one.
4946 Call my_bring_window_to_top instead of my_set_foreground_window.
4947 (Bug#11513)
4948
4949 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4950 by calling BringWindowToTop.
4951
4952 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4953 (WM_EMACS_END): Increase by one.
4954
4955 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4956
4957 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4958 This avoids undefined behavior that might cause the eassert
4959 to not catch an out-of-range value.
4960
4961 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
4962
4963 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4964 Update dependencies.
4965
4966 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4967
4968 * bidi.c (bidi_mirror_char): Fix last change.
4969
4970 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4971
4972 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4973 when referring to sectname field in printf format.
4974
4975 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4976
4977 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4978 Only r_alloc_inhibit_buffer_relocation needed to be added;
4979 the others were already declared.
4980
4981 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4982 before checking whether it's out of range. Put the check inside
4983 eassert. See
4984 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4985
4986 2012-05-27 Ken Brown <kbrown@cornell.edu>
4987
4988 * callproc.c (Fcall_process): Restore a line that was accidentally
4989 commented out in the 2011-02-13 change (bug#11547).
4990
4991 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4992
4993 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4994 defined on ralloc.c.
4995
4996 * buffer.c [REL_ALLOC]: Remove prototypes of
4997 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4998 they are now on lisp.h.
4999
5000 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5001
5002 * search.c (search_buffer): Use it to inhibit relocation of buffer
5003 text while re_search_2 is doing its job, because re_search_2 is
5004 passed C pointers to buffer text. (Bug#11519)
5005
5006 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5007 Update value to 24.
5008
5009 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5010 state after an additional call to move_it_in_display_line_to, keep
5011 the values of it->max_ascent and it->max_descent found for the
5012 entire line.
5013 (pos_visible_p): Revert the comparison against bottom_y to what it
5014 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5015 (Bug#11464)
5016
5017 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5018
5019 Fix coding-related core dumps with gcc -ftrapv.
5020 The code was computing A - B, where A and B are pointers, and B is
5021 random garbage. This can lead to core dumps on platforms that
5022 have special pointer registers, and it also leads to core dumps on
5023 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5024 A - B only when B is initialized properly.
5025 * coding.c (coding_set_source, coding_set_destination): Return void.
5026 (coding_change_source, coding_change_destinations): New functions,
5027 with the old behaviors of coding_set_source and coding_set_destination.
5028 All callers that need an offset changed to use these new functions.
5029
5030 2012-05-26 Glenn Morris <rgm@gnu.org>
5031
5032 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5033
5034 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5035
5036 Extend mouse support on W32 text-mode console.
5037 * xdisp.c (draw_row_with_mouse_face):
5038 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5039
5040 * w32console.c: Include window.h.
5041 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5042 New functions.
5043 (initialize_w32_display): Initialize mouse-highlight data.
5044
5045 * w32inevt.c: Include termchar.h and window.h.
5046 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5047 moves, call note_mouse_highlight. If help_echo changed, call
5048 gen_help_event to produce help-echo message in the echo area.
5049 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5050 highlight info.
5051
5052 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5053
5054 * lread.c (read1): Simplify slightly to avoid an overflow warning
5055 with GCC 4.7.0 on x86-64.
5056
5057 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5058
5059 * bidi.c (bidi_mirror_char): Revert last change: an int is
5060 definitely wide enough here.
5061
5062 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5063
5064 Fix integer width and related bugs (Bug#9874).
5065 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5066 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5067 (string_bytes, check_sblock, allocate_string_data):
5068 (compact_small_strings, Fmake_bool_vector, make_string)
5069 (make_unibyte_string, make_multibyte_string)
5070 (make_string_from_bytes, make_specified_string)
5071 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5072 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5073 (mark_vectorlike):
5074 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5075 (allocate_pseudovector):
5076 Use int, not EMACS_INT, where int is wide enough.
5077 (inhibit_garbage_collection, Fgarbage_collect):
5078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5079 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5080 int might not be wide enough.
5081 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5082 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5083 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5084 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5085 (bidi_level_of_next_char, bidi_move_to_visually_next):
5086 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5087 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5088 (Fkill_buffer, Fset_buffer_major_mode)
5089 (advance_to_char_boundary, Fbuffer_swap_text)
5090 (Fset_buffer_multibyte, overlays_at, overlays_in)
5091 (overlay_touches_p, struct sortvec, record_overlay_string)
5092 (overlay_strings, recenter_overlay_lists)
5093 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5094 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5095 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5096 (Foverlay_recenter, last_overlay_modification_hooks_used)
5097 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5098 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5099 (validate_region): Omit unnecessary test for b <= e,
5100 since that's guaranteed by the previous test.
5101 (adjust_overlays_for_delete): Avoid pos + length overflow.
5102 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5103 (report_overlay_modification):
5104 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5105 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5106 Omit pointer cast, which isn't needed anyway, and doesn't work
5107 after the EMACS_INT -> ptrdiff_t change.
5108 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5109 * buffer.h: Adjust decls to match defn changes elsewhere.
5110 (struct buffer_text, struct buffer):
5111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5112 Use EMACS_INT, not int, where int might not be wide enough.
5113 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5114 not int, to avoid needless 32-bit limit on 64-bit hosts.
5115 (exec_byte_code): Use tighter memory-full test, one that checks
5116 for alloca overflow. Don't compute the address of the object just
5117 before an array, as that's not portable. Use EMACS_INT, not
5118 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5119 * callint.c (Fcall_interactively):
5120 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5121 * callproc.c (call_process_kill, Fcall_process):
5122 Don't assume pid_t fits into an Emacs fixnum.
5123 (call_process_cleanup, Fcall_process, child_setup):
5124 Don't assume pid_t fits into int.
5125 (call_process_cleanup, Fcall_process, delete_temp_file)
5126 (Fcall_process_region):
5127 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5128 (Fcall_process): Simplify handling of volatile integers.
5129 Use int, not EMACS_INT, where int will do.
5130 * casefiddle.c (casify_object, casify_region, operate_on_word)
5131 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5133 (casify_object): Avoid integer overflow when overallocating buffer.
5134 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5135 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
5136 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5137 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5138 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5139 integers are now checked earlier. All uses replaced with XINT.
5140 (ccl_driver):
5141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5142 For CCL_MapSingle, check that content and value are in int range.
5143 (ccl_driver, Fregister_code_conversion_map):
5144 Check that Vcode_version_map_vector is a vector.
5145 (resolve_symbol_ccl_program): Check that vector header is in range.
5146 Always copy the vector, so that we can check its contents reliably
5147 now rather than having to recheck each instruction as it's being
5148 executed. Check that vector words fit in 'int'.
5149 (ccl_get_compiled_code, Fregister_ccl_program)
5150 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5151 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5152 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5153 contents are in range.
5154 (Fccl_execute_on_string): Check that status is in range.
5155 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5156 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5157 Accept and return EMACS_INT, not int, because callers can pass values
5158 out of 'int' range.
5159 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5160 (multibyte_chars_in_text, parse_str_as_multibyte)
5161 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5162 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5163 (string_escape_byte8, Fget_byte):
5164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5165 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5166 avoid mishandling large integers.
5167 * character.h: Adjust decls to match defn changes elsewhere.
5168 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5169 (Ffind_charset_region):
5170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5171 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5172 (load_charset_map_from_vector, Fdefine_charset_internal):
5173 Don't assume fixnum fits in int.
5174 (load_charset_map_from_vector, Fmap_charset_chars):
5175 Remove now-unnecessary CHECK_NATNUMs.
5176 (Fdefine_charset_internal): Check ranges here, more carefully.
5177 Don't rely on undefined behavior with signed left shift overflow.
5178 Don't assume unsigned int fits into fixnum, or that fixnum fits
5179 into unsigned int. Don't require max_code to be a valid fixnum;
5180 that's not true for gb10830 4-byte on a 32-bit host. Allow
5181 invalid_code to be a cons, for the same reason. Require code_offset
5182 to be a character. Avoid int overflow if max_char is close
5183 to INT_MAX.
5184 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5185 this is intended anyway and avoids some undefined behavior.
5186 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5187 INDEX_TO_CODE_POINT, as that's what it expects.
5188 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5189 * charset.h (DECODE_CHAR): Return int, not unsigned;
5190 this is what was intended anyway, and it avoids undefined behavior.
5191 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5192 integer-overflow issues.
5193 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5194 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5195 where the argument is EMACS_INT, and this behavior is not intended.
5196 * chartab.c (Fmake_char_table, Fset_char_table_range)
5197 (uniprop_get_decoder, uniprop_get_encoder):
5198 Don't assume fixnum fits in int.
5199 * cmds.c (move_point): New function, that does the gist of
5200 Fforward_char and Fbackward_char, but does so while checking
5201 for integer overflow more accurately.
5202 (Fforward_char, Fbackward_char): Use it.
5203 (Fforward_line, Fend_of_line, internal_self_insert)
5204 (internal_self_insert):
5205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5206 Fix a FIXME, by checking for integer overflow when calculating
5207 target_clm and actual_clm.
5208 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5209 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5210 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5211 (coding_alloc_by_making_gap, alloc_destination)
5212 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5213 (encode_coding_utf_16, detect_coding_emacs_mule)
5214 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5215 (detect_coding_iso_2022, decode_coding_iso_2022)
5216 (encode_invocation_designation, encode_designation_at_bol)
5217 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5218 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5219 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5220 (encode_coding_ccl, encode_coding_raw_text)
5221 (detect_coding_charset, decode_coding_charset)
5222 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5223 (produce_composition, produce_charset, produce_annotation)
5224 (decode_coding, handle_composition_annotation)
5225 (handle_charset_annotation, consume_chars, decode_coding_gap)
5226 (decode_coding_object, encode_coding_object, detect_coding_system)
5227 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5228 (code_convert_region, code_convert_string)
5229 (Fdefine_coding_system_internal)
5230 (coding_set_source, coding_set_destination):
5231 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5232 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5233 (Fdefine_coding_system_internal):
5234 Don't assume fixnums fit in int.
5235 (decode_coding_gap, decode_coding_object, encode_coding_object)
5236 (Fread_coding_system, Fdetect_coding_region)
5237 (Funencodable_char_position, Fcheck_coding_systems_region)
5238 (get_translation, handle_composition_annotation, consume_chars):
5239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5240 (consume_chars): Rewrite to not calculate an address outside buffer.
5241 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5242 Don't access memory outside of the args array.
5243 (Fdefine_coding_system_internal): Check for charset-id overflow.
5244 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5245 result of ENCODE_CHAR.
5246 * coding.h: Adjust decls to match defn changes elsewhere.
5247 (struct coding_system):
5248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5249 * composite.c (get_composition_id, find_composition)
5250 (run_composition_function, update_compositions)
5251 (compose_text, composition_gstring_put_cache)
5252 (composition_gstring_p, composition_gstring_width)
5253 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5254 (composition_compute_stop_pos, composition_reseat_it)
5255 (composition_update_it, struct position_record)
5256 (find_automatic_composition, composition_adjust_point)
5257 (Fcomposition_get_gstring, Ffind_composition_internal):
5258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5259 (update_compositions):
5260 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5261 * composite.h: Adjust decls to match defn changes elsewhere.
5262 (struct composition):
5263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5264 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5265 Do not attempt to compute the address of the object just before a
5266 buffer; this is not portable.
5267 (Faref, Faset):
5268 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5269 (Faset): Use int, not EMACS_INT, where int is wide enough.
5270 (Fstring_to_number): Don't assume fixnums fit in int.
5271 (Frem): Don't assume arg is nonnegative.
5272 * dbusbind.c (xd_append_arg): Check for integers out of range.
5273 (Fdbus_call_method): Don't overflow the timeout int.
5274 (extract_signed, extract_unsigned): New functions.
5275 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5276 (xd_get_connection_references): Return ptrdiff_t, not int.
5277 All uses changed.
5278 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5279 (xd_read_message_1):
5280 Use int, not unsigned, where the dbus API uses int.
5281 (Fdbus_message_internal): Don't overflow mtype.
5282 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5283 * dired.c (directory_files_internal, file_name_completion, scmp)
5284 (file_name_completion_stat):
5285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5286 (file_name_completion): Don't overflow matchcount.
5287 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5288 * dispextern.h: Adjust decls to match defn changes elsewhere.
5289 (struct text_pos, struct glyph, struct bidi_saved_info)
5290 (struct bidi_string_data, struct bidi_it, struct composition_it)
5291 (struct it):
5292 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5293 (struct display_pos, struct composition_it, struct it):
5294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5295 * dispnew.c (increment_matrix_positions)
5296 (increment_row_positions, mode_line_string)
5297 (marginal_area_string):
5298 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5299 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5301 (duration_to_sec_usec): New function, to check for overflow better.
5302 (Fsleep_for, sit_for): Use it.
5303 * doc.c (get_doc_string, store_function_docstring):
5304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5305 (get_doc_string, Fsnarf_documentation):
5306 Use int, not EMACS_INT, where int is wide enough.
5307 (get_doc_string):
5308 Use SAFE_ALLOCA, not alloca.
5309 Check for overflow when converting EMACS_INT to off_t.
5310 * doprnt.c (doprnt):
5311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5312 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5313 Don't assume uid_t fits into fixnum.
5314 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5315 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5316 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5317 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5318 (general_insert_function)
5319 (Finsert_char, make_buffer_string, make_buffer_string_both)
5320 (update_buffer_properties, Fbuffer_substring)
5321 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5322 (Fsubst_char_in_region, check_translation)
5323 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5324 (transpose_markers, Ftranspose_regions):
5325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5326 (clip_to_bounds): Move to lisp.h as an inline function).
5327 (Fconstrain_to_field): Don't assume integers are nonnegative.
5328 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5329 (Fsubst_char_in_region, Fsave_restriction):
5330 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5331 (Femacs_pid): Don't assume pid_t fits into fixnum.
5332 (lo_time): Use int, not EMACS_INT, when int suffices.
5333 (lisp_time_argument): Check for usec out of range.
5334 (Fencode_time): Don't assume fixnum fits in int.
5335 (Fuser_login_name, Fuser_full_name): Signal an error
5336 if a uid argument is out of range, rather than relying on
5337 undefined behavior.
5338 (Fformat_time_string): Remove now-unnecessary check.
5339 lisp_time_argument checks for out-of-range usec now.
5340 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5341 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5342 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5343 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5344 (init_cmdargs, Fdump_emacs):
5345 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5346 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5347 the bottom (typically) 32 bits of the fixnum.
5348 * eval.c (specpdl_size, call_debugger):
5349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5350 (when_entered_debugger, Fbacktrace_debug):
5351 Don't assume fixnum can fit in int.
5352 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5353 the object just before a buffer; this is not portable.
5354 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5355 (grow_specpdl, unbind_to):
5356 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5357 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5358 (grow_specpdl): Simplify allocation by using xpalloc.
5359 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5360 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5361 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5363 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5364 (a_write, e_write):
5365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5366 (Fcopy_file, non_regular_nbytes, read_non_regular)
5367 (Finsert_file_contents):
5368 Use int, not EMACS_INT, where int is wide enough.
5369 (READ_BUF_SIZE): Verify that it fits in int.
5370 (Finsert_file_contents): Check that counts are in proper range,
5371 rather than assuming fixnums fit into ptrdiff_t etc.
5372 Don't assume fixnums fit into int.
5373 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5374 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5375 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5376 (string_char_to_byte, string_byte_to_char)
5377 (string_make_multibyte, string_to_multibyte)
5378 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5379 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5380 (substring_both, Fdelete, internal_equal, Ffillarray)
5381 (Fclear_string, mapcar1)
5382 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5383 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5384 (larger_vector, make_hash_table, maybe_resize_hash_table)
5385 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5386 (Fmaphash, secure_hash):
5387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5388 (concat): Check for string index and length overflow.
5389 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5390 (Frequire):
5391 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5392 (larger_vector): New API (vec, incr_min, size_max) replaces old
5393 one (vec, new_size, init). This catches size overflow.
5394 INIT was removed because it was always Qnil.
5395 All callers changed.
5396 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5397 the upper bound on a hash table index size.
5398 (make_hash_table, maybe_resize_hash_table): Use it.
5399 (secure_hash): Computer start_byte and end_byte only after
5400 they're known to be in ptrdiff_t range.
5401 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5402 (Ffont_get_glyphs, Ffont_at):
5403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5404 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5405 (Flist_fonts, Fopen_font):
5406 Don't assume fixnum can fit in int.
5407 (check_gstring): Don't assume index can fit in int.
5408 (font_match_p): Check that fixnum is a character, not a nonnegative
5409 fixnum, since the later code needs to stuff it into an int.
5410 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5411 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5412 conversion overflow issues.
5413 (Fopen_font): Check for integer out of range.
5414 (Ffont_get_glyphs): Don't assume index can fit in int.
5415 * font.h: Adjust decls to match defn changes elsewhere.
5416 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5417 integer overflow.
5418 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5419 printmax_t, where ptrdiff_t is wide enough.
5420 (Finternal_char_font):
5421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5422 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5423 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5424 (Fset_frame_position, x_set_frame_parameters)
5425 (x_set_line_spacing, x_set_border_width)
5426 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5427 Check that fixnums are in proper range for system types.
5428 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5430 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5431 Use SAFE_ALLOCA_LISP, not alloca.
5432 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5433 intptr_t is wide enough.
5434 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5435 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5436 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5437 Check for fixnum out of range.
5438 * ftfont.c (ftfont_list): Don't assume index fits in int.
5439 Check that fixnums are in proper range for system types.
5440 (ftfont_shape_by_flt):
5441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5442 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5444 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5445 Check that fixnums are in proper range for system types.
5446 * gnutls.h: Adjust decls to match defn changes elsewhere.
5447 * gtkutil.c (xg_dialog_run):
5448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5449 (update_frame_tool_bar):
5450 Check that fixnums are in proper range for system types.
5451 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5452 (lookup_image): Check that fixnums are in range for system types.
5453 * indent.c (last_known_column, last_known_column_point):
5454 (current_column_bol_cache):
5455 (skip_invisible, current_column, check_display_width):
5456 (check_display_width, scan_for_column, current_column_1)
5457 (Findent_to, Fcurrent_indentation, position_indentation)
5458 (indented_beyond_p, Fmove_to_column, compute_motion):
5459 (Fcompute_motion, Fvertical_motion):
5460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5461 (last_known_column_modified): Use EMACS_INT, not int.
5462 (check_display_width):
5463 (Fcompute_motion):
5464 Check that fixnums and floats are in proper range for system types.
5465 (compute_motion): Don't assume index or fixnum fits in int.
5466 (compute_motion, Fcompute_motion):
5467 Use int, not EMACS_INT, when it is wide enough.
5468 (vmotion): Omit local var start_hpos that is always 0; that way
5469 we don't need to worry about overflow in expressions involving it.
5470 * indent.h: Adjust decls to match defn changes elsewhere.
5471 (struct position):
5472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5473 Use int, not EMACS_INT, where int is wide enough.
5474 Remove unused members ovstring_chars_done and tab_offset;
5475 all uses removed.
5476 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5477 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5478 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5479 (make_gap, copy_text, insert, insert_and_inherit)
5480 (insert_before_markers, insert_before_markers_and_inherit)
5481 (insert_1, count_combining_before, count_combining_after)
5482 (insert_1_both, insert_from_string)
5483 (insert_from_string_before_markers, insert_from_string_1)
5484 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5485 (adjust_after_replace, adjust_after_insert, replace_range)
5486 (replace_range_2, del_range, del_range_1, del_range_byte)
5487 (del_range_both, del_range_2, modify_region)
5488 (prepare_to_modify_buffer, signal_before_change)
5489 (signal_after_change, Fcombine_after_change_execute):
5490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5491 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5492 (balance_an_interval, split_interval_right, split_interval_left)
5493 (find_interval, next_interval, update_interval)
5494 (adjust_intervals_for_insertion, delete_node, delete_interval)
5495 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5496 (static_offset_intervals, offset_intervals)
5497 (merge_interval_right, merge_interval_left, make_new_interval)
5498 (graft_intervals_into_buffer, temp_set_point_both)
5499 (temp_set_point, set_point, adjust_for_invis_intang)
5500 (set_point_both, move_if_not_intangible, get_property_and_range)
5501 (get_local_map, copy_intervals, copy_intervals_to_string)
5502 (compare_string_intervals, set_intervals_multibyte_1):
5503 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5504 * intervals.h: Adjust decls to match defn changes elsewhere.
5505 (struct interval):
5506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5507 * keyboard.c (this_command_key_count, this_single_command_key_start)
5508 (before_command_key_count, before_command_echo_length, echo_now)
5509 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5510 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5511 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5512 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5513 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5514 (last_non_minibuf_size, last_point_position, echo_truncate)
5515 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5516 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5517 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5518 (stuff_buffered_input):
5519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5520 (last_auto_save, command_loop_1, read_char):
5521 Use EMACS_INT, not int, to avoid integer overflow.
5522 (record_char): Avoid overflow in total_keys computation.
5523 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5524 * keyboard.h: Adjust decls to match defn changes elsewhere.
5525 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5526 (Fkey_description, Fdescribe_vector, Flookup_key):
5527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5528 (click_position): New function, to check that positions are in range.
5529 (Fcurrent_active_maps):
5530 (describe_command):
5531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5532 (Faccessible_keymaps, Fkey_description):
5533 (preferred_sequence_p):
5534 Don't assume fixnum can fit into int.
5535 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5536 Check for integer overflow in size calculations.
5537 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5538 avoid mishandling large integers.
5539 * lisp.h: Adjust decls to match defn changes elsewhere.
5540 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5541 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5542 (struct Lisp_Marker):
5543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5544 (clip_to_bounds): Now an inline function, moved here from editfns.c.
5545 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5546 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5547 All callers changed.
5548 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5549 Assume the arg has valid form, since it always does.
5550 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5551 unsigned integer system type.
5552 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5553 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5555 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5556 (duration_to_sec_usec): New decl.
5557 * lread.c (read_from_string_index, read_from_string_index_byte)
5558 (read_from_string_limit, readchar, unreadchar, openp)
5559 (read_internal_start, read1, oblookup):
5560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5561 (Fload, readevalloop, Feval_buffer, Feval_region):
5562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5563 (openp): Check for out-of-range argument to 'access'.
5564 (read1): Use int, not EMACS_INT, where int is wide enough.
5565 Don't assume fixnum fits into int.
5566 Fix off-by-one error that can read outside a buffer.
5567 (read_filtered_event): Use duration_to_sec_usec
5568 to do proper overflow checking on durations.
5569 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5570 in size calculation.
5571 (Fexecute_kbd_macro):
5572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5573 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5574 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5575 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5576 (set_marker_both, set_marker_restricted_both, marker_position)
5577 (marker_byte_position, Fbuffer_has_markers_at):
5578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5579 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
5580 * menu.c (ensure_menu_items): Rename from grow_menu_items.
5581 It now merely ensures that the menu is large enough, without
5582 necessarily growing it, as this avoids some integer overflow issues.
5583 All callers changed.
5584 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5585 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5586 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5587 Use SAFE_ALLOCA_LISP, not alloca.
5588 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5589 to EMACS_INT. Check that fixnums are in proper range for system types.
5590 * minibuf.c (minibuf_prompt_width, string_to_object)
5591 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5592 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5594 (get_minibuffer, read_minibuf_unwind):
5595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5596 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5597 this simplifies overflow checking. All callers changed.
5598 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5599 (Ftest_completion):
5600 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5601 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5602 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5603 Check that fixnums are in proper range for system types.
5604 (Fx_create_frame, Fx_show_tip):
5605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5606 * nsfont.m (ns_findfonts, nsfont_list_family):
5607 Don't assume fixnum fits in long.
5608 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5610 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5611 wide enough.
5612 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
5613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5614 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5615 (PRINTDECLARE, PRINTPREPARE):
5616 (strout, print_string):
5617 (print, print_preprocess, print_check_string_charset_prop)
5618 (print_object):
5619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5620 (PRINTDECLARE):
5621 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5623 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
5624 (printchar, strout): Use xpalloc to catch size calculation overflow.
5625 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
5626 (print_error_message): Use SAFE_ALLOCA, not alloca.
5627 (print_object): Use int, not EMACS_INT, where int is wide enough.
5628 (print_depth, new_backquote_output, print_number_index):
5629 Use ptrdiff_t, not int, where int might not be wide enough.
5630 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5631 (Fset_process_window_size, Fformat_network_address)
5632 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
5633 (sigchld_handler):
5634 Check that fixnums are in proper range for system types.
5635 (Fsignal_process): Simplify by avoiding a goto.
5636 Check for process-ids out of pid_t range rather than relying on
5637 undefined behavior.
5638 (process_tick, update_tick): Use EMACS_INT, not int.
5639 (Fformat_network_address, read_process_output, send_process)
5640 (Fprocess_send_region, status_notify):
5641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5642 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5643 (wait_reading_process_output, read_process_output, exec_sentinel):
5644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5645 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5646 (Faccept_process_output): Use duration_to_sec_usec to do proper
5647 overflow checking on durations.
5648 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5649 Don't assume pid_t fits in int.
5650 * process.h (struct Lisp_Process): Members tick and update_tick
5651 are now of type EMACS_INT, not int.
5652 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5653 configured --with-wide-int.
5654 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5655 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5656 * search.c (looking_at_1, string_match_1):
5657 (fast_string_match, fast_c_string_match_ignore_case)
5658 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5659 (scan_newline, find_before_next_newline, search_command)
5660 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5661 (set_search_regs, wordify):
5662 (Freplace_match):
5663 (Fmatch_data):
5664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5665 (string_match_1, search_buffer, set_search_regs):
5666 (Fmatch_data):
5667 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5668 (wordify): Check for overflow in size calculation.
5669 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5670 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5671 Check that fixnums are in proper range for system types.
5672 * sound.c (struct sound_device)
5673 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5675 (Fplay_sound_internal):
5676 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5677 * syntax.c (struct lisp_parse_state, find_start_modiff)
5678 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5679 (Fparse_partial_sexp):
5680 Don't assume fixnums can fit in int.
5681 (struct lisp_parse_state, find_start_pos, find_start_value)
5682 (find_start_value_byte, find_start_begv)
5683 (update_syntax_table, char_quoted, dec_bytepos)
5684 (find_defun_start, prev_char_comend_first, back_comment):
5685 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5686 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5688 (Finternal_describe_syntax_value): Check that match_lisp is a
5689 character, not an integer, since the code stuffs it into int.
5690 (scan_words, scan_sexps_forward):
5691 Check that fixnums are in proper range for system types.
5692 (Fforward_word):
5693 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5694 (scan_sexps_forward):
5695 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5696 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5697 * syntax.h: Adjust decls to match defn changes elsewhere.
5698 (struct gl_state_s):
5699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5700 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5701 MOST_POSITIVE_FIXNUM.
5702 * sysdep.c (wait_for_termination_1, wait_for_termination)
5703 (interruptible_wait_for_termination, mkdir):
5704 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5705 (emacs_read, emacs_write):
5706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5707 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5708 and double all fit in int.
5709 * term.c (set_tty_color_mode):
5710 Check that fixnums are in proper range for system types.
5711 * termhooks.h (struct input_event):
5712 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5713 * textprop.c (validate_interval_range, interval_of)
5714 (Fadd_text_properties, set_text_properties_1)
5715 (Fremove_text_properties, Fremove_list_of_text_properties)
5716 (Ftext_property_any, Ftext_property_not_all)
5717 (copy_text_properties, text_property_list, extend_property_ranges)
5718 (verify_interval_modification):
5719 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5720 (Fnext_single_char_property_change)
5721 (Fprevious_single_char_property_change):
5722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5723 (copy_text_properties):
5724 Check for integer overflow in index calculation.
5725 * undo.c (last_boundary_position, record_point, record_insert)
5726 (record_delete, record_marker_adjustment, record_change)
5727 (record_property_change):
5728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5729 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5730 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5731 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5732 (Fx_hide_tip, Fx_file_dialog):
5733 * w32menu.c (set_frame_menubar):
5734 Use ptrdiff_t, not int, for consistency with rest of code.
5735 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5736 (select_window, Fdelete_other_windows_internal)
5737 (window_scroll_pixel_based, window_scroll_line_based)
5738 (Frecenter, Fset_window_configuration):
5739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5740 (Fset_window_hscroll, run_window_configuration_change_hook)
5741 (set_window_buffer, temp_output_buffer_show, scroll_command)
5742 (Fscroll_other_window, Frecenter):
5743 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5744 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5745 Don't assume fixnum fits in int.
5746 (Fset_window_scroll_bars):
5747 Check that fixnums are in proper range for system types.
5748 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5749 (string_pos, c_string_pos, number_of_chars, init_iterator)
5750 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5751 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5752 (compute_display_string_end, handle_face_prop)
5753 (face_before_or_after_it_pos, handle_invisible_prop)
5754 (handle_display_prop, handle_display_spec, handle_single_display_spec)
5755 (display_prop_intangible_p, string_buffer_position_lim)
5756 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5757 (get_overlay_strings_1, get_overlay_strings)
5758 (iterate_out_of_display_property, forward_to_next_line_start)
5759 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5760 (get_next_display_element, set_iterator_to_next)
5761 (get_visually_first_element, compute_stop_pos_backwards)
5762 (handle_stop_backwards, next_element_from_buffer)
5763 (move_it_in_display_line_to, move_it_in_display_line)
5764 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5765 (add_to_log, message_dolog, message_log_check_duplicate)
5766 (message2, message2_nolog, message3, message3_nolog
5767 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5768 (current_message_1, truncate_echo_area, truncate_message_1)
5769 (set_message, set_message_1, store_mode_line_noprop)
5770 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5771 (text_outside_line_unchanged_p, check_point_in_composition)
5772 (reconsider_clip_changes)
5773 (redisplay_internal, set_cursor_from_row, try_scrolling)
5774 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5775 (redisplay_window, find_last_unchanged_at_beg_row)
5776 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5777 (trailing_whitespace_p, find_row_edges, display_line)
5778 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5779 (display_mode_element, store_mode_line_string)
5780 (pint2str, pint2hrstr, decode_mode_spec)
5781 (display_count_lines, display_string, draw_glyphs)
5782 (x_produce_glyphs, x_insert_glyphs)
5783 (rows_from_pos_range, mouse_face_from_buffer_pos)
5784 (fast_find_string_pos, mouse_face_from_string_pos)
5785 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5786 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5787 (safe_call, init_from_display_pos, handle_fontified_prop)
5788 (handle_single_display_spec, load_overlay_strings)
5789 (with_echo_area_buffer, setup_echo_area_for_printing)
5790 (display_echo_area, echo_area_display)
5791 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5792 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5793 (redisplay_window, dump_glyph_row, display_mode_line)
5794 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
5795 (handle_display_spec, display_prop_string_p):
5796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5797 (handle_single_display_spec, build_desired_tool_bar_string)
5798 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5799 (get_specified_cursor_type):
5800 Check that fixnums are in proper range for system types.
5801 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5802 (Flookup_image_map):
5803 Don't assume fixnums fit in int.
5804 (compare_overlay_entries):
5805 Avoid mishandling comparisons due to subtraction overflow.
5806 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5807 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5808 (handle_tool_bar_click):
5809 Use int, not unsigned, since we prefer signed and the signedness
5810 doesn't matter here.
5811 (get_next_display_element, next_element_from_display_vector):
5812 Use int, not EMACS_INT, when int is wide enough.
5813 (start_hourglass): Use duration_to_sec_usec to do proper
5814 overflow checking on durations.
5815 * xfaces.c (Fbitmap_spec_p):
5816 Check that fixnums are in proper range for system types.
5817 (compare_fonts_by_sort_order):
5818 Avoid mishandling comparisons due to subtraction overflow.
5819 (Fx_family_fonts, realize_basic_faces):
5820 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5821 (Fx_family_fonts):
5822 Don't assume fixnum fits in int.
5823 Use SAFE_ALLOCA_LISP, not alloca.
5824 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5825 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5826 (face_at_buffer_position, face_for_overlay_string)
5827 (face_at_string_position):
5828 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5829 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5830 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5831 (Fx_show_tip):
5832 Check that fixnums are in proper range for system types.
5833 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5834 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5836 (Fx_change_window_property): Don't assume fixnums fit in int.
5837 * xfont.c (xfont_chars_supported):
5838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5839 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5840 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5841 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5842 * xml.c (parse_region):
5843 * xrdb.c (magic_file_p):
5844 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5845 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5846 (x_get_local_selection, x_reply_selection_request)
5847 (x_handle_selection_request, wait_for_property_change):
5848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5849 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5850 short is wide enough.
5851 (x_send_client_event): Don't assume fixnum fits in int.
5852 * xterm.c (x_x_to_emacs_modifiers):
5853 Don't assume EMACS_INT overflows nicely into int.
5854 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5855 may come from Lisp.
5856 (handle_one_xevent): NATNUMP can eval its arg twice.
5857 (x_connection_closed):
5858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5859 * xterm.h: Adjust decls to match defn changes elsewhere.
5860 (struct scroll_bar): Use struct vectorlike_header
5861 rather than rolling our own approximation.
5862 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5863
5864 2012-05-25 Glenn Morris <rgm@gnu.org>
5865
5866 * lisp.mk (lisp): Update for more files being compiled now.
5867
5868 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5869
5870 * lread.c: Remove `read_pure' which makes no difference.
5871 (read_pure): Remove var.
5872 (unreadpure): Remove function.
5873 (readevalloop): Don't call read_list with -1 flag.
5874 (read1, read_vector): Don't test read_pure any more.
5875 (read_list): Simplify.
5876
5877 * fileio.c, character.h: Minor style tweaks.
5878
5879 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5880
5881 * window.h (clip_changed): Remove useless declaration.
5882
5883 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
5884
5885 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5886 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5887
5888 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5889
5890 Remove src/m/*.
5891 This directory predates autoconf and is no longer needed nowadays.
5892 Move its few remaining bits of functionality to where they're needed.
5893 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5894 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5895 * m/template.h: Remove.
5896 * Makefile.in (M_FILE): Remove. All uses removed.
5897 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5898 * lisp.h (USE_LSB_TAG):
5899 * mem-limits.h (EXCEEDS_LISP_PTR):
5900 Use VAL_MAX, not VALBITS, in #if.
5901 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5902 (EMACS_UINT): Define unconditionally now.
5903 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5904 (BITS_PER_EMACS_INT): New constants, replacing
5905 what used to be in config.h, but not useful in #if.
5906 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5907 define them any more.
5908 (VAL_MAX): New macro.
5909 (VALMASK): Use it.
5910 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5911 BITS_PER_EMACS_INT, in #if.
5912 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5913 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5914 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5915 * s/ms-w32.h (DATA_START):
5916 Move here from removed file m/intel386.h.
5917 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5918 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5919
5920 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5921
5922 Assume C89 or later.
5923 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5924 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5925 (xrealloc):
5926 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5927 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5928 * textprop.c, tparam.c (NULL): Remove.
5929 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5930 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5931 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5932 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5933 * xterm.c (input_signal_count): Assume volatile works.
5934
5935 2012-05-21 Ken Brown <kbrown@cornell.edu>
5936
5937 * xgselect.c (xg_select): Fix first argument in call to 'select'
5938 (bug#11508).
5939
5940 2012-05-20 Ken Brown <kbrown@cornell.edu>
5941
5942 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
5943 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
5944
5945 2012-05-19 Ken Brown <kbrown@cornell.edu>
5946
5947 * xfns.c (x_in_use): Remove `static' qualifier.
5948 * xterm.h (x_in_use): Declare.
5949 * xgselect.c: Include xterm.h.
5950 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5951 and `display_arg' (bug#9754).
5952
5953 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5956
5957 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5958 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5959
5960 2012-05-18 Eli Zaretskii <eliz@gnu.org>
5961
5962 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5963
5964 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
5965 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
5966
5967 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5968 reference to image_cache->refcount.
5969 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5970
5971 2012-05-17 Juri Linkov <juri@jurta.org>
5972
5973 * search.c (Fword_search_regexp, Fword_search_backward)
5974 (Fword_search_forward, Fword_search_backward_lax)
5975 (Fword_search_forward_lax): Move functions to isearch.el
5976 (bug#10145, bug#11381).
5977
5978 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5979
5980 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5981
5982 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5983
5984 * lread.c (init_obarray): Declare Qt and Qnil as special.
5985
5986 2012-05-14 Glenn Morris <rgm@gnu.org>
5987
5988 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
5989 Put "libexec" before "bin", for the sake of init_callproc_1.
5990
5991 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5992
5993 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5994
5995 * unexaix.c: Port to more-recent AIX compilers.
5996 (report_error, report_error_1, make_hdr, copy_sym)
5997 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5998 Make arguments const char *, not char *, to avoid violations of C
5999 standard and to fix some AIX warnings reported by Gilles Pion.
6000
6001 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6002
6003 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6004 already have overlays loaded.
6005 (handle_single_display_spec): Before returning without displaying
6006 fringe bitmap, synchronize the bidi iterator with the main display
6007 iterator, by calling iterate_out_of_display_property.
6008 (iterate_out_of_display_property): Detect buffer iteration by
6009 testing that it->string is a Lisp string.
6010 (get_next_display_element): When the current object is exhausted,
6011 and there's something on it->stack, call set_iterator_to_next to
6012 proceed with what's on the stack, instead of returning zero.
6013 (set_iterator_to_next): If called at the end of a Lisp string,
6014 proceed to consider_string_end without incrementing string
6015 position. Don't increment display vector index past the end of
6016 the display vector. (Bug#11417)
6017 (pos_visible_p): Don't report a position visible when move_it_to
6018 stopped at the last line of window, which happens to be scanned
6019 backwards by the bidi iteration. (Bug#11464)
6020
6021 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6022
6023 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6024 and right-margin display specs even if the spec is invalid or we
6025 are on a TTY, and thus unable to display on the fringes.
6026 That's because the text with the property will not be displayed anyway,
6027 so we need to signal to the caller that this is a "replacing"
6028 display spec. This fixes display when the spec is invalid or we
6029 are on a TTY.
6030
6031 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6032
6033 * unexaix.c (make_hdr): Fix typo in prototype.
6034 This bug broke the build on AIX. Problem reported by Gilles Pion.
6035
6036 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6037
6038 * keyboard.c (kbd_buffer_get_event): Read special events also in
6039 batch mode. (Bug#11415)
6040
6041 2012-05-12 Glenn Morris <rgm@gnu.org>
6042
6043 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6044
6045 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6046
6047 * lisp.mk (lisp): Add newcomment.elc.
6048
6049 2012-05-12 Glenn Morris <rgm@gnu.org>
6050
6051 * Makefile.in (MKDIR_P): New, set by configure.
6052 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6053
6054 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6055
6056 Remove unused function hourglass_started.
6057 * dispextern.h (hourglass_started):
6058 * w32fns.c (hourglass_started):
6059 * xdisp.c (hourglass_started): Remove.
6060
6061 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6062
6063 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6064 Update dependencies.
6065
6066 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6067
6068 * xgselect.c (xg_select): Put maxfds+1 into a var.
6069 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6070
6071 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6072
6073 2012-05-10 Dave Abrahams <dave@boostpro.com>
6074
6075 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6076 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6077
6078 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6079
6080 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6081 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6082 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6083 Initialize xd_registered_buses.
6084
6085 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6086
6087 Untag more efficiently if USE_LSB_TAG.
6088 This is based on a proposal by YAMAMOTO Mitsuharu in
6089 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6090 For an admittedly artificial (nth 8000 longlist) benchmark on
6091 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6092 Emacs's overall text size by 1%.
6093 * lisp.h (XUNTAG): New macro.
6094 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6095 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6096 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6097 * eval.c (Fautoload):
6098 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6099 * frame.h (XFRAME): Use XUNTAG.
6100
6101 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6102 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6103 Remove unportable assumptions about print widths of types like
6104 dbus_uint32_t.
6105 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6106 intptr_t when converting between pointer and integer, to avoid GCC
6107 warnings about wrong width.
6108
6109 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6110
6111 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6112 stack for each reader_thread, instead of defaulting to 8MB
6113 determined by the linker. This avoids failures in creating
6114 subprocesses on Windows 7, see the discussion in this thread:
6115 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6116
6117 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6118
6119 Fix up display of the *Minibuf-0* buffer in the mini window.
6120 * keyboard.c (read_char): Don't clear the echo area if there's no
6121 message to clear.
6122 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6123 contents of *Minibuf-0*) if there's no message displayed in its stead.
6124
6125 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6126
6127 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6128 batch mode.
6129
6130 2012-05-06 Chong Yidong <cyd@gnu.org>
6131
6132 * lisp.mk (lisp): Update.
6133
6134 2012-05-05 Jim Meyering <meyering@redhat.com>
6135
6136 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6137
6138 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6139
6140 * data.c (PUT_ERROR): New macro.
6141 (syms_of_data): Use it. Add new error type `user-error'.
6142 * undo.c (user_error): New function.
6143 (Fprimitive_undo): Use it.
6144 * print.c (print_error_message): Adjust print style for `user-error'.
6145 * keyboard.c (user_error): New function.
6146 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6147
6148 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6149
6150 Do not limit current-time-string to years 1000..9999.
6151 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6152 (Fcurrent_time_string): Support any year that is supported by the
6153 underlying localtime representation. Don't use asctime, as it
6154 has undefined behavior for years outside the range -999..9999.
6155
6156 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6157
6158 Fix race conditions involving setenv, gmtime, localtime, asctime.
6159 Without this fix, interrupts could mess up code that uses these
6160 nonreentrant functions, since setting TZ invalidates existing
6161 tm_zone or tzname values, and since most of these functions return
6162 pointers to static storage.
6163 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6164 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6165 Grow the critical sections to include not just invoking
6166 localtime/gmtime, but also accessing these functions' results
6167 including their tm_zone values if any, and any related TZ setting.
6168 (format_time_string): Last arg is now struct tm *, not struct tm **,
6169 so that the struct tm is saved in the critical section.
6170 All callers changed. Simplify allocation of initial buffer, partly
6171 motivated by the fact that memory allocation needs to be outside
6172 the critical section.
6173
6174 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6175
6176 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6177 with RESET_INTERVAL.
6178
6179 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6180 Remove duplicated buffer name initialization.
6181
6182 2012-05-02 Jim Meyering <jim@meyering.net>
6183
6184 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6185
6186 * xfns.c (x_window): Use xstrdup (Bug#11375).
6187
6188 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6189
6190 * xdisp.c (pos_visible_p): If already at a newline from the
6191 display string before the 'while' loop, don't walk back the glyphs
6192 from it3.glyph_row. Solves assertion violation when the display
6193 string begins with a newline (egg.el). (Bug#11367)
6194
6195 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6196
6197 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6198 Move to simple.el.
6199
6200 2012-05-01 Glenn Morris <rgm@gnu.org>
6201
6202 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6203 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6204 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6205 All were removed before 23.1.
6206
6207 * dispnew.c: Remove HAVE_LIBNCURSES test;
6208 it is always true on relevant platforms.
6209
6210 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6211 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6212
6213 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6214
6215 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6216
6217 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6218 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6219 Remove.
6220
6221 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6222
6223 Do not avoid creating empty evaporating overlays (Bug#9642).
6224 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6225 That is, do not delete an evaporating overlay if it becomes
6226 empty after its bounds are adjusted to fit within its buffer.
6227 This fix caused other problems, and I'm reverting it until we get
6228 to the bottom of them.
6229
6230 2012-04-27 Chong Yidong <cyd@gnu.org>
6231
6232 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6233
6234 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6235
6236 * xdisp.c (pos_visible_p): If the window start position is beyond
6237 ZV, start the display from buffer beginning. Prevents assertion
6238 violation in init_iterator when the minibuffer window is scrolled
6239 via the scroll bar.
6240
6241 * window.c (window_scroll_pixel_based): Likewise.
6242
6243 2012-04-27 Chong Yidong <cyd@gnu.org>
6244
6245 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6246
6247 2012-04-27 Glenn Morris <rgm@gnu.org>
6248
6249 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6250 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6251
6252 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6253
6254 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6255 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6256
6257 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6258
6259 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6260 display element, check also the underlying string or buffer
6261 character. (Bug#11341)
6262
6263 * w32menu.c: Include w32heap.h.
6264 (add_menu_item): If the call to AppendMenuW (via
6265 unicode_append_menu) fails, disable Unicode menus only if we are
6266 running on Windows 9X/Me.
6267
6268 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6269
6270 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6271 (xgetint): Add missing shift for LSB tags.
6272
6273 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6274
6275 * keyboard.c (read_char): Don't wipe echo area for select window
6276 events: These might get delayed via `mouse-autoselect-window'
6277 (Bug#11304).
6278
6279 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6280
6281 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6282 manipulation of :loaded-from data.
6283
6284 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6285
6286 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6287 now a cons (bug#11311).
6288
6289 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6290
6291 Do not create empty overlays with the evaporate property (Bug#9642).
6292 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6293 if it becomes empty after its bounds are adjusted to fit within
6294 its buffer. Without this fix, in a nonempty buffer (let ((o
6295 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6296 yields an empty overlay that has the evaporate property, which is
6297 not supposed to happen.
6298
6299 Fix minor GTK3 problems found by static checking.
6300 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6301 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6302 (struct _EmacsFixedClass, emacs_fixed_get_type):
6303 Move decls here from emacsgtkfixed.h, since they needn't be public.
6304 (emacs_fixed_get_type): Now static.
6305 (emacs_fixed_class_init): Omit unused local.
6306 (emacs_fixed_child_type): Remove; unused.
6307 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6308 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6309 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6310 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6311 (EMACS_FIXED_GET_CLASS): Remove; unused.
6312 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6313
6314 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6315 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6316
6317 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6318
6319 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6320 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6321 (__malloc_size_t, __malloc_ptrdiff_t):
6322 Remove. All uses removed, replaced by the definiens if needed,
6323 since we can assume C89 or better now.
6324 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6325 (protect_malloc_state, align, get_contiguous_space)
6326 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6327 (malloc_atfork_handler_child, malloc_enable_thread)
6328 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6329 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6330 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6331 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6332 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6333 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6334 Define using prototypes, not old style.
6335 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6336 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6337 (align): Don't assume that signed integer overflow wraps around.
6338 Omit unused local var.
6339 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6340 (_free_internal_nolock, memalign, mallochook, reallochook):
6341 Omit no-longer-needed casts.
6342 (valloc): Use getpagesize, not __getpagesize.
6343 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6344 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6345
6346 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6347
6348 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6349
6350 Move functions from C to Lisp. Make non-blocking method calls
6351 the default. Implement further D-Bus standard interfaces.
6352
6353 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6354 (QCdbus_request_name_allow_replacement)
6355 (QCdbus_request_name_replace_existing)
6356 (QCdbus_request_name_do_not_queue)
6357 (QCdbus_request_name_reply_primary_owner)
6358 (QCdbus_request_name_reply_in_queue)
6359 (QCdbus_request_name_reply_exists)
6360 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6361 (QCdbus_registered_serial, QCdbus_registered_method)
6362 (QCdbus_registered_signal): New Lisp objects.
6363 (XD_DEBUG_MESSAGE): Use sizeof.
6364 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6365 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6366 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6367 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6368 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6369 (xd_signature, xd_append_arg): Allow float for integer types.
6370 (xd_get_connection_references): New function.
6371 (xd_get_connection_address): Rename from xd_initialize.
6372 Return cached address.
6373 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6374 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6375 level.
6376 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6377 Return number of refcounts.
6378 (Fdbus_get_unique_name): Make stronger parameter check.
6379 (Fdbus_message_internal): New defun.
6380 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6381 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6382 (Fdbus_send_signal, Fdbus_register_service)
6383 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6384 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6385 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6386 (Vdbus_compiled_version, Vdbus_runtime_version)
6387 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6388 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6389 (Vdbus_message_type_signal): New defvars.
6390 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6391 Adapt docstring.
6392
6393 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6394
6395 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6396 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6397 Do not assume ptrdiff_t is the same width as 'int'.
6398
6399 * alloc.c: Handle unusual debugging option combinations.
6400 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6401 since the two debugging options are incompatible.
6402 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6403 is defined.
6404 (mem_init, mem_insert, mem_insert_fixup):
6405 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6406 (NEED_MEM_INSERT): Remove; no longer needed.
6407
6408 2012-04-22 Leo Liu <sdl.web@gmail.com>
6409
6410 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6411
6412 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6413
6414 * sysdep.c [__FreeBSD__]: Minor cleanups.
6415 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6416 Use Emacs indenting style more consistently. Avoid some casts.
6417 Use 'double' consistently rather than mixing 'float' and 'double'.
6418
6419 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6420
6421 * sysdep.c (list_system_processes, system_process_attributes):
6422 Add implementation for FreeBSD (Bug#5243).
6423
6424 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6425
6426 * lisp.mk (lisp): Update.
6427
6428 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6429
6430 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6431 It is never used otherwise.
6432
6433 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6434
6435 * print.c (print_preprocess): Only check print_depth if print-circle
6436 is nil.
6437 (print_object): Check for cycles even when print-circle is nil and
6438 print-gensym is t, but only check print_depth if print-circle is nil.
6439
6440 2012-04-20 Chong Yidong <cyd@gnu.org>
6441
6442 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6443 set the status to "failed" and ensure that sentinel is run.
6444
6445 2012-04-20 Glenn Morris <rgm@gnu.org>
6446
6447 * process.c (Fset_process_inherit_coding_system_flag)
6448 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
6449 (Fmake_network_process, Fmake_serial_process): Doc fix.
6450
6451 2012-04-20 Eli Zaretskii <eliz@gnu.org>
6452
6453 * xdisp.c (string_buffer_position_lim): Limit starting position to
6454 BEGV.
6455 (set_cursor_from_row): If called for a mode-line or header-line
6456 row, return zero immediately.
6457 (try_cursor_movement): If inside continuation line, don't back up
6458 farther than the first row after the header line, if any.
6459 Don't consider the header-line row as "partially visible", even if
6460 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6461
6462 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6463
6464 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6465 (bug#11238).
6466
6467 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6468 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 configure: new option --enable-gcc-warnings (Bug#11207)
6471 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6472 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6473 (ALL_CFLAGS): Use new macros rather than old.
6474 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6475 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6476 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6477 -Wunused-result, -Wunused-variable. This should go away once
6478 the Emacs and Gnulib regex code is merged.
6479 (xmalloc, xrealloc): Now static.
6480
6481 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6482
6483 * dired.c (Fsystem_groups): Remove unused local.
6484
6485 2012-04-17 Glenn Morris <rgm@gnu.org>
6486
6487 * dired.c (Fsystem_users): Doc fix.
6488
6489 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6490
6491 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6492 (syms_of_dired): Add them.
6493
6494 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6495
6496 Fix minor alloc.c problems found by static checking.
6497 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6498 New extern decls, to avoid calling undeclared functions.
6499 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6500 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6501 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6502 (NEED_MEM_INSERT): New macro.
6503 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
6504 Remove one incorrect comment and fix another.
6505
6506 Fix minor ralloc.c problems found by static checking.
6507 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6508 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6509 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6510 (r_alloc_sbrk): Now static.
6511
6512 Improve ralloc.c interface checking.
6513 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6514 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6515 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6516 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6517 [REL_ALLOC]: ... to here, to check interface.
6518 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6519 Remove decls. This fixes an "It stinks!".
6520
6521 * alloc.c (which_symbols): Fix alignment issue / type clash.
6522
6523 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6524
6525 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6526 (struct Lisp_Misc_Any): Likewise.
6527 (struct Lisp_Free): Likewise.
6528 * alloc.c (union aligned_Lisp_Symbol): Define.
6529 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6530 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6531 (union aligned_Lisp_Misc): Define.
6532 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6533 aligned_Lisp_Misc instead of union Lisp_Misc.
6534 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
6535
6536 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6537
6538 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6539 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6540 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6541 * s/netbsd.h, s/sol2-6.h:
6542 Remove definition of GC_MARK_STACK, since the default now works.
6543 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6544 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6545 no longer the default.
6546 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6547
6548 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6549
6550 * lread.c (lisp_file_lexically_bound_p):
6551 Fix hang at ";-*-\n" (bug#11238).
6552
6553 2012-04-14 Eli Zaretskii <eliz@gnu.org>
6554
6555 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6556 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6557
6558 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6559
6560 * nsterm.m (constrainFrameRect): Always constrain when there is only
6561 one screen (Bug#10962).
6562
6563 2012-04-13 Ken Brown <kbrown@cornell.edu>
6564
6565 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6566
6567 2012-04-13 Reuben Thomas <rrt@sc3d.org>
6568
6569 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6570
6571 2012-04-11 Daniel Colascione <dancol@dancol.org>
6572
6573 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6574 against is gone. It's better to use vfork now so that when Cygwin
6575 gains a new, working vfork, we use it automatically (bug#10398).
6576
6577 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6578
6579 * window.c (save_window_save): Obey window-point-insertion-type.
6580
6581 2012-04-11 Glenn Morris <rgm@gnu.org>
6582
6583 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6584
6585 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6586
6587 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6588
6589 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6590
6591 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6592 (force_quit_count): New var.
6593 (handle_interrupt): Use it.
6594
6595 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
6596
6597 * w32.c (w32_delayed_load): Record the full path of the library
6598 being loaded (bug#10424).
6599
6600 2012-04-09 Glenn Morris <rgm@gnu.org>
6601
6602 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6603 not just in the obarray, before snarfing them. (Bug#11036)
6604
6605 * Makefile.in ($(leimdir)/leim-list.el):
6606 Pass EMACS rather than BUILT_EMACS.
6607
6608 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6609
6610 * process.c (make_process):
6611 * process.h: Add integer `gnutls_handshakes_tried' member to
6612 process struct.
6613
6614 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6615 Add convenience `GNUTLS_LOG2i' macro.
6616
6617 * gnutls.c (gnutls_log_function2i): Convenience log function.
6618 (emacs_gnutls_read): Use new log functions,
6619 `gnutls_handshakes_tried' process member, and
6620 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6621 attempts per process (connection).
6622
6623 2012-04-09 Chong Yidong <cyd@gnu.org>
6624
6625 * eval.c (Fuser_variable_p, user_variable_p_eh)
6626 (lisp_indirect_variable): Functions deleted.
6627 (Fdefvar): Caller changed.
6628
6629 * callint.c (Finteractive, Fcall_interactively):
6630 * minibuf.c (Fread_variable): Callers changed.
6631
6632 2012-04-09 Eli Zaretskii <eliz@gnu.org>
6633
6634 * xdisp.c (set_cursor_from_row): If the display string appears in
6635 the buffer at position that is closer to point than the position
6636 after the display string, display the cursor on the first glyph of
6637 the display string. Fixes cursor display when a 'display' text
6638 property immediately follows invisible text. (Bug#11094)
6639
6640 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6641
6642 composite.c: use 'double' consistently
6643 * composite.c (get_composition_id): Use 'double' consistently
6644 instead of converting 'float' to 'double' and vice versa; this is
6645 easier to understand and avoids a GCC warning.
6646
6647 2012-04-09 Glenn Morris <rgm@gnu.org>
6648
6649 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6650 preparation for dumping it with emacs. (Bug#4789)
6651 (leimdir): New variable.
6652 ($(leimdir)/leim-list.el): New rule.
6653 (emacs$(EXEEXT)): Depend on leim-list.el.
6654
6655 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6656 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6657 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6658
6659 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6660
6661 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6662 proper alignment.
6663
6664 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
6665
6666 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6667 Remove unused local variable.
6668
6669 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6670
6671 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6672 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6673 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6674 objects, as mark_maybe_pointer will catch them otherwise.
6675 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6676 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6677
6678 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6679
6680 Fix typo that broke non-Windows builds.
6681 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6682
6683 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6684
6685 Support building on MS-Windows with libxml2.
6686
6687 * makefile.w32-in (OBJ2): Add xml.$(O).
6688 (GLOBAL_SOURCES): Add xml.c.
6689 ($(BLD)/xml.$(O)): New dependency list.
6690
6691 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6692 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6693 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6694 [!WINDOWSNT]: New macros.
6695 (init_libxml2_functions, libxml2_loaded_p): New functions.
6696 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6697 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6698 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6699 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6700 linked in).
6701 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6702 Call init_libxml2_functions before calling libxml2 functions.
6703 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6704
6705 * emacs.c: Don't include libxml/parser.h.
6706 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6707 xmlCleanupParser directly.
6708
6709 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6710
6711 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6712
6713 * indent.c (Fvertical_motion): If there is a display string at
6714 point, use it.vpos to compute how many lines to backtrack after
6715 move_it_to point. (Bug#11133)
6716
6717 2012-04-06 Eli Zaretskii <eliz@gnu.org>
6718
6719 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6720 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6721 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6722 macros related to unification of CJK characters. For the details,
6723 see the discussion following the message here:
6724 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6725
6726 2012-04-04 Chong Yidong <cyd@gnu.org>
6727
6728 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6729
6730 2012-04-01 Eli Zaretskii <eliz@gnu.org>
6731
6732 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6733 instead of alloca. (Bug#11138)
6734
6735 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6736
6737 * w32menu.c (is_simple_dialog): Properly check lisp types.
6738 (Bug#11141)
6739
6740 2012-03-31 Eli Zaretskii <eliz@gnu.org>
6741
6742 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6743 position we get to after a call to move_it_to fails the
6744 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6745 only if we wind up in a string from display property. (Bug#11063)
6746
6747 * window.c (Fdelete_other_windows_internal): Invalidate the row
6748 and column information about mouse highlight, so that redisplay
6749 restores it after reallocating the glyph matrices. (Bug#7464)
6750
6751 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6752 string comes from a `display' text property, use the buffer
6753 position of that property as if we actually saw that position in
6754 the row's glyphs.
6755 (move_it_by_lines): Remove the assertion that
6756 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6757 violated when there's a before-string at the beginning of a line.
6758 (Bug#11063)
6759
6760 2012-03-30 Eli Zaretskii <eliz@gnu.org>
6761
6762 * xdisp.c (append_space_for_newline): If the default face was
6763 remapped, use the remapped face for the appended newline.
6764 (extend_face_to_end_of_line): Use the remapped default face for
6765 extending the face to the end of the line.
6766 (display_line): Call extend_face_to_end_of_line when the default
6767 face was remapped. (Bug#11068)
6768
6769 2012-03-29 Eli Zaretskii <eliz@gnu.org>
6770
6771 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6772
6773 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6774
6775 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6776
6777 2012-03-27 Glenn Morris <rgm@gnu.org>
6778
6779 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6780 Doc fixes.
6781
6782 2012-03-26 Kenichi Handa <handa@m17n.org>
6783
6784 * dispextern.h (struct glyph): Fix previous change. Change the
6785 bit length of glyphless.ch to 25 (Bug#11082).
6786
6787 2012-03-26 Chong Yidong <cyd@gnu.org>
6788
6789 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6790 (command_loop_1): Use it; inhibit selection update for
6791 handle-select-window too (Bug#8996).
6792
6793 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6794
6795 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
6796
6797 2012-03-25 Kenichi Handa <handa@m17n.org>
6798
6799 * dispextern.h (struct glyph): Change the bit length of
6800 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6801
6802 2012-03-24 Eli Zaretskii <eliz@gnu.org>
6803
6804 * s/ms-w32.h (tzname): Include time.h before redirecting to
6805 _tzname. Fixes the MSVC build. (Bug#9960)
6806
6807 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6808
6809 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6810 characters.
6811
6812 * xterm.c (XTread_socket): Only modify handling_signal if
6813 !SYNC_INPUT. (Bug#11080)
6814
6815 2012-03-23 Eli Zaretskii <eliz@gnu.org>
6816
6817 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6818 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6819 when fetching a multibyte character consumes more bytes than
6820 CHAR_BYTES returns, due to unification of CJK characters in
6821 string_char. (Bug#11073)
6822
6823 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6824
6825 * process.c (wait_reading_process_output): Handle pty disconnect
6826 by refraining from sending oneself a SIGCHLD (bug#10933).
6827
6828 2012-03-22 Chong Yidong <cyd@gnu.org>
6829
6830 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6831
6832 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
6833 Mark string as coming from a prefix property.
6834 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6835 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6836
6837 2012-03-21 Chong Yidong <cyd@gnu.org>
6838
6839 * xfaces.c (Vface_remapping_alist): Doc fix.
6840
6841 2012-03-20 Eli Zaretskii <eliz@gnu.org>
6842
6843 * w32proc.c (Fw32_set_console_codepage)
6844 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6845 Doc fixes.
6846
6847 2012-03-20 Chong Yidong <cyd@gnu.org>
6848
6849 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6850 to reflect default non-nil value of redisplay-dont-pause.
6851
6852 2012-03-19 Kenichi Handa <handa@m17n.org>
6853
6854 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6855 it fit in a valid range (Bug#11003).
6856
6857 2012-03-18 Eli Zaretskii <eliz@gnu.org>
6858
6859 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6860 that is not from display property, accept the row as a "cursor
6861 row" if one of the string's character has a non-nil `cursor'
6862 property. Fixes cursor positioning when there are newlines in
6863 overlay strings, e.g. in icomplete.el. (Bug#11035)
6864
6865 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6866
6867 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6868
6869 2012-03-12 Chong Yidong <cyd@gnu.org>
6870
6871 * eval.c (inhibit_lisp_code): Rename from
6872 inhibit_window_configuration_change_hook; move from window.c.
6873
6874 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6875 * window.c (run_window_configuration_change_hook)
6876 (syms_of_window): Callers changed.
6877
6878 2012-03-11 Chong Yidong <cyd@gnu.org>
6879
6880 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6881
6882 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6883
6884 2012-03-10 Chong Yidong <cyd@gnu.org>
6885
6886 * frame.c (other_visible_frames): Don't assume the selected frame
6887 is visible (Bug#10955).
6888
6889 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6890
6891 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6892
6893 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6894
6895 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6896 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6897 zero (Bug#10954).
6898
6899 2012-03-03 Glenn Morris <rgm@gnu.org>
6900
6901 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
6902
6903 2012-03-02 Eli Zaretskii <eliz@gnu.org>
6904
6905 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6906 position past the first glyph_row that ends at ZV. (Bug#10902)
6907 (redisplay_window, next_element_from_string): Fix typos in
6908 comments.
6909 (redisplay_window): Pass to move_it_vertically the margin in
6910 pixels, not in screen lines.
6911
6912 2012-03-02 Glenn Morris <rgm@gnu.org>
6913
6914 * buffer.c (buffer-list-update-hook): Doc fix.
6915
6916 2012-02-29 Eli Zaretskii <eliz@gnu.org>
6917
6918 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6919 push_it before setting up the iterator for the first overlay
6920 string, even if we have an empty string loaded.
6921 (next_overlay_string): If there's an empty string on the iterator
6922 stack, pop the stack. (Bug#10903)
6923
6924 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6925
6926 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6927 Suggested by Stefan Monnier in
6928 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6929 * alloc.c (widen_to_Lisp_Object): New static function.
6930 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6931 and widening them to Lisp_Objects. This would work even if
6932 USE_LSB_TAG is defined and wide integers are used, which might
6933 happen in a future version of Emacs.
6934
6935 2012-02-25 Chong Yidong <cyd@gnu.org>
6936
6937 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6938 Doc fix.
6939
6940 * xselect.c (Fx_selection_exists_p): Doc fix.
6941 (x_clipboard_manager_save_all): Print an informative message
6942 before saving to clipboard manager.
6943
6944 2012-02-24 Chong Yidong <cyd@gnu.org>
6945
6946 * keyboard.c (process_special_events): Handle all X selection
6947 requests in kbd_buffer, not just the next one (Bug#8869).
6948
6949 2012-02-23 Chong Yidong <cyd@gnu.org>
6950
6951 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6952 call when setting menu-bar-lines and tool-bar-lines parameters.
6953 (unwind_create_frame_1): New helper function.
6954
6955 * window.c (inhibit_window_configuration_change_hook): New var.
6956 (run_window_configuration_change_hook): Obey it.
6957 (syms_of_window): Initialize it.
6958
6959 2012-02-22 Chong Yidong <cyd@gnu.org>
6960
6961 * xterm.c (x_draw_image_relief): Add missing type check for
6962 Vtool_bar_button_margin (Bug#10743).
6963
6964 2012-02-21 Chong Yidong <cyd@gnu.org>
6965
6966 * fileio.c (Vfile_name_handler_alist): Doc fix.
6967
6968 * buffer.c (Fget_file_buffer): Protect against invalid file
6969 handler return value.
6970
6971 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6972
6973 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6974 when computing $valmask.
6975
6976 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6977 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6978 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6979 It's useless in that case, and it can cause problems on hosts
6980 that allocate halves of EMACS_INT values separately.
6981 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6982 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6983 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6984 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6985 it avoids undefined behavior on hosts where shifting right by more
6986 than the word width has undefined behavior.
6987
6988 2012-02-19 Chong Yidong <cyd@gnu.org>
6989
6990 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6991 (Funhandled_file_name_directory, Ffile_name_as_directory)
6992 (Fdirectory_file_name, Fexpand_file_name)
6993 (Fsubstitute_in_file_name): Protect against invalid file handler
6994 return values (Bug#10845).
6995
6996 2012-02-18 Eli Zaretskii <eliz@gnu.org>
6997
6998 * .gdbinit (pitx): Fix incorrect references to fields of the
6999 iterator stack.
7000
7001 2012-02-17 Chong Yidong <cyd@gnu.org>
7002
7003 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7004
7005 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7006
7007 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7008 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7009
7010 2012-02-15 Chong Yidong <cyd@gnu.org>
7011
7012 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7013 marked as special. Also, starting docstrings with * is obsolete.
7014
7015 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7016
7017 * gnutls.c (emacs_gnutls_write): Fix last change.
7018
7019 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7020
7021 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7022 send_process.
7023
7024 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7025
7026 * keymap.c (Fsingle_key_description): Handle char ranges.
7027
7028 2012-02-12 Chong Yidong <cyd@gnu.org>
7029
7030 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7031 as that creates a dangerous corner case.
7032
7033 * window.c (Fdelete_window_internal): Invalidate the mouse
7034 highlight (Bug#9904).
7035
7036 2012-02-12 Glenn Morris <rgm@gnu.org>
7037
7038 * xselect.c (Fx_own_selection_internal)
7039 (Fx_get_selection_internal, Fx_disown_selection_internal)
7040 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7041 * nsselect.m (Fx_own_selection_internal)
7042 (Fx_disown_selection_internal, Fx_selection_exists_p)
7043 (Fx_selection_owner_p, Fx_get_selection_internal):
7044 Sync docs and argument specs with the xselect.c versions.
7045
7046 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7047
7048 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7049
7050 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7051
7052 * w32select.c (Fx_selection_exists_p): Sync doc string and
7053 argument list with xselect.c. (Bug#10783)
7054
7055 * w16select.c (Fx_selection_exists_p): Sync doc string and
7056 argument list with xselect.c. (Bug#10783)
7057
7058 2012-02-10 Glenn Morris <rgm@gnu.org>
7059
7060 * fns.c (Fsecure_hash): Doc fix.
7061
7062 2012-02-09 Kenichi Handa <handa@m17n.org>
7063
7064 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7065
7066 2012-02-07 Chong Yidong <cyd@gnu.org>
7067
7068 * buffer.c (Fbuffer_local_variables)
7069 (buffer_lisp_local_variables): Handle unbound vars correctly;
7070 don't let Qunbound leak into Lisp.
7071
7072 2012-02-07 Glenn Morris <rgm@gnu.org>
7073
7074 * image.c (Fimagemagick_types): Doc fix.
7075
7076 * image.c (imagemagick-render-type): Change it from a lisp object
7077 to an integer. Move the doc here from the lisp manual.
7078 Treat all values not equal to 0 the same.
7079
7080 2012-02-06 Chong Yidong <cyd@gnu.org>
7081
7082 * doc.c (store_function_docstring): Avoid applying docstring of
7083 alias to base function (Bug#2603).
7084
7085 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7086
7087 * .gdbinit (pp1, pv1): Remove redundant defines.
7088 (pr): Use pp.
7089
7090 2012-02-04 Chong Yidong <cyd@gnu.org>
7091
7092 * nsterm.m: Declare a global (Bug#10694).
7093
7094 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7095
7096 * w32.c (get_emacs_configuration_options):
7097 Include --enable-checking, if specified, in the return value.
7098
7099 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7100
7101 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7102 after rounding frame sizes. (Bug#9723)
7103
7104 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7105
7106 * keyboard.c (adjust_point_for_property): Don't position point
7107 before BEGV. (Bug#10696)
7108
7109 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7110
7111 Handle overflow when computing char display width (Bug#9496).
7112 * character.c (char_width): Return EMACS_INT, not int.
7113 (char_width, c_string_width): Check for overflow when
7114 computing the width; this is possible now that individual
7115 characters can have unbounded width. Problem introduced
7116 by merge from Emacs 23 on 2012-01-19.
7117
7118 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7119
7120 * dbusbind.c (Fdbus_register_method): Mention the return value
7121 :ignore in the docstring.
7122
7123 2012-02-02 Glenn Morris <rgm@gnu.org>
7124
7125 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7126
7127 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7128 Unconditionally set to t. (Bug#10673)
7129 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7130 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7131 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7132
7133 2012-02-02 Kenichi Handa <handa@m17n.org>
7134
7135 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7136 0, do not call append_composite_glyph.
7137
7138 2012-02-02 Kenichi Handa <handa@m17n.org>
7139
7140 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7141 NULL (Bug#6988).
7142 (x_produce_glyphs): If the component of a composition is a null
7143 string, set it->pixel_width to 1 to avoid zero-width glyph.
7144
7145 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7146
7147 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7148 first 2 arguments are identical. This makes inserting large
7149 output from a subprocess an order of magnitude faster on
7150 MS-Windows, where all sbrk'ed memory is always contiguous.
7151
7152 2012-01-31 Glenn Morris <rgm@gnu.org>
7153
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>: Sync docs.
7157
7158 2012-01-29 Glenn Morris <rgm@gnu.org>
7159
7160 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7161
7162 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7163
7164 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7165
7166 2012-01-28 Chong Yidong <cyd@gnu.org>
7167
7168 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7169
7170 2012-01-26 Chong Yidong <cyd@gnu.org>
7171
7172 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7173
7174 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7175 repeat counts (Bug#10507).
7176
7177 2012-01-26 Glenn Morris <rgm@gnu.org>
7178
7179 * lread.c (syms_of_lread): Doc fix.
7180
7181 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7182
7183 * coding.c (encode_designation_at_bol): Change return value to
7184 EMACS_INT.
7185
7186 2012-01-25 Chong Yidong <cyd@gnu.org>
7187
7188 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7189
7190 2012-01-21 Chong Yidong <cyd@gnu.org>
7191
7192 * floatfns.c (Fcopysign): Make the second argument non-optional,
7193 since nil is not allowed anyway.
7194
7195 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7196
7197 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7198 (send_process): Likewise.
7199
7200 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7201
7202 * window.c (save_window_save, Fcurrent_window_configuration)
7203 (Vwindow_persistent_parameters): Do not use Qstate.
7204 Rewrite doc-strings.
7205
7206 2012-01-19 Kenichi Handa <handa@m17n.org>
7207
7208 * character.c (char_width): New function.
7209 (Fchar_width, c_string_width, lisp_string_width):
7210 Use char_width (Bug#9496).
7211
7212 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7213
7214 * window.c (Vwindow_persistent_parameters): New variable.
7215 (Fset_window_configuration, save_window_save): Handle persistent
7216 window parameters.
7217
7218 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7219
7220 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7221 thrashing the stack of the thread. (Bug#9087)
7222
7223 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7224
7225 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7226
7227 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7228
7229 * xdisp.c (rows_from_pos_range): Handle the case where the
7230 highlight ends on a newline. (Bug#10464)
7231 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7232 he end column for display of highlight that ends on a newline
7233 before a R2L line.
7234
7235 2012-01-11 Glenn Morris <rgm@gnu.org>
7236
7237 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7238 from load-path also when installation-directory is nil. (Bug#10208)
7239
7240 2012-01-10 Glenn Morris <rgm@gnu.org>
7241
7242 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7243
7244 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7245 Update template values to be closer to their typical values these days.
7246
7247 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7248
7249 * xdisp.c (rows_from_pos_range): Accept additional argument
7250 DISP_STRING, and accept any glyph in a row whose object is that
7251 string as eligible for mouse highlight. Fixes mouse highlight of
7252 display strings from overlays. (Bug#10464)
7253
7254 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7255
7256 emacs: fix an auto-save permissions race condition (Bug#10400)
7257 * fileio.c (auto_saving_dir_umask): New static var.
7258 (Fmake_directory_internal): Use it.
7259 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7260 creating the directory. The old code temporarily assigns
7261 too-generous permissions to the directory.
7262 (do_auto_save_eh): Clear it.
7263 (Fdo_auto_save): Catch all errors, not just file errors, so
7264 that the var is always cleared.
7265
7266 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7267
7268 * search.c (scan_buffer): Pass character positions to
7269 know_region_cache, not byte positions. (Bug#6540)
7270
7271 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7272
7273 * w32.c (sys_rename): Report EXDEV when rename of a directory
7274 fails because the target is on another logical disk. (Bug#10284)
7275
7276 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7277
7278 * xterm.c (x_embed_request_focus): New function.
7279
7280 * xterm.h: Add prototype.
7281
7282 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7283
7284 2012-01-05 Glenn Morris <rgm@gnu.org>
7285
7286 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7287
7288 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7289
7290 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7291 Load gnutls_transport_set_lowat only if GnuTLS version is below
7292 2.11.1.
7293 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7294 GnuTLS versions below 2.11.1.
7295
7296 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7297
7298 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7299 to the doc string advising against its use for altering the way
7300 windows are scrolled.
7301
7302 2011-12-28 Kenichi Handa <handa@m17n.org>
7303
7304 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7305 coding-system ASCII compatible only when it does not produce BOM
7306 on encoding (Bug#10383).
7307
7308 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7309
7310 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7311 can scroll.
7312 (create_and_show_popup_menu): Always use menu_position_func for
7313 Gtk3 (Bug#10361).
7314
7315 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7316
7317 * callint.c (Fcall_interactively): Don't truncate prompt string.
7318
7319 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7320
7321 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7322 property that ends at ZV, so that the bidi iteration could be
7323 resumed from there (after widening). (Bug#10360)
7324
7325 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7326
7327 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7328
7329 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7330
7331 * nsterm.m (x_free_frame_resources):
7332 Release f->output_data.ns->miniimage.
7333 (ns_index_color): Fix indentation. Do not retain
7334 color_table->colors[i].
7335
7336 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7337 before returning.
7338
7339 * nsfns.m (x_set_background_color): Assign return value from
7340 ns_index_color to face-background instead of NSColor*.
7341 (ns_implicitly_set_icon_type): Fix indentation.
7342 Change assignment in for loop to comparison.
7343
7344 * emacs.c (ns_pool): New variable.
7345 (main): Assign ns_pool.
7346 (Fkill_emacs): Call ns_release_autorelease_pool.
7347
7348 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7349 autorelease fdesc, release fdAttrs and tdict.
7350 (ns_get_covering_families): Release charset.
7351 (ns_findfonts): Release NSFontDescriptor created with new.
7352 (ns_uni_to_glyphs): Fix indentation.
7353 (setString): Release attrStr before assigning new value.
7354
7355 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7356
7357 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7358 and NS_IMPL_COCOA.
7359 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7360 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7361
7362 2011-12-18 David Reitter <reitter@cmu.edu>
7363
7364 * nsterm.m (ns_term_init): Subscribe for notifications
7365 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7366 to method trackingNotification in EmacsMenu.
7367
7368 * nsmenu.m (trackingMenu): New variable.
7369 (trackingNotification): New method (from Aquamacs).
7370 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7371 from Aquamacs (Bug#7030).
7372
7373 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7374
7375 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7376 (symbol_to_nsstring): Fix indentation.
7377 (ns_symbol_to_pb): New function.
7378 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7379 (Fns_rotate_cut_buffers_internal): Remove.
7380 (Fns_store_selection_internal): Rename from
7381 Fns_store_cut_buffer_internal.
7382 (ns_get_foreign_selection, Fx_own_selection_internal)
7383 (Fx_disown_selection_internal, Fx_selection_exists_p)
7384 (Fns_get_selection_internal, Fns_store_selection_internal):
7385 Use ns_symbol_to_pb and check if return value is nil.
7386 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7387 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7388 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7389 renamed to Sns_store_selection_internal.
7390 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7391 and remove this function.
7392 (ns_handle_selection_clear): Remove, never used.
7393 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7394 here.
7395
7396 2011-12-17 Ken Brown <kbrown@cornell.edu>
7397
7398 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7399 GID is unknown (Bug#10257).
7400
7401 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7402
7403 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7404 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7405 which caused a build failure on GNU/Linux IA-64. This problem was
7406 introduced by my 2011-10-07 patch.
7407
7408 2011-12-15 Juri Linkov <juri@jurta.org>
7409
7410 * image.c (imagemagick_error): New function. (Bug#10112)
7411 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7412 Use `imagemagick_error' where ImageMagick functions return
7413 `MagickFalse'.
7414 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7415 proper order.
7416
7417 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7418
7419 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7420 fill background (Bug#8992).
7421
7422 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7423
7424 * window.c (Vwindow_combination_resize)
7425 (Vwindow_combination_limit): Use t instead of non-nil in
7426 doc-strings.
7427 (Vrecenter_redisplay): Add first sentence of doc-string on
7428 separate line.
7429 (Frecenter): Fix doc-string typo.
7430
7431 2011-12-11 Kenichi Handa <handa@m17n.org>
7432
7433 * coding.c (Funencodable_char_position): Pay attention to the
7434 buffer text relocation (Bug#9389).
7435
7436 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7437
7438 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7439 gtk_init (Bug#10100).
7440
7441 2011-12-10 Eli Zaretskii <eliz@gnu.org>
7442
7443 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7444 IT->string is nil. (Bug#10263)
7445
7446 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7447
7448 * nsterm.h (x_free_frame_resources): Declare.
7449
7450 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7451 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7452
7453 * nsterm.h (ns_get_defaults_value): Declare.
7454
7455 * nsterm.m (ns_default): Call ns_get_defaults_value.
7456
7457 2011-12-09 Eli Zaretskii <eliz@gnu.org>
7458
7459 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7460 (Bug#10170)
7461
7462 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7463
7464 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7465 that where the value of an _OBJC_* symbol points to is in the .bss
7466 section (Bug#10240).
7467
7468 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7469
7470 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
7471 after the loop to call ccl_driver at least once (Bug#8619).
7472
7473 2011-12-08 Kenichi Handa <handa@m17n.org>
7474
7475 * ftfont.c (get_adstyle_property): Fix previous change
7476 (Bug#10233).
7477
7478 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
7479
7480 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7481 dirs from the default value of EMACSLOADPATH (bug#10208).
7482
7483 2011-12-07 Glenn Morris <rgm@gnu.org>
7484
7485 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7486 installation and source directories as well. (Bug#10208)
7487
7488 2011-12-06 Chong Yidong <cyd@gnu.org>
7489
7490 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7491
7492 2011-12-06 Glenn Morris <rgm@gnu.org>
7493
7494 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7495 as an error, not just -1. (Bug#10217)
7496
7497 2011-12-05 Chong Yidong <cyd@gnu.org>
7498
7499 * keyboard.c (process_special_events): New function.
7500 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7501
7502 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * coding.c (encode_designation_at_bol): Don't use uninitialized
7505 local variable (Bug#9318).
7506
7507 2011-12-05 Kenichi Handa <handa@m17n.org>
7508
7509 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7510 return Qnil (Bug#8046, Bug#10193).
7511
7512 2011-12-05 Kenichi Handa <handa@m17n.org>
7513
7514 * coding.c (encode_designation_at_bol): New args charbuf_end and
7515 dst. Return the number of produced bytes. Callers changed.
7516 (coding_set_source): Return how many bytes coding->source was
7517 relocated.
7518 (coding_set_destination): Return how many bytes
7519 coding->destination was relocated.
7520 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
7521 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
7522
7523 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7524
7525 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7526 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7527 macro (Bug#9318).
7528
7529 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7530
7531 The following changes are to fix Bug#9318.
7532
7533 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
7534 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7535 (encode_coding_iso_2022, encode_coding_sjis)
7536 (encode_coding_big5, encode_coding_charset): Use the above macros.
7537
7538 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
7539
7540 * lisp.h (process_quit_flag): Fix external declaration.
7541
7542 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7543
7544 Don't macro-inline non-performance-critical code.
7545 * eval.c (process_quit_flag): New function.
7546 * lisp.h (QUIT): Use it.
7547
7548 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7549
7550 * nsfns.m (get_geometry_from_preferences): New function.
7551 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7552
7553 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7554
7555 * emacs.c (Qkill_emacs): Define.
7556 (syms_of_emacs): Initialize it.
7557 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7558 Qquit_flag to `kill-emacs' instead.
7559 (quit_throw_to_read_char): Add parameter `from_signal'.
7560 All callers changed. Call Fkill_emacs if requested and safe.
7561 * lisp.h (QUIT): Call Fkill_emacs if requested.
7562
7563 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7564
7565 * widget.c (update_wm_hints): Return if wmshell is null.
7566 (widget_update_wm_size_hints): New function.
7567
7568 * widget.h (widget_update_wm_size_hints): Declare.
7569
7570 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7571 widget_update_wm_size_hints (Bug#10104).
7572
7573 2011-12-03 Eli Zaretskii <eliz@gnu.org>
7574
7575 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7576 before a newline, prepare the bidi iterator for consuming the
7577 newline, and keep the current paragraph direction. (Bug#10183)
7578 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
7579
7580 2011-12-02 Juri Linkov <juri@jurta.org>
7581
7582 * search.c (Fword_search_regexp): New Lisp function created from
7583 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7584 (Fword_search_backward, Fword_search_forward)
7585 (Fword_search_backward_lax, Fword_search_forward_lax):
7586 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7587 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7588
7589 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7590
7591 * fileio.c (Finsert_file_contents): Move after-change-function call
7592 to before the "handled:" label, since all "goto handled" appear in
7593 cases where the *-change-functions have already been properly called
7594 (bug#10117).
7595
7596 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7597
7598 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7599 waiting for input. (Bug#10169)
7600
7601 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7602
7603 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7604 verifies glyph row's hash code--we have just reallocated the
7605 glyphs, so their contents can be complete garbage. (Bug#10164)
7606
7607 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
7608
7609 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7610
7611 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7612
7613 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7614 attributes are tested _before_ calling verify_row_hash, to protect
7615 against GCC re-ordering of the tests. (Bug#10164)
7616
7617 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7618
7619 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7620
7621 * xterm.c (handle_one_xevent): Only set async_visible and friends
7622 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7623 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
7624 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7625
7626 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7627
7628 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7629 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7630 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7631 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7632 All uses changed to use GCPRO1 etc.
7633 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7634 Revert to old implementation (i.e., before 2011-03-11).
7635
7636 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7637
7638 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7639 of scroll runs so as to avoid assigning disabled bogus rows and
7640 unnecessary graphics copy operations.
7641
7642 2011-11-27 Eli Zaretskii <eliz@gnu.org>
7643
7644 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7645 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7646 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7647 (malloc, free, realloc, calloc): Redirect to e_* only when
7648 compiling Emacs.
7649
7650 * lisp.h (GCTYPEBITS): Move before first use.
7651 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7652 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7653 this macro definition.
7654
7655 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7656 _MSC_VER.
7657
7658 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7659
7660 * gtkutil.c (xg_create_frame_widgets):
7661 Call gtk_window_set_has_resize_grip (FALSE) if that function is
7662 present with Gtk+ 2.0.
7663
7664 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7665
7666 * fileio.c (Finsert_file_contents): Undo previous change; see
7667 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7668
7669 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7670
7671 Rename locals to avoid shadowing.
7672 * fileio.c (Finsert_file_contents):
7673 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7674 * process.c (wait_reading_process_output):
7675 Rename inner 'proc' to 'p' to avoid shadowing.
7676 Indent for consistency with usual Emacs style.
7677
7678 2011-11-25 Eli Zaretskii <eliz@gnu.org>
7679
7680 * xdisp.c (redisplay_window): If cursor row is not fully visible
7681 after recentering, and scroll-conservatively is set to a large
7682 number, scroll window by a few more lines to make the cursor fully
7683 visible and out of scroll-margin. (Bug#10105)
7684 (start_display): Don't move to the next line if the display should
7685 start at a newline that is part of a display vector or an overlay
7686 string. (Bug#10119)
7687
7688 2011-11-24 Juri Linkov <juri@jurta.org>
7689
7690 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7691 after the `MagickPingImage' call. (Bug#10112)
7692
7693 2011-11-23 Chong Yidong <cyd@gnu.org>
7694
7695 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7696
7697 2011-11-23 Martin Rudalics <rudalics@gmx.at>
7698
7699 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7700 making another buffer current. (Bug#10114)
7701
7702 2011-11-23 Glenn Morris <rgm@gnu.org>
7703
7704 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7705
7706 2011-11-23 Chong Yidong <cyd@gnu.org>
7707
7708 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7709 using it (Bug#5984).
7710
7711 2011-11-22 Eli Zaretskii <eliz@gnu.org>
7712
7713 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7714 and header-lines, as they don't have one computed for them.
7715 (Bug#10098)
7716
7717 * .gdbinit (prow): Make displayed values more self-explaining.
7718 Add row's hash code.
7719
7720 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7721
7722 * process.c (wait_reading_process_output): Fix asynchrounous
7723 GnuTLS socket handling on some versions of the GnuTLS library.
7724 (wait_reading_process_output): Add comment and URL.
7725
7726 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7727
7728 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7729
7730 2011-11-21 Chong Yidong <cyd@gnu.org>
7731
7732 * window.c (Fnext_window, Fprevious_window): Doc fix.
7733
7734 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7735
7736 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7737
7738 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7739
7740 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7741
7742 2011-11-20 Martin Rudalics <rudalics@gmx.at>
7743
7744 * window.c (Fset_window_combination_limit): Rename argument
7745 STATUS to LIMIT.
7746 (Vwindow_combination_limit): Remove "status" from doc-string.
7747
7748 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7749
7750 * m/ibms390.h: Remove.
7751 * m/ibms390x.h: Don't include "ibms390.h".
7752
7753 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7754
7755 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7756 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7757
7758 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7759
7760 * casetab.c (Fset_case_table):
7761 * charset.c (Fcharset_after): Fix typos.
7762
7763 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
7764
7765 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7766 Otherwise, valgrind does not work on some platforms.
7767 Problem reported by Andreas Schwab in
7768 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7769 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7770 is set, removing the need for VIRT_ADDRESS_VARIES.
7771 (PURE_P): Use a more-efficient implementation that needs just one
7772 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7773 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7774 to 4 (xorl, subq, cmpq, setbe).
7775 * alloc.c (pure): Always extern now, since that's the
7776 VIRT_ADDR_VARIES behavior.
7777 (PURE_POINTER_P): Use a single comparison, not two, for
7778 consistency with the new puresize.h.
7779 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7780 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7781 Remove VIRT_ADDR_VARIES no longer needed.
7782
7783 2011-11-19 Eli Zaretskii <eliz@gnu.org>
7784
7785 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7786 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7787 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7788 behave as if the cursor position were at the window margin.
7789
7790 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7791 and the cursor position is out of bounds, behave as if the cursor
7792 position were at the window margin. (Bug#10075)
7793
7794 2011-11-18 Chong Yidong <cyd@gnu.org>
7795
7796 * window.c (Fwindow_combination_limit): Make first argument
7797 non-optional, since it is meaningless for live windows like the
7798 selected window.
7799
7800 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7801
7802 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7803
7804 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7805
7806 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7807 (graft_intervals_into_buffer): Simplify.
7808
7809 2011-11-18 Eli Zaretskii <eliz@gnu.org>
7810
7811 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7812 hash values of the two rows.
7813 (copy_row_except_pointers): Preserve the used[] arrays and the
7814 hash values of the two rows. (Bug#10035)
7815 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
7816
7817 * xdisp.c (row_hash): New function, body extracted from
7818 compute_line_metrics.
7819 (compute_line_metrics): Call row_hash, instead of computing the
7820 hash code inline.
7821
7822 * dispnew.c (verify_row_hash): Call row_hash for computing the
7823 hash code of a row, instead of duplicating code from xdisp.c.
7824
7825 * dispextern.h (row_hash): Add prototype.
7826
7827 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7828
7829 * frame.c (delete_frame): Don't delete the terminal when the last
7830 X frame is closed if emacs is built with GTK toolkit.
7831
7832 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
7833
7834 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7835
7836 2011-11-17 Martin Rudalics <rudalics@gmx.at>
7837
7838 * window.c (Vwindow_splits): Rename to
7839 Vwindow_combination_resize. Suggested by Juri Linkov.
7840 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7841 of Vwindow_splits.
7842
7843 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
7844
7845 * nsfns.m (Fns_font_name):
7846 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
7847
7848 2011-11-16 Martin Rudalics <rudalics@gmx.at>
7849
7850 * window.h (window): Rename slot "nest" to "combination_limit".
7851 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7852 (Fset_window_nest): Rename to Fset_window_combination_limit.
7853 (Vwindow_nest): Rename to Vwindow_combination_limit.
7854 (recombine_windows, make_parent_window, make_window)
7855 (Fsplit_window_internal, saved_window)
7856 (Fset_window_configuration, save_window_save): Rename all
7857 occurrences of window_nest to window_combination_limit.
7858
7859 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
7860
7861 * image.c (imagemagick_load_image): Fix typo.
7862
7863 2011-11-14 Eli Zaretskii <eliz@gnu.org>
7864
7865 * xdisp.c (display_line): Move the call to
7866 highlight_trailing_whitespace before the call to
7867 compute_line_metrics, since the latter needs to see the final
7868 faces of all the glyphs to compute ROW's hash value.
7869 Fixes assertion violations in row_equal_p. (Bug#10035)
7870
7871 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
7872
7873 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7874 just return (bug#10044).
7875
7876 2011-11-12 Eli Zaretskii <eliz@gnu.org>
7877
7878 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7879 with user-defined heap size. Bump the default size of the temacs
7880 heap to 27MB, to avoid memory warning when running temacs.
7881 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7882
7883 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7884 current_matrix and desired_matrix. (Bug#9990)
7885 (verify_row_hash) [XASSERTS]: New function.
7886 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7887 that the hash value of glyph rows is correct.
7888
7889 2011-11-12 Martin Rudalics <rudalics@gmx.at>
7890
7891 * window.h (window): Remove splits slot.
7892 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7893 (Fdelete_other_windows_internal, make_parent_window)
7894 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7895 (Fset_window_configuration, save_window_save): Don't deal with
7896 split status of windows.
7897 (saved_window): Remove splits slot.
7898 (Vwindow_splits): Rewrite doc-string.
7899
7900 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7901
7902 * xfns.c (unwind_create_frame):
7903 * nsfns.m (unwind_create_frame):
7904 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7905 Vframe_list (Bug#9999).
7906
7907 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7908
7909 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
7910
7911 2011-11-11 Kenichi Handa <handa@m17n.org>
7912
7913 * callproc.c (Fcall_process): Set the member dst_multibyte of
7914 process_coding.
7915
7916 2011-11-11 Johan Bockgård <bojohan@gnu.org>
7917
7918 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7919 avoid a crash (bug#9496).
7920
7921 2011-11-09 Chong Yidong <cyd@gnu.org>
7922
7923 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7924 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7925
7926 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7927
7928 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7929
7930 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7931
7932 Avoid some portability problems by eschewing 'extern inline' functions.
7933 The trivial performance wins aren't worth the portability hassles; see
7934 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7935 et seq.
7936 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7937 (window_box_width, window_box_left, window_box_left_offset)
7938 (window_box_right, window_box_right_offset): Undo previous change,
7939 by removing the "extern"s.
7940 * intervals.c (adjust_intervals_for_insertion)
7941 (adjust_intervals_for_deletion): Undo previous change,
7942 making these static again.
7943 (offset_intervals, temp_set_point_both, temp_set_point)
7944 (copy_intervals_to_string): No longer inline.
7945 * xdisp.c (window_text_bottom_y, window_box_width)
7946 (window_box_height, window_box_left_offset)
7947 (window_box_right_offset, window_box_left, window_box_right)
7948 (window_box): No longer inline.
7949
7950 2011-11-08 Chong Yidong <cyd@gnu.org>
7951
7952 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
7953 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7954 Signal an error if not a live window.
7955 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7956 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7957
7958 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
7959
7960 * lisp.h (syms_of_abbrev): Remove declaration.
7961 Reported by CHENG Gao <chenggao@royau.me>.
7962
7963 2011-11-07 Eli Zaretskii <eliz@gnu.org>
7964
7965 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7966 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7967 of temacs in GUI mode.
7968
7969 2011-11-07 Martin Rudalics <rudalics@gmx.at>
7970
7971 * window.h: Declare delete_all_child_windows instead of
7972 delete_all_subwindows.
7973 * window.c (Fwindow_nest, Fset_window_nest)
7974 (Fset_window_new_total, Fset_window_new_normal)
7975 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7976 (delete_all_subwindows): Rename to delete_all_child_windows.
7977 (Fdelete_other_windows_internal, Fset_window_configuration):
7978 Call delete_all_child_windows instead of delete_all_subwindows.
7979 * frame.c (delete_frame): Call delete_all_child_windows instead
7980 of delete_all_subwindows.
7981
7982 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7983
7984 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7985 This is also needed for porting to any host where GC_MARK_STACK is
7986 not GC_MAKE_GCPROS_NOOPS.
7987 (which_symbols): Use it.
7988
7989 2011-11-07 Kenichi Handa <handa@m17n.org>
7990
7991 * coding.c (coding_set_destination): Check coding->src_pos only
7992 when coding->src_object is a buffer (bug#9910).
7993
7994 * process.c (send_process): Set the member src_multibyte of coding
7995 to 0 (bug#9911) when sending a unibyte text.
7996
7997 * callproc.c (Fcall_process): Set the member src_multibyte of
7998 process_coding to 0 (bug#9912).
7999
8000 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8001
8002 * xmenu.c (cleanup_widget_value_tree): New function.
8003 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8004 calling free_menubar_widget_value_tree directly (Bug#9830).
8005
8006 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8007
8008 Fix some portability problems with 'inline'.
8009 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8010 (window_box_width, window_box_left, window_box_left_offset)
8011 (window_box_right, window_box_right_offset): Declare extern.
8012 Otherwise, these inline functions do not conform to C99 and
8013 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8014 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8015 * intervals.c (adjust_intervals_for_insertion)
8016 (adjust_intervals_for_deletion): Now extern, because otherwise the
8017 extern inline functions 'offset_intervals' couldn't refer to it.
8018 (static_offset_intervals): Remove.
8019 (offset_intervals): Rewrite using the old contents of
8020 static_offset_intervals. The old version didn't conform to C99
8021 because an extern inline function contained a reference to an
8022 identifier with static linkage.
8023
8024 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8025
8026 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8027 GC.
8028
8029 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8030
8031 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8032 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8033 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8034 return Qleft_to_right.
8035
8036 2011-11-06 Chong Yidong <cyd@gnu.org>
8037
8038 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8039 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8040 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8041 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8042 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8043 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8044 (Fwindow_vscroll): Doc fix.
8045 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8046 argument, since it makes no sense to pass a live window and for
8047 consistency with window-child.
8048
8049 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8050
8051 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8052 support MSVC.
8053
8054 2011-11-05 Jason Rumney <jasonr@gnu.org>
8055
8056 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8057 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8058 fonts (Bug#6029).
8059 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8060 bitwise arithmetic preventing use of unicode-sip and non-truetype
8061 opentype fonts.
8062
8063 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8064
8065 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8066 "emacs"-only part.
8067
8068 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8069 initialization code to keep similarity to xfns.c after changes
8070 from 2011-11-05.
8071
8072 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8073
8074 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8075 (unwind_create_frame): New function (Bug#9943).
8076 (Fx_create_frame): Restructure code to be more similar to the one in
8077 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8078 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8079 Move terminal->reference_count++ just before making the frame official
8080 (Bug#9943).
8081
8082 * nsterm.m (x_free_frame_resources): New function.
8083 (x_destroy_window): Move code to x_free_frame_resources.
8084
8085 * xfns.c (unwind_create_frame): Fix comment.
8086 (Fx_create_frame, x_create_tip_frame):
8087 Move terminal->reference_count++ just before making the frame
8088 official. Move initialization of image_cache_refcount and
8089 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8090
8091 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8092
8093 Support MSVC build with newer versions of Visual Studio.
8094 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8095 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8096 nt/gmake.defs.
8097
8098 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8099 which are not supported by MSVC.
8100 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8101 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8102 bitfields.
8103 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8104 types in bitfields.
8105 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8106
8107 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8108
8109 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8110
8111 Support MSVC build with newer versions of Visual Studio.
8112 * w32.c: Don't include w32api.h for MSVC.
8113 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8114
8115 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8116 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8117 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8118 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8119 e_* cousins.
8120 (alloca) [_MSC_VER]: Define to _alloca.
8121
8122 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8123
8124 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8125
8126 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8127
8128 * xdisp.c (note_mouse_highlight): If either of
8129 previous/next-single-property-change returns nil, treat that as
8130 the beginning or the end of the buffer. (Bug#9955)
8131
8132 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8133
8134 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8135 label is not null (Bug#9951).
8136 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8137 may be NULL.
8138
8139 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8140
8141 * window.c (Fwindow_body_size): Mention in the doc string that the
8142 return value is in frame's canonical units. (Bug#9949)
8143
8144 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8145
8146 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8147
8148 * w32fns.c (unwind_create_frame): If needed, free the glyph
8149 matrices of the partially constructed frame. (Bug#9943)
8150 * xfns.c (unwind_create_frame): Likewise.
8151
8152 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8153
8154 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8155 Don't stop backward scan on the continuation glyph, even though
8156 its CHARPOS is positive.
8157 (mouse_face_from_buffer_pos, note_mouse_highlight):
8158 Rename cover_string to disp_string.
8159
8160 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8161
8162 * window.c (temp_output_buffer_show): Don't use
8163 Vtemp_buffer_show_specifiers.
8164 (Vtemp_buffer_show_specifiers): Remove unused variable.
8165
8166 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8167
8168 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8169 past the beginning of the current glyph matrix.
8170
8171 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8172
8173 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8174 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8175 HAVE_GTK3 (Bug#9869).
8176
8177 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8178 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8179
8180 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8181
8182 * xterm.c: Declare x_handle_net_wm_state to return int.
8183 (handle_one_xevent): Check if we are iconified but don't have
8184 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8185 (get_current_wm_state): Return non-zero if not hidden,
8186 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8187 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8188 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8189 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8190
8191 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8192
8193 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8194 so that this new function doesn't get optimized away by a
8195 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8196
8197 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8198
8199 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8200
8201 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8202
8203 Fix the `xbytecode' command.
8204 * .gdbinit (xprintbytestr): New command.
8205 (xwhichsymbols): Rename from `which'; all callers changed.
8206 (xbytecode): Print the byte-code string as well.
8207
8208 2011-10-29 Kim Storm <storm@cua.dk>
8209
8210 * alloc.c (which_symbols): New function.
8211
8212 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8213
8214 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8215 line. (Bug#9903)
8216
8217 2011-10-29 Glenn Morris <rgm@gnu.org>
8218
8219 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8220 Not clear what it was for, and it causes various bugs. (Bug#9839)
8221
8222 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8223
8224 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8225 possible random value that matches one of those tested as
8226 condition to clear the mouse face.
8227
8228 2011-10-28 Chong Yidong <cyd@gnu.org>
8229
8230 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8231
8232 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8233
8234 * window.c (make_window): Initialize phys_cursor_on_p.
8235
8236 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8237
8238 * lisp.h (struct Lisp_Symbol): Update comments.
8239
8240 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8241
8242 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8243
8244 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8245
8246 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8247 <oslsachem@gmail.com> for helping to debug this.
8248
8249 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8250 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8251 (g_b_init_get_glyph_outline_w): New static variables.
8252 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8253 (GetGlyphOutlineW_Proc): New typedefs.
8254 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8255 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8256 New functions.
8257 (w32font_open_internal, compute_metrics):
8258 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8259 instead of calling the "wide" APIs directly.
8260
8261 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8262
8263 * w32.h (syms_of_w32font): Add prototype.
8264
8265 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8266
8267 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8268 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8269 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8270 (Fmove_to_window_line): Doc fix.
8271
8272 2011-10-27 Chong Yidong <cyd@gnu.org>
8273
8274 * process.c (make_process): Set gnutls_state to NULL.
8275
8276 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8277 non-NULL, regardless of GNUTLS_INITSTAGE.
8278 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8279 an error. Set process slots as soon as we allocate them.
8280
8281 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8282
8283 2011-10-27 Chong Yidong <cyd@gnu.org>
8284
8285 * gnutls.c (emacs_gnutls_deinit): New function.
8286 Deallocate credentials structures as well as calling gnutls_deinit.
8287 (Fgnutls_deinit, Fgnutls_boot): Use it.
8288
8289 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8290 (deactivate_process): Call emacs_gnutls_deinit.
8291
8292 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8293
8294 * image.c (x_create_x_image_and_pixmap):
8295 * w32.c (sys_rename, w32_delayed_load):
8296 * w32font.c (fill_in_logfont):
8297 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8298
8299 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8300
8301 * w32fns.c (w32_default_color_map): New function,
8302 extracted from Fw32_default_color_map.
8303 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8304
8305 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8308
8309 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8310
8311 * keyboard.c (test_undefined): New function (bug#9751).
8312 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8313
8314 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8315
8316 * sysdep.c (init_sys_modes): Fix the check for the controlling
8317 terminal (Bug#6649).
8318
8319 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8320
8321 * dispextern.h (struct bidi_it): New member next_en_type.
8322
8323 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8324 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8325 current character, check also for next_en_type being WEAK_EN.
8326 (bidi_resolve_weak): Don't enter the expensive loop if the current
8327 position is before next_en_pos. Record the bidi type of the first
8328 non-ET, non-BN character we find, in addition to its position.
8329 (bidi_level_of_next_char): Invalidate next_en_type when
8330 next_en_pos is over-stepped.
8331
8332 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8333
8334 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8335 * editfns.c: Rewrite current-time-zone so that it invokes
8336 the equivalent of (format-time-string "%Z") to get the time zone name.
8337 This fixes a bug when the time zone name contains characters that
8338 need converting from the system time locale to Emacs internal format.
8339 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8340 that patch fixed format-time-string to do the conversion, but
8341 I forgot to fix current-time-zone.
8342 (format_time_string): New function, containing most of
8343 what Fformat_time_string used to contain.
8344 (Fformat_time_string): Rewrite in terms of format_time_string.
8345 This doesn't change this function's behavior.
8346 (current-time-zone): Rewrite to use format_time_string.
8347 This fixes the bug reported by Michael Schierl in
8348 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8349 Jason Rumney's 2007-06-07 change worked around this bug, but
8350 didn't fix it.
8351 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8352
8353 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8354
8355 * xdisp.c (start_display): If the character at POS is displayed
8356 via a display vector, reset IT->current.dpvec_index to zero.
8357 (try_window_reusing_current_matrix): If a line ends in a display
8358 vector or the next line starts in a display vector, continue
8359 redrawing the window even though the character position of
8360 start_row was reached.
8361 (Bug#9771, part 2)
8362
8363 2011-10-18 Chong Yidong <cyd@gnu.org>
8364
8365 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8366 with nobreak-char-display too.
8367
8368 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8369
8370 Fix part 3 of bug#9771.
8371 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8372 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8373 non-neutral characters if the current character is a paragraph
8374 separator (a.k.a. Newline). This avoids running the same
8375 expensive loop twice, once when we consume the preceding newline
8376 and the other time when the line actually needs to be displayed.
8377 Avoid the loop when we see neutrals on the base embedding level
8378 following a character whose directionality is the same as the
8379 paragraph's. This avoids running the expensive loop when a line
8380 ends in a long sequence of neutrals, like control characters.
8381 Add assertion against STRONG_AL type. Slightly rearrange code
8382 that determines the type of a neutral given the first non-neutral
8383 that follows it.
8384 (bidi_level_of_next_char): Set next_en_pos to zero when
8385 invalidating its info.
8386
8387 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8388
8389 * xdisp.c (push_display_prop): Determine whether to record string
8390 or buffer position by IT->string, not by IT->method. Allow
8391 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8392 (move_it_vertically_backward): Don't look for character position
8393 immediately after the newline when in a continuation line.
8394 (Bug#9771, part 1)
8395
8396 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8397
8398 * window.c (coordinates_in_window): Rewrite and delabelize
8399 vertical border check. (Bug#5357) (Bug#9618)
8400
8401 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8402
8403 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8404 errors in XSetWindowBorder (bug#9310).
8405
8406 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8407
8408 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8409 avoid crash when xmalloc overrun checking is enabled.
8410
8411 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8412
8413 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8414 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8415 cursor motion with <left> and <right> arrow keys.
8416
8417 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8418 some callers set that themselves.
8419
8420 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8421
8422 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8423 display string and the previous row comes from the same string and
8424 is empty. (Bug#9739) (Bug#9738)
8425
8426 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8427
8428 * doc.c (get_doc_string): Encode file name (bug#9735).
8429
8430 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8431
8432 * bidi.c (bidi_level_of_next_char):
8433 * xdisp.c (get_visually_first_element): Remove old incorrect
8434 comments regarding the Unicode Line Separator character.
8435
8436 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8437
8438 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8439
8440 * alloc.c (Fgc_status): Do not access beyond zombies array
8441 boundary if nzombies > MAX_ZOMBIES.
8442 * alloc.c (dump_zombies): Add missing format specifier.
8443
8444 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8445
8446 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8447 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8448
8449 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8450 Some packages use them to denote characters with modifiers.
8451
8452 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8453
8454 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8455 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8456 matching a pp-number. Rename parameter var to var1.
8457
8458 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8459
8460 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8461
8462 2011-10-08 Glenn Morris <rgm@gnu.org>
8463
8464 * callint.c (Fcall_interactively): Give a more explicit error for the
8465 'c' case with a non-character input. (Bug#8479)
8466
8467 2011-10-08 Eli Zaretskii <eliz@gnu.org>
8468
8469 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8470 lines.
8471 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8472 lines that are hscrolled on the left.
8473
8474 * dispnew.c (buffer_posn_from_coords): Account for a possible
8475 presence of header-line. (Bug#4426)
8476
8477 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8478
8479 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8480 Don't advertise functionality which we discourage or doesn't work.
8481
8482 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8483
8484 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8485 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8486 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8487 this makes Emacs dump core during garbage collection on rare
8488 occasions. sizeof is obviously inferior to offsetof here, so
8489 stick with offsetof.
8490 (GC_POINTER_ALIGNMENT): New macro.
8491 (mark_memory): Omit 3rd (offset) arg; caller changed.
8492 Don't assume EMACS_INT alignment is the same as pointer alignment.
8493
8494 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8495
8496 * keyboard.c (read_key_sequence_remapped): New var.
8497 (read_key_sequence): Compute remapping in the right buffer.
8498 (command_loop_1): Use read_key_sequence's remapping directly.
8499
8500 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8501
8502 * dired.c (file_name_completion): Don't expand file name.
8503 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8504 before checking file name handler.
8505
8506 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8507 they've been requested explicitly (bug#9591).
8508
8509 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
8510
8511 * keymap.c (Fsingle_key_description): Use make_specified_string
8512 instead of build_string to build string from push_key_description.
8513 (Bug#5193)
8514
8515 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8516
8517 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8518 This fixes a Y2038 bug on 64-bit hosts.
8519 * buffer.c (reset_buffer):
8520 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8521 (Fclear_buffer_auto_save_failure):
8522 Use 0, not -1, to represent an unset failure time, since time_t
8523 might not be signed.
8524
8525 Remove dependency on glibc malloc internals.
8526 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8527 Move back here from lisp.h, but with their new implementations.
8528 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8529 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8530 * charset.c (charset_table_init): New static var.
8531 (syms_of_charset): Use it instead of xmalloc. This removes a
8532 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8533 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8534 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8535 Move back to alloc.c.
8536 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8537 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8538
8539 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8540
8541 * nsterm.m (windowDidResize): Call x_set_window_size only when
8542 ns_in_resize is true. Otherwise set pixelwidth/height and
8543 call change_frame_size (Bug#9628).
8544
8545 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8546
8547 Port --enable-checking=all to Fedora 14 x86-64.
8548 * charset.c (syms_of_charset): Also account for glibc malloc's
8549 internal overhead when calculating the initial malloc maximum.
8550
8551 Port --enable-checking=all to Fedora 14 x86.
8552 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8553 Move to lisp.h.
8554 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8555 (overrun_check_realloc, overrun_check_free):
8556 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8557 That way, xmalloc returns a properly-aligned pointer even if
8558 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8559 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8560 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8561 into account when calculating the initial malloc maximum.
8562 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8563 Move here from alloc.c, so that charset.c can use it too.
8564 Properly align; the old code wasn't right for common 32-bit hosts
8565 when configured with --enable-checking=all.
8566 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8567 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8568
8569 2011-09-29 Eli Zaretskii <eliz@gnu.org>
8570
8571 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
8572 use EDOM.
8573
8574 2011-09-28 Eli Zaretskii <eliz@gnu.org>
8575
8576 * xdisp.c (compute_display_string_end): If there's no display
8577 string at CHARPOS, return -1.
8578
8579 * bidi.c (bidi_fetch_char): When compute_display_string_end
8580 returns a negative value, treat the character as a normal
8581 character not covered by a display string. (Bug#9624)
8582
8583 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
8584
8585 * lread.c (Fread_from_string): Fix typo in docstring.
8586
8587 2011-09-27 Eli Zaretskii <eliz@gnu.org>
8588
8589 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8590 newline, reseat the iterator instead of bidi-iterating there one
8591 character at a time. (Bug#9610)
8592 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8593 TO_CHARPOS if the bidi iterator is at base embedding level.
8594
8595 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8596
8597 * lread.c (readevalloop): Use correct code for NBSP.
8598 (read1): Likewise. (Bug#9608)
8599
8600 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
8601
8602 * dbusbind.c (Fdbus_register_signal): When service is not
8603 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8604
8605 2011-09-25 Glenn Morris <rgm@gnu.org>
8606
8607 * buffer.c (truncate-lines): Doc fix.
8608
8609 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
8610
8611 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8612 (Fset_window_next_buffers): Doc fix.
8613
8614 2011-09-24 Glenn Morris <rgm@gnu.org>
8615
8616 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8617
8618 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8619
8620 Fix minor problems found by static checking.
8621 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
8622 * indent.c (Fvertical_motion): Fix == vs = typo.
8623
8624 2011-09-24 Eli Zaretskii <eliz@gnu.org>
8625
8626 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8627 Default value is now t. Doc fix.
8628
8629 * indent.c (Fvertical_motion): Compute and apply the overshoot
8630 logic when moving up, not only when moving down. Fix the
8631 confusing name and values of the it_overshoot_expected variable;
8632 logic changes accordingly. (Bug#9254) (Bug#9549)
8633
8634 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8635 CHARPOS is covered by a display string which includes newlines.
8636 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8637 is covered by a display string with embedded newlines.
8638
8639 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
8640
8641 * dbusbind.c (Fdbus_register_signal): Add match rule to
8642 Vdbus_registered_objects_table. (Bug#9581)
8643 (Fdbus_register_method, Vdbus_registered_objects_table):
8644 Fix docstring.
8645
8646 2011-09-24 Jim Meyering <meyering@redhat.com>
8647
8648 do not ignore write error for any output size
8649 The previous change was incomplete.
8650 While it makes emacs --batch detect the vast majority of stdout
8651 write failures, errors were still ignored whenever the output size is
8652 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8653 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8654 && echo FAIL: ignored write error
8655 FAIL: ignored write error
8656 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8657 && echo FAIL: ignored write error
8658 FAIL: ignored write error
8659 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8660
8661 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8662
8663 * emacs.c (Fkill_emacs): In noninteractive mode exit
8664 non-successfully if a write error occurred on stdout. (Bug#9574)
8665
8666 2011-09-21 Eli Zaretskii <eliz@gnu.org>
8667
8668 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8669 the xassert test.
8670
8671 * dispextern.h (struct it): Update the comment documenting what
8672 can it->OBJECT be.
8673
8674 2011-09-20 Eli Zaretskii <eliz@gnu.org>
8675
8676 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8677 a display string, extend search for cursor position to end of row.
8678 (find_row_edges): If the row ends in a newline from a display
8679 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8680 Handle the case of a display string with multiple newlines.
8681 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8682 non-empty line. Fixes confusing cursor motion with arrow keys at
8683 the beginning of a line that starts with whitespace.
8684
8685 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8686
8687 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8688 (bug#9493).
8689
8690 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
8691
8692 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8693 boolean (Bug#9154).
8694
8695 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8696
8697 * xdisp.c (display_line): Record maximum and minimum buffer
8698 positions even if no glyphs were produced (e.g., by a zero-width
8699 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8700 buffer positions that will be removed from the glyph row because
8701 they don't fit.
8702 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8703 column is beyond frame width: don't subtract 1 "pixel" when
8704 computing width of the stretch.
8705 (reseat_at_next_visible_line_start): Undo the change made on
8706 2011-09-17 that saved paragraph information and restored it after
8707 the call to `reseat'. (Bug#9545)
8708
8709 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8710
8711 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8712 and turn window cursor on if cleared (Bug#9415).
8713
8714 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
8715
8716 * search.c (boyer_moore): Take unibyte characters from pattern
8717 literally. (Bug#9458)
8718
8719 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8720
8721 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8722
8723 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8724
8725 Fix minor problem found by static checking.
8726 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8727 initialized, to pacify gcc -Wuninitialized.
8728
8729 * fileio.c: Report proper errno when syscall falls.
8730 (Finsert_file_contents): Save and restore errno,
8731 so that report_file_error outputs the correct diagnostic.
8732 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8733
8734 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8735
8736 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8737
8738 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8739
8740 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8741 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8742
8743 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8744
8745 * xdisp.c (reseat_at_next_visible_line_start): Keep information
8746 about the current paragraph and restore it after the call to reseat.
8747
8748 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8749 (bidi_find_paragraph_start): Search back for paragraph beginning
8750 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8751 (bidi_move_to_visually_next): Only trigger paragraph-related
8752 computations when the last character is a newline or at EOB, not
8753 just any NEUTRAL_B. (Bug#9470)
8754
8755 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8756 truncated lines if point is covered by a display string. (Bug#9524)
8757
8758 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8759
8760 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8761 (cons_to_x_long): New function.
8762 (lisp_data_to_selection_data): Use it. Correct the test for
8763 short-versus-long data; it was negated. Break out of vector
8764 loop, for efficiency, when a long datum is discovered.
8765
8766 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8767
8768 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8769
8770 2011-09-16 Eli Zaretskii <eliz@gnu.org>
8771
8772 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8773 GCC PR/17406) by declaring this function with external scope.
8774
8775 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8776
8777 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8778 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8779
8780 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8781
8782 * editfns.c (Fformat): Correctly handle text properties on "%%".
8783
8784 2011-09-15 Eli Zaretskii <eliz@gnu.org>
8785
8786 * xterm.c (x_draw_composite_glyph_string_foreground):
8787 * w32term.c (x_draw_composite_glyph_string_foreground):
8788 * term.c (encode_terminal_code):
8789 * composite.c (composition_update_it, get_composition_id):
8790 * xdisp.c (get_next_display_element)
8791 (fill_composite_glyph_string): Add comments about special meaning
8792 of TAB characters in a composition.
8793
8794 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8795
8796 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
8797 This occurs when processing a multibyte format.
8798 Problem reported by Wolfgang Jenker.
8799
8800 2011-09-15 Johan Bockgård <bojohan@gnu.org>
8801
8802 * xdisp.c (try_cursor_movement): Only check for exact match if
8803 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8804
8805 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8806
8807 Remove unused external symbols.
8808 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8809 * xdisp.c (calc_pixel_width_or_height): Now static.
8810 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8811 * indent.c (check_display_width):
8812 * w32term.c: Fix comment to match code.
8813 * xterm.c, xterm.h (x_catching_errors): Remove.
8814
8815 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8816
8817 * xselect.c: Use signed conversions more consistently (Bug#9498).
8818 (selection_data_to_lisp_data): Assume incoming selection data are
8819 signed integers, not unsigned. This is to be consistent with
8820 outgoing selection data, which was modified to use signed integers
8821 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8822 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8823 expects long, not unsigned long.
8824
8825 2011-09-14 Eli Zaretskii <eliz@gnu.org>
8826
8827 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8828 computation of loop end. Reported by Johan Bockgård
8829 <bojohan@gnu.org>.
8830
8831 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
8832
8833 * frame.c (Fother_visible_frames_p): Function deleted.
8834
8835 2011-09-12 Eli Zaretskii <eliz@gnu.org>
8836
8837 * indent.c (compute_motion): Process display vector front to back
8838 rather than the other way around. (Bug#2496)
8839
8840 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8841
8842 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8843
8844 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
8845
8846 * minibuf.c (Fread_from_minibuffer): Doc fix.
8847
8848 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8849
8850 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8851 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8852
8853 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8854
8855 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8856 value for non-existent files.
8857
8858 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8859
8860 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8861 set its "size" to -1. This will set the modtime_size field of
8862 the corresponding buffer to -1, which is what
8863 verify-visited-file-modtime expects for files that do not exist.
8864 (Bug#9139)
8865
8866 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8867
8868 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8869 here ...
8870 * lisp.h: ... from here. push_key_description is no longer
8871 defined in keyboard.c, so its declaration should not be in
8872 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8873 logically belongs with push_key_description.
8874
8875 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8876
8877 * buffer.h: Include <sys/types.h> instead of <time.h>.
8878 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8879 Problem reported by Herbert J. Skuhra.
8880
8881 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8882
8883 * xml.c (parse_region): Make the parsing work for
8884 non-comment-starting XML files again (bug#9144).
8885
8886 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8887
8888 * image.c (gif_load): Fix calculation of bottom and right corner.
8889 (Bug#9468)
8890
8891 2011-09-10 Eli Zaretskii <eliz@gnu.org>
8892
8893 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8894 redisplay in small windows.
8895
8896 2011-09-09 Eli Zaretskii <eliz@gnu.org>
8897
8898 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8899
8900 2011-09-08 Martin Rudalics <rudalics@gmx.at>
8901
8902 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8903 Operate on live windows only.
8904
8905 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
8906
8907 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8908
8909 2011-09-07 Eli Zaretskii <eliz@gnu.org>
8910
8911 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8912 only under bidi iteration.
8913
8914 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8915
8916 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8917
8918 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8919
8920 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8921 Without this fix, the command to link temacs failed due to an
8922 undefined symbol __builtin_isnan. This is because
8923 /usr/include/iso/math_c99.h #defines isnan(x) to
8924 __builtin_isnan(x), but the bundled gcc, which identifies itself
8925 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8926 a __builtin_isnan.
8927 * floatfns.c (isnan): #undef, and then #define to a clone of
8928 what's in data.c.
8929 (Fisnan): Always define, since it's always available now.
8930 (syms_of_floatfns): Always define isnan at the Lisp level.
8931
8932 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8933
8934 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8935
8936 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8937
8938 * fileio.c: Fix bugs with large file offsets (Bug#9428).
8939 The previous code assumed that file offsets (off_t values) fit in
8940 EMACS_INT variables, which is not true on typical 32-bit hosts.
8941 The code messed up by falsely reporting buffer overflow in cases
8942 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8943 when "big" contains more than 2**29 bytes, even though this
8944 inserts just one byte and does not overflow the buffer.
8945 (Finsert_file_contents): Store file offsets as off_t
8946 values, not as EMACS_INT values. Check for overflow when
8947 converting between EMACS_INT and off_t. When checking for
8948 buffer overflow or for overlap, take the offsets into account.
8949 Don't use EMACS_INT for small values where int suffices.
8950 When checking for overlap, fix a typo: ZV was used where
8951 ZV_BYTE was intended.
8952 (Fwrite_region): Don't assume off_t fits into 'long'.
8953 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8954
8955 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
8956
8957 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8958
8959 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8960
8961 sprintf-related integer and memory overflow issues (Bug#9412).
8962
8963 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8964 (esprintf, exprintf, evxprintf): New functions.
8965 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
8966 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
8967 (modify_event_symbol): Do not assume that the length of
8968 name_alist_or_stem is safe to alloca and fits in int.
8969 (Fexecute_extended_command): Likewise for function name and binding.
8970 (Frecursion_depth): Wrap around reliably on integer overflow.
8971 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8972 since some callers pass EMACS_INT values.
8973 (Fsingle_key_description): Don't crash if symbol name contains more
8974 than MAX_ALLOCA bytes.
8975 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8976 (get_minibuffer): Arg is now EMACS_INT, not int.
8977 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8978 (esprintf, exprintf, evxprintf): New decls.
8979 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8980
8981 * dbusbind.c (signature_cat): New function.
8982 (xd_signature, Fdbus_register_signal):
8983 Do not overrun buffer; instead, report string overflow.
8984
8985 * dispnew.c (add_window_display_history): Don't overrun buffer.
8986 Truncate instead; this is OK since it's just a log.
8987
8988 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8989 even if the time zone offset is outlandishly large.
8990 Don't mishandle offset == INT_MIN.
8991
8992 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8993 when creating daemon; the previous buffer-overflow check was incorrect.
8994
8995 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8996 which has the guts of the old verror function.
8997
8998 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8999 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9000
9001 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9002 (font_unparse_xlfd): Don't blindly alloca long strings.
9003 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9004 fits in int, when using sprintf. Use single snprintf to count
9005 length of string rather than counting it via multiple sprintfs;
9006 that's simpler and more reliable.
9007 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9008 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9009 sprintf, in case result does not fit in int.
9010
9011 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9012 (fontset_from_font): Print it.
9013
9014 * frame.c (tty_frame_count): Now printmax_t, not int.
9015 (make_terminal_frame, set_term_frame_name): Print it.
9016 (x_report_frame_params): In X, window IDs are unsigned long,
9017 not signed long, so print them as unsigned.
9018 (validate_x_resource_name): Check for implausibly long names,
9019 and don't assume name length fits in 'int'.
9020 (x_get_resource_string): Don't blindly alloca invocation name;
9021 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9022 not fit in int.
9023
9024 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9025 (xg_check_special_colors, xg_set_geometry):
9026 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9027
9028 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9029 Use esprintf, not sprintf, in case result does not fit in int.
9030
9031 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9032 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9033 it as a large positive number.
9034 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9035 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9036
9037 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9038 in case result does not fit in int.
9039
9040 * print.c (float_to_string): Detect width overflow more reliably.
9041 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9042 buffer overrun. Don't assume list length fits in 'int'. Treat
9043 print length of 0 as 0, not as infinity; to be consistent with other
9044 uses of print length in this function. Don't overflow print length
9045 index. Don't assume hash table size fits in 'long', or that
9046 vectorlike size fits in 'unsigned long'.
9047
9048 * process.c (make_process): Use printmax_t, not int, to format
9049 process-name gensyms.
9050
9051 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9052
9053 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9054 to avoid potential buffer overrun.
9055
9056 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9057 if X resource line is longer than 512 bytes.
9058
9059 * xfns.c (x_window): Make sprintf buffer a bit bigger
9060 to avoid potential buffer overrun.
9061
9062 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9063
9064 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9065
9066 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9067
9068 Integer overflow fixes for scrolling, etc.
9069 Without these, Emacs silently mishandles large integers sometimes.
9070 For example, "C-u 4294967297 M-x recenter" was treated as if
9071 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9072
9073 * xdisp.c (try_window_id): Check Emacs fixnum range before
9074 converting to 'int'.
9075
9076 * window.c (window_scroll_line_based, Frecenter):
9077 Check that an Emacs fixnum is in range before assigning it to 'int'.
9078 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9079 values converted from Emacs fixnums.
9080 (Frecenter): Don't wrap around a line count if it is out of 'int'
9081 range; instead, treat it as an extreme value.
9082 (Fset_window_configuration, compare_window_configurations):
9083 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9084
9085 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9086 that can exceed INT_MAX. Check that EMACS_INT value is in range
9087 before assigning it to the (possibly-narrower) index.
9088 (match_limit): Don't assume that a fixnum can fit in 'int'.
9089
9090 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9091 exceed INT_MAX.
9092
9093 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9094 (Fvertical_motion): Don't wrap around LINES values that don't fit
9095 in 'int'. Instead, treat them as extreme values. This is good
9096 enough for windows, which can't have more than INT_MAX lines anyway.
9097
9098 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9099
9100 * Require libxml/parser.h to avoid compilation warning.
9101
9102 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9103
9104 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9105 since this reportedly can destroy thread storage.
9106
9107 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9108
9109 * syntax.c (find_defun_start): Update all cache variables if
9110 exiting early (Bug#9401).
9111
9112 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9113
9114 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9115
9116 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9117 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9118 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9119
9120 * term.c (tty_append_glyph): New function.
9121 (produce_stretch_glyph): Static function and its prototype deleted.
9122
9123 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9124 Add prototypes.
9125
9126 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9129 when checking :margin (Bug#9390).
9130 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9131 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9132 so that the name doesn't mislead. All uses changed.
9133
9134 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9135
9136 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9137 set_tty_hooks.
9138
9139 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9140
9141 * xdisp.c (move_it_to): Don't bail out early when reaching
9142 position beyond to_charpos, if we are scanning backwards.
9143 (move_it_vertically_backward): When DY == 0, make sure we get to
9144 the first character in the line after the newline.
9145
9146 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9149 (ccl_driver): Do not generate an out-of-range pointer.
9150 (Fccl_execute_on_string): Remove unnecessary check for
9151 integer overflow, noted by Stefan Monnier in
9152 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9153 Remove a FIXME that didn't need fixing.
9154 Simplify the newly-introduced buffer reallocation code.
9155
9156 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9157
9158 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9159
9160 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9161
9162 Integer and memory overflow issues (Bug#9196).
9163
9164 * doc.c (get_doc_string): Rework so that
9165 get_doc_string_buffer_size is the actual buffer size, rather than
9166 being 1 less than the actual buffer size; this makes xpalloc more
9167 convenient.
9168
9169 * image.c (x_allocate_bitmap_record, cache_image):
9170 * xselect.c (Fx_register_dnd_atom):
9171 Simplify previous changes by using xpalloc.
9172
9173 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9174 since either will do and ptrdiff_t is convenient with xpalloc.
9175
9176 * charset.c (charset_table_size)
9177 (struct charset_sort_data.priority): Now ptrdiff_t.
9178 (charset_compare): Don't overflow if priorities differ greatly.
9179 (Fsort_charsets): Don't assume list length fits in int.
9180 Check for size-calculation overflow when allocating sort data.
9181 (syms_of_charset): Allocate an initial charset table that is
9182 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9183
9184 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9185
9186 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9187 The actual value is always <= INT_MAX, and leaving it unsigned made
9188 overflow checking harder.
9189
9190 * dispextern.h (struct glyph_matrix.rows_allocated)
9191 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9192 with xpalloc. The values are still always <= INT_MAX.
9193
9194 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9195
9196 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9197 (SAFE_NALLOCA): New macro.
9198
9199 * region-cache.c (struct boundary.pos, find_cache_boundary)
9200 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9201 (set_cache_region, invalidate_region_cache)
9202 (revalidate_region_cache, know_region_cache, region_cache_forward)
9203 (region_cache_backward, pp_cache):
9204 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9205 so that ptrdiff_t * can be passed to xpalloc.
9206 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9207 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9208 (pp_cache): Don't assume cache_len fits in int.
9209 * region-cache.h: Adjust extern decls to match.
9210
9211 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9212 EMACS_INT, since either will do, for xpalloc.
9213
9214 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9215 (xnmalloc, xnrealloc, xpalloc): New functions.
9216
9217 * bidi.c (bidi_shelve_header_size): New constant.
9218 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9219 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9220
9221 * bidi.c (bidi_cache_shrink):
9222 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9223 (overlay_strings):
9224 Don't update size of array until after memory allocation succeeds,
9225 because xmalloc/xrealloc may not return.
9226 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9227 now that we have proper integer overflow checking.
9228 (record_overlay_string, overlay_strings): Catch overflows when
9229 calculating size of overlay_str_buf.
9230
9231 * callproc.c (Fcall_process): Check for size overflow when
9232 calculating size of args2.
9233 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9234 Normally we prefer signed values, but sticking with ptrdiff_t would
9235 require adding more-complicated checks.
9236
9237 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9238 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9239 Redo buffer-overflow calculations to avoid integer overflow.
9240 Add a FIXME comment where memory seems to be over-allocated.
9241
9242 * character.c (Fstring): Check for size-calculation overflow.
9243
9244 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9245 unnecessary integer overflow. Check for size overflow.
9246 (encode_coding_object): Don't update size until xmalloc succeeds.
9247
9248 * composite.c (get_composition_id): Check for overflow in glyph
9249 length calculations.
9250
9251 Integer and memory overflow fixes for display code.
9252 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9253 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9254 (scrolling_window): Check for overflow in size calculations.
9255 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9256 Don't assume glyph table len fits in int.
9257 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9258 (row_table_size): Now ptrdiff_t, not int.
9259 (scrolling_window): Avoid overflow in size calculations.
9260 Don't update size until allocation succeeds.
9261 * fns.c (concat): Check for overflow in size calculations.
9262 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9263 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9264 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9265
9266 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9267 (get_doc_string): Check for size calculation overflow.
9268 Don't update size until allocation succeeds.
9269 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9270 EMACS_INT, where ptrdiff_t will do.
9271 (Fsubstitute_command_keys): Check for string overflow.
9272
9273 * editfns.c (set_time_zone_rule): Don't assume environment length
9274 fits in int.
9275 (message_length): Now ptrdiff_t, not int.
9276 (Fmessage_box): Don't update size until allocation succeeds.
9277 Don't assume message length fits in int.
9278 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9279
9280 * emacs.c (main): Do not reallocate argv, since there is a null at
9281 the end that can be overwritten, and this way there's no need to
9282 worry about size-calculation overflow.
9283 (sort_args): Check for size-calculation overflow.
9284
9285 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9286 alloc succeeds.
9287 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9288
9289 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9290 (x_set_scroll_bar_width, x_figure_window_size):
9291 Check for integer overflow.
9292 (x_set_alpha): Do not assume XINT fits in int.
9293
9294 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9295 This is for the members text_lines, text_cols, total_lines, total_cols,
9296 where the system imposes an 'int' limit.
9297
9298 * fringe.c (Fdefine_fringe_bitmap):
9299 Don't update size until alloc works.
9300
9301 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9302 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9303
9304 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9305 Check for size-calculation overflow.
9306 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9307 do, as we prefer signed integers.
9308 (id_to_widget.max_size, id_to_widget.used)
9309 (xg_store_widget_in_map, xg_remove_widget_from_map)
9310 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9311 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9312 Use and return ptrdiff_t, not int.
9313 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9314 * gtkutil.h: Change prototypes to match the above.
9315
9316 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9317 are duplicate now that they've been promoted to lisp.h.
9318 (x_allocate_bitmap_record, x_alloc_image_color)
9319 (make_image_cache, cache_image, xpm_load):
9320 Don't update size until alloc is done.
9321 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9322 (x_detect_edges):
9323 Check for size calculation overflow.
9324 (ct_colors_allocated_max): New constant.
9325 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9326 overflow.
9327
9328 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9329 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9330 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9331 Use ptrdiff_t, not int, to count maps.
9332 (read_char_minibuf_menu_prompt): Check for overflow in size
9333 calculations. Don't update size until allocation succeeds.
9334 Redo calculations to avoid overflow.
9335 * keyboard.h: Change prototypes to match the above.
9336
9337 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9338 to count maps.
9339 (current_minor_maps): Check for size calculation overflow.
9340 * keymap.h: Change prototypes to match the above.
9341
9342 * lread.c (read1, init_obarray): Don't update size until alloc done.
9343
9344 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9345 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9346
9347 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9348 Now ptrdiff_t, not int.
9349 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9350 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9351
9352 * process.c (Fnetwork_interface_list): Check for overflow
9353 in size calculation.
9354
9355 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9356
9357 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9358 overflow. Don't bother calling xmalloc when xrealloc will do.
9359
9360 * search.c (Freplace_match): Check for size calculation overflow.
9361 (Fset_match_data): Don't assume list lengths fit in 'int'.
9362
9363 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9364 for command line length. Do not attempt to address one before the
9365 beginning of an array, as that's not portable.
9366
9367 * term.c (max_frame_lines): Remove; unused.
9368 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9369 not int.
9370 (encode_terminal_code, calculate_costs): Check for size
9371 calculation overflow.
9372 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9373 table lengths and related sizes. Don't update size until alloc
9374 done. Redo calculations to avoid overflow.
9375 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9376
9377 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9378 subtracting pointers.
9379 (gobble_line): Check for overflow more carefully. Don't update size
9380 until alloc done.
9381
9382 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9383 Don't update size until alloc done.
9384 Redo size calculations to avoid overflow.
9385 Check for size calculation overflow.
9386 (main) [DEBUG]: Fix typo in invoking tparam1.
9387
9388 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9389 Use ptrdiff_t, not int, for sizes.
9390 (store_mode_line_noprop_char): Don't update size until alloc done.
9391
9392 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9393 Use ptrdiff_t, not int, for sizes.
9394 (Finternal_make_lisp_face, cache_face):
9395 Check for size calculation overflow.
9396 (cache_face): Treat size calculation overflows as if they were
9397 memory exhaustion (the usual treatment), rather than aborting.
9398
9399 * xfns.c (x_encode_text, x_set_name_internal)
9400 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9401 sizes, since they can exceed INT_MAX in size. Check for size
9402 calculation overflow.
9403
9404 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9405 (xg_select): Check for size calculation overflow.
9406 Don't update size until alloc done.
9407
9408 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9409 as sprintf is limited to int lengths.
9410
9411 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9412 (X_LONG_MIN): New macros.
9413 Use them to make the following changes clearer.
9414 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9415 This change doesn't affect the value now, but it may help remind
9416 future maintainers not to raise the value too much later.
9417 (SELECTION_QUANTUM): Remove, replacing with ...
9418 (selection_quantum): ... new function, which avoids overflow.
9419 All uses changed.
9420 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9421 assumption that selection length fits in 'int'.
9422 (x_reply_selection_request, x_handle_selection_request)
9423 (x_get_window_property, receive_incremental_selection)
9424 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9425 (lisp_data_to_selection_data, clean_local_selection_data):
9426 Use ptrdiff_t, not int, to record length of selection.
9427 (x_reply_selection_request, x_get_window_property)
9428 (receive_incremental_selection, x_property_data_to_lisp):
9429 Redo calculations to avoid overflow.
9430 (x_reply_selection_request): When sending hint, ceiling it at
9431 X_LONG_MAX rather than relying on wraparound overflow to send
9432 something.
9433 (x_get_window_property, receive_incremental_selection)
9434 (lisp_data_to_selection_data, x_property_data_to_lisp):
9435 Check for size-calculation overflow.
9436 (x_get_window_property, receive_incremental_selection)
9437 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9438 Don't store size until memory allocation succeeds.
9439 (x_get_window_property): Plug memory leak on memory exhaustion.
9440 Don't double-block input; malloc is safe here. Don't assume 2**34
9441 - 4 fits in unsigned long. Add an xassert to check
9442 XGetWindowProperty overflow. Be more careful about overflow
9443 calculations, and distinguish size from memory overflow better.
9444 (receive_incremental_selection): When tracing, don't assume
9445 unsigned int is less than INT_MAX.
9446 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9447 harmful) conversions of unsigned short to int.
9448 (lisp_data_to_selection_data): Don't assume that integers
9449 in the range -65535 through -1 fit in an X unsigned short.
9450 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9451 result parameters unless successful. Rely on cons_to_unsigned
9452 to report problems with elements; the old code wasn't right anyway.
9453 (x_check_property_data): Check for int overflow; we cannot use
9454 a wider type due to X limits.
9455 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9456
9457 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
9458
9459 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9460 (x_term_init): Check for size calculation overflow.
9461 (x_color_cells): Don't store size until memory allocation succeeds.
9462 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
9463 Don't assume alloca size is less than MAX_ALLOCA.
9464 (x_term_init): Don't assume length fits in int (sprintf is limited
9465 to int size).
9466
9467 Use ptrdiff_t for composition IDs.
9468 * character.c (lisp_string_width):
9469 * composite.c (composition_table_size, n_compositions)
9470 (get_composition_id, composition_gstring_from_id):
9471 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9472 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9473 * window.c (Frecenter):
9474 Use ptrdiff_t, not int, for composition IDs.
9475 * composite.c (get_composition_id): Check for integer overflow.
9476 * composite.h: Adjust prototypes to match the above changes.
9477
9478 Use ptrdiff_t for hash table indexes.
9479 * category.c (hash_get_category_set):
9480 * ccl.c (ccl_driver):
9481 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9482 * coding.c (coding_system_charset_list, detect_coding_system):
9483 * coding.h (struct coding_system.id):
9484 * composite.c (get_composition_id, gstring_lookup_cache):
9485 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9486 * image.c (xpm_get_color_table_h):
9487 * lisp.h (hash_lookup, hash_put):
9488 * minibuf.c (Ftest_completion):
9489 Use ptrdiff_t for hash table indexes, not int (which is too
9490 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9491 32-bit --with-wide-int hosts).
9492
9493 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9494 Add a FIXME comment about memory leaks.
9495 (syms_of_charset): Don't assume xmalloc returns.
9496
9497 Don't assume that stated character widths fit in int.
9498 * character.c (Fchar_width, c_string_width, lisp_string_width):
9499 * character.h (CHAR_WIDTH):
9500 * indent.c (MULTIBYTE_BYTES_WIDTH):
9501 Use sanitize_char_width to avoid undefined and/or bad behavior
9502 with outlandish widths.
9503 * character.h (sanitize_tab_width): Rename from sanitize_width,
9504 now that we have two such functions. All uses changed.
9505 (sanitize_char_width): New inline function.
9506
9507 Don't assume that tab-width fits in int.
9508 * character.h (sanitize_width): New inline function.
9509 (SANE_TAB_WIDTH): New macro.
9510 (ASCII_CHAR_WIDTH): Use it.
9511 * indent.c (sane_tab_width): Remove. All uses replaced by
9512 SANE_TAB_WIDTH (current_buffer).
9513 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9514
9515 * fileio.c: Integer overflow issues with file modes.
9516 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9517
9518 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9519 Remove unreachable code.
9520 (read_hex, load_charset_map_from_file): Check for integer overflow.
9521
9522 * xterm.c: Don't go over XClientMessageEvent limit.
9523 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9524 (x_send_scroll_bar_event): Likewise. Check that the size does not
9525 exceed limits imposed by XClientMessageEvent, as well as the usual
9526 ptrdiff_t and size_t limits.
9527
9528 * keyboard.c: Overflow, signedness and related fixes.
9529 (make_lispy_movement): Use same integer type in forward decl
9530 that is used in the definition.
9531 (read_key_sequence, keyremap_step):
9532 Change bufsize argument back to int, undoing my 2011-03-30 change.
9533 We prefer signed types, and int is wide enough here.
9534 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9535 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9536 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9537 length, not size_t. Use ptrdiff_t for index, not int.
9538 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9539 possibility of integer overflow.
9540
9541 Overflow, signedness and related fixes for images.
9542
9543 * dispextern.h (struct it.stack[0].u.image.image_id)
9544 (struct_it.image_id, struct image.id, struct image_cache.size)
9545 (struct image_cache.used, struct image_cache.ref_count):
9546 * gtkutil.c (update_frame_tool_bar):
9547 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9548 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9549 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9550 * nsmenu.m (update_frame_tool_bar):
9551 * xdisp.c (calc_pixel_width_or_height):
9552 * xfns.c (image_cache_refcount):
9553 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9554 on typical 64-bit hosts.
9555
9556 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9557 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9558 Omit unnecessary casts to int.
9559 (parse_image_spec): Check that integers fall into 'int' range
9560 when the callers expect that.
9561 (image_ascent): Redo ascent calculation to avoid int overflow.
9562 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9563 (lookup_image): Remove unnecessary tests.
9564 (xbm_image_p): Locals are now of int, not EMACS_INT,
9565 since parse_image_check makes sure they fit into int.
9566 (png_load, gif_load, svg_load_image):
9567 Prefer int to unsigned where either will do.
9568 (tiff_handler): New function, combining the cores of the
9569 old tiff_error_handler and tiff_warning_handler.
9570 This function is rewritten to use vsnprintf and thereby avoid
9571 stack buffer overflows. It uses only the features of vsnprintf
9572 that are common to both POSIX and native Microsoft.
9573 (tiff_error_handler, tiff_warning_handler): Use it.
9574 (tiff_load, gif_load, imagemagick_load_image):
9575 Don't assume :index value fits in 'int'.
9576 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9577 (imagemagick_load_image): Check that crop parameters fit into
9578 the integer types that MagickCropImage accepts. Don't assume
9579 Vimagemagick_render_type has a nonnegative value. Don't assume
9580 size_t fits in 'long'.
9581 (gs_load): Use printmax_t to print the widest integers possible.
9582 Check for integer overflow when computing image height and width.
9583
9584 2011-08-26 Eli Zaretskii <eliz@gnu.org>
9585
9586 * xdisp.c (redisplay_window): Don't force window start if point
9587 will be invisible in the resulting window. (Bug#9324)
9588
9589 2011-08-25 Eli Zaretskii <eliz@gnu.org>
9590
9591 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9592 the display spec is of the form `(space ...)'.
9593 (handle_display_spec): Return the value returned by
9594 handle_single_display_spec, not just 1 or zero.
9595 (handle_single_display_spec): If the display spec is of the form
9596 `(space ...)', and specifies display in the text area, return 2
9597 rather than 1.
9598 (try_cursor_movement): Check for the need to scroll more
9599 accurately, and prefer exact match for point under bidi.
9600 Don't advance `row' beyond the last row of the window.
9601
9602 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9603 into disp_prop; all users changed.
9604
9605 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9606 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9607 for the text covered by the display property.
9608
9609 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
9610
9611 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9612 Change return value to nil.
9613 (Frecord_buffer): Delete unused function.
9614
9615 2011-08-24 Eli Zaretskii <eliz@gnu.org>
9616
9617 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9618 buffers, return left-to-right.
9619 (set_cursor_from_row): Consider candidate row a win if its glyph
9620 represents a newline and point is on that newline. Fixes cursor
9621 positioning on the newline at EOL of R2L text within L2R
9622 paragraph, and vice versa.
9623 (try_cursor_movement): Check continued rows, in addition to
9624 continuation rows. Fixes unwarranted scroll when point enters a
9625 continued line of R2L text within an L2R paragraph, or vice versa.
9626 (cursor_row_p): Consider the case of point being equal to
9627 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9628 from the end of a short line to the beginning of a continued line
9629 of R2L text within L2R paragraph.
9630 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9631 composed characters.
9632
9633 * bidi.c (bidi_check_type): Use xassert.
9634 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9635 members.
9636
9637 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9638
9639 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9640 a character.
9641
9642 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
9643
9644 * nsfont.m (ns_otf_to_script): Fix typo.
9645
9646 2011-08-22 Kenichi Handa <handa@m17n.org>
9647
9648 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9649 extra slot even if the purpose is char-code-property-table.
9650
9651 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9652
9653 * xdisp.c (redisplay_window): When computing centering_position,
9654 account for the height of the header line. (Bug#8874)
9655
9656 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9657 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9658 candidate is selected by the mouse, and that candidate has a
9659 composed character under the mouse.
9660
9661 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9662 coordinates reported by pos-visible-in-window-p for a composed
9663 character in column zero.
9664
9665 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9666
9667 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9668
9669 2011-08-22 Eli Zaretskii <eliz@gnu.org>
9670
9671 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9672 consider it a hit if to_charpos is anywhere in the range of the
9673 composed buffer positions.
9674
9675 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
9676
9677 * image.c (gif_load): Don't assume that each subimage has the same
9678 dimensions as the base image. Handle disposal method that is
9679 "undefined" by the gif spec (Bug#9335).
9680
9681 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
9682
9683 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
9684 (Fcondition_case): Document `debug' symbol in error handler.
9685
9686 2011-08-19 Eli Zaretskii <eliz@gnu.org>
9687
9688 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9689 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9690 from an Org mode buffer to a Speedbar frame.
9691
9692 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9693 a composition, take its buffer position from IT->cmp_it.charpos.
9694 Fixes cursor positioning at the beginning of a line that begins
9695 with a composed character.
9696
9697 2011-08-18 Eli Zaretskii <eliz@gnu.org>
9698
9699 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9700 character bidirectional type, use STRONG_L instead. Fixes crashes
9701 in a buffer produced by `describe-categories'.
9702
9703 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9704 members before the level stack, so they would be saved and
9705 restored when copying iterator state. Fixes incorrect reordering
9706 around TABs covered by display properties.
9707
9708 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9709
9710 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
9711
9712 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
9713
9714 * eval.c (internal_condition_case, internal_condition_case_1)
9715 (internal_condition_case_2, internal_condition_case_n):
9716 Remove unnecessary aborts (Bug#9081).
9717
9718 2011-08-17 Eli Zaretskii <eliz@gnu.org>
9719
9720 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9721 has no `load' handler, try opening the file locally. (Bug#9311)
9722
9723 2011-08-16 Ken Brown <kbrown@cornell.edu>
9724
9725 * gmalloc.c: Expand comment.
9726
9727 2011-08-16 Eli Zaretskii <eliz@gnu.org>
9728
9729 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9730 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9731
9732 2011-08-16 Ken Brown <kbrown@cornell.edu>
9733
9734 Fix memory allocation problems in Cygwin build (Bug#9273).
9735
9736 * unexcw.c ( __malloc_initialized): Declare external variable.
9737 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9738
9739 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9740 New variables.
9741 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9742 dumped emacs.
9743 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9744 in the static heap.
9745 [CYGWIN] (special_realloc): New function.
9746 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9747 requests to realloc storage in the static heap.
9748
9749 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9750
9751 * bidi.c (bidi_initialize): Remove unused local.
9752
9753 2011-08-15 Eli Zaretskii <eliz@gnu.org>
9754
9755 * bidimirror.h:
9756 * biditype.h: Remove file.
9757 * makefile.w32-in ($(BLD)/bidi.$(O)):
9758 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
9759
9760 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9761
9762 * chartab.c: Improve commentary for the uniprop_table API.
9763
9764 * bidi.c (bidi_paragraph_init): Support zero value of
9765 bidi_ignore_explicit_marks_for_paragraph_level.
9766 (bidi_initialize): Use uniprop_table instead of including
9767 biditype.h and bidimirror.h.
9768
9769 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9770 coordinates of the iterator when restoring from ppos_it.
9771 (Bug#9296)
9772
9773 2011-08-14 Kenichi Handa <handa@m17n.org>
9774
9775 * process.c (create_process): Call setup_process_coding_systems
9776 after the pid of the process is set to -1 (Bug#8162).
9777
9778 2011-08-14 Eli Zaretskii <eliz@gnu.org>
9779
9780 * xdisp.c (move_it_in_display_line_to): Don't invoke
9781 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9782 ppos_it. Fixes vertical cursor motion when line beginning is
9783 covered by an image. (Bug#9296)
9784
9785 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9786
9787 * nsterm.h (ns_run_ascript): Declare.
9788 (NSAPP_DATA2_RUNASSCRIPT): Define.
9789
9790 * nsfns.m (as_script, as_result, as_status): New static variables.
9791 (ns_run_ascript): New function.
9792 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
9793 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9794 the event loop. Get status from as_status (Bug#7276).
9795
9796 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9797 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9798 the event loop (Bug#7276).
9799
9800 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9801
9802 * gnutls.c (QCgnutls_bootprop_priority)
9803 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9804 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9805 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9806 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9807 (QCgnutls_bootprop_verify_hostname_error)
9808 (QCgnutls_bootprop_callbacks_verify): Rename from
9809 Qgnutls_bootprop_..., all uses changed.
9810
9811 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9812 uses changed.
9813
9814 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9815
9816 * xfaces.c (Qframe_set_background_mode): Now static.
9817 * dispextern.h (Qframe_set_background_mode): Remove decl.
9818
9819 * process.c (Fnetwork_interface_info): Declare local only if needed.
9820
9821 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9822
9823 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9824 (Fnetwork_interface_list): Allocate in increments of bytes instead
9825 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9826 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9827 sockaddr.
9828 (struct ifflag_def): notrailers is smart on OSX.
9829 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9830 Get hardware address with getifaddrs if available.
9831
9832 2011-08-12 Eli Zaretskii <eliz@gnu.org>
9833
9834 * xdisp.c (iterate_out_of_display_property): xassert that
9835 IT->position is set to within IT->object's boundaries. Break from
9836 the loop as soon as EOB is reached; avoids infloops in redisplay
9837 when IT->position is set up wrongly due to some bug.
9838 Set IT->current to match the bidi iterator unconditionally.
9839 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9840 entry. Force push_it to save on the stack the current
9841 buffer/string position, to be restored by pop_it. Fix flags in
9842 the iterator structure wrt the object coming from a display
9843 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9844 properties. (Bug#9284)
9845
9846 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
9847
9848 * fontset.c (fontset_get_font_group): Add proper type checks.
9849 (Bug#9172)
9850
9851 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9852
9853 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9854 and LC_VERSION_MIN_MACOSX.
9855 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9856 (dump_it) [LC_FUNCTION_STARTS]: Use it.
9857
9858 2011-08-08 Eli Zaretskii <eliz@gnu.org>
9859
9860 * xdisp.c (forward_to_next_line_start): Allow to use the
9861 no-display-properties-and-no-overlays under bidi display.
9862 Set disp_pos in the bidi iterator to avoid searches for display
9863 properties and overlays.
9864
9865 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
9866
9867 * editfns.c (Fset_time_zone_rule): Document relationship with the
9868 setenv function.
9869
9870 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9871 the font entity extracted from the cache (Bug#8109).
9872
9873 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
9874
9875 * composite.c (autocmp_chars): Don't reset point. That is done by
9876 restore_point_unwind (Bug#5984).
9877
9878 2011-08-07 Juri Linkov <juri@jurta.org>
9879
9880 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9881 to show the arg `TIME' instead of `TIMEVAL'.
9882
9883 2011-08-06 Eli Zaretskii <eliz@gnu.org>
9884
9885 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9886 display property strides EOL and includes a newline, as in
9887 longlines-mode. (Bug#9254)
9888 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9889 word-wrap under bidirectional display. (Bug#9224)
9890
9891 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9892 is non-zero, even if the data buffer is NULL. Fixes a crash in
9893 vertical-motion with longlines-mode. (Bug#9254)
9894
9895 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9896
9897 * bidi.c <bidi_cache_total_alloc>: Now static.
9898 (bidi_initialize): Initialize bidi_cache_total_alloc.
9899
9900 * xdisp.c (display_line): Release buffer allocated for shelved bidi
9901 cache. (Bug#9221)
9902
9903 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9904 amount allocated this far in `bidi_cache_total_alloc'.
9905 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9906 non-zero, only free the data buffer without restoring the cache
9907 contents. All callers changed.
9908
9909 * dispextern.h (bidi_unshelve_cache): Update prototype.
9910
9911 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9912 (move_it_in_display_line, move_it_to)
9913 (move_it_vertically_backward, move_it_by_lines): Replace the call
9914 to xfree to an equivalent call to bidi_unshelve_cache.
9915 (move_it_in_display_line_to): Fix logic of returning
9916 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
9917
9918 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9919
9920 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9921 came from a string character with a `cursor' property. (Bug#9229)
9922
9923 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9924
9925 * Makefile.in (LIB_PTHREAD): New variable.
9926 (LIBES): Add LIB_PTHREAD (Bug#9216).
9927
9928 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9929 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9930
9931 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9932
9933 * regex.c (re_iswctype): Remove some redundant boolean conversions.
9934
9935 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9936
9937 * xterm.c (x_find_topmost_parent): New function.
9938 (x_set_frame_alpha): Find topmost parent window with
9939 x_find_topmost_parent and set the property there also (bug#9181).
9940 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9941
9942 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9943
9944 * callproc.c (Fcall_process): Avoid vfork clobbering
9945 the local vars buffer, coding_systems, current_dir.
9946
9947 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9948
9949 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9950
9951 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9952
9953 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9954 so that it is not optimized away.
9955
9956 * xdisp.c (compute_display_string_pos): Remove unused local.
9957
9958 2011-08-02 Eli Zaretskii <eliz@gnu.org>
9959
9960 Fix slow cursor motion and scrolling in large buffers with
9961 selective display, like Org Mode buffers. (Bug#9218)
9962
9963 * dispextern.h (struct bidi_it): New member disp_prop_p.
9964
9965 * xdisp.c: Remove one-slot cache of display string positions.
9966 (compute_display_string_pos): Accept an additional argument
9967 DISP_PROP_P; callers changed. Scan at most 5K characters forward
9968 for a display string or property. If found, set DISP_PROP_P
9969 non-zero.
9970
9971 * bidi.c (bidi_fetch_char): Accept an additional argument
9972 DISP_PROP_P, and pass it to compute_display_string_pos.
9973 Only handle text covered by a display string if DISP_PROP_P is returned
9974 non-zero. All callers of bidi_fetch_char changed.
9975
9976 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9977
9978 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9979
9980 2010-12-03 Don March <don@ohspite.net>
9981
9982 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9983 last character M-[char] is translated to ESC [char] (bug#7541).
9984
9985 2011-08-02 Kenichi Handa <handa@m17n.org>
9986
9987 * lisp.h (uniprop_table): Extern it.
9988
9989 * chartab.c (uniprop_table): Make it non-static.
9990
9991 2011-08-01 Eli Zaretskii <eliz@gnu.org>
9992
9993 * xdisp.c (forward_to_next_line_start): Accept additional argument
9994 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9995 on the newline.
9996 (reseat_at_next_visible_line_start): Use the bidi iterator state
9997 returned by forward_to_next_line_start to restore the state of
9998 it->bidi_it after backing up to previous newline. (Bug#9212)
9999
10000 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10001
10002 * regex.c (re_comp): Protoize.
10003 (re_exec): Fix return type.
10004 (regexec): Fix type of `ret'. (Bug#9203)
10005
10006 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10007
10008 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10009 This is needed if max-image-size is a floating-point number.
10010
10011 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10012
10013 * print.c (print_object): Print empty symbol as ##.
10014
10015 * lread.c (read1): Read ## as empty symbol.
10016
10017 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10018
10019 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10020 setting frame foreground color (Bug#9175).
10021 (x_set_background_color): Likewise.
10022
10023 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10024 contents (Bug#9176).
10025 (EmacsTooltip -init): Remove bezels and add shadows to
10026 tooltip windows.
10027
10028 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10029 or scroll bar (Bug#8470).
10030
10031 * nsfont.m (nsfont_open): Remove assignment to voffset and
10032 unnecessary vars hshink, expand, hd, full_height, min_height.
10033 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10034
10035 * nsterm.h (nsfont_info): Remove voffset field.
10036
10037 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10038
10039 Implement strike-through and overline on NextStep (Bug#8863).
10040
10041 * nsfont.m (nsfont_open): Use underline position provided by font,
10042 instead of hard-coded value of 2.
10043 (nsfont_draw): Call ns_draw_text_decoration instead.
10044
10045 * nsterm.h: Add declaration for ns_draw_text_decoration.
10046
10047 * nsterm.m (ns_draw_text_decoration): New function for drawing
10048 underline, overline, and strike-through.
10049 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10050 ns_draw_text_decoration. Change treatment of cursor drawing to
10051 accommodate underlining, etc.
10052
10053 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10054
10055 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10056 default.
10057
10058 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10061 Without this fix, if a signal arrives just after memory fills up,
10062 'malloc' might be invoked reentrantly.
10063
10064 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10065 In other words, assume that every image size is allowed, on non-X
10066 hosts. This assumption is probably wrong, but it lets Emacs compile.
10067
10068 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10069
10070 * regex.c (re_iswctype): Convert return values to boolean.
10071
10072 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10073
10074 * xdisp.c (compute_display_string_pos): Don't use cached display
10075 string position if the buffer had its restriction changed.
10076 (Bug#9184)
10077
10078 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10079
10080 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10081
10082 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10083
10084 Integer signedness and overflow and related fixes. (Bug#9079)
10085
10086 * bidi.c: Integer size and overflow fixes.
10087 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10088 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10089 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10090 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10091 (bidi_find_other_level_edge):
10092 Use ptrdiff_t instead of EMACS_INT where either will do.
10093 This works better on 32-bit hosts configured --with-wide-int.
10094 (bidi_cache_ensure_space): Check for size-calculation overflow.
10095 Use % rather than repeated addition, for better worst-case speed.
10096 Don't set bidi_cache_size until after xrealloc returns, because it
10097 might not return.
10098 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10099 (bidi_cache_ensure_space): Also check that the bidi cache size
10100 does not exceed that of the largest Lisp string or buffer. See Eli
10101 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10102
10103 * alloc.c (__malloc_size_t): Remove.
10104 All uses replaced by size_t. See Andreas Schwab's note
10105 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10106
10107 * image.c: Improve checking for integer overflow.
10108 (check_image_size): Assume that f is nonnull, since
10109 it is always nonnull in practice. This is one less thing to
10110 worry about when checking for integer overflow later.
10111 (x_check_image_size): New function, which checks for integer
10112 overflow issues inside X.
10113 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10114 This removes the need for a memory_full check.
10115 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10116 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10117 (xbm_read_bitmap_data): Change locals back to 'int', since
10118 their values must fit in 'int'.
10119 (xpm_load_image, png_load, tiff_load):
10120 Invoke x_create_x_image_and_pixmap earlier,
10121 to avoid much needless work if the image is too large.
10122 (tiff_load): Treat overly large images as if
10123 x_create_x_image_and_pixmap failed, not as malloc failures.
10124 (gs_load): Use x_check_image_size.
10125
10126 * gtkutil.c: Omit integer casts.
10127 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10128 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10129
10130 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10131
10132 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10133 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10134 would wrongly return t on a 64-bit host.
10135
10136 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10137 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10138 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10139 and therefore cause GCC to emit a bogus diagnostic in some cases.
10140
10141 * image.c: Integer signedness and overflow and related fixes.
10142 This is not an exhaustive set of fixes, but it's time to
10143 record what I've got.
10144 (lookup_pixel_color, check_image_size): Remove redundant decls.
10145 (check_image_size): Don't assume that arbitrary EMACS_INT values
10146 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10147 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10148 (tiff_load, imagemagick_load_image):
10149 Check for overflow in size calculations.
10150 (x_create_x_image_and_pixmap): Remove unnecessary test for
10151 xmalloc returning NULL; that can't happen.
10152 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10153 (xpm_color_bucket): Use better integer hashing function.
10154 (xpm_cache_color): Don't possibly over-allocate memory.
10155 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10156 (gif_memory_source):
10157 Use ptrdiff_t, not int or size_t, to record sizes.
10158 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10159 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10160 either works, as we prefer signed integers.
10161 (tiff_read_from_memory, tiff_write_from_memory):
10162 Return tsize_t, not size_t, since that's what the TIFF API wants.
10163 (tiff_read_from_memory): Don't fail simply because the read would
10164 go past EOF; instead, return a short read.
10165 (tiff_load): Omit no-longer-needed casts.
10166 (Fimagemagick_types): Don't assume size fits into 'int'.
10167
10168 Improve hashing quality when configured --with-wide-int.
10169 * fns.c (hash_string): New function, taken from sxhash_string.
10170 Do not discard information about ASCII character case; this
10171 discarding is no longer needed.
10172 (sxhash-string): Use it. Change sig to match it. Caller changed.
10173 * lisp.h: Declare it.
10174 * lread.c (hash_string): Remove, since we now use fns.c's version.
10175 The fns.c version returns a wider integer if --with-wide-int is
10176 specified, so this should help the quality of the hashing a bit.
10177
10178 * emacs.c: Integer overflow minor fix.
10179 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10180 Define only if GNU_LINUX.
10181 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10182
10183 * dispnew.c: Integer signedness and overflow fixes.
10184 Remove unnecessary forward decls, that were a maintenance hassle.
10185 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10186 All uses changed.
10187 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10188 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10189 (prepare_desired_row, line_draw_cost):
10190 Use int, not unsigned, where either works.
10191 (save_current_matrix, restore_current_matrix):
10192 Use ptrdiff_t, not size_t, where either works.
10193 (init_display): Check for overflow more accurately, and without
10194 relying on undefined behavior.
10195
10196 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10197 Remove, replacing with the new symbols in lisp.h. All uses changed.
10198 * fileio.c (make_temp_name):
10199 * filelock.c (lock_file_1, lock_file):
10200 * xdisp.c (message_dolog):
10201 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10202 Use pMd etc. instead.
10203 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10204 replacing the pWIDE etc. symbols removed from editfns.c.
10205
10206 * keyboard.h (num_input_events): Now uintmax_t.
10207 This is (very slightly) less likely to mess up due to wraparound.
10208 All uses changed.
10209
10210 * buffer.c: Integer signedness fixes.
10211 (alloc_buffer_text, enlarge_buffer_text):
10212 Use ptrdiff_t rather than size_t when either will do, as we prefer
10213 signed integers.
10214
10215 * alloc.c: Integer signedness and overflow fixes.
10216 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10217 (__malloc_size_t): Default to size_t, not to int.
10218 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10219 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10220 Prefer ptrdiff_t to size_t when either would do, as we prefer
10221 signed integers.
10222 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10223 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10224 Now const. Initialize with values that are in range even if char
10225 is signed.
10226 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10227 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10228 These functions do the right thing with sizes > 2**32.
10229 (check_depth): Now ptrdiff_t, not int.
10230 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10231 Adjust to new way of storing sizes. Check for size overflow bugs
10232 in rest of code.
10233 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10234 slightly wrong anyway, as it missed one instance of
10235 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10236 (refill_memory_reserve): Omit needless cast to size_t.
10237 (mark_object_loop_halt): Mark as externally visible.
10238
10239 * xselect.c: Integer signedness and overflow fixes.
10240 (Fx_register_dnd_atom, x_handle_dnd_message):
10241 Use ptrdiff_t, not size_t, since we prefer signed.
10242 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10243 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10244 x_dnd_atoms_size and x_dnd_atoms_length.
10245
10246 * doprnt.c: Prefer signed to unsigned when either works.
10247 * eval.c (verror):
10248 * doprnt.c (doprnt):
10249 * lisp.h (doprnt):
10250 * xdisp.c (vmessage):
10251 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10252 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10253 prefer signed arithmetic to avoid comparison confusion.
10254 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10255 but is a bit tricky.
10256
10257 Assume freestanding C89 headers, string.h, stdlib.h.
10258 * data.c, doprnt.c, floatfns.c, print.c:
10259 Include float.h unconditionally.
10260 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10261 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10262 * regex.c: Likewise for stddef.h, string.h.
10263 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10264 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10265 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10266 (STDC_HEADERS): Remove obsolete defines.
10267 * sysdep.c: Include limits.h unconditionally.
10268
10269 Assume support for memcmp, memcpy, memmove, memset.
10270 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10271 * regex.c (memcmp, memcpy):
10272 Remove; we assume C89 now.
10273
10274 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10275 (__malloc_safe_bcopy): Remove; no longer needed.
10276
10277 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10278 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10279 well either way, and we prefer signed to unsigned.
10280
10281 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10282
10283 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10284 closes the connection while we're reading (bug#9182).
10285
10286 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10287
10288 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10289 are specified (Bug#9168).
10290
10291 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10292
10293 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10294 Found by GCC static checking and --with-wide-int on a 32-bit host.
10295
10296 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10297
10298 * xdisp.c (compute_display_string_pos): Fix logic of caching
10299 previous display string position. Initialize cached_prev_pos to
10300 -1. Fixes slow-down at the beginning of a buffer.
10301
10302 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10303
10304 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10305 for attrs[LFACE_FONTSET_INDEX].
10306
10307 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 * xml.c (parse_region): Remove unused local
10310 that was recently introduced.
10311
10312 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10313
10314 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10315 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10316
10317 * xdisp.c (move_it_in_display_line_to): Record the best matching
10318 position for TO_CHARPOS while scanning the line, and restore it on
10319 exit if none of the characters scanned was an exact match.
10320 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10321 when exact match is impossible due to invisible text, and the
10322 lines are truncated.
10323
10324 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10325
10326 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10327 for OSX >= 10.7.
10328
10329 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10330
10331 Fix a significant slow-down of cursor motion with C-n, C-p,
10332 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10333 auto-repeat under bidi redisplay in fontified buffers.
10334 * xdisp.c (compute_stop_pos_backwards): New function.
10335 (next_element_from_buffer): Call compute_stop_pos_backwards to
10336 find a suitable prev_stop when we find ourselves before
10337 base_level_stop.
10338 (reseat): Don't look for prev_stop, as that could mean a very long
10339 run.
10340 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10341 <cached_disp_overlay_modiff>: Cache for last found display string
10342 position.
10343 (compute_display_string_pos): Return the cached position if asked
10344 about the same buffer in the same area of character positions, and
10345 the buffer wasn't changed since the time the display string
10346 position was cached.
10347
10348 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10349
10350 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10351 is an integer, which is important for empty lines. (Bug#9149)
10352
10353 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10354
10355 * frame.c (Fmodify_frame_parameters): In tty case, update the
10356 default face if necessary (Bug#4238).
10357
10358 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10359
10360 * editfns.c (Fstring_to_char): No need to explain what a character
10361 is in the docstring (Bug#6576).
10362
10363 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10364
10365 * xml.c (parse_region): Make sure we always return a tree.
10366
10367 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10368
10369 * xml.c (parse_region): If a document contains only comments,
10370 return that, too.
10371
10372 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10373
10374 * xml.c (make_dom): Return comments, too.
10375
10376 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10377
10378 Port to OpenBSD.
10379 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10380 and the surrounding thread.
10381 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10382 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10383 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10384 timer goes off.
10385 * s/openbsd.h (BROKEN_SIGIO): Define.
10386 * unexelf.c (unexec) [__OpenBSD__]:
10387 Don't update the .mdebug section of the Alpha COFF symbol table.
10388
10389 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10390
10391 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10392 (bug#8460).
10393
10394 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10395
10396 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10397 This fixes some race conditions on the permissions of any newly
10398 created file.
10399
10400 * alloc.c (valid_pointer_p): Use pipe, not open.
10401 This fixes some permissions issues when debugging.
10402
10403 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10404 If fchown fails to set both uid and gid, try to set just gid,
10405 as that is sometimes allowed. Adjust the file's mode to eliminate
10406 setuid or setgid bits that are inappropriate if fchown fails.
10407
10408 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10409
10410 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10411 to compare Lisp_Objects.
10412 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10413 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10414 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10415
10416 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10417
10418 * lread.c (read_integer): Unread even EOF character.
10419 (read1): Likewise. Properly record start position of symbol.
10420
10421 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10422 symbol character follows.
10423
10424 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10425
10426 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10427 This works around a problem with the previous change to Fcopy_file.
10428 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10429 and without this change, GCC might complain about discarding
10430 fchown's return value.
10431
10432 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
10433
10434 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10435
10436 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10437
10438 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10439
10440 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10441
10442 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10443 it's used from the C level.
10444
10445 * process.c: Use the same condition for POLL_FOR_INPUT in both
10446 keyboard.c and process.c (bug#1858).
10447
10448 2011-07-09 Lawrence Mitchell <wence@gmx.li>
10449
10450 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10451 (Fgnutls_boot): Use it.
10452
10453 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10454
10455 * doc.c (Fsubstitute_command_keys): Revert last change.
10456
10457 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10458
10459 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10460 quotes the next character, and doesn't affect other longer
10461 sequences (bug#8935).
10462
10463 * lread.c (syms_of_lread): Clarify that is isn't only
10464 `eval-buffer' and `eval-defun' that's affected by
10465 `lexical-binding' (bug#8460).
10466
10467 2011-07-15 Eli Zaretskii <eliz@gnu.org>
10468
10469 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
10470 bidi redisplay when a line includes both an image and is truncated.
10471
10472 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10473
10474 Fix minor problems found by static checking.
10475 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10476 (elsz): Now a signed constant, not a size_t var. We prefer signed
10477 types to unsigned, to avoid integer comparison confusion. Without
10478 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10479 "cannot optimize loop, the loop counter may overflow", a symptom
10480 of the confusion.
10481 * indent.c (Fvertical_motion): Mark locals as initialized.
10482 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10483
10484 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10485
10486 * search.c (Fre_search_backward): Mention `case-fold-search' in
10487 all the re_search_* functions (bug#8138).
10488
10489 * keyboard.c (Fopen_dribble_file): Document when the file is
10490 closed (bug#8056).
10491
10492 2011-07-14 Eli Zaretskii <eliz@gnu.org>
10493
10494 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10495 bidi_cache_idx.
10496
10497 Support bidi reordering of display and overlay strings.
10498 * xdisp.c (compute_display_string_pos)
10499 (compute_display_string_end): Accept additional argument STRING.
10500 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10501 (reseat_to_string): Initialize bidi_it->string.s and
10502 bidi_it->string.schars.
10503 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
10504 NULL (avoids a crash in bidi_paragraph_init).
10505 Initialize itb.string.lstring.
10506 (init_iterator): Call bidi_init_it only of a valid
10507 buffer position was specified. Initialize paragraph_embedding to
10508 L2R.
10509 (reseat_to_string): Initialize the bidi iterator.
10510 (display_string): If we need to ignore text properties of
10511 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10512 original value of -1 will not work with bidi.)
10513 (compute_display_string_pos): First arg is now struct
10514 `text_pos *'; all callers changed. Support display properties on
10515 Lisp strings.
10516 (compute_display_string_end): Support display properties on Lisp
10517 strings.
10518 (init_iterator, reseat_1, reseat_to_string): Initialize the
10519 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10520 when iterating on a string not from display properties).
10521 (compute_display_string_pos, compute_display_string_end):
10522 Fix calculation of the object to scan. Fixes an error when using
10523 arrow keys.
10524 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
10525 base_level_stop; instead, set base_level_stop to BEGV.
10526 Fixes crashes in vertical-motion.
10527 (next_element_from_buffer): Improve commentary for when
10528 the iterator is before prev_stop.
10529 (init_iterator): Initialize bidi_p from the default value of
10530 bidi-display-reordering, not from buffer-local value. Use the
10531 buffer-local value only if initializing for buffer iteration.
10532 (handle_invisible_prop): Support invisible properties on strings
10533 that are being bidi-reordered.
10534 (set_iterator_to_next): Support bidi reordering of C strings and
10535 Lisp strings.
10536 (next_element_from_string): Support bidi reordering of Lisp
10537 strings.
10538 (handle_stop_backwards): Support Lisp strings as well.
10539 (display_string): Support display of R2L glyph rows.
10540 Use IT_STRING_CHARPOS when displaying from a Lisp string.
10541 (init_iterator): Don't initialize it->bidi_p for strings
10542 here.
10543 (reseat_to_string): Initialize it->bidi_p for strings here.
10544 (next_element_from_string, next_element_from_c_string)
10545 (next_element_from_buffer): Add xassert's for correspondence
10546 between IT's object being iterated and it->bidi_it.string
10547 structure.
10548 (face_before_or_after_it_pos): Support bidi iteration.
10549 (next_element_from_c_string): Handle the case of the first string
10550 character that is not the first one in the visual order.
10551 (get_visually_first_element): New function, refactored from common
10552 parts of next_element_from_buffer, next_element_from_string, and
10553 next_element_from_c_string.
10554 (tool_bar_lines_needed, redisplay_tool_bar)
10555 (display_menu_bar): Force left-to-right direction. Add a FIXME
10556 comment for making that be controlled by a user option.
10557 (push_it, pop_it): Save and restore the state of the
10558 bidi iterator. Save and restore the bidi_p flag.
10559 (pop_it): Iterate out of display property for string iteration as
10560 well.
10561 (iterate_out_of_display_property): Support iteration over strings.
10562 (handle_single_display_spec): Set up it->bidi_it for iteration
10563 over a display string, and call bidi_init_it.
10564 (handle_single_display_spec, next_overlay_string)
10565 (get_overlay_strings_1, push_display_prop): Set up the bidi
10566 iterator for displaying display or overlay strings.
10567 (forward_to_next_line_start): Don't use the shortcut if
10568 bidi-iterating.
10569 (back_to_previous_visible_line_start): If handle_display_prop
10570 pushed the iterator stack, restore the internal state of the bidi
10571 iterator by calling bidi_pop_it same number of times.
10572 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10573 and we are bidi-iterating, don't decrement the iterator position;
10574 instead, set the first_elt flag in the bidi iterator, to produce
10575 the same effect.
10576 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10577 (push_display_prop): xassert that we are iterating a buffer.
10578 (push_it, pop_it): Save and restore paragraph_embedding member.
10579 (handle_single_display_spec, next_overlay_string)
10580 (get_overlay_strings_1, reseat_1, reseat_to_string)
10581 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10582 correctly. Don't assume unibyte strings are not bidi-reordered.
10583 (compute_display_string_pos)
10584 (compute_display_string_end): Fix handling the case of C string.
10585 (push_it, pop_it): Save and restore from_disp_prop_p.
10586 (handle_single_display_spec, push_display_prop): Set the
10587 from_disp_prop_p flag.
10588 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10589 (pop_it): Call iterate_out_of_display_property only if we are
10590 popping after iteration over a string that came from a display
10591 property. Fix a typo in popping stretch info. Add an assertion
10592 for verifying that the iterator position is in sync with the bidi
10593 iterator.
10594 (handle_single_display_spec, get_overlay_strings_1)
10595 (push_display_prop): Fix initialization of paragraph direction for
10596 string when that of the parent object is not yet determined.
10597 (reseat_1): Call bidi_init_it to resync the bidi
10598 iterator with IT's position. (Bug#7616)
10599 (find_row_edges): If ROW->start.pos gives position
10600 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10601 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10602 Reset the from_disp_prop_p flag.
10603 (SAVE_IT, RESTORE_IT): New macros.
10604 (pos_visible_p, face_before_or_after_it_pos)
10605 (back_to_previous_visible_line_start)
10606 (move_it_in_display_line_to, move_it_in_display_line)
10607 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10608 (try_scrolling, redisplay_window, display_line): Use them when
10609 saving a temporary copy of the iterator and restoring it back.
10610 (back_to_previous_visible_line_start, reseat_1)
10611 (init_iterator): Empty the bidi cache "stack".
10612 (move_it_in_display_line_to): If iterator ended up at
10613 EOL, but we never saw any buffer positions smaller than
10614 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10615 motion in bidi-reordered lines.
10616 (move_it_in_display_line_to): Record prev_method and prev_pos
10617 immediately before the call to set_iterator_to_next. Fixes cursor
10618 motion in bidi-reordered lines with stretch glyphs and strings
10619 displayed in margins. (Bug#8133) (Bug#8867)
10620 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10621 TO_CHARPOS.
10622 (pos_visible_p): Support positions in bidi-reordered lines.
10623 Save and restore bidi cache.
10624
10625 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10626 (bidi_paragraph_info): Delete unused struct.
10627 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10628 (bidi_cache_start): New variable.
10629 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10630 to zero.
10631 (bidi_cache_fetch_state, bidi_cache_search)
10632 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10633 (bidi_cache_find, bidi_peek_at_next_level)
10634 (bidi_level_of_next_char, bidi_find_other_level_edge)
10635 (bidi_move_to_visually_next): Compare cache index with
10636 bidi_cache_start rather than with zero.
10637 (bidi_fetch_char): Accept new argument STRING; all callers
10638 changed. Support iteration over a string. Support strings with
10639 display properties. Support unibyte strings. Fix the type of
10640 `len' according to what STRING_CHAR_AND_LENGTH expects.
10641 (bidi_paragraph_init, bidi_resolve_explicit_1)
10642 (bidi_resolve_explicit, bidi_resolve_weak)
10643 (bidi_level_of_next_char, bidi_move_to_visually_next):
10644 Support iteration over a string.
10645 (bidi_set_sor_type, bidi_resolve_explicit_1)
10646 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10647 can now be zero (for strings); special values 0 and -1 were
10648 changed to -1 and -2, respectively.
10649 (bidi_char_at_pos): New function.
10650 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10651 Call it instead of FETCH_MULTIBYTE_CHAR.
10652 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10653 initialized to valid values.
10654 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10655 values.
10656 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10657 the test for valid cached positions. Fix the logic for looking up
10658 the sentinel state in the cache. GCPRO the Lisp string we are
10659 iterating.
10660 (bidi_push_it, bidi_pop_it): New functions.
10661 (bidi_initialize): Initialize the bidi cache start stack pointer.
10662 (bidi_cache_ensure_space): New function, refactored from part of
10663 bidi_cache_iterator_state. Don't assume the required size is just
10664 one BIDI_CACHE_CHUNK away.
10665 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10666 (bidi_count_bytes, bidi_char_at_pos): New functions.
10667 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10668 always valid if bidi_cache_idx is valid.
10669 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10670 is valid if it's going to be used.
10671 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10672 (bidi_cache_fetch_state, bidi_cache_search)
10673 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10674 (bidi_cache_iterator_state, bidi_cache_find)
10675 (bidi_find_other_level_edge, bidi_cache_start_stack):
10676 All variables related to cache indices are now EMACS_INT.
10677
10678 * dispextern.h (struct bidi_string_data): New structure.
10679 (struct bidi_it): New member `string'. Make flag members be 1-bit
10680 fields, and put them last in the struct.
10681 (compute_display_string_pos, compute_display_string_end):
10682 Update prototypes.
10683 (bidi_push_it, bidi_pop_it): Add prototypes.
10684 (struct iterator_stack_entry): New members bidi_p,
10685 paragraph_embedding, and from_disp_prop_p.
10686 (struct it): Member bidi_p is now a bit field 1 bit wide.
10687 (bidi_shelve_cache, bidi_unshelve_cache):
10688 Declare prototypes.
10689
10690 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10691 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10692 and vector-like objects.
10693
10694 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10695 cache around display iteration.
10696
10697 * window.c (Fwindow_end, window_scroll_pixel_based)
10698 (displayed_window_lines, Frecenter): Save and restore the bidi
10699 cache around display iteration.
10700
10701 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10702
10703 * editfns.c (Fdelete_region): Clarify the use of the named
10704 parameters (bug#6788).
10705
10706 2011-07-14 Martin Rudalics <rudalics@gmx.at>
10707
10708 * indent.c (Fvertical_motion): Set and restore w->pointm when
10709 saving and restoring the window's buffer (Bug#9006).
10710
10711 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10712
10713 * editfns.c (Fstring_to_char): Clarify just what is returned
10714 (bug#6576). Text by Eli Zaretskii.
10715
10716 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
10717
10718 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10719
10720 2011-07-13 Eli Zaretskii <eliz@gnu.org>
10721
10722 * buffer.c (mmap_find): Fix a typo.
10723
10724 2011-07-13 Johan Bockgård <bojohan@gnu.org>
10725
10726 Fix execution of x selection hooks.
10727 * xselect.c (Qx_lost_selection_functions)
10728 (Qx_sent_selection_functions): New vars.
10729 (syms_of_xselect): DEFSYM them.
10730 (x_handle_selection_request): Pass Qx_sent_selection_functions
10731 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10732 (x_handle_selection_clear,x_clear_frame_selections):
10733 Pass Qx_lost_selection_functions rather than
10734 Vx_lost_selection_functions to Frun_hook_with_args.
10735
10736 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10737
10738 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
10739 The old code sometimes used this field without initializing it.
10740
10741 * alloc.c (gc_sweep): Don't read past end of array.
10742 In theory, the old code could also have corrupted Emacs internals,
10743 though it'd be very unlikely.
10744
10745 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10746
10747 * character.c (Fcharacterp): Don't advertise optional ignored
10748 argument. (Bug#4026)
10749
10750 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10751
10752 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10753 key" (bug#4257).
10754
10755 * window.c (Fset_window_start): Doc fix (bug#4199).
10756 (Fset_window_hscroll): Ditto.
10757
10758 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10759
10760 Fix minor new problems caught by GCC 4.6.1.
10761 * term.c (init_tty): Remove unused local.
10762 * xsettings.c (store_monospaced_changed): Define this function only
10763 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
10764 not used otherwise.
10765
10766 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
10767
10768 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10769
10770 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10771
10772 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10773 are the mini-buffer and the echo area (bug#3320).
10774
10775 * term.c (init_tty): Remove support for supdup, c10 and perq
10776 terminals, which are no longer supported (bug#1482).
10777
10778 2011-07-10 Johan Bockgård <bojohan@gnu.org>
10779
10780 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10781
10782 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10783
10784 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10785 for non-popups (Bug#3642).
10786
10787 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10788
10789 * alloc.c (reset_malloc_hooks): Protoize.
10790 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
10791 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10792 * cm.c (losecursor): Likewise.
10793 * data.c (fmod): Likewise.
10794 * dispnew.c (swap_glyphs_in_rows): Likewise.
10795 * emacs.c (memory_warning_signal): Likewise.
10796 * floatfns.c (float_error): Likewise.
10797 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10798 (otf_open, font_otf_capability, generate_otf_features)
10799 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10800 Likewise.
10801 * image.c (pbm_read_file): Likewise.
10802 * indent.c (string_display_width): Likewise.
10803 * intervals.c (check_for_interval, search_for_interval)
10804 (inc_interval_count, count_intervals, root_interval)
10805 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10806 * lread.c (defalias): Likewise.
10807 * ralloc.c (r_alloc_check): Likewise.
10808 * regex.c (set_image_of_range_1, set_image_of_range)
10809 (regex_grow_registers): Likewise.
10810 * sysdep.c (strerror): Likewise.
10811 * termcap.c (valid_filename_p, tprint, main): Likewise.
10812 * tparam.c (main): Likewise.
10813 * unexhp9k800.c (run_time_remap, save_data_space)
10814 (update_file_ptrs, read_header, write_header, calculate_checksum)
10815 (copy_file, copy_rest, display_header): Likewise.
10816 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10817 Likewise.
10818 * xdisp.c (check_it): Likewise.
10819 * xfaces.c (register_color, unregister_color, unregister_colors):
10820 Likewise.
10821 * xfns.c (print_fontset_result): Likewise.
10822 * xrdb.c (member, fatal, main): Likewise.
10823
10824 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10825
10826 Fix minor problems found by static checking (Bug#9031).
10827 * chartab.c (char_table_set_range, map_sub_char_table):
10828 Remove unused locals.
10829 (uniprop_table): Now static.
10830 * composite.c (_work_char): Remove unused static var.
10831
10832 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
10833
10834 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10835
10836 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10837
10838 * gtkutil.c (qttip_cb): Remove code without function.
10839
10840 2011-07-09 Eli Zaretskii <eliz@gnu.org>
10841
10842 * w32.c (pthread_sigmask): New stub.
10843
10844 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
10845
10846 Use pthread_sigmask, not sigprocmask (Bug#9010).
10847 sigprocmask is portable only for single-threaded applications, and
10848 Emacs can be multi-threaded when it uses GTK.
10849 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10850 (LIBES): Use it.
10851 * callproc.c (Fcall_process):
10852 * process.c (create_process):
10853 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10854 Use pthread_sigmask, not sigprocmask.
10855
10856 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10857
10858 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10859 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10860 wrong (Bug#8591).
10861
10862 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10863
10864 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10865 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10866 (xg_hide_tooltip): Fix comment.
10867
10868 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10869 in registerServicesMenuSendTypes.
10870 (validRequestorForSendType): Don't check ns_return_types.
10871
10872 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10873 ns_return_type.
10874
10875 2011-07-08 Jason Rumney <jasonr@gnu.org>
10876
10877 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10878 SH_SHOW for hidden windows (Bug#5482).
10879
10880 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10881 frame struct members of non-existent frames (Bug#6284).
10882
10883 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10884
10885 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10886 variable firstTime not needed on OSX >= 10.6.
10887 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10888 >= 10.5. Use setKnobProportion, setDoubleValue.
10889
10890 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10891 (MAC_OS_X_VERSION_10_5): Define if not defined.
10892 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10893 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10894 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10895
10896 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
10897 cString and lossyCString on OSX >= 10.4.
10898
10899 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
10900 sizeToFit on OSX >= 10.2.
10901
10902 * nsimage.m (allocInitFromFile): Don't use deprecated method
10903 bestRepresentationForDevice on OSX >= 10.6.
10904
10905 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10906 to avoid warning.
10907
10908 * emacs.c: Declare unexec_init_emacs_zone.
10909
10910 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10911
10912 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10913
10914 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10915 on svcsMenu (Bug#8842).
10916
10917 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10918 ns_return_types.
10919 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10920
10921 * nsterm.m (QUTF8_STRING): Declare.
10922 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10923 (validRequestorForSendType): Return type is (id).
10924 Change indexOfObjectIdenticalTo to indexOfObject.
10925 Check if we have local selection before returning self (Bug#8842).
10926 (writeSelectionToPasteboard): Put local selection into paste board
10927 if we have a local selection (Bug#8842).
10928 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10929
10930 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10931 (ns_get_local_selection): Declare.
10932
10933 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10934
10935 * keymap.c (describe_map_tree): Don't insert a double newline at
10936 the end of the buffer (bug#1169) and return whether we inserted
10937 something.
10938
10939 * callint.c (Fcall_interactively): Change "reading args" to
10940 "providing args" to try to clarify what it does (bug#1010).
10941
10942 2011-07-07 Kenichi Handa <handa@m17n.org>
10943
10944 * composite.c (composition_compute_stop_pos): Ignore a static
10945 composition starting before CHARPOS (Bug#8915).
10946
10947 * xdisp.c (handle_composition_prop): Likewise.
10948
10949 2011-07-07 Eli Zaretskii <eliz@gnu.org>
10950
10951 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10952 (Bug#9015)
10953
10954 2011-07-07 Kenichi Handa <handa@m17n.org>
10955
10956 * character.h (unicode_category_t): New enum type.
10957
10958 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10959 (Qchar_code_property_table): New variable.
10960 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10961 (UNIPROP_COMPRESSED_FORM_P): New macros.
10962 (char_table_ascii): Uncompress the compressed values.
10963 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10964 Uncompress the compressed values.
10965 (sub_char_table_ref_and_range): Likewise.
10966 (char_table_ref_and_range): Uncompress the compressed values.
10967 (sub_char_table_set): New arg is_uniprop. Callers changed.
10968 Uncompress the compressed values.
10969 (sub_char_table_set_range): Args changed. Callers changed.
10970 (char_table_set_range): Adjuted for the above change.
10971 (map_sub_char_table): Delete args default_val and parent. Add arg
10972 top. Give decoded values to a Lisp function.
10973 (map_char_table): Adjust for the above change. Give decoded
10974 values to a Lisp function. Gcpro more variables.
10975 (uniprop_table_uncompress)
10976 (uniprop_decode_value_run_length): New functions.
10977 (uniprop_decoder, uniprop_decoder_count): New variables.
10978 (uniprop_get_decoder, uniprop_encode_value_character)
10979 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10980 New functions.
10981 (uniprop_encoder, uniprop_encoder_count): New variables.
10982 (uniprop_get_encoder, uniprop_table)
10983 (Funicode_property_table_internal, Fget_unicode_property_internal)
10984 (Fput_unicode_property_internal): New functions.
10985 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10986 Sunicode_property_table_internal, Sget_unicode_property_internal,
10987 and Sput_unicode_property_internal. Defvar_lisp
10988 char-code-property-alist.
10989
10990 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
10991 Vunicode_category_table.
10992
10993 * font.c (font_range): Adjust for the change of
10994 Vunicode_category_table.
10995
10996 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10997
10998 * m/iris4d.h: Remove file, move contents ...
10999 * s/irix6-5.h: ... here.
11000
11001 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11002
11003 Remove unportable assumption about struct layout (Bug#8884).
11004 * alloc.c (mark_buffer):
11005 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11006 (clone_per_buffer_values): Don't assume that
11007 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11008 This isn't true in general, and it's particularly not true
11009 if Emacs is configured with --with-wide-int.
11010 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11011 New macros, used in the buffer.c change.
11012
11013 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11014
11015 * xsettings.c: Use both GConf and GSettings if both are available.
11016 (store_config_changed_event): Add comment.
11017 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11018 (store_tool_bar_style_changed): New functions.
11019 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11020 (struct xsettings): Move font inside HAVE_XFT.
11021 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11022 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11023 Move inside HAVE_XFT.
11024 (something_changed_gsettingsCB): Rename from something_changedCB.
11025 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11026 also.
11027 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11028 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11029 (something_changed_gconfCB): Rename from something_changedCB.
11030 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11031 (parse_settings): Move check for font inside HAVE_XFT.
11032 (read_settings, apply_xft_settings): Add comment.
11033 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11034 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11035 call store_font_name_changed.
11036 (xft_settings_event): Add comment.
11037 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11038 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11039 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11040 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11041 (xsettings_initialize): Call init_gsettings last.
11042 (xsettings_get_system_font, xsettings_get_system_normal_font):
11043 Add comment.
11044
11045 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11046
11047 Random fixes. E.g., (random) never returned negative values.
11048 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11049 subseconds part to the entropy, as that's a bit more random.
11050 Prefer signed to unsigned, since the signedness doesn't matter and
11051 in general we prefer signed. When given a limit, use a
11052 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11053 latter isn't right if USE_2_TAGS_FOR_INTS.
11054 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11055 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11056
11057 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11058
11059 * textprop.c (text_property_stickiness):
11060 Obey Vtext_property_default_nonsticky.
11061 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11062 * w32fns.c (syms_of_w32fns):
11063 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11064
11065 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11066
11067 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11068 This is more efficient than Ffile_directory_p and avoids a minor race.
11069
11070 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11071
11072 * buffer.c (Foverlay_put): Say what the return value is
11073 (bug#7835).
11074
11075 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11076 is a directory before asking whether to use the file name
11077 (bug#7564).
11078 (barf_or_query_if_file_exists): Make the "File is a directory"
11079 error be more correct.
11080
11081 * fns.c (Frequire): Remove the mention of the .gz files, since
11082 that's installation-specific, but keep the mention of
11083 `get-load-suffixes'.
11084
11085 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11086
11087 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11088 Report string overflow if the output is too long.
11089
11090 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11091
11092 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11093 (syms_of_gnutls): Remove duplicate DEFSYM for
11094 Qgnutls_bootprop_verify_hostname_error, an error for
11095 Qgnutls_bootprop_verify_error (which is no longer used).
11096
11097 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11098 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11099 Also (re)move comments that are misplaced or no longer relevant.
11100
11101 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11102
11103 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11104
11105 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11106
11107 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11108 and background color parameters if they have been changed.
11109
11110 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11111
11112 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11113
11114 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11115
11116 * xsettings.c (SYSTEM_FONT): Define only when used.
11117 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11118
11119 * keymap.c (access_keymap_1): Now static.
11120
11121 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11122
11123 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11124 leave any prefix arg for the up event (Bug#1586).
11125
11126 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11127
11128 * lread.c (syms_of_lread): Mention single symbols defined by
11129 `defvar' or `defconst' (bug#7154).
11130
11131 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11132 (Frequire): Mention get-load-suffixes.
11133
11134 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11135
11136 * window.h (window): Remove clone_number slot.
11137 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11138 Remove.
11139 (make_parent_window, make_window, saved_window)
11140 (Fset_window_configuration, save_window_save): Don't deal with
11141 clone numbers.
11142 * buffer.c (Qclone_number): Remove declaration.
11143 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11144
11145 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11146
11147 Add multiple inheritance to keymaps.
11148 * keymap.c (Fmake_composed_keymap): New function.
11149 (Fset_keymap_parent): Simplify.
11150 (fix_submap_inheritance): Remove.
11151 (access_keymap_1): New function extracted from access_keymap to handle
11152 embedded parents and handle lists of maps.
11153 (access_keymap): Use it.
11154 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11155 (Fcopy_keymap): Handle embedded parents.
11156 (Fcommand_remapping, define_as_prefix): Simplify.
11157 (Fkey_binding): Simplify.
11158 (syms_of_keymap): Move minibuffer-local-completion-map,
11159 minibuffer-local-filename-completion-map,
11160 minibuffer-local-must-match-map, and
11161 minibuffer-local-filename-must-match-map to Elisp.
11162 (syms_of_keymap): Defsubr make-composed-keymap.
11163 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11164 (parse_menu_item): Trivial simplification.
11165
11166 2011-07-01 Glenn Morris <rgm@gnu.org>
11167
11168 * Makefile.in (SETTINGS_LIBS): Fix typo.
11169
11170 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11171
11172 * coding.c (Fencode_coding_string): Record the last coding system
11173 used, as the function doc string says (bug#8738).
11174
11175 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11176
11177 * xsettings.c (store_monospaced_changed): Take new font as arg and
11178 check for change against current_mono_font.
11179 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11180 (emacs_settings_constructor, emacs_settings_get_property)
11181 (emacs_settings_set_property, emacs_settings_class_init)
11182 (emacs_settings_init, gsettings_obj): Remove.
11183 (something_changedCB): New function for HAVE_GSETTINGS.
11184 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11185 with value as argument.
11186 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11187 g_settings_new (Bug#8967). Do not create gsettings_obj.
11188 Remove calls to g_settings_bind. Connect something_changedCB to
11189 "changed".
11190
11191 * xgselect.c: Add defined (HAVE_GSETTINGS).
11192 (xgselect_initialize): Ditto.
11193
11194 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11195 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11196 xg_select.
11197
11198 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11199
11200 * eval.c (struct backtrace): Simplify and port the data structure.
11201 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11202 signed bit field, as this assumption is not portable and it makes
11203 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11204 "char debug_on_exit : 1" as this is not portable either; instead,
11205 use the portable "unsigned int debug_on_exit : 1". Remove unused
11206 member evalargs. Remove obsolete comments about cc bombing out.
11207
11208 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11209
11210 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11211 Let HAVE_GSETTINGS override HAVE_GCONF.
11212 (store_monospaced_changed): New function.
11213 (EMACS_SETTINGS): A new type derived from GObject to handle
11214 GSettings notifications.
11215 (emacs_settings_constructor, emacs_settings_get_property)
11216 (emacs_settings_set_property, emacs_settings_class_init):
11217 New functions.
11218 (gsettings_client, gsettings_obj): New variables.
11219 (GSETTINGS_SCHEMA): New define.
11220 (something_changedCB): Call store_monospaced_changed.
11221 (init_gsettings): New function.
11222 (xsettings_initialize): Call init_gsettings.
11223 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11224 to NULL.
11225
11226 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11227 GCONF_CFLAGS/LIBS.
11228
11229 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11230
11231 * window.c (resize_root_window, grow_mini_window)
11232 (shrink_mini_window): Rename Qresize_root_window to
11233 Qwindow_resize_root_window and Qresize_root_window_vertically to
11234 Qwindow_resize_root_window_vertically.
11235
11236 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11237
11238 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11239
11240 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11241
11242 * makefile.w32-in: Redesign dependencies so they reflect more
11243 clearly which files are directly included by each source file,
11244 and not through other includes.
11245
11246 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11247
11248 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11249 (sort_overlays, overlay_strings): When an overlay's clone number
11250 matches the window's clone number process the overlay even if
11251 the overlay's window property doesn't match the current window.
11252
11253 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11254 (Fwindow_hchild): Rename to Fwindow_left_child.
11255 (Fwindow_next): Rename to Fwindow_next_sibling.
11256 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11257 (resize_window_check): Rename to window_resize_check.
11258 (resize_window_apply): Rename to window_resize_apply.
11259 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11260 (Fdelete_other_windows_internal, resize_frame_windows)
11261 (Fsplit_window_internal, Fdelete_window_internal)
11262 (grow_mini_window, shrink_mini_window)
11263 (Fresize_mini_window_internal): Fix callers accordingly.
11264
11265 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11266
11267 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11268 (emacs_fixed_set_min_size): Remove.
11269 (emacs_fixed_new): Take frame as argument.
11270
11271 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11272 (_EmacsFixedPrivate): Remove minwidth/height.
11273 Add struct frame *f.
11274 (emacs_fixed_init): Initialize priv->f.
11275 (get_parent_class, emacs_fixed_set_min_size): Remove.
11276 (emacs_fixed_new): Set priv->f to argument.
11277 (emacs_fixed_get_preferred_width)
11278 (emacs_fixed_get_preferred_height): Use min_width/height from
11279 frames size_hint to set minimum and natural (Bug#8919).
11280 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11281 and use min_width/height from frames size_hint to set
11282 min_width/height (Bug#8919).
11283
11284 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11285 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11286 Fix indentation.
11287
11288 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11289
11290 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11291 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11292 called at ZV.
11293
11294 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11295
11296 * process.c (wait_reading_process_output): Bypass select if
11297 waiting for a cell while ignoring keyboard input, and input is
11298 pending. Suggested by Jan Djärv (Bug#8869).
11299
11300 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11301
11302 Use gnulib's dup2 module instead of rolling our own.
11303 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11304
11305 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11306
11307 * dispnew.c (scrolling_window): Before scrolling, turn off a
11308 mouse-highlight in the window being scrolled.
11309
11310 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11311
11312 Move DEFSYM to lisp.h and use everywhere.
11313
11314 * character.h (DEFSYM): Move declaration...
11315 * lisp.h (DEFSYM): ...here.
11316
11317 * gnutls.c:
11318 * minibuf.c:
11319 * w32menu.c:
11320 * w32proc.c:
11321 * w32select.c: Don't include character.h.
11322
11323 * alloc.c (syms_of_alloc):
11324 * buffer.c (syms_of_buffer):
11325 * bytecode.c (syms_of_bytecode):
11326 * callint.c (syms_of_callint):
11327 * casefiddle.c (syms_of_casefiddle):
11328 * casetab.c (init_casetab_once):
11329 * category.c (init_category_once, syms_of_category):
11330 * ccl.c (syms_of_ccl):
11331 * cmds.c (syms_of_cmds):
11332 * composite.c (syms_of_composite):
11333 * dbusbind.c (syms_of_dbusbind):
11334 * dired.c (syms_of_dired):
11335 * dispnew.c (syms_of_display):
11336 * doc.c (syms_of_doc):
11337 * editfns.c (syms_of_editfns):
11338 * emacs.c (syms_of_emacs):
11339 * eval.c (syms_of_eval):
11340 * fileio.c (syms_of_fileio):
11341 * fns.c (syms_of_fns):
11342 * frame.c (syms_of_frame):
11343 * fringe.c (syms_of_fringe):
11344 * insdel.c (syms_of_insdel):
11345 * keymap.c (syms_of_keymap):
11346 * lread.c (init_obarray, syms_of_lread):
11347 * macros.c (syms_of_macros):
11348 * msdos.c (syms_of_msdos):
11349 * print.c (syms_of_print):
11350 * process.c (syms_of_process):
11351 * search.c (syms_of_search):
11352 * sound.c (syms_of_sound):
11353 * syntax.c (init_syntax_once, syms_of_syntax):
11354 * terminal.c (syms_of_terminal):
11355 * textprop.c (syms_of_textprop):
11356 * undo.c (syms_of_undo):
11357 * w32.c (globals_of_w32):
11358 * window.c (syms_of_window):
11359 * xdisp.c (syms_of_xdisp):
11360 * xfaces.c (syms_of_xfaces):
11361 * xfns.c (syms_of_xfns):
11362 * xmenu.c (syms_of_xmenu):
11363 * xsettings.c (syms_of_xsettings):
11364 * xterm.c (syms_of_xterm): Use DEFSYM.
11365
11366 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11367
11368 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11369
11370 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11371
11372 Integer and buffer overflow fixes (Bug#8873).
11373
11374 * print.c (printchar, strout): Check for string overflow.
11375 (PRINTPREPARE, printchar, strout):
11376 Don't set size unless allocation succeeds.
11377
11378 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11379 for sizes. Check for string overflow more accurately.
11380 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11381
11382 * macros.c: Integer and buffer overflow fixes.
11383 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11384 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11385 Use ptrdiff_t, not int, for sizes.
11386 Don't increment bufsize until after realloc succeeds.
11387 Check for size-calculation overflow.
11388 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11389
11390 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11391
11392 * lread.c: Integer overflow fixes.
11393 (read_integer): Radix is now EMACS_INT, not int,
11394 to improve quality of diagnostics for out-of-range radices.
11395 Calculate buffer size correctly for out-of-range radices.
11396 (read1): Check for integer overflow in radices, and in
11397 read-circle numbers.
11398 (read_escape): Avoid int overflow.
11399 (Fload, openp, read_buffer_size, read1)
11400 (substitute_object_recurse, read_vector, read_list, map_obarray):
11401 Use ptrdiff_t, not int, for sizes.
11402 (read1): Use EMACS_INT, not int, for sizes.
11403 Check for size overflow.
11404
11405 * image.c (cache_image): Check for size arithmetic overflow.
11406
11407 * lread.c: Integer overflow issues.
11408 (saved_doc_string_size, saved_doc_string_length)
11409 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11410 Now ptrdiff_t, not int.
11411 (read1): Don't assume doc string length fits in int. Check for
11412 out-of-range doc string lengths.
11413 (read_list): Don't assume file position fits in int.
11414 (read_escape): Check for hex character overflow.
11415
11416 2011-06-22 Leo Liu <sdl.web@gmail.com>
11417
11418 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11419 Move to minibuffer.el.
11420
11421 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11422
11423 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11424 The following patches are for when GLYPH_DEBUG && !XASSERT.
11425 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11426 * dispnew.c (flush_stdout):
11427 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11428 Mark as externally visible.
11429 * dispnew.c (check_window_matrix_pointers): Now static.
11430 * dispnew.c (window_to_frame_vpos):
11431 * xfns.c (unwind_create_frame):
11432 * xterm.c (x_check_font): Remove unused local.
11433 * scroll.c (CHECK_BOUNDS):
11434 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11435 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11436 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11437 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11438 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11439 Now static.
11440 (debug_method_add): Use va_list and vsprintf rather than relying
11441 on undefined behavior with wrong number of arguments.
11442 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11443 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11444 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11445 since we're not interested in debugging glyphs with old libraries.
11446 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11447 GCC 4.6.0's static checking.
11448
11449 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11450
11451 Integer overflow and signedness fixes (Bug#8873).
11452 A few related buffer overrun fixes, too.
11453
11454 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11455
11456 * dispextern.h (struct face.stipple):
11457 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11458 (x_bitmap_mask, x_allocate_bitmap_record)
11459 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11460 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11461 (x_create_bitmap_from_xpm_data):
11462 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11463 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11464 (.bitmaps_last):
11465 * xfaces.c (load_pixmap):
11466 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11467 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11468 (.bitmaps_last, struct x_output.icon_bitmap):
11469 Use ptrdiff_t, not int, for bitmap indexes.
11470 (x_allocate_bitmap_record): Check for size overflow.
11471 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11472
11473 Use ptrdiff_t, not int, for overlay counts.
11474 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11475 * editfns.c (overlays_around, get_pos_property):
11476 * textprop.c (get_char_property_and_overlay):
11477 * xdisp.c (next_overlay_change, note_mouse_highlight):
11478 * xfaces.c (face_at_buffer_position):
11479 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11480 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11481 (Fnext_overlay_change, Fprevious_overlay_change)
11482 (mouse_face_overlay_overlaps, Foverlays_in):
11483 Use ptrdiff_t, not int, for sizes.
11484 (overlays_at, overlays_in): Check for size-calculation overflow.
11485
11486 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11487
11488 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11489 (x_session_initialize): Do not assume string length fits in int.
11490
11491 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11492 This is unlikely, but can occur if DPI is outlandish.
11493
11494 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
11495 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11496
11497 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11498 * xrdb.c (magic_file_p, search_magic_path):
11499 Omit last arg SUFFIX; it was always 0. All callers changed.
11500 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11501
11502 * xfont.c (xfont_match): Avoid need for strlen.
11503
11504 * xfns.c: Don't assume strlen fits in int.
11505 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11506
11507 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11508 not unsigned long, as we prefer signed integers. All callers changed.
11509 Detect integer overflow in repeat count.
11510 (message_dolog): Don't assume print length fits in 39 bytes.
11511 (display_mode_element): Don't assume strlen fits in int.
11512
11513 * termcap.c: Don't assume sizes fit in int and never overflow.
11514 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11515 (gobble_line): Check for size-calculation overflow.
11516
11517 * minibuf.c (Fread_buffer):
11518 * lread.c (intern, intern_c_string):
11519 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11520 Don't assume string length fits in int.
11521
11522 * keyboard.c (parse_tool_bar_item):
11523 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11524
11525 * font.c: Don't assume string length fits in int.
11526 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11527 Use ptrdiff_t, not int.
11528 (font_intern_prop): Don't assume string length fits in int.
11529 Don't assume integer property fits in fixnum.
11530 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
11531
11532 * filelock.c: Fix some buffer overrun and integer overflow issues.
11533 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
11534 Reformulate so as not to need the command string.
11535 Invoke gzip -cd rather than gunzip, as it's more portable.
11536 (lock_info_type, lock_file_1, lock_file):
11537 Don't assume pid_t and time_t fit in unsigned long.
11538 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11539 (current_lock_owner): Prefer signed type for sizes.
11540 Use memcpy, not strncpy, where memcpy is what is really wanted.
11541 Don't assume (via atoi) that time_t and pid_t fit in int.
11542 Check for time_t and/or pid_t out of range, e.g., via a network share.
11543 Don't alloca where an auto var works fine.
11544
11545 * fileio.c: Fix some integer overflow issues.
11546 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11547 Don't assume string length fits in int.
11548 (directory_file_name): Don't assume string length fits in long.
11549 (make_temp_name): Don't assume pid fits in int, or that its print
11550 length is less than 20.
11551
11552 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11553
11554 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11555
11556 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11557
11558 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11559 We prefer signed integers, even for size calculations.
11560
11561 * emacs.c: Don't assume string length fits in 'int'.
11562 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11563 (main): Don't invoke strlen when not needed.
11564
11565 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11566 (XD_DEBUG_MESSAGE): Don't waste a byte.
11567
11568 * callproc.c (getenv_internal_1, getenv_internal)
11569 (Fgetenv_internal):
11570 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11571
11572 * lread.c (invalid_syntax): Omit length argument.
11573 All uses changed. This doesn't fix a bug, but it simplifies the
11574 code away from its former Hollerith-constant appearance, and it's
11575 one less 'int' to worry about when looking at integer-overflow issues.
11576 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
11577
11578 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11579 This didn't break anything, but it didn't help either.
11580 It's confusing to put a bogus integer in a place where the actual
11581 value does not matter.
11582 (LIST_END_P): Remove unused macro and its bogus comment.
11583 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
11584
11585 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11586 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11587 implementation.
11588 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11589 We prefer signed types, and the value cannot exceed the EMACS_INT
11590 range anyway (because otherwise the length would not be representable).
11591 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11592 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11593 This avoids a GCC warning when WIDE_EMACS_INT.
11594
11595 * indent.c (sane_tab_width): New function.
11596 (current_column, scan_for_column, Findent_to, position_indentation)
11597 (compute_motion): Use it. This is just for clarity.
11598 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
11599
11600 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
11601
11602 * lisp.h (lint_assume): New macro.
11603 * composite.c (composition_gstring_put_cache):
11604 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11605
11606 * editfns.c, insdel.c:
11607 Omit unnecessary forward decls, to simplify future changes.
11608
11609 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11610
11611 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11612
11613 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
11614 Use much-faster test for byte-length change.
11615 Don't assume string byte-length fits in 'int'.
11616 Check that character arg fits in 'int'.
11617 (mapcar1): Declare byte as byte, for clarity.
11618
11619 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11620
11621 * fns.c (concat): Catch string overflow earlier.
11622 Do not rely on integer wraparound.
11623
11624 * dispextern.h (struct it.overlay_strings_charpos)
11625 (struct it.selective): Now EMACS_INT, not int.
11626 * xdisp.c (forward_to_next_line_start)
11627 (back_to_previous_visible_line_start)
11628 (reseat_at_next_visible_line_start, next_element_from_buffer):
11629 Don't arbitrarily truncate the value of 'selective' to int.
11630
11631 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11632
11633 * composite.c: Don't truncate sizes to 'int'.
11634 (composition_gstring_p, composition_reseat_it)
11635 (composition_adjust_point): Use EMACS_INT, not int.
11636 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11637 not EMACS_UINT, for indexes.
11638
11639 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11640
11641 * buffer.c: Include <verify.h>.
11642 (struct sortvec.priority, struct sortstr.priority):
11643 Now EMACS_INT, not int.
11644 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
11645 (struct sortstr.size, record_overlay_string)
11646 (struct sortstrlist.size, struct sortlist.used):
11647 Don't truncate size to int.
11648 (record_overlay_string): Check for size-calculation overflow.
11649 (init_buffer_once): Check at compile-time, not run-time.
11650
11651 2011-06-22 Jim Meyering <meyering@redhat.com>
11652
11653 Don't leak an XBM-image-sized buffer
11654 * image.c (xbm_load): Free the image buffer after using it.
11655
11656 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11657
11658 Port to Sun C.
11659 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11660 that Sun C diagnosed.
11661 * fns.c (secure_hash): Fix pointer signedness issue.
11662 * intervals.c (static_offset_intervals): New function.
11663 (offset_intervals): Use it.
11664
11665 2011-06-21 Leo Liu <sdl.web@gmail.com>
11666
11667 * deps.mk (fns.o):
11668 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11669 sha512.h.
11670
11671 * fns.c (secure_hash): Rename from crypto_hash_function and change
11672 the first arg to accept symbols.
11673 (Fsecure_hash): New primitive.
11674 (syms_of_fns): New symbols.
11675
11676 2011-06-20 Deniz Dogan <deniz@dogan.se>
11677
11678 * process.c (Fset_process_buffer): Clarify return value in
11679 docstring.
11680
11681 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
11682
11683 * dispnew.c (add_window_display_history): Use BVAR.
11684
11685 * xdisp.c (debug_method_add): Use BVAR.
11686 (check_window_end, dump_glyph_matrix, dump_glyph)
11687 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11688
11689 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11690 Likewise.
11691
11692 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11693 check till after the cache is created in init_frame_faces.
11694
11695 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11696
11697 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11698
11699 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11700
11701 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11702 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11703 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11704
11705 Improve buffer-overflow checking (Bug#8873).
11706 * fileio.c (Finsert_file_contents):
11707 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11708 Remove the old (too-loose) buffer overflow checks.
11709 They weren't needed, since make_gap checks for buffer overflow.
11710 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11711 The old code merely checked for Emacs fixnum overflow, and relied
11712 on undefined (wraparound) behavior. The new code avoids undefined
11713 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11714
11715 * editfns.c (Finsert_char): Don't dump core with very negative counts.
11716 Tune. Don't use wider integers than needed. Don't use alloca.
11717 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
11718
11719 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11720
11721 * insdel.c, lisp.h (buffer_overflow): New function.
11722 (insert_from_buffer_1, replace_range, replace_range_2):
11723 * insdel.c (make_gap_larger):
11724 * editfns.c (Finsert_char):
11725 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11726
11727 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11728
11729 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11730
11731 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
11732
11733 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11734 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11735
11736 * fileio.c: Don't assume EMACS_INT fits in off_t.
11737 (emacs_lseek): New static function.
11738 (Finsert_file_contents, Fwrite_region): Use it.
11739 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11740
11741 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11742
11743 * fns.c: Don't overflow int when computing a list length.
11744 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11745 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11746 truncation on 64-bit hosts. Check for QUIT every
11747 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11748 faster and is responsive enough.
11749 (Flength): Report an error instead of overflowing an integer.
11750 (Fsafe_length): Return a float if the value is not representable
11751 as a fixnum. This shouldn't happen except in contrived situations.
11752 (Fnthcdr, Fsort): Don't assume list length fits in int.
11753 (Fcopy_sequence): Don't assume vector length fits in int.
11754
11755 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11756 (header_size, word_size): New constants.
11757 (allocate_vectorlike): Don't check size overflow here.
11758 (allocate_vector): Check it here instead, since this is the only
11759 caller of allocate_vectorlike that could cause overflow.
11760 Check that the new vector's length is representable as a fixnum.
11761
11762 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11763 The previous code was bogus. For example, next_almost_prime (32)
11764 returned 39, which is undesirable as it is a multiple of 3; and
11765 next_almost_prime (24) returned 25, which is a multiple of 5 so
11766 why was the code bothering to check for multiples of 7?
11767
11768 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11769
11770 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11771
11772 Variadic C functions now count arguments with ptrdiff_t.
11773 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11774 Back then I didn't know that the Emacs coding style prefers signed int.
11775 Also, in the meantime I found a few more instances where arguments
11776 were being counted with int, which may truncate counts on 64-bit
11777 machines, or EMACS_INT, which may be unnecessarily wide.
11778 * lisp.h (struct Lisp_Subr.function.aMANY)
11779 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11780 Arg counts are now ptrdiff_t, not size_t.
11781 All variadic functions and their callers changed accordingly.
11782 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11783 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11784 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11785 * callint.c (Fcall_interactively): Check arg count for overflow,
11786 to avoid potential buffer overrun. Use signed char, not 'int',
11787 for 'varies' array, so that we needn't bother to check its size
11788 calculation for overflow.
11789 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11790 * eval.c (apply_lambda):
11791 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11792 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11793 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11794
11795 * callint.c (Fcall_interactively): Don't use index var as event count.
11796
11797 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11798 * mem-limits.h (SIZE): Remove; no longer used.
11799
11800 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
11801
11802 Remove unnecessary casts.
11803 * xterm.c (x_term_init):
11804 * xfns.c (x_set_border_pixel):
11805 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11806 These aren't needed now that we assume ANSI C.
11807
11808 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11809 It's more likely to cause problems (due to unsigned overflow)
11810 than to cure them.
11811
11812 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11813
11814 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11815
11816 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11817
11818 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11819
11820 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11821
11822 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11823
11824 GLYPH_CODE_FACE returns EMACS_INT, not int.
11825 * dispextern.h (merge_faces):
11826 * xfaces.c (merge_faces):
11827 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11828 Don't assume EMACS_INT fits in int.
11829
11830 * character.h (CHAR_VALID_P): Remove unused parameter.
11831 * fontset.c, lisp.h, xdisp.c: All uses changed.
11832
11833 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11834
11835 * fns.c (concat): Minor tuning based on overflow analysis.
11836 This doesn't fix any bugs. Use int to hold character, instead
11837 of constantly refetching from Emacs object. Use XFASTINT, not
11838 XINT, for value known to be a character. Don't bother comparing
11839 a single byte to 0400, as it's always less.
11840
11841 * floatfns.c (Fexpt):
11842 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11843
11844 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11845 for characters.
11846
11847 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11848
11849 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11850 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11851 incorrectly succeed when S was a string, because 4294967386 was
11852 truncated before it was used.
11853
11854 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11855 Otherwise, an out-of-range integer could cause undefined behavior
11856 on a 64-bit host.
11857
11858 * composite.c: Use int, not EMACS_INT, for characters.
11859 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11860 EMACS_INT, for values that are known to be in character range.
11861 This doesn't fix any bugs but is the usual style inside Emacs and
11862 may generate better code on 32-bit machines.
11863
11864 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11865 This is for reasons similar to the recent CHAR_STRING fix.
11866 * charset.c (Fencode_char): Check that character arg is actually
11867 a character. Pass an int to ENCODE_CHAR.
11868 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11869 wider than 'int', as a compile-time check to prevent future regressions
11870 in this area.
11871
11872 * character.c (char_string): Remove unnecessary casts.
11873
11874 Make sure a 64-bit char is never passed to CHAR_STRING.
11875 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11876 by silently ignoring the top 32 bits, allowing some values
11877 that were far too large to be valid characters.
11878 * character.h: Include <verify.h>.
11879 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11880 arguments are no wider than unsigned, as a compile-time check
11881 to prevent future regressions in this area.
11882 * data.c (Faset):
11883 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
11884 (Fsubst_char_in_region):
11885 * fns.c (concat):
11886 * xdisp.c (decode_mode_spec_coding):
11887 Adjust to CHAR_STRING's new requirement.
11888 * editfns.c (Finsert_char, Fsubst_char_in_region):
11889 * fns.c (concat): Check that character args are actually
11890 characters. Without this test, these functions did the wrong
11891 thing with wildly out-of-range values on 64-bit hosts.
11892
11893 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11894 These casts should not be needed on 32-bit hosts, either.
11895 * keyboard.c (read_char):
11896 * lread.c (Fload): Remove casts to unsigned.
11897
11898 * lisp.h (UNSIGNED_CMP): New macro.
11899 This fixes comparison bugs on 64-bit hosts.
11900 (ASCII_CHAR_P): Use it.
11901 * casefiddle.c (casify_object):
11902 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
11903 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11904 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11905 * dispextern.h (FACE_FROM_ID):
11906 * keyboard.c (read_char): Use UNSIGNED_CMP.
11907
11908 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11909 not to EMACS_INT, to avoid GCC warning.
11910
11911 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11912
11913 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11914 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11915 isn't needed on 32-bit machines.
11916
11917 * buffer.c (Fgenerate_new_buffer_name):
11918 Use EMACS_INT for count, not int.
11919 (advance_to_char_boundary): Return EMACS_INT, not int.
11920
11921 * data.c (Qcompiled_function): Now static.
11922
11923 * window.c (window_body_lines): Now static.
11924
11925 * image.c (gif_load): Rename local to avoid shadowing.
11926
11927 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11928 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11929 * alloc.c (make_save_value): Integer argument is now of type
11930 ptrdiff_t, not int.
11931 (mark_object): Use ptrdiff_t, not int.
11932 * lisp.h (pD): New macro.
11933 * print.c (print_object): Use it.
11934
11935 * alloc.c: Use EMACS_INT, not int, to count objects.
11936 (total_conses, total_markers, total_symbols, total_vector_size)
11937 (total_free_conses, total_free_markers, total_free_symbols)
11938 (total_free_floats, total_floats, total_free_intervals)
11939 (total_intervals, total_strings, total_free_strings):
11940 Now EMACS_INT, not int. All uses changed.
11941 (Fgarbage_collect): Compute overall total using a double, so that
11942 integer overflow is less likely to be a problem. Check for overflow
11943 when converting back to an integer.
11944 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11945 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11946 These were 'int' variables that could overflow on 64-bit hosts;
11947 they were never used, so remove them instead of repairing them.
11948 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
11949 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11950 Previously, this ceilinged at INT_MAX, but that doesn't work on
11951 64-bit machines.
11952 (allocate_pseudovector): Don't use EMACS_INT when int would do.
11953
11954 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
11955 (allocate_vectorlike): Check for ptrdiff_t overflow.
11956 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11957 when a (possibly-narrower) signed value would do just as well.
11958 We prefer using signed arithmetic, to avoid comparison confusion.
11959
11960 * alloc.c: Catch some string size overflows that we were missing.
11961 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11962 for convenience in STRING_BYTES_MAX.
11963 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11964 The definition here is exact; the one in lisp.h was approximate.
11965 (allocate_string_data): Check for string overflow. This catches
11966 some instances we weren't catching before. Also, it catches
11967 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11968 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11969 and ptrdiff_t and EMACS_INT are both 64 bits.
11970
11971 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11972 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
11973 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
11974
11975 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11976
11977 * alloc.c (Fmake_string): Check for out-of-range init.
11978
11979 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11980
11981 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11982
11983 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11984
11985 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11986 xg_get_default_scrollbar_width.
11987
11988 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11989 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11990 (style_changed_cb): Call update_theme_scrollbar_width and call
11991 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11992 all frames (Bug#8505).
11993 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11994 Call gtk_window_set_resizable if HAVE_GTK3.
11995 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11996 and height if HAVE_GTK3 (Bug#8505).
11997 (scroll_bar_width_for_theme): New variable.
11998 (update_theme_scrollbar_width): New function.
11999 (xg_get_default_scrollbar_width): Move code to
12000 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12001 (xg_initialize): Call update_theme_scrollbar_width.
12002
12003 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12004
12005 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12006
12007 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12008
12009 * frame.c (make_frame): Call other_buffer_safely instead of
12010 other_buffer.
12011
12012 * window.c (temp_output_buffer_show): Call display_buffer with
12013 second argument Vtemp_buffer_show_specifiers and reset latter
12014 immediately after the call.
12015 (Vtemp_buffer_show_specifiers): New variable.
12016 (auto_window_vscroll_p, next_screen_context_lines)
12017 (Vscroll_preserve_screen_position): Remove leading asterisks from
12018 doc-strings.
12019
12020 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12021
12022 Fix minor problems found by GCC 4.6.0 static checking.
12023 * buffer.c (Qclone_number): Remove for now, as it's unused.
12024 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12025 (record_buffer): Remove unused local.
12026 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12027 (set_frame_buffer_list): Remove; unused.
12028 * frame.h (other_visible_frames): Remove decl.
12029 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12030 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12031 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12032 if HAVE_GPM.
12033 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12034 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12035 Define only if HAVE_GPM.
12036 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12037 (update_hints_inhibit): Remove; never set. All uses removed.
12038 * widgetprv.h (emacsFrameClassRec): Remove decl.
12039 * window.c (delete_deletable_window): Now returns void, since it
12040 wasn't returning anything.
12041 (compare_window_configurations): Remove unused locals.
12042 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12043 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12044 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12045 the same widths as pointers. This follows up on the 2011-05-06 patch.
12046 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12047 * xterm.h: Likewise.
12048 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12049
12050 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12051
12052 * makefile.w32-in: Update dependencies.
12053 (LISP_H): Add lib/intprops.h.
12054
12055 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12056
12057 * image.c (gif_load): Add animation frame delay to the metadata.
12058 (syms_of_image): Use DEFSYM. New symbol `delay'.
12059
12060 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12061
12062 * window.c (delete_deletable_window): Re-add.
12063 (Fset_window_configuration): Rewrite to handle dead buffers and
12064 consequently deletable windows.
12065 (window_tree, Fwindow_tree): Remove. Supply functionality in
12066 window.el.
12067 (compare_window_configurations): Simplify code.
12068
12069 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12070
12071 * image.c (imagemagick_load_image): Fix type mismatch.
12072 (Fimagemagick_types): Likewise.
12073
12074 * window.h (replace_buffer_in_windows): Declare.
12075
12076 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12077
12078 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12079 Qclone_number. Remove external declaration of Qdelete_window.
12080 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12081 code.
12082 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12083 Run Qbuffer_list_update_hook if allowed.
12084 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12085 buffer list implementation.
12086 (other_buffer_safely): New function.
12087 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12088 calls to replace_buffer_in_windows and
12089 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12090 if allowed.
12091 (record_buffer): Inhibit quitting and rewrite using quittable
12092 functions. Run Qbuffer_list_update_hook if allowed.
12093 (Frecord_buffer, Funrecord_buffer): New functions.
12094 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12095 Move switch-to-buffer to window.el.
12096 (bury-buffer): Move to window.el.
12097 (Vbuffer_list_update_hook): New variable.
12098
12099 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12100 section.
12101
12102 * window.h (resize_frame_windows): Move up in code.
12103 (Fwindow_frame): Remove EXFUN.
12104 (replace_buffer_in_all_windows): Remove prototype.
12105 (replace_buffer_in_windows_safely): Add prototype.
12106
12107 * window.c: Declare Qdelete_window static again. Move down
12108 declaration of select_count.
12109 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12110 (Fother_window): Move to window.el.
12111 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12112 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12113 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12114 window.el.
12115 (replace_buffer_in_windows): Implement by calling
12116 Qreplace_buffer_in_windows.
12117 (replace_buffer_in_all_windows): Remove with some functionality
12118 moved into replace_buffer_in_windows_safely.
12119 (replace_buffer_in_windows_safely): New function.
12120 (select_window_norecord, select_frame_norecord): Move in front
12121 of run_window_configuration_change_hook. Remove now obsolete
12122 declarations.
12123 (Fset_window_buffer): Rewrite doc-string.
12124 Call Qrecord_window_buffer.
12125 (keys_of_window): Move binding for other-window to window.el.
12126
12127 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12128
12129 * dispextern.h (struct image): Replace data member, whose int_val
12130 and ptr_val fields were not used by anything, with a single
12131 lisp_val object.
12132
12133 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12134 (gif_clear_image, gif_load, imagemagick_load_image)
12135 (gs_clear_image, gs_load): Callers changed.
12136
12137 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12138
12139 * buffer.h: Include <time.h>, for time_t.
12140 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12141
12142 Fix minor problems found by static checking.
12143
12144 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12145
12146 Make identifiers static if they are not used in other modules.
12147 * data.c (Qcompiled_function, Qframe, Qvector):
12148 * image.c (QimageMagick, Qsvg):
12149 * minibuf.c (Qmetadata):
12150 * window.c (resize_window_check, resize_root_window): Now static.
12151 * window.h (resize_window_check, resize_root_window): Remove decls.
12152
12153 * window.c (window_deletion_count, delete_deletable_window):
12154 Remove; unused.
12155 (window_body_lines): Now static.
12156 (Fdelete_other_windows_internal): Mark vars as initialized.
12157 Make sure 'resize_failed' is initialized.
12158 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12159 (resize_window_apply): Remove unused local.
12160 * window.h (delete_deletable_window): Remove decl.
12161
12162 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12163 (imagemagick_load_image): Fix pointer signedness problem by changing
12164 last arg from unsigned char * to char *. All uses changed.
12165 Also, fix a local for similar reasons.
12166 Remove unused locals. Remove locals to avoid shadowing.
12167 (fn_rsvg_handle_free): Remove; unused.
12168 (svg_load, svg_load_image): Fix pointer signedness problem.
12169 (imagemagick_load_image): Don't use garbage pointer image_wand.
12170
12171 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12172
12173 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12174
12175 * image.c (gif_load): Fix omitted cast error introduced by
12176 2011-06-06 change.
12177
12178 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12179
12180 * window.h (resize_proportionally, orig_total_lines)
12181 (orig_top_line): Remove from window structure.
12182 (set_window_height, set_window_width, change_window_heights)
12183 (Fdelete_window): Remove prototypes.
12184 (resize_frame_windows): Remove duplicate declaration.
12185
12186 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12187
12188 * window.h (resize_frame_windows, resize_window_check)
12189 (delete_deletable_window, resize_root_window)
12190 (resize_frame_windows): Declare prototypes.
12191
12192 * window.c (resize_window_apply): Make definition be "static" to
12193 match the prototype.
12194
12195 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12196
12197 * window.c: Remove declarations of Qwindow_size_fixed,
12198 window_min_size_1, window_min_size_2, window_min_size,
12199 size_window, window_fixed_size_p, enlarge_window, delete_window.
12200 Remove static from declaration of Qdelete_window, it's
12201 temporarily needed by Fbury_buffer.
12202 (replace_window): Don't assign orig_top_line and
12203 orig_total_lines.
12204 (Fdelete_window, delete_window): Remove. Window deletion is
12205 handled by window.el.
12206 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12207 Replace Fdelete_window calls with calls to Qdelete_window.
12208 (Fdelete_other_windows): Remove. Deleting other windows is
12209 handled by window.el.
12210 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12211 handled in window.el.
12212 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12213 Window minimum sizes are handled in window.el.
12214 (shrink_windows, size_window, set_window_height)
12215 (set_window_width, change_window_heights, window_height)
12216 (window_width, CURBEG, CURSIZE, enlarge_window)
12217 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12218 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12219 handled in window.el.
12220 (make_dummy_parent): Rename to make_parent_window and give it a
12221 second argument horflag.
12222 (make_window): Don't set resize_proportionally any more.
12223 (Fsplit_window): Remove. Windows are split in window.el.
12224 (save_restore_action, save_restore_orig_size)
12225 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12226 Resize mini windows in window.el.
12227 (grow_mini_window, shrink_mini_window): Implement by calling
12228 Qresize_root_window_vertically, resize_window_check and
12229 resize_window_apply.
12230 (saved_window, Fset_window_configuration, save_window_save):
12231 Do not handle orig_top_line, orig_total_lines, and
12232 resize_proportionally.
12233 (window_min_height, window_min_width): Move to window.el.
12234 (keys_of_window): Move bindings for delete-other-windows,
12235 split-window, delete-window and enlarge-window to window.el.
12236
12237 * buffer.c: Temporarily extern Qdelete_window.
12238 (Fbury_buffer): Temporarily call Qdelete_window instead of
12239 Fdelete_window (Fbury_buffer will move to window.el soon).
12240
12241 * frame.c (set_menu_bar_lines_1): Remove code handling
12242 orig_top_line and orig_total_lines.
12243
12244 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12245 set_window_height but set heights directly.
12246 (change_frame_size_1): Use resize_frame_windows.
12247
12248 * xdisp.c (init_xdisp): Don't use set_window_height but set
12249 heights directly.
12250
12251 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12252 Use resize_frame_windows instead of change_window_heights and run
12253 run_window_configuration_change_hook.
12254
12255 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12256 instead of change_window_heights and run
12257 run_window_configuration_change_hook.
12258
12259 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12260
12261 * window.c (replace_window): Rename second argument REPLACEMENT to
12262 NEW. New third argument SETFLAG. Rewrite.
12263 (delete_window, make_dummy_parent): Call replace_window with
12264 third argument 1.
12265 (window_list_1): Move down in code.
12266 (run_window_configuration_change_hook): Move set_buffer part
12267 before select_frame_norecord part in order to unwind correctly.
12268 Rename count1 to count.
12269 (recombine_windows, delete_deletable_window, resize_root_window)
12270 (Fdelete_other_windows_internal)
12271 (Frun_window_configuration_change_hook, make_parent_window)
12272 (resize_window_check, resize_window_apply, Fresize_window_apply)
12273 (resize_frame_windows, Fsplit_window_internal)
12274 (Fdelete_window_internal, Fresize_mini_window_internal):
12275 New functions.
12276 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12277
12278 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12279
12280 * window.h (window): Add some new members to window structure -
12281 normal_lines, normal_cols, new_total, new_normal, clone_number,
12282 splits, nest, prev_buffers, next_buffers.
12283 (WINDOW_TOTAL_SIZE): Move here from window.c.
12284 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12285
12286 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12287 Remove.
12288 (make_dummy_parent): Set new members of windows structure.
12289 (make_window): Move down in code. Handle new members of window
12290 structure.
12291 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12292 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12293 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12294 (Fset_window_prev_buffers, Fwindow_next_buffers)
12295 (Fset_window_next_buffers, Fset_window_clone_number):
12296 New functions.
12297 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12298 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12299 Doc-string fixes.
12300 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12301 Argument WINDOW can be now internal window too.
12302 (Fwindow_use_time): Move up in code.
12303 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12304 Rewrite doc-string.
12305 (Fset_window_configuration, saved_window)
12306 (Fcurrent_window_configuration, save_window_save): Handle new
12307 members of window structure.
12308 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12309 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12310 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12311 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12312 Qget_mru_window, Qresize_root_window,
12313 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12314 Qauto_buffer_name; staticpro them.
12315
12316 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12317
12318 * window.c (Fwindow_total_size, Fwindow_left_column)
12319 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12320 (Fwindow_list_1): New functions.
12321 (window_box_text_cols): Replace with window_body_cols.
12322 (Fwindow_width, Fscroll_left, Fscroll_right):
12323 Use window_body_cols instead of window_box_text_cols.
12324 (delete_window, Fset_window_configuration):
12325 Call delete_all_subwindows with window as argument.
12326 (delete_all_subwindows): Take a window as argument and not a
12327 structure. Rewrite.
12328 (window_loop): Remove handling of GET_LRU_WINDOW and
12329 GET_LARGEST_WINDOW.
12330 (Fget_lru_window, Fget_largest_window): Move to window.el.
12331
12332 * window.h: Extern window_body_cols instead of
12333 window_box_text_cols. delete_all_subwindows now takes a
12334 Lisp_Object as argument.
12335
12336 * indent.c (compute_motion, Fcompute_motion):
12337 Use window_body_cols instead of window_box_text_cols.
12338
12339 * frame.c (delete_frame): Call delete_all_subwindows with root
12340 window as argument.
12341
12342 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12343
12344 * fns.c (Fputhash): Document return value.
12345
12346 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12347
12348 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12349
12350 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12351
12352 Cons<->int and similar integer overflow fixes (Bug#8794).
12353
12354 Check for overflow when converting integer to cons and back.
12355 * charset.c (Fdefine_charset_internal, Fdecode_char):
12356 Use cons_to_unsigned to catch overflow.
12357 (Fencode_char): Use INTEGER_TO_CONS.
12358 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12359 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12360 * data.c (long_to_cons, cons_to_long): Remove.
12361 (cons_to_unsigned, cons_to_signed): New functions.
12362 These signal an error for invalid or out-of-range values.
12363 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12364 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12365 * font.c (Ffont_variation_glyphs):
12366 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12367 * lisp.h: Include <intprops.h>.
12368 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12369 (cons_to_signed, cons_to_unsigned): New decls.
12370 (long_to_cons, cons_to_long): Remove decls.
12371 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12372 (Fprimitive_undo): Use CONS_TO_INTEGER.
12373 * xfns.c (Fx_window_property): Likewise.
12374 * xselect.c: Include <limits.h>.
12375 (x_own_selection, selection_data_to_lisp_data):
12376 Use INTEGER_TO_CONS.
12377 (x_handle_selection_request, x_handle_selection_clear)
12378 (x_get_foreign_selection, Fx_disown_selection_internal)
12379 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12380 (lisp_data_to_selection_data): Use cons_to_unsigned.
12381 (x_fill_property_data): Use cons_to_signed.
12382 Report values out of range.
12383
12384 Check for buffer and string overflow more precisely.
12385 * buffer.h (BUF_BYTES_MAX): New macro.
12386 * lisp.h (STRING_BYTES_MAX): New macro.
12387 * alloc.c (Fmake_string):
12388 * character.c (string_escape_byte8):
12389 * coding.c (coding_alloc_by_realloc):
12390 * doprnt.c (doprnt):
12391 * editfns.c (Fformat):
12392 * eval.c (verror):
12393 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12394 since they may not be the same number.
12395 * editfns.c (Finsert_char):
12396 * fileio.c (Finsert_file_contents):
12397 Likewise for BUF_BYTES_MAX.
12398
12399 * image.c: Use ptrdiff_t, not int, for sizes.
12400 (slurp_file): Switch from int to ptrdiff_t.
12401 All uses changed.
12402 (slurp_file): Check that file size fits in both size_t (for
12403 malloc) and ptrdiff_t (for sanity and safety).
12404
12405 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12406 if b->modtime has its maximal value.
12407
12408 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12409
12410 Don't assume time_t can fit into int.
12411 * buffer.h (struct buffer.modtime): Now time_t, not int.
12412 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12413 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12414
12415 Minor fixes for signed vs unsigned integers.
12416 * character.h (MAYBE_UNIFY_CHAR):
12417 * charset.c (maybe_unify_char):
12418 * keyboard.c (read_char, reorder_modifiers):
12419 XINT -> XFASTINT, since the integer must be nonnegative.
12420 * ftfont.c (ftfont_spec_pattern):
12421 * keymap.c (access_keymap, silly_event_symbol_error):
12422 XUINT -> XFASTINT, since the integer must be nonnegative.
12423 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12424 since it makes no difference and we prefer signed.
12425 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12426 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12427 nonnegative.
12428
12429 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12430
12431 * window.h (Fwindow_frame): Declare.
12432
12433 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12434
12435 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12436 (SPARE_MEMORY): Always define.
12437 (LARGE_REQUEST): Remove.
12438 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12439
12440 2011-06-06 Martin Rudalics <rudalics@gmx.at>
12441
12442 * lisp.h: Move EXFUNS for Fframe_root_window,
12443 Fframe_first_window and Fset_frame_selected_window to window.h.
12444
12445 * window.h: Move EXFUNS for Fframe_root_window,
12446 Fframe_first_window and Fset_frame_selected_window here from
12447 lisp.h.
12448
12449 * frame.c (Fwindow_frame, Fframe_first_window)
12450 (Fframe_root_window, Fframe_selected_window)
12451 (Fset_frame_selected_window): Move to window.c.
12452 (Factive_minibuffer_window): Move to minibuf.c.
12453 (Fother_visible_frames_p): New function.
12454
12455 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12456
12457 * window.c (decode_window, decode_any_window): Move up in code.
12458 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12459 (inhibit_frame_unsplittable): Remove unused variable.
12460 (Fwindow_buffer): Move up and rewrite doc-string.
12461 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12462 (Fwindow_prev): New functions.
12463 (Fwindow_frame): Move here from frame.c. Accept any window as
12464 argument.
12465 (Fframe_root_window, Fframe_first_window)
12466 (Fframe_selected_window): Move here from frame.c. Accept frame
12467 or arbitrary window as argument. Update doc-strings.
12468 (Fminibuffer_window): Move up in code.
12469 (Fwindow_minibuffer_p): Move up in code and simplify.
12470 (Fset_frame_selected_window): Move here from frame.c.
12471 Marginal rewrite.
12472 (Fselected_window, select_window, Fselect_window): Move up in
12473 code. Minor doc-string fixes.
12474
12475 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12476
12477 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12478 Do not assume that spare memory exists; that assumption is valid
12479 only if SYSTEM_MALLOC.
12480 (LARGE_REQUEST): New macro, so that the issue of large requests
12481 is separated from the issue of spare memory.
12482
12483 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12484
12485 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12486 format. (Bug#8806)
12487
12488 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12489
12490 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12491 before statements.
12492
12493 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12494
12495 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12496
12497 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12498
12499 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12500 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12501
12502 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
12503
12504 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12505
12506 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
12507
12508 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12509 (x_clipboard_manager_save): Add return value.
12510 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12511 New error handlers.
12512 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12513 Obey Vx_select_enable_clipboard_manager. Catch errors in
12514 x_clipboard_manager_save (Bug#8779).
12515 (Vx_select_enable_clipboard_manager): New variable.
12516 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
12517
12518 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
12519
12520 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12521
12522 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12523
12524 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12525 in the current matrix if keep_current_p is non-zero.
12526
12527 2011-06-04 Eli Zaretskii <eliz@gnu.org>
12528
12529 * bidi.c (bidi_level_of_next_char): Fix last change.
12530
12531 2011-06-03 Eli Zaretskii <eliz@gnu.org>
12532
12533 Support bidi reordering of text covered by display properties.
12534
12535 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12536 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12537 (bidi_cache_search, bidi_cache_iterator_state)
12538 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12539 (bidi_level_of_next_char, bidi_move_to_visually_next):
12540 Support character positions inside a run of characters covered by a
12541 display string.
12542 (bidi_paragraph_init, bidi_resolve_explicit_1)
12543 (bidi_level_of_next_char): Call bidi_fetch_char and
12544 bidi_fetch_char_advance instead of FETCH_CHAR and
12545 FETCH_CHAR_ADVANCE.
12546 (bidi_init_it): Initialize new members.
12547 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12548 definitions.
12549 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12550 instead of using explicit *_CHAR codes.
12551 (bidi_resolve_explicit, bidi_resolve_weak):
12552 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
12553 bidirectional text is supported only in multibyte buffers.
12554 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12555 it to initialize the frame_window_p member of struct bidi_it.
12556 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12557 (bidi_resolve_explicit, bidi_resolve_weak)
12558 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12559 bidi_it->nchars is non-positive.
12560 (bidi_level_of_next_char): Don't try to lookup the cache for the
12561 next/previous character if nothing is cached there yet, or if we
12562 were just reseat()'ed to a new position.
12563
12564 * xdisp.c (set_cursor_from_row): Set start and stop points
12565 according to the row's direction when priming the loop that looks
12566 for the glyph on which to display cursor.
12567 (single_display_spec_intangible_p): Function deleted.
12568 (display_prop_intangible_p): Reimplement to call
12569 handle_display_spec instead of single_display_spec_intangible_p.
12570 Accept 3 additional arguments needed by handle_display_spec.
12571 This fixes incorrect cursor motion across display property with complex
12572 values: lists, `(when COND...)' forms, etc.
12573 (single_display_spec_string_p): Support property values that are
12574 lists with the argument STRING its top-level element.
12575 (display_prop_string_p): Fix the condition for processing a
12576 property that is a list to be consistent with handle_display_spec.
12577 (handle_display_spec): New function, refactored from the
12578 last portion of handle_display_prop.
12579 (compute_display_string_pos): Accept additional argument
12580 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12581 value of a `display' property is a "replacing spec".
12582 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12583 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12584 the display property, but just return a value indicating whether
12585 the display property will replace the characters it covers.
12586 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12587 frame_window_p members of struct bidi_it.
12588 (compute_display_string_pos, compute_display_string_end):
12589 New functions.
12590 (push_it): Accept second argument POSITION, where pop_it should
12591 jump to continue iteration.
12592 (reseat_1): Initialize bidi_it.disp_pos.
12593
12594 * keyboard.c (adjust_point_for_property): Adjust the call to
12595 display_prop_intangible_p to its new signature.
12596
12597 * dispextern.h (struct bidi_it): New member frame_window_p.
12598 (bidi_init_it): Update prototypes.
12599 (display_prop_intangible_p): Update prototype.
12600 (compute_display_string_pos, compute_display_string_end):
12601 Declare prototypes.
12602 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12603 EMACS_INT.
12604
12605 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
12606
12607 Malloc failure behavior now depends on size of allocation.
12608 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12609 * lisp.h: Change signatures accordingly.
12610 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12611 All callers changed. (Bug#8762)
12612
12613 * gnutls.c: Use Emacs's memory allocators.
12614 Without this change, the gnutls library would invoke malloc etc.
12615 directly, which causes problems on non-SYNC_INPUT hosts, and which
12616 runs afoul of improving memory_full behavior. (Bug#8761)
12617 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12618 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12619 xfree instead of the default malloc, realloc, free.
12620 (Fgnutls_boot): No need to check for memory allocation failure,
12621 since xmalloc does that for us.
12622
12623 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
12624 * category.c (hash_get_category_set):
12625 * ccl.c (ccl_driver):
12626 * charset.c (Fdefine_charset_internal):
12627 * charset.h (struct charset.hash_index):
12628 * composite.c (get_composition_id, gstring_lookup_cache)
12629 (composition_gstring_put_cache):
12630 * composite.h (struct composition.hash_index):
12631 * dispextern.h (struct image.hash):
12632 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12633 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12634 (hashfn_equal, hashfn_user_defined, make_hash_table)
12635 (maybe_resize_hash_table, hash_lookup, hash_put)
12636 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12637 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12638 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12639 * image.c (make_image, search_image_cache, lookup_image)
12640 (xpm_put_color_table_h):
12641 * lisp.h (struct Lisp_Hash_Table):
12642 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
12643 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
12644 for hashes and hash indexes, instead of 'unsigned' and 'int'.
12645 * alloc.c (allocate_vectorlike):
12646 Check for overflow in vector size calculations.
12647 * ccl.c (ccl_driver):
12648 Check for overflow when converting EMACS_INT to int.
12649 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12650 need to be updated by these changes.
12651 * fns.c (make_hash_table, maybe_resize_hash_table):
12652 Check for integer overflow with large hash tables.
12653 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12654 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12655 (SXHASH_REDUCE): New macro.
12656 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12657 Use it instead of discarding useful hash info with large hash values.
12658 (sxhash_float): New function.
12659 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12660 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
12661 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12662 Rewrite to use FIXNUM_BITS, as this simplifies things.
12663 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12664 Adjust signatures to match updated version of code.
12665 (consing_since_gc): Now EMACS_INT, since a single hash table can
12666 use more than INT_MAX bytes.
12667
12668 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12669
12670 Make it possible to build with GCC-4.6+ -O2 -flto.
12671
12672 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12673
12674 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12675
12676 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12677 Call minibuffer-inactive-mode.
12678
12679 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
12680
12681 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12682 Update dependencies.
12683
12684 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12685
12686 * data.c (init_data): Remove code for UTS, this system is not
12687 supported anymore.
12688
12689 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12690
12691 Don't force ./temacs to start in terminal mode.
12692
12693 * frame.c (make_initial_frame): Initialize faces in all cases, not
12694 only when CANNOT_DUMP is defined.
12695 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12696
12697 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12698
12699 * dispnew.c (add_window_display_history): Use const for the string
12700 pointer. Remove declaration, not needed.
12701
12702 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12703
12704 Use 'inline', not 'INLINE'.
12705 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
12706 * alloc.c, fontset.c (INLINE): Remove.
12707 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12708 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12709 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12710 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12711 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12712
12713 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12714
12715 Make it possible to run ./temacs.
12716
12717 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12718 syms_of_callproc does the same thing. Remove test for
12719 "initialized", do it in the caller.
12720 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12721
12722 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12723
12724 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12725 (read_minibuf): Use get_minibuffer.
12726 (syms_of_minibuf): Use DEFSYM.
12727 (Qmetadata): New var.
12728 * data.c (Qbuffer): Don't make it static.
12729 (syms_of_data): Use DEFSYM.
12730
12731 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12732
12733 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12734 (CCL_CODE_MIN): New macro.
12735
12736 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12737
12738 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12739
12740 * eval.c (Qdebug): Now static.
12741 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12742 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12743 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12744
12745 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12746
12747 * image.c: Various fixes to ImageMagick code comments.
12748 (Fimagemagick_types): Doc fix.
12749
12750 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12751
12752 Minor fixes prompted by GCC 4.6.0 warnings.
12753
12754 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12755
12756 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12757 (x_clipboard_manager_save_all): Move extern decl to ...
12758 * xterm.h: ... here, so that it can be checked for consistency.
12759
12760 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12761
12762 * xselect.c (x_clipboard_manager_save_frame)
12763 (x_clipboard_manager_save_all): New functions.
12764 (Fx_clipboard_manager_save): Lisp function deleted.
12765
12766 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12767 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12768
12769 * xterm.h: Update prototype.
12770
12771 2011-05-28 William Xu <william.xwl@gmail.com>
12772
12773 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12774 exiting (Bug#8239).
12775
12776 2011-05-28 Jim Meyering <meyering@redhat.com>
12777
12778 Avoid a sign-extension bug in crypto_hash_function.
12779 * fns.c (to_uchar): Define.
12780 (crypto_hash_function): Use it to convert some newly-signed
12781 variables to unsigned, to avoid sign-extension bugs. For example,
12782 without this change, (md5 "truc") would evaluate to
12783 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12784 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
12785 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
12786
12787 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12788
12789 Integer overflow fixes.
12790
12791 * dbusbind.c: Serial number integer overflow fixes.
12792 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
12793 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12794 to hold a serial number that is too large for a fixnum.
12795 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12796 Check for serial numbers out of range. Decode any serial number
12797 that was so large that it became a float. (Bug#8722)
12798
12799 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12800 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12801 Use XFASTINT rather than XUINT when numbers are nonnegative.
12802 (xd_append_arg, Fdbus_method_return_internal):
12803 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12804 arguments, check that Lisp number is nonnegative, rather than
12805 silently wrapping negative numbers around. (Bug#8722)
12806 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
12807 (Bug#8722)
12808
12809 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12810
12811 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12812
12813 ccl: Add integer overflow checks.
12814 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12815 (IN_INT_RANGE): New macros.
12816 (ccl_driver): Use them to check for integer overflow when
12817 decoding a CCL program. Many of the new checks are whether XINT (x)
12818 fits in int; it doesn't always, on 64-bit hosts. The new version
12819 doesn't catch all possible integer overflows, but it's an
12820 improvement. (Bug#8719)
12821
12822 * alloc.c (make_event_array): Use XINT, not XUINT.
12823 There's no need for unsigned here.
12824
12825 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12826 This follows up to the 2011-05-06 change that substituted uintptr_t
12827 for EMACS_INT. This case wasn't caught back then.
12828
12829 Rework Fformat to avoid integer overflow issues.
12830 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12831 now (part of C89). Include <verify.h>.
12832 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12833 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12834 (Fformat): Avoid the prepass trying to compute sizes; it was only
12835 approximate and thus did not catch overflow reliably. Instead, walk
12836 through the format just once, formatting and computing sizes as we go,
12837 checking for integer overflow at every step, and allocating a larger
12838 buffer as needed. Keep track separately whether the format is
12839 multibyte. Keep only the most-recently calculated precision, rather
12840 than them all. Record whether each argument has been converted to
12841 string. Use EMACS_INT, not int, for byte and char and arg counts.
12842 Support field widths and precisions larger than INT_MAX. Avoid
12843 sprintf's undefined behavior with conversion specifications such as %#d
12844 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12845 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12846 formatting out-of-range floating point numbers with int
12847 formats. (Bug#8668)
12848
12849 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12850
12851 * data.c: Avoid integer truncation in expressions involving floats.
12852 * data.c: Include <intprops.h>.
12853 (arith_driver): When there's an integer overflow in an expression
12854 involving floating point, convert the integers to floating point
12855 so that the resulting value does not suffer from catastrophic
12856 integer truncation. For example, on a 64-bit host (* 4
12857 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12858 Do not rely on undefined behavior after integer overflow.
12859
12860 merge count_size_as_multibyte, parse_str_to_multibyte
12861 * character.c, character.h (count_size_as_multibyte):
12862 Rename from parse_str_to_multibyte; all uses changed.
12863 Check for integer overflow.
12864 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12865 since it's now a duplicate of the other. This is more of
12866 a character than a buffer op, so better that it's in character.c.
12867 * fns.c, print.c: Adjust to above changes.
12868
12869 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12870
12871 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12872
12873 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12874
12875 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12876 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12877 (x_clipboard_manager_save): Now static.
12878 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12879
12880 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12881 (crypto_hash_function): Now static.
12882 Fix pointer signedness problems. Avoid unnecessary initializations.
12883
12884 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
12885
12886 * termhooks.h (Vselection_alist): Make it terminal-local.
12887
12888 * terminal.c (create_terminal): Initialize it.
12889
12890 * xselect.c: Support for clipboard managers.
12891 (Vselection_alist): Move to termhooks.h as terminal-local var.
12892 (LOCAL_SELECTION): New macro.
12893 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12894 (symbol_to_x_atom): Remove gratuitous arg.
12895 (x_handle_selection_request, lisp_data_to_selection_data)
12896 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
12897 (x_own_selection, x_get_local_selection, x_convert_selection):
12898 New arg, specifying work frame. Use terminal-local Vselection_alist.
12899 (some_frame_on_display): Delete unused function.
12900 (Fx_own_selection_internal, Fx_get_selection_internal)
12901 (Fx_disown_selection_internal, Fx_selection_owner_p)
12902 (Fx_selection_exists_p): New optional frame arg.
12903 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12904 (x_handle_selection_clear): Don't treat other terminals with the
12905 same keyboard specially. Use the terminal-local Vselection_alist.
12906 (x_clear_frame_selections): Use Frun_hook_with_args.
12907
12908 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12909
12910 * xterm.h: Add support for those atoms.
12911
12912 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
12913
12914 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12915 (converted_selections, conversion_fail_tag): New global variables.
12916 (x_selection_request_lisp_error): Free the above.
12917 (x_get_local_selection): Remove unnecessary code.
12918 (x_reply_selection_request): Args changed; handle arbitrary array
12919 of converted selections stored in converted_selections.
12920 Separate the XChangeProperty and SelectionNotify steps.
12921 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12922 (x_convert_selection): New function.
12923 (x_handle_selection_event): Simplify.
12924 (x_get_foreign_selection): Don't ignore incoming requests while
12925 waiting for an answer; this will fail when we implement
12926 SAVE_TARGETS, and seems unnecessary anyway.
12927 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12928 (Vx_sent_selection_functions): Doc fix.
12929
12930 2011-05-26 Leo Liu <sdl.web@gmail.com>
12931
12932 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12933
12934 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12935
12936 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12937
12938 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12939 for fringe update if it has periodic bitmap.
12940 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
12941 and fringe_bitmap_periodic_p.
12942
12943 * fringe.c (get_fringe_bitmap_data): New function.
12944 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12945 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12946 row. Mark glyph row for fringe update if periodicity changed.
12947
12948 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12949 for fringe update unless it has periodic bitmap.
12950
12951 2011-05-25 Kenichi Handa <handa@m17n.org>
12952
12953 * xdisp.c (get_next_display_element): Set correct it->face_id for
12954 a static composition.
12955
12956 2011-05-24 Leo Liu <sdl.web@gmail.com>
12957
12958 * deps.mk (fns.o):
12959 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12960
12961 * fns.c (crypto_hash_function, Fsha1): New function.
12962 (Fmd5): Use crypto_hash_function.
12963 (syms_of_fns): Add Ssha1.
12964
12965 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12966
12967 * gnutls.c: Remove unused macros.
12968 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12969 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12970 Remove macros that are defined and never used.
12971 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12972
12973 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12974
12975 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12976 (Fx_get_selection_internal): Minor cleanup.
12977 (Fx_own_selection_internal): Rename arguments for consistency with
12978 select.el.
12979
12980 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12981
12982 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12983
12984 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12985
12986 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12987
12988 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12989
12990 * dispnew.c (scrolling_window): Don't exclude the case that the
12991 last enabled row in the desired matrix touches the bottom boundary.
12992
12993 2011-05-21 Glenn Morris <rgm@gnu.org>
12994
12995 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
12996 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12997 and add some more files.
12998
12999 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13000
13001 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13002 report_file_error introduced by the change from 2011-05-07.
13003
13004 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13005
13006 * systime.h (Time): Define only if emacs is defined.
13007 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13008 where the include path doesn't have X11/X.h by default. See
13009 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13010
13011 2011-05-20 Kenichi Handa <handa@m17n.org>
13012
13013 * composite.c (find_automatic_composition): Fix previous change.
13014
13015 2011-05-20 Glenn Morris <rgm@gnu.org>
13016
13017 * lisp.mk: New file, split from Makefile.in.
13018 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13019 (shortlisp): Remove.
13020 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13021
13022 2011-05-19 Glenn Morris <rgm@gnu.org>
13023
13024 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13025 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13026 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13027 (lisp): Set the order to that of loadup.el.
13028 (shortlisp): Make it a copy of $lisp.
13029 (SOME_MACHINE_LISP): Remove.
13030 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13031 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13032
13033 2011-05-18 Kenichi Handa <handa@m17n.org>
13034
13035 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13036 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13037 (find_automatic_composition): Mostly rewrite for efficiency.
13038
13039 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13040
13041 * makefile.w32-in: Update dependencies.
13042
13043 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13044
13045 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13046 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13047
13048 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13049
13050 Fix some integer overflow issues, such as string length overflow.
13051
13052 * insdel.c (count_size_as_multibyte): Check for string overflow.
13053
13054 * character.c (lisp_string_width): Check for string overflow.
13055 Use EMACS_INT, not int, for string indexes and lengths; in
13056 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13057 the resulting string length overflows an EMACS_INT; instead,
13058 report a string overflow if no precision given. When checking for
13059 precision exhaustion, use a check that cannot possibly have
13060 integer overflow. (Bug#8675)
13061 * character.h (lisp_string_width): Adjust to new signature.
13062
13063 * alloc.c (string_overflow): New function.
13064 (Fmake_string): Use it. This doesn't change behavior, but saves
13065 a few bytes and will simplify future changes.
13066 * character.c (string_escape_byte8): Likewise.
13067 * lisp.h (string_overflow): New decl.
13068
13069 Fixups, following up to the user-interface timestamp change.
13070 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13071 for UI timestamps, instead of unsigned long.
13072 * msdos.c (mouse_get_pos): Likewise.
13073 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13074 * w32gui.h (Time): Define by including "systime.h" rather than by
13075 declaring it ourselves. (Bug#8664)
13076
13077 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13078 * image.c (clear_image_cache): Likewise.
13079
13080 * term.c (term_mouse_position): Don't assume time_t wraparound.
13081
13082 Be more systematic about user-interface timestamps.
13083 Before, the code sometimes used 'Time', sometimes 'unsigned long',
13084 and sometimes 'EMACS_UINT', to represent these timestamps.
13085 This change causes it to use 'Time' uniformly, as that's what X uses.
13086 This makes the code easier to follow, and makes it easier to catch
13087 integer overflow bugs such as Bug#8664.
13088 * frame.c (Fmouse_position, Fmouse_pixel_position):
13089 Use Time, not unsigned long, for user-interface timestamps.
13090 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13091 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13092 * keyboard.h (last_event_timestamp): Likewise.
13093 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13094 * menu.h (xmenu_show): Likewise.
13095 * term.c (term_mouse_position): Likewise.
13096 * termhooks.h (struct input_event.timestamp): Likewise.
13097 (struct terminal.mouse_position_hook): Likewise.
13098 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13099 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13100 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13101 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13102 what it was before.
13103 * menu.h, termhooks.h: Include "systime.h", for Time.
13104
13105 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13106 Don't assume that the difference between two unsigned long values
13107 can fit into an integer. At this point, we know button_down_time
13108 <= event->timestamp, so the difference must be nonnegative, so
13109 there's no need to cast the result if double-click-time is
13110 nonnegative, as it should be; check that it's nonnegative, just in
13111 case. This bug is triggered when events are more than 2**31 ms
13112 apart (about 25 days). (Bug#8664)
13113
13114 * xselect.c (last_event_timestamp): Remove duplicate decl.
13115 (x_own_selection): Remove needless cast to unsigned long.
13116
13117 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13118 that always fit in int. Use a sentinel instead of a counter, to
13119 avoid a temp and to allay GCC's concerns about possible int overflow.
13120 * frame.h (struct frame): Use int for menu_bar_items_used
13121 instead of EMACS_INT, since it always fits in int.
13122
13123 * menu.c (grow_menu_items): Check for int overflow.
13124
13125 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13126
13127 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13128 Before, the code was not consistent. These values cannot exceed
13129 2**31 - 1 so there's no need to make them unsigned.
13130 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13131 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13132 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13133 as modifiers.
13134 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13135
13136 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13137 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13138 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13139 presumably because the widths might not match.
13140
13141 * window.c (size_window): Avoid needless test at loop start.
13142
13143 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13144
13145 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13146
13147 2011-05-12 Drew Adams <drew.adams@oracle.com>
13148
13149 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13150
13151 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13152
13153 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13154 `width' to `bar_area_x' and `bar_area_width', respectively.
13155 (x_scroll_run): Take account of fringe background extension.
13156
13157 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13158 Rename local vars `left' and `width' to `bar_area_x' and
13159 `bar_area_width', respectively.
13160 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13161 background extension.
13162
13163 2011-05-10 Jim Meyering <meyering@redhat.com>
13164
13165 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13166
13167 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13168
13169 * image.c (Finit_image_library): Return t for built-in image types,
13170 like pbm and xbm. (Bug#8640)
13171
13172 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13173
13174 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13175
13176 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13177
13178 * w32console.c (Fset_screen_color): Doc fix.
13179 (Fget_screen_color): New function.
13180 (syms_of_ntterm): Defsubr it.
13181
13182 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13183 unlink the temporary file if Fcall_process didn't create it in the
13184 first place.
13185 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13186 child process will be redirected to a file specified with `:file'.
13187 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13188 cue to call_process_cleanup not to close that handle.
13189
13190 2011-05-07 Ben Key <bkey76@gmail.com>
13191
13192 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13193 one of two shell specific rules, either bootstrap-temacs-CMD or
13194 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13195 to the previous implementation of the bootstrap-temacs rule.
13196 The bootstrap-temacs-CMD rule is similar to the previous
13197 implementation of the bootstrap-temacs rule except that it
13198 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13199 variable.
13200
13201 These changes, along with some changes to nt/configure.bat,
13202 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13203 earlier fix to add support for --cflags and --ldflags options
13204 that include quotes so that it works whether make uses cmd or
13205 sh as the shell.
13206
13207 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13208
13209 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13210 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13211 is a constant.
13212 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13213 a string. Handle both cases.
13214 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13215 (Fdbus_register_method): Use Qinvalid_function.
13216
13217 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13218
13219 * makefile.w32-in: Update dependencies.
13220 (LISP_H): Add inttypes.h and stdin.h.
13221 (PROCESS_H): Add unistd.h.
13222
13223 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13224
13225 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13226 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13227
13228 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13229
13230 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13231
13232 * term.c (vfatal): Remove stray call to va_end.
13233 It's not needed and the C Standard doesn't allow it here anyway.
13234
13235 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13236 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13237
13238 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13239 bytes.
13240
13241 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13242
13243 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13244
13245 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13246
13247 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13248
13249 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13250
13251 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13252 * charset.c (Fdefine_charset_internal): Don't initialize
13253 charset.code_space[15]. The value was garbage, on hosts with
13254 32-bit int (Bug#8600).
13255
13256 * lread.c (read_integer): Be more consistent with string-to-number.
13257 Use string_to_number to do the actual conversion; this avoids
13258 rounding errors and fixes some other screwups. Without this fix,
13259 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13260 (digit_to_number): Move earlier, for benefit of read_integer.
13261 Return -1 if the digit is out of range for the base, -2 if it is
13262 not a digit in any supported base. (Bug#8602)
13263
13264 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13265
13266 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13267 to match comment at start of function. This also removes a
13268 GCC warning about overflow in a 32+64-bit port.
13269
13270 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13271
13272 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13273 Reported by Stefan Monnier in
13274 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13275 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13276 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13277
13278 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13279 (EMACS_UINTPTR): Likewise, with uintptr_t.
13280
13281 * lisp.h: Prefer 64-bit EMACS_INT if available.
13282 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13283 on 32-bit hosts that have 64-bit int, so that they can access
13284 large files.
13285 However, temporarily disable this change unless the temporary
13286 symbol WIDE_EMACS_INT is defined.
13287
13288 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13289
13290 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13291 This removes an assumption that EMACS_INT and long are the same
13292 width as pointers. The assumption is true for Emacs porting targets
13293 now, but we want to make other targets possible.
13294 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13295 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13296 In the rest of the code, change types of integers that hold casted
13297 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13298 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13299 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13300 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13301 No need to cast type when ORing.
13302 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13303 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13304 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13305 assume EMACS_INT is the same width as char *.
13306 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13307 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13308 Remove no-longer-needed casts.
13309 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13310 (xg_tool_bar_help_callback, xg_make_tool_item):
13311 Use EMACS_INTPTR to hold an integer
13312 that will be cast to void *; this can avoid a GCC warning
13313 if EMACS_INT is not the same width as void *.
13314 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13315 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13316 (current_message_1, set_message_1):
13317 Use a local to convert to proper width without a cast.
13318 * xmenu.c (dialog_selection_callback): Likewise.
13319
13320 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13321 Also, don't assume VALBITS / RAND_BITS is less than 5,
13322 and don't rely on undefined behavior when shifting a 1 left into
13323 the sign bit.
13324 * lisp.h (get_random): Change signature to match.
13325
13326 * lread.c (hash_string): Use size_t, not int, for hash computation.
13327 Normally we prefer signed values; but hashing is special, because
13328 it's better to use unsigned division on hash table sizes so that
13329 the remainder is nonnegative. Also, size_t is the natural width
13330 for hashing into memory. The previous code used 'int', which doesn't
13331 retain enough info to hash well into very large tables.
13332 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13333
13334 * dbusbind.c: Don't possibly lose pointer info when converting.
13335 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13336 Use XPNTR rather than XHASH, so that the high-order bits of
13337 the pointer aren't lost when converting through void *.
13338
13339 * eval.c (Fautoload): Don't double-shift a pointer.
13340
13341 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13342
13343 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13344
13345 * gnutls.c (DEF_GNUTLS_FN):
13346 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13347
13348 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13349
13350 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13351 marker. (Bug#8610)
13352
13353 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13354
13355 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13356 New version that can reserve upto 2GB of heap space.
13357
13358 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13359
13360 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13361
13362 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13363
13364 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13365 `gnutls_certificate_set_x509_key_file'.
13366
13367 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13368
13369 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13370 Update dependencies.
13371
13372 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13373
13374 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13375 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13376 Remove unused parameter `fildes'.
13377 * process.c (read_process_output, send_process): Don't pass it.
13378
13379 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13380
13381 Fix previous change: the library cache is defined in w32.c.
13382 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13383 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13384
13385 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13386
13387 Implement dynamic loading of GnuTLS on Windows.
13388
13389 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13390 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13391 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13392 Declare.
13393
13394 * gnutls.c (Qgnutls_dll): Define.
13395 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13396 (gnutls_*): Declare function pointers.
13397 (init_gnutls_functions): New function to initialize function pointers.
13398 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13399 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13400 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13401 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13402 (emacs_gnutls_write, emacs_gnutls_read)
13403 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13404 (Fgnutls_available_p): New function.
13405 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13406 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13407 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13408
13409 * image.c: Include w32.h.
13410 (Vimage_type_cache): Delete.
13411 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13412 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13413 (w32_delayed_load): Move to w32.c.
13414
13415 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13416
13417 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13418 (w32_delayed_load): Move from image.c. When loading a library, record
13419 its filename in the :loaded-from property of the library id.
13420 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13421 Initialize and staticpro them.
13422 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13423
13424 * process.c: Include lisp.h before w32.h, not after.
13425 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13426 instead of gnutls_record_check_pending.
13427
13428 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13429
13430 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13431
13432 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13433 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13434 as passed in.
13435
13436 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13437
13438 * xterm.c (x_set_frame_alpha): Do not set property on anything
13439 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13440
13441 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13442
13443 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13444
13445 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13446
13447 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13448 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13449 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13450 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13451 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13452 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13453 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13454 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13455 (Qgnutls_bootprop_callbacks_verify): Make static.
13456
13457 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13458
13459 * callproc.c: Indentation fixup.
13460
13461 * sysdep.c (wait_for_termination_1): Make static.
13462 (wait_for_termination, interruptible_wait_for_termination):
13463 Move after wait_for_termination_1.
13464
13465 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13466
13467 * sysdep.c (interruptible_wait_for_termination): New function
13468 which is like wait_for_termination, but allows keyboard
13469 interruptions.
13470
13471 * callproc.c (Fcall_process): Add (:file "file") as an option for
13472 the STDOUT buffer.
13473 (Fcall_process_region): Ditto.
13474
13475 2011-04-30 Eli Zaretskii <eliz@gnu.org>
13476
13477 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13478 rather than `XVECTOR (FOO)->size'.
13479
13480 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13481 inttypes.h, as a gnulib replacement is used if it not available in
13482 system headers.
13483
13484 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13485
13486 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13487 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13488 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13489
13490 * coding.c (coding_alloc_by_realloc): Error out if destination
13491 will grow beyond MOST_POSITIVE_FIXNUM.
13492 (decode_coding_emacs_mule): Abort if there isn't enough place in
13493 charbuf for the composition carryover bytes. Reserve an extra
13494 space for up to 2 characters produced in a loop.
13495 (decode_coding_iso_2022): Abort if there isn't enough place in
13496 charbuf for the composition carryover bytes.
13497
13498 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13499
13500 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13501 aborting when %lld or %lll format is passed.
13502 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13503 %llo or %llx format is passed. (Bug#8545)
13504
13505 * window.c (window_scroll_line_based): Use a marker instead of
13506 simple variables to record original value of point. (Bug#7952)
13507
13508 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13509 produced by %s or %c overflows available buffer space. (Bug#8545)
13510
13511 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13512
13513 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
13514 (SIZE_MAX): Move defn after all includes, as they might #define it.
13515
13516 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13517
13518 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13519
13520 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13521
13522 * keyboard.c (Qdelayed_warnings_hook): Define.
13523 (command_loop_1): Run `delayed-warnings-hook'
13524 if Vdelayed_warnings_list is non-nil.
13525 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13526 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13527
13528 2011-04-28 Eli Zaretskii <eliz@gnu.org>
13529
13530 * doprnt.c (doprnt): Don't return value smaller than the buffer
13531 size if the message was truncated. (Bug#8545).
13532
13533 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13534
13535 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13536 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13537
13538 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13539
13540 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13541
13542 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
13543
13544 * makefile.w32-in: Update dependencies.
13545
13546 2011-04-27 Eli Zaretskii <eliz@gnu.org>
13547
13548 Improve `doprnt' and its usage. (Bug#8545)
13549 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13550 `format_end'. Remove support for %l as a conversion specifier.
13551 Don't use xrealloc. Improve diagnostics when the %l size modifier
13552 is used. Update the commentary.
13553
13554 * eval.c (verror): Simplify calculation of size_t.
13555
13556 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13557 messages.
13558
13559 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13560
13561 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13562 change.
13563
13564 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13565
13566 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13567 This makes this file independent of the recent pseudovector change.
13568
13569 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
13570
13571 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13572
13573 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
13574 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
13575 Remove unused local.
13576 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
13577
13578 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
13579 GCC 4.6.0 optimizes based on type-based alias analysis.
13580 For example, if b is of type struct buffer * and v of type struct
13581 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13582 != &v->size, and therefore "v->size = 1; b->size = 2; return
13583 v->size;" must therefore return 1. This assumption is incorrect
13584 for Emacs, since it type-puns struct Lisp_Vector * with many other
13585 types. To fix this problem, this patch adds a new type struct
13586 vectorlike_header that documents the constraints on layout of vectors
13587 and pseudovectors, and helps optimizing compilers not get fooled
13588 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13589 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
13590 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13591 the size member.
13592 (XSETPVECTYPE): Rewrite in terms of new macro.
13593 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13594 This is a bit clearer, and further avoids the possibility of
13595 undesirable aliasing.
13596 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
13597 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
13598 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13599 since Lisp_Subr is a special case (no "next" field).
13600 (ASIZE): Now uses header.size rather than size.
13601 All previous uses of XVECTOR (foo)->size replaced to use this macro,
13602 to avoid the hassle of writing XVECTOR (foo)->header.size.
13603 (struct vectorlike_header): New type.
13604 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13605 object, to help avoid aliasing.
13606 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13607 (SUBRP): Likewise, since Lisp_Subr is a special case.
13608 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13609 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13610 (struct Lisp_Hash_Table): Combine first two members into a single
13611 struct vectorlike_header member. All uses of "size" and "next" members
13612 changed to be "header.size" and "header.next".
13613 * buffer.h (struct buffer): Likewise.
13614 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13615 * frame.h (struct frame): Likewise.
13616 * process.h (struct Lisp_Process): Likewise.
13617 * termhooks.h (struct terminal): Likewise.
13618 * window.c (struct save_window_data, struct saved_window): Likewise.
13619 * window.h (struct window): Likewise.
13620 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13621 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13622 * buffer.c (init_buffer_once): Likewise.
13623 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13624 special case.
13625 * process.c (Fformat_network_address): Use local var for size,
13626 for brevity.
13627
13628 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13629
13630 Make the Lisp reader and string-to-float more consistent (Bug#8525)
13631 * data.c (atof): Remove decl; no longer used or needed.
13632 (digit_to_number): Move to lread.c.
13633 (Fstring_to_number): Use new string_to_number function, to be
13634 consistent with how the Lisp reader treats infinities and NaNs.
13635 Do not assume that floating-point numbers represent EMACS_INT
13636 without losing information; this is not true on most 64-bit hosts.
13637 Avoid double-rounding errors, by insisting on integers when
13638 parsing non-base-10 numbers, as the documentation specifies.
13639 * lisp.h (string_to_number): New decl, replacing ...
13640 (isfloat_string): Remove.
13641 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
13642 (read1): Do not accept +. and -. as integers; this
13643 appears to have been a coding error. Similarly, do not accept
13644 strings like +-1e0 as floating point numbers. Do not report
13645 overflow for integer overflows unless the base is not 10 which
13646 means we have no simple and reliable way to continue.
13647 Break out the floating-point parsing into a new
13648 function string_to_number, so that Fstring_to_number parses
13649 floating point numbers consistently with the Lisp reader.
13650 (digit_to_number): Move here from data.c. Make it static inline.
13651 (E_CHAR, EXP_INT): Remove, replacing with ...
13652 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13653 (string_to_number): New function, replacing isfloat_string.
13654 This function checks for valid syntax and produces the resulting
13655 Lisp float number too. Rework it so that string-to-number
13656 no longer mishandles examples like "1.0e+". Use strtoumax,
13657 so that overflow for non-base-10 numbers is reported only when
13658 there's no portable and simple way to convert to floating point.
13659
13660 * textprop.c (set_text_properties_1): Rewrite for clarity,
13661 and to avoid GCC warning about integer overflow.
13662
13663 * intervals.h (struct interval): Use EMACS_INT for members
13664 where EMACS_UINT might cause problems. See
13665 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13666 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13667 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13668 All uses changed.
13669 (offset_intervals): Tell GCC not to worry about length overflow
13670 when negating a negative length.
13671
13672 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13673 (overrun_check_free): Likewise.
13674
13675 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13676 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13677 word size.
13678
13679 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13680 (gnutls_make_error): Rename local to avoid shadowing.
13681 (gnutls_emacs_global_deinit): ifdef out; not used.
13682 (Fgnutls_boot): Use const for pointer to readonly storage.
13683 Comment out unused local. Fix pointer signedness problems.
13684
13685 * lread.c (openp): Don't stuff size_t into an 'int'.
13686 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13687 about possible signed overflow.
13688
13689 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13690 (GDK_KEY_g): Don't define if already defined.
13691 (xg_prepare_tooltip): Avoid pointer signedness problem.
13692 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13693
13694 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13695 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13696
13697 * xfns.c (Fx_window_property): Simplify a bit,
13698 to make a bit faster and to avoid GCC 4.6.0 warning.
13699 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13700
13701 * fns.c (internal_equal): Don't assume size_t fits in int.
13702
13703 * alloc.c (compact_small_strings): Tighten assertion a little.
13704
13705 Replace pEd with more-general pI, and fix some printf arg casts.
13706 * lisp.h (pI): New macro, generalizing old pEd macro to other
13707 conversion specifiers. For example, use "...%"pI"d..." rather
13708 than "...%"pEd"...".
13709 (pEd): Remove. All uses replaced with similar uses of pI.
13710 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
13711 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13712 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13713 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13714 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13715 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13716 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13717 64-bit hosts.
13718 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13719 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13720 * print.c (safe_debug_print, print_object): Likewise.
13721 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13722 to int.
13723 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13724 avoiding the 0 flag, which is not portable.
13725 * process.c (Fmake_network_process): Use pI to avoid cast.
13726 * region-cache.c (pp_cache): Likewise.
13727 * xdisp.c (decode_mode_spec): Likewise.
13728 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13729 behavior on 64-bit hosts with printf arg.
13730 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
13731 (x_stop_queuing_selection_requests): Likewise.
13732 (x_get_window_property): Don't truncate byte count to an 'int'
13733 when tracing.
13734
13735 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13736 here, since it parses constructs like leading '-' and spaces,
13737 which are not wanted; and it overflows with large numbers.
13738 Instead, simply match F[0-9]+, which is what is wanted anyway.
13739
13740 * alloc.c: Remove unportable assumptions about struct layout.
13741 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13742 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13743 (allocate_vectorlike, make_pure_vector): Use the new macros,
13744 plus offsetof, to remove unportable assumptions about struct layout.
13745 These assumptions hold on all porting targets that I know of, but
13746 they are not guaranteed, they're easy to remove, and removing them
13747 makes further changes easier.
13748
13749 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13750 This doesn't fix a bug but makes the code clearer.
13751 (string_overrun_cookie): Now const. Use initializers that
13752 don't formally overflow signed char, to avoid warnings.
13753 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13754 can cause Emacs to crash when string overrun checking is enabled.
13755 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13756 multiple of sizeof (EMACS_INT); it need not be, if
13757 alignof(EMACS_INT) < sizeof (EMACS_INT).
13758 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
13759
13760 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
13761
13762 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13763
13764 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13765
13766 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
13767 supposed to be handshaking. (Bug#8556)
13768 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13769
13770 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
13771
13772 * lisp.h (Qdebug): List symbol.
13773 * eval.c (Qdebug): Restore global linkage.
13774 * keyboard.c (debug-on-event): New variable.
13775 (handle_user_signal): Break into debugger when debug-on-event
13776 matches the current signal symbol.
13777
13778 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13779
13780 * alloc.c (check_sblock, check_string_bytes)
13781 (check_string_free_list): Convert to standard C.
13782
13783 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13784
13785 * w32.c (emacs_gnutls_push): Fix typo.
13786
13787 2011-04-25 Eli Zaretskii <eliz@gnu.org>
13788
13789 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13790 "cast to pointer from integer of different size".
13791
13792 Improve doprnt and its use in verror. (Bug#8545)
13793 * doprnt.c (doprnt): Document the set of format control sequences
13794 supported by the function. Use SAFE_ALLOCA instead of always
13795 using `alloca'.
13796
13797 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13798 is one byte too soon. Don't use xrealloc; instead xfree and
13799 xmalloc anew.
13800
13801 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13802
13803 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13804 callbacks stage.
13805
13806 * gnutls.c: Renamed global_initialized to
13807 gnutls_global_initialized. Added internals for the
13808 :verify-hostname-error, :verify-error, and :verify-flags
13809 parameters of `gnutls-boot' and documented those parameters in the
13810 docstring. Start callback support.
13811 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13812 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13813 on error. Return error code.
13814 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13815 (emacs_gnutls_read): Likewise.
13816 (Fgnutls_boot): Return handshake error code.
13817 (emacs_gnutls_handle_error): New function.
13818 (wsaerror_to_errno): Likewise.
13819
13820 * w32.h (emacs_gnutls_pull): Add prototype.
13821 (emacs_gnutls_push): Likewise.
13822
13823 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13824 (emacs_gnutls_push): Likewise.
13825
13826 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13827
13828 * process.c (wait_reading_process_output): Check if GnuTLS
13829 buffered some data internally if no FDs are set for TLS
13830 connections.
13831
13832 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13833 (LIBS): Link to USER_LIBS.
13834 ($(BLD)/gnutls.$(0)): New target.
13835
13836 2011-04-24 Eli Zaretskii <eliz@gnu.org>
13837
13838 * xdisp.c (handle_single_display_spec): Rename the
13839 display_replaced_before_p argument into display_replaced_p, to
13840 make it consistent with the commentary. Fix typos in the
13841 commentary.
13842
13843 * textprop.c (syms_of_textprop): Remove dead code.
13844 (copy_text_properties): Delete obsolete commentary about an
13845 interface that was deleted long ago. Fix typos in the description
13846 of arguments.
13847
13848 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13849 to changes in oldXMenu/XMenu.h from 2011-04-16.
13850 <menu_help_message, prev_menu_help_message>: Constify.
13851 (IT_menu_make_room): menu->help_text is now `const char **';
13852 adjust.
13853
13854 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13855 to changes in oldXMenu/XMenu.h from 2011-04-16.
13856 (struct XMenu): Declare `help_text' `const char **'.
13857
13858 * xfaces.c <Qunspecified>: Make extern again.
13859
13860 * syntax.c: Include sys/types.h before including regex.h, as
13861 required by POSIX.
13862
13863 * doc.c (get_doc_string): Improve the format passed to `error'.
13864
13865 * doprnt.c (doprnt): Improve commentary.
13866
13867 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13868
13869 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13870 them with etags.
13871
13872 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13873 changes in globals.h immediately force recompilation.
13874 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13875 $(CURDIR)/s/ms-w32.h.
13876 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
13877
13878 * character.c (Fchar_direction): Function deleted.
13879 (syms_of_character): Don't defsubr it.
13880 <char-direction-table>: Deleted.
13881
13882 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13883
13884 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13885 * doprnt.c: Include limits.h.
13886 (SIZE_MAX): New macro.
13887 (doprnt): Return a size_t value. 2nd arg is now size_t.
13888 Many local variables are now size_t instead of int or unsigned.
13889 Improve overflow protection. Support `l' modifier for integer
13890 conversions. Support %l conversion. Don't assume an EMACS_INT
13891 argument for integer conversions and for %c.
13892
13893 * lisp.h (doprnt): Restore prototype.
13894
13895 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13896 $(SRC)/character.h.
13897
13898 * Makefile.in (base_obj): Add back doprnt.o.
13899
13900 * deps.mk (doprnt.o): Add back prerequisites.
13901 (callint.o): Depend on character.h.
13902
13903 * eval.c (internal_lisp_condition_case): Include the handler
13904 representation in the error message.
13905 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13906 when breaking from the loop.
13907
13908 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13909
13910 * callint.c (Fcall_interactively): When displaying error message
13911 about invalid control letter, pass the character's codepoint, not
13912 a pointer to its multibyte form. Improve display of the character
13913 in octal and display also its hex code.
13914
13915 * character.c (char_string): Use %x to display the (unsigned)
13916 codepoint of an invalid character, to avoid displaying a bogus
13917 negative value.
13918
13919 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13920 `error', not SYMBOL_NAME itself.
13921
13922 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13923 character arguments to `error'.
13924
13925 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13926 to `error' in error message about FINAL_CHAR argument. Make sure
13927 FINAL_CHAR is a character, and use %c when it is passed as
13928 argument to `error'.
13929
13930 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13931
13932 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13933
13934 * w32.c: Include <time.h>.
13935 (sys_localtime): New function.
13936
13937 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
13938
13939 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13940
13941 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
13942
13943 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
13944
13945 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13946 zombies (Bug#8467).
13947
13948 2011-04-19 Eli Zaretskii <eliz@gnu.org>
13949
13950 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13951 gl_state.e_property when gl_state.object is Qt.
13952
13953 * insdel.c (make_gap_larger): Remove limitation of buffer size
13954 to <= INT_MAX.
13955
13956 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
13957
13958 * xdisp.c (lookup_glyphless_char_display)
13959 (produce_glyphless_glyph): Handle cons cell entry in
13960 glyphless-char-display.
13961 (Vglyphless_char_display): Document it.
13962
13963 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13964 glyphless-char-display.
13965
13966 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
13967
13968 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13969
13970 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13971
13972 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13973 definition for no-X builds.
13974
13975 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
13976
13977 Static checks with GCC 4.6.0 and non-default toolkits.
13978
13979 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13980
13981 * process.c (keyboard_bit_set): Define only if SIGIO.
13982 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13983 (send_process): Repair possible setjmp clobbering.
13984
13985 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13986
13987 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13988
13989 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13990
13991 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13992 Define only if needed.
13993
13994 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13995 by pacifying GCC about it. Maybe it's time to retire it?
13996 * xfaces.c (USG, __TIMEVAL__): Likewise.
13997
13998 * dispextern.h (struct redisplay_interface): Rename param
13999 to avoid shadowing.
14000 * termhooks.h (struct terminal): Likewise.
14001 * xterm.c (xembed_send_message): Likewise.
14002
14003 * insdel.c (make_gap_smaller): Define only if
14004 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14005
14006 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14007 it.
14008
14009 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14010 so that we aren't warned about unused symbols.
14011
14012 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14013
14014 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14015
14016 * xfns.c (x_real_positions): Mark locals as initialized.
14017
14018 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14019
14020 * xterm.c: Fix problems found by static analysis with other toolkits.
14021 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14022 (x_dispatch_event): Declare static if USE_GTK, and
14023 define if USE_GTK || USE_X_TOOLKIT.
14024 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14025 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14026 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14027 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14028
14029 * xmenu.c (menu_help_callback): Pointer type fixes.
14030 Use const pointers when pointing at readonly data. Avoid pointer
14031 signedness clashes.
14032 (FALSE): Remove unused macro.
14033 (update_frame_menubar): Remove unused decl.
14034
14035 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14036
14037 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14038 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14039 (single_menu_item): Rename local to avoid shadowing.
14040
14041 * keyboard.c (make_lispy_event): Remove unused local var.
14042
14043 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14044 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14045
14046 * bitmaps: Change bitmaps from unsigned char back to the X11
14047 compatible char. Avoid the old compiler warnings about
14048 out-of-range initializers by using, for example, '\xab' rather
14049 than 0xab.
14050
14051 * xgselect.c (xgselect_initialize): Check vs interface
14052 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14053
14054 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14055
14056 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14057 to read-only memory.
14058
14059 * fns.c (vector): Remove; this old hack is no longer needed.
14060
14061 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14062 Remove unused var.
14063 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14064
14065 * xrdb.c (x_load_resources): Omit unused local.
14066
14067 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14068 (x_window): Rename locals to avoid shadowing.
14069 (USG): Use the kludged USG macro, to pacify gcc.
14070
14071 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14072 (x_term_init): Remove local to avoid shadowing.
14073
14074 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14075
14076 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14077 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14078
14079 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14080
14081 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14082
14083 Fix regex.c, syntax.c and friends for buffers > 2GB.
14084 * syntax.h (struct gl_state_s): Declare character position members
14085 EMACS_INT.
14086
14087 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14088
14089 * textprop.c (verify_interval_modification, interval_of):
14090 Declare arguments EMACS_INT.
14091
14092 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14093 EMACS_INT.
14094
14095 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14096
14097 * indent.c (Fvertical_motion): Local variable it_start is now
14098 EMACS_INT.
14099
14100 * regex.c (re_match, re_match_2, re_match_2_internal)
14101 (bcmp_translate, regcomp, regexec, print_double_string)
14102 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14103 (re_compile_pattern, re_exec): Declare arguments and local
14104 variables `size_t' and `ssize_t' and return values `regoff_t', as
14105 appropriate.
14106 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14107 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14108 <compile_stack_type>: `size' and `avail' are now `size_t'.
14109
14110 * regex.h <regoff_t>: Use ssize_t, not int.
14111 (re_search, re_search_2, re_match, re_match_2): Arguments that
14112 specify buffer/string position and length are now ssize_t and
14113 size_t. Return type is regoff_t.
14114
14115 2011-04-16 Ben Key <bkey76@gmail.com>
14116
14117 * nsfont.m: Fixed bugs in ns_get_family and
14118 ns_descriptor_to_entity that were caused by using free to
14119 deallocate memory blocks that were allocated by xmalloc (via
14120 xstrdup). This caused Emacs to crash when compiled with
14121 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14122 --enable-checking=xmallocoverrun). xfree is now used to
14123 deallocate these memory blocks.
14124
14125 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14126
14127 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14128
14129 emacs_write: Accept and return EMACS_INT for sizes.
14130 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14131 et seq.
14132 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14133 Accept and return EMACS_INT.
14134 (emacs_gnutls_write): Return the number of bytes written on
14135 partial writes.
14136 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14137 (emacs_read, emacs_write): Remove check for negative size, as the
14138 Emacs source code has been audited now.
14139 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14140 (emacs_read, emacs_write): Use it.
14141 * process.c (send_process): Adjust to the new signatures of
14142 emacs_write and emacs_gnutls_write. Do not attempt to store
14143 a byte offset into an 'int'; it might overflow.
14144 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14145
14146 * sound.c: Don't assume sizes fit in 'int'.
14147 (struct sound_device.period_size, alsa_period_size):
14148 Return EMACS_INT, not int.
14149 (struct sound_device.write, vox_write, alsa_write):
14150 Accept EMACS_INT, not int.
14151 (wav_play, au_play): Use EMACS_INT to store sizes and to
14152 record read return values.
14153
14154 2011-04-15 Ben Key <bkey76@gmail.com>
14155
14156 * keyboard.c (Qundefined): Don't declare static since it is used
14157 in nsfns.m.
14158 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14159 static since they are used in nsfont.m.
14160
14161 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14162
14163 * process.c (Qprocessp): Don't declare static.
14164 * lisp.h (Qprocessp): Declare again.
14165
14166 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14167
14168 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14169
14170 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14171
14172 Improve C-level modularity by making more things 'static'.
14173
14174 Don't publish debugger-only interfaces to other modules.
14175 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14176 (verify_bytepos, count_markers): Move decls to the only modules
14177 that need them.
14178 * region-cache.h (pp_cache): Likewise.
14179 * window.h (check_all_windows): Likewise.
14180 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14181
14182 * sysdep.c (croak): Now static, if
14183 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14184 * syssignal.h (croak): Declare only if not static.
14185
14186 * alloc.c (refill_memory_reserve): Now static if
14187 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14188 * lisp.h (refill_memory_reserve): Declare only if not static.
14189
14190 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14191 Define only if USE_LUCID.
14192
14193 * xrdb.c (x_customization_string, x_rm_string): Now static.
14194
14195 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14196 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14197
14198 * xdisp.c (draw_row_with_mouse_face): Now static.
14199 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14200
14201 * window.h (check_all_windows): Mark externally visible.
14202
14203 * window.c (window_deletion_count): Now static.
14204
14205 * undo.c: Make symbols static if they're not exported.
14206 (last_undo_buffer, last_boundary_position, pending_boundary):
14207 Now static.
14208
14209 * textprop.c (interval_insert_behind_hooks): Now static.
14210 (interval_insert_in_front_hooks): Likewise.
14211
14212 * term.c: Make symbols static if they're not exported.
14213 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14214 (max_frame_lines, tty_set_terminal_modes):
14215 (tty_reset_terminal_modes, tty_turn_off_highlight):
14216 (get_tty_terminal): Now static.
14217 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14218 * termhooks.h (term_mouse_moveto): Do not declare if
14219 HAVE_WINDOW_SYSTEM.
14220 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14221 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14222
14223 * sysdep.c: Make symbols static if they're not exported.
14224 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14225 Now static.
14226 (sigprocmask_set, full_mask): Remove; unused.
14227 (wait_debugging): Mark as visible.
14228 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14229 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14230
14231 * syntax.c (syntax_temp): Define only if !__GNUC__.
14232
14233 * sound.c (current_sound_device, current_sound): Now static.
14234
14235 * search.c (searchbufs, searchbuf_head): Now static.
14236
14237 * scroll.c (scroll_cost): Remove; unused.
14238 * dispextern.h (scroll_cost): Remove decl.
14239
14240 * region-cache.h (pp_cache): Mark as externally visible.
14241
14242 * process.c: Make symbols static if they're not exported.
14243 (process_tick, update_tick, create_process, chan_process):
14244 (Vprocess_alist, proc_buffered_char, datagram_access):
14245 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14246 (deactivate_process): Mark defn as static, as well as decl.
14247 * lisp.h (create_process): Remove decl.
14248 * process.h (chan_process, Vprocess_alist): Remove decls.
14249
14250 * print.c: Make symbols static if they're not exported.
14251 (print_depth, new_backquote_output, being_printed, print_buffer):
14252 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14253 (print_interval, print_number_index, initial_stderr_stream):
14254 Now static.
14255 * lisp.h (Fprinc): Remove decl.
14256 (debug_output_compilation_hack): Mark as externally visible.
14257
14258 * sysdep.c (croak): Move decl from here to syssignal.h.
14259 * syssignal.h (croak): Put it here, so the API can be checked when
14260 'croak' is called from dissociate_if_controlling_tty.
14261
14262 * minibuf.c: Make symbols static if they're not exported.
14263 (minibuf_save_list, choose_minibuf_frame): Now static.
14264 * lisp.h (choose_minibuf_frame): Remove decl.
14265
14266 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14267
14268 * lread.c: Make symbols static if they're not exported.
14269 (read_objects, initial_obarray, oblookup_last_bucket_number):
14270 Now static.
14271 (make_symbol): Remove; unused.
14272 * lisp.h (initial_obarray, make_symbol): Remove decls.
14273
14274 * keyboard.c: Make symbols static if they're not exported.
14275 (single_kboard, recent_keys_index, total_keys, recent_keys):
14276 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14277 (this_single_command_key_start, echoing, last_auto_save):
14278 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14279 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14280 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14281 (Vlispy_mouse_stem, double_click_count):
14282 Now static.
14283 (force_auto_save_soon): Define only if SIGDANGER.
14284 (ignore_mouse_drag_p): Now static if
14285 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14286 (print_help): Remove; unused.
14287 (stop_character, last_timer_event): Mark as externally visible.
14288 * keyboard.h (ignore_mouse_drag_p): Declare only if
14289 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14290 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14291 * lisp.h (echoing): Remove decl.
14292 (force_auto_save_soon): Declare only if SIGDANGER.
14293 * xdisp.c (redisplay_window): Simplify code, to make it more
14294 obvious that ignore_mouse_drag_p is not accessed if !defined
14295 USE_GTK && !defined HAVE_NS.
14296
14297 * intervals.c: Make symbols static if they're not exported.
14298 (merge_properties_sticky, merge_interval_right, delete_interval):
14299 Now static.
14300 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14301
14302 * insdel.c: Make symbols static if they're not exported.
14303 However, leave prepare_to_modify_buffer alone. It's never
14304 called from outside this function, but that appears to be a bug.
14305 (combine_after_change_list, combine_after_change_buffer):
14306 (adjust_after_replace, signal_before_change): Now static.
14307 (adjust_after_replace_noundo): Remove; unused.
14308 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14309 (signal_before_change): Remove decls.
14310
14311 * indent.c (val_compute_motion, val_vmotion): Now static.
14312
14313 * image.c: Make symbols static if they're not exported.
14314 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14315 if USE_GTK.
14316 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14317 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14318
14319 * fringe.c (standard_bitmaps): Now static.
14320 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14321
14322 * frame.c: Make symbols static if they're not exported.
14323 (x_report_frame_params, make_terminal_frame): Now static.
14324 (get_frame_param): Now static, unless HAVE_NS.
14325 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14326 (x_get_resource_string): Remove; not used.
14327 * frame.h (make_terminal_frame, x_report_frame_params):
14328 (x_get_resource_string); Remove decls.
14329 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14330 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14331
14332 * font.c, fontset.c: Make symbols static if they're not exported.
14333 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14334 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14335 * font.c (font_close_object): Now static.
14336 * font.h (font_close_object): Remove.
14337 * fontset.c (FONTSET_OBJLIST): Remove.
14338 (free_realized_fontset) #if-0 the body, which does nothing.
14339 (face_suitable_for_char_p): #if-0, as it's never called.
14340 * fontset.h (face_suitable_for_char_p): Remove decl.
14341 * xfaces.c (face_at_string_position):
14342 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14343 since 0 is always ASCII.
14344
14345 * fns.c (weak_hash_tables): Now static.
14346
14347 * fileio.c: Make symbols static if they're not exported.
14348 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14349 (Vwrite_region_annotation_buffers): Now static.
14350
14351 * eval.c: Make symbols static if they're not exported.
14352 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14353 * lisp.h (backtrace_list): Remove decl.
14354
14355 * emacs.c: Make symbols static if they're not exported.
14356 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14357 (fatal_error_code, fatal_error_signal_hook, standard_args):
14358 Now static.
14359 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14360 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14361 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14362 * lisp.h (fatal_error_signal_hook): Remove decl.
14363 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14364
14365 * editfns.c: Move a (normally-unused) function to its only use.
14366 * editfns.c, lisp.h (get_operating_system_release): Remove.
14367 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14368 worth the hassle of breaking this out.
14369
14370 * xterm.c: Make symbols static if they're not exported.
14371 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14372 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14373 (x_destroy_window, x_delete_display):
14374 Now static.
14375 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14376 (x_mouse_leave): Remove; unused.
14377 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14378 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14379 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14380 Remove decls.
14381 (x_mouse_leave): Declare only if WINDOWSNT.
14382 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14383 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14384 USE_X_TOOLKIT.
14385
14386 * ftxfont.c: Make symbols static if they're not exported.
14387 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14388 HAVE_FREETYPE.
14389 * font.h (ftxfont_driver): Likewise.
14390
14391 * xfns.c: Make symbols static if they're not exported.
14392 (x_last_font_name, x_display_info_for_name):
14393 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14394 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14395 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14396 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14397 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14398 (last_show_tip_args): Now static.
14399 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14400 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14401 (x_screen_planes): Remove; unused.
14402 * dispextern.h (x_screen_planes): Remove decl.
14403
14404 * dispnew.c: Make symbols static if they're not exported.
14405 * dispextern.h (redraw_garbaged_frames, scrolling):
14406 (increment_row_positions): Remove.
14407 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14408 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14409 Now static.
14410 (redraw_garbaged_frames): Remove; unused.
14411
14412 * xfaces.c: Make symbols static if they're not exported.
14413 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14414 Remove decls.
14415 * xterm.h (defined_color): Remove decls.
14416 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14417 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14418 (menu_face_changed_default, defined_color, free_realized_face):
14419 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14420 (ascii_face_of_lisp_face): Remove; unused.
14421
14422 * xdisp.c: Make symbols static if they're not exported.
14423 * dispextern.h (scratch_glyph_row, window_box_edges):
14424 (glyph_to_pixel_coords, set_cursor_from_row):
14425 (get_next_display_element, set_iterator_to_next):
14426 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14427 (show_mouse_face): Remove decls
14428 * frame.h (message_buf_print): Likewise.
14429 * lisp.h (pop_message, set_message, check_point_in_composition):
14430 Likewise.
14431 * xterm.h (set_vertical_scroll_bar): Likewise.
14432 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14433 (message_buf_print, scratch_glyph_row, displayed_buffer):
14434 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14435 (get_next_display_element, show_mouse_face, window_box_edges):
14436 (frame_to_window_pixel_xy, check_point_in_composition):
14437 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14438 (glyph_to_pixel_coords): Remove; unused.
14439
14440 * dired.c (file_name_completion): Now static.
14441
14442 * dbusbind.c (xd_in_read_queued_messages): Now static.
14443
14444 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14445 * data.c (circular_list_error): Remove.
14446
14447 * commands.h (last_point_position, last_point_position_buffer):
14448 (last_point_position_window): Remove decls.
14449 * keyboard.c: Make these variables static.
14450
14451 * coding.h (coding, code_convert_region, encode_coding_gap):
14452 Remove decls.
14453 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14454 (iso_code_class, detect_coding, code_convert_region): Now static.
14455 (encode_coding_gap): Remove; unused.
14456
14457 * chartab.c (chartab_chars, chartab_bits): Now static.
14458
14459 * charset.h (charset_iso_8859_1): Remove decl.
14460 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14461 Now static.
14462
14463 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14464 * ccl.c (Vccl_program_table): Now static.
14465 (check_ccl_update): Remove; unused.
14466
14467 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14468 * category.h: ... from here.
14469 * category.c (check_category_table, set_category_set): Now static.
14470
14471 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14472 * lisp.h: Remove these decls.
14473
14474 * buffer.c (buffer_count): Remove unused var.
14475
14476 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14477 so that it's not optimized away.
14478 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14479 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14480 exported only to the debugger.
14481
14482 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
14483 * atimer.h (run_all_atimers): Remove; not exported.
14484
14485 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14486 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14487 was inaccessible from Lisp.
14488 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14489 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14490
14491 alloc.c: Import and export fewer symbols, and remove unused items.
14492 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14493 is defined.
14494 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14495 it's not optimized away by whole-program optimization.
14496 (message_enable_multibyte, free_misc): Remove.
14497 (catchlist, handlerlist, mark_backtrace):
14498 Declare only if BYTE_MARK_STACK.
14499 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14500 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14501 (message_enable_multibyte): Remove decl.
14502 (free_misc, interval_free_list, float_block, float_block_index):
14503 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14504 (cons_free_list, last_marked_index):
14505 Now static.
14506 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14507 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14508 (mark_backtrace): Define only if BYTE_MARK_STACK.
14509 * xdisp.c (message_enable_multibyte): Now static.
14510
14511 Declare Lisp_Object Q* variables to be 'static' if not exported.
14512 This makes it easier for human readers (and static analyzers)
14513 to see whether these variables are used from other modules.
14514 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14515 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14516 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14517 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14518 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14519 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14520 * xmenu.c, xselect.c:
14521 Declare Q* vars static if they are not used in other modules.
14522 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14523 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14524 Remove decls of unexported vars.
14525 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14526
14527 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14528
14529 Make Emacs functions such as Fatom 'static' by default.
14530 This makes it easier for human readers (and static analyzers)
14531 to see whether these functions can be called from other modules.
14532 DEFUN now defines a static function. To make the function external
14533 so that it can be used in other C modules, use the new macro DEFUE.
14534 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14535 (Finit_image_library):
14536 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14537 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14538 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14539 Remove decls, since these functions are now static.
14540 (Funintern, Fget_internal_run_time): New decls, since these functions
14541 were already external.
14542
14543 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14544 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14545 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14546 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14547 * keyboard.c, keymap.c, lread.c:
14548 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14549 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14550 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14551 Mark functions with DEFUE instead of DEFUN,
14552 if they are used in other modules.
14553 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14554 decls for now-static functions.
14555 * buffer.h (Fdelete_overlay): Remove decl.
14556 * callproc.c (Fgetenv_internal): Mark as internal.
14557 * composite.c (Fremove_list_of_text_properties): Remove decl.
14558 (Fcomposition_get_gstring): New forward static decl.
14559 * composite.h (Fcomposite_get_gstring): Remove decl.
14560 * dired.c (Ffile_attributes): New forward static decl.
14561 * doc.c (Fdocumntation_property): New forward static decl.
14562 * eval.c (Ffetch_bytecode): New forward static decl.
14563 (Funintern): Remove extern decl; now in .h file where it belongs.
14564 * fileio.c (Fmake_symbolic_link): New forward static decl.
14565 * image.c (Finit_image_library): New forward static decl.
14566 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14567 * intervals.h (Fprevious_property_change):
14568 (Fremove_list_of_text_properties): Remove decls.
14569 * keyboard.c (Fthis_command_keys): Remove decl.
14570 (Fcommand_execute): New forward static decl.
14571 * keymap.c (Flookup_key): New forward static decl.
14572 (Fcopy_keymap): Now static.
14573 * keymap.h (Flookup_key): Remove decl.
14574 * process.c (Fget_process): New forward static decl.
14575 (Fprocess_datagram_address): Mark as internal.
14576 * syntax.c (Fsyntax_table_p): New forward static decl.
14577 (skip_chars): Remove duplicate decl.
14578 * textprop.c (Fprevious_property_change): New forward static decl.
14579 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14580 Now internal.
14581 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14582 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14583
14584 * editfns.c (Fformat): Remove unreachable code.
14585
14586 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14587
14588 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14589 change. (Bug#8496)
14590
14591 2011-04-13 Eli Zaretskii <eliz@gnu.org>
14592
14593 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14594 when at ZV. (Bug#8487)
14595
14596 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14597
14598 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14599 (Bug#8437)
14600 * keyboard.c (parse_tool_bar_item): Likewise.
14601 * sound.c (sound_cleanup, alsa_close): Likewise.
14602 * termcap.c (tgetent): Likewise.
14603 * xfns.c (x_default_font_parameter): Likewise.
14604 * xsettings.c (read_and_apply_settings): Likewise.
14605
14606 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14607 (overrun_check_free): Protoize.
14608
14609 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14610
14611 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14612 since callers should never pass a negative size.
14613 Change the signature to match that of plain 'read' and 'write'; see
14614 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14615 * lisp.h: Update prototypes of emacs_write and emacs_read.
14616
14617 2011-04-11 Eli Zaretskii <eliz@gnu.org>
14618
14619 * xdisp.c (redisplay_window): Don't try to determine the character
14620 position of the scroll margin if the window start point w->startp
14621 is outside the buffer's accessible region. (Bug#8468)
14622
14623 2011-04-10 Eli Zaretskii <eliz@gnu.org>
14624
14625 Fix write-region and its subroutines for buffers > 2GB.
14626 * fileio.c (a_write, e_write): Modify declaration of arguments and
14627 local variables to support buffers larger than 2GB.
14628 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14629
14630 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14631 argument, local variables, and return value.
14632
14633 * lisp.h: Update prototypes of emacs_write and emacs_read.
14634
14635 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14636
14637 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
14638
14639 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14640
14641 Fix more problems found by GCC 4.6.0's static checks.
14642
14643 * xdisp.c (vmessage): Use a better test for character truncation.
14644
14645 * charset.c (load_charset_map): <, not <=, for optimization,
14646 and to avoid potential problems with integer overflow.
14647 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
14648 * casetab.c (set_identity, shuffle): Likewise.
14649 * editfns.c (Fformat): Likewise.
14650 * syntax.c (skip_chars): Likewise.
14651
14652 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14653 This also lets GCC 4.6.0 generate slightly better loop code.
14654
14655 * callint.c (Fcall_interactively): <, not <=, for optimization.
14656 (Fcall_interactively): Count the number of arguments produced,
14657 not the number of arguments given. This is simpler and lets GCC
14658 4.6.0 generate slightly better code.
14659
14660 * ftfont.c: Distingish more carefully between FcChar8 and char.
14661 The previous code passed unsigned char * to a functions like
14662 strlen and xstrcasecmp that expect char *, which does not
14663 conform to the C standard.
14664 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14665 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14666 char * when the C standard requires it.
14667
14668 * keyboard.c (read_char): Remove unused var.
14669
14670 * eval.c: Port to Windows vsnprintf (Bug#8435).
14671 Include <limits.h>.
14672 (SIZE_MAX): Define if the headers do not.
14673 (verror): Do not give up if vsnprintf returns a negative count.
14674 Instead, grow the buffer. This ports to Windows vsnprintf, which
14675 does not conform to C99. Problem reported by Eli Zaretskii.
14676 Also, simplify the allocation scheme, by avoiding the need for
14677 calling realloc, and removing the ALLOCATED variable.
14678
14679 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14680
14681 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14682 But keep the doprint source code for now, as we might revamp it
14683 and use it again (Bug#8435).
14684 * lisp.h (doprnt): Remove.
14685 * Makefile.in (base_obj): Remove doprnt.o.
14686 * deps.mk (doprnt.o): Remove.
14687
14688 error: Print 32- and 64-bit integers portably (Bug#8435).
14689 Without this change, on typical 64-bit hosts error ("...%d...", N)
14690 was used to print both 32- and 64-bit integers N, which relied on
14691 undefined behavior.
14692 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
14693 * lisp.h (error, verror): Mark as printf-like functions.
14694 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14695 Report overflow in size calculations when allocating printf buffer.
14696 Do not truncate output string at its first null byte.
14697 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14698 Truncate the output at a character boundary, since vsnprintf does not
14699 do that.
14700 * charset.c (check_iso_charset_parameter): Convert internal
14701 character to string before calling 'error', since %c now has the
14702 printf meaning.
14703 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14704 overflow when computing char to be passed to 'error'. Do not
14705 pass Lisp_Object to 'error'; pass the integer instead.
14706 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14707 formatted with plain %d.
14708
14709 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14710
14711 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14712
14713 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14714
14715 * xterm.c (x_catch_errors): Remove duplicate declaration.
14716
14717 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14718
14719 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14720
14721 2011-04-10 Jim Meyering <meyering@redhat.com>
14722
14723 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14724 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14725 return ssize_t not "int", and use size_t as the buffer length.
14726 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14727 * gnutls.h: Update declarations.
14728 * process.c (read_process_output): Use ssize_t, to match.
14729 (send_process): Likewise.
14730
14731 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14732
14733 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14734
14735 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14736
14737 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14738 Use unsigned char, to match FcChar8 type definition.
14739
14740 * xterm.c (handle_one_xevent):
14741 * xmenu.c (create_and_show_popup_menu):
14742 * xselect.c (x_decline_selection_request)
14743 (x_reply_selection_request): Avoid type-punned deref of X events.
14744
14745 2011-04-09 Eli Zaretskii <eliz@gnu.org>
14746
14747 Fix some uses of `int' instead of EMACS_INT.
14748 * search.c (string_match_1, fast_string_match)
14749 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14750 (scan_buffer, find_next_newline_no_quit)
14751 (find_before_next_newline, search_command, Freplace_match)
14752 (Fmatch_data): Make some `int' variables be EMACS_INT.
14753
14754 * xdisp.c (display_count_lines): 3rd argument and return value now
14755 EMACS_INT. All callers changed.
14756 (pint2hrstr): Last argument is now EMACS_INT.
14757
14758 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14759 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14760 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14761 (decode_coding_utf_16, decode_coding_emacs_mule)
14762 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14763 (decode_coding_ccl, decode_coding_charset)
14764 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14765 (decode_coding_iso_2022, decode_coding_emacs_mule)
14766 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14767 <char_offset, last_offset>: Declare EMACS_INT.
14768 (encode_coding_utf_8, encode_coding_utf_16)
14769 (encode_coding_emacs_mule, encode_invocation_designation)
14770 (encode_designation_at_bol, encode_coding_iso_2022)
14771 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14772 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14773 Declare EMACS_INT.
14774 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14775 (encode_invocation_designation): Last argument P_NCHARS is now
14776 EMACS_INT.
14777 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14778 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14779
14780 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14781 All users changed.
14782
14783 * ccl.c (Fccl_execute_on_string): Declare some variables
14784 EMACS_INT.
14785
14786 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
14787
14788 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14789
14790 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14791
14792 * process.c (Fformat_network_address): Doc fix.
14793
14794 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14795
14796 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
14797
14798 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
14799
14800 * keyboard.c (read_char): Call Lisp function help-form-show,
14801 instead of using internal_with_output_to_temp_buffer.
14802 (Qhelp_form_show): New var.
14803 (syms_of_keyboard): Use DEFSYM macro.
14804
14805 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14806
14807 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14808
14809 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
14810
14811 * process.c (Flist_processes): Remove to Lisp.
14812 (list_processes_1): Delete.
14813
14814 2011-04-06 Eli Zaretskii <eliz@gnu.org>
14815
14816 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14817
14818 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14819
14820 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
14821
14822 Fix more problems found by GCC 4.6.0's static checks.
14823
14824 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14825
14826 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14827
14828 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
14829
14830 * xdisp.c (vmessage): Mark as a printf-like function.
14831
14832 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14833
14834 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14835
14836 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14837 printf-like functions.
14838 (tiff_load): Add casts to remove these marks before passing them
14839 to system-supplied API.
14840
14841 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14842
14843 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14844 This avoids several warnings with gcc -Wstrict-overflow.
14845 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14846 directly, rather than having caller test rule sign. This avoids
14847 some unnecessary tests.
14848 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14849 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14850 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
14851
14852 * xfont.c (xfont_text_extents): Remove var that was set but not used.
14853 (xfont_open): Avoid unnecessary tests.
14854
14855 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14856
14857 * composite.h, composite.c (composition_gstring_put_cache):
14858 Use EMACS_INT, not int, for length.
14859
14860 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14861 breaking out part of COMPOSITION_DECODE_RULE.
14862 (COMPOSITION_DECODE_RULE): Use it.
14863 * composite.c (get_composition_id): Remove unused local vars,
14864 by using the new macro.
14865
14866 * textprop.c (set_text_properties_1): Change while to do-while,
14867 since the condition is always true at first.
14868
14869 * intervals.c (graft_intervals_into_buffer): Mark var as used.
14870 (interval_deletion_adjustment): Return unsigned value.
14871 All uses changed.
14872
14873 * process.c (list_processes_1, create_pty, read_process_output):
14874 (exec_sentinel): Remove vars that were set but not used.
14875 (create_pty): Remove unnecessary "volatile"s.
14876 (Fnetwork_interface_info): Avoid possibility of int overflow.
14877 (read_process_output): Do adaptive read buffering even if carryover.
14878 (read_process_output): Simplify nbytes computation if buffered.
14879
14880 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14881
14882 * syntax.c (scan_words): Remove var that was set but not used.
14883 (update_syntax_table): Use unsigned instead of int.
14884
14885 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
14886 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
14887 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
14888
14889 * print.c (print_error_message): Avoid int overflow.
14890
14891 * font.c (font_list_entities): Redo for clarity,
14892 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14893
14894 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
14895 (font_score): Avoid potential overflow in diff calculation.
14896
14897 * fns.c (substring_both): Remove var that is set but not used.
14898 (sxhash): Redo loop for clarity and to avoid wraparound warning.
14899
14900 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14901
14902 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14903 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14904 can always succeed if overflow has undefined behavior.
14905
14906 * search.c (boyer_moore, wordify): Remove vars set but not used.
14907 (wordify): Omit three unnecessary tests.
14908
14909 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14910 All callers changed. This avoids the need for an unused var.
14911
14912 * casefiddle.c (casify_region): Remove var that is set but not used.
14913
14914 * dired.c (file_name_completion): Remove var that is set but not used.
14915
14916 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14917
14918 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
14919 (Finsert_file_contents): Remove unnecessary code checking fd.
14920
14921 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14922 Check for integer overflow on size calculations.
14923
14924 * buffer.c (Fprevious_overlay_change): Remove var that is set
14925 but not used.
14926
14927 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14928 Remove vars that are set but not used.
14929 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
14930 (timer_check_2): Mark vars as initialized.
14931
14932 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14933
14934 * image.c (lookup_image): Remove var that is set but not used.
14935 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
14936
14937 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14938 that are set but not used.
14939
14940 * xfns.c (make_invisible_cursor): Don't return garbage
14941 if XCreateBitmapFromData fails (Bug#8410).
14942
14943 * xselect.c (x_get_local_selection, x_handle_property_notify):
14944 Remove vars that are set but not used.
14945
14946 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
14947 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
14948
14949 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14950 Remove var that is set but not used.
14951 (scroll_bar_windows_size): Now size_t, not int.
14952 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14953 Check for overflow.
14954
14955 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14956 (map_tty_color) [!defined MSDOS]: Likewise.
14957
14958 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14959
14960 * coding.c: Remove vars that are set but not used.
14961 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14962 All callers changed.
14963 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14964 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14965 (decode_coding_charset): Remove vars that are set but not used.
14966
14967 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14968 that is set but not used.
14969
14970 * print.c (print_object): Remove var that is set but not used.
14971
14972 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
14973 The gnulib version avoids calling malloc in the usual case,
14974 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14975 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14976 * filelock.c (current_lock_owner): Likewise.
14977 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14978 * sysdep.c: Include allocator.h, careadlinkat.h.
14979 (emacs_no_realloc_allocator): New static constant.
14980 (emacs_readlink): New function.
14981 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14982 ../lib/careadlinkat.h.
14983
14984 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14985
14986 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14987 first non-nil return value).
14988
14989 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14990
14991 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14992 if not defined (Bug#8403).
14993
14994 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
14995
14996 * xdisp.c (display_count_lines): Remove parameter `start',
14997 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14998 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14999 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15000 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15001 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15002 and thereabouts. All callers changed.
15003 (get_per_char_metric): Remove parameter `f', unused since
15004 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15005
15006 2011-04-02 Jim Meyering <meyering@redhat.com>
15007
15008 do not dereference NULL upon failed strdup
15009 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15010 (ns_get_family): Likewise.
15011
15012 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15013
15014 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15015
15016 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15017
15018 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15019 later (Bug#8403).
15020
15021 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15022
15023 Add lexical binding.
15024
15025 * window.c (Ftemp_output_buffer_show): New fun.
15026 (Fsave_window_excursion):
15027 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15028
15029 * lread.c (lisp_file_lexically_bound_p): New function.
15030 (Fload): Bind Qlexical_binding.
15031 (readevalloop): Remove `evalfun' arg.
15032 Bind Qinternal_interpreter_environment.
15033 (Feval_buffer): Bind Qlexical_binding.
15034 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15035 Mark as dynamic.
15036 (syms_of_lread): Declare `lexical-binding'.
15037
15038 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15039
15040 * keyboard.c (eval_dyn): New fun.
15041 (menu_item_eval_property): Use it.
15042
15043 * image.c (parse_image_spec): Use Ffunctionp.
15044
15045 * fns.c (concat, mapcar1): Accept byte-code-functions.
15046
15047 * eval.c (Fsetq): Handle lexical vars.
15048 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15049 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15050 (FletX, Flet): Obey lexical binding.
15051 (Fcommandp): Handle closures.
15052 (Feval): New `lexical' arg.
15053 (eval_sub): New function extracted from Feval. Use it almost
15054 everywhere where Feval was used. Look up vars in lexical env.
15055 Handle closures.
15056 (Ffunctionp): Move from subr.el.
15057 (Ffuncall): Handle closures.
15058 (apply_lambda): Remove `eval_flags'.
15059 (funcall_lambda): Handle closures and new byte-code-functions.
15060 (Fspecial_variable_p): New function.
15061 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15062 but without exporting it to Lisp.
15063
15064 * doc.c (Fdocumentation, store_function_docstring):
15065 * data.c (Finteractive_form): Handle closures.
15066
15067 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15068 interactive spec.
15069
15070 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15071 New byte-codes.
15072 (exec_byte_code): New function extracted from Fbyte_code to handle new
15073 calling convention for byte-code-functions. Add new byte-codes.
15074
15075 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15076
15077 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15078
15079 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15080
15081 * xdisp.c (redisplay_internal): Fix prototype.
15082
15083 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15084
15085 * xdisp.c (SCROLL_LIMIT): New macro.
15086 (try_scrolling): Use it when setting scroll_limit.
15087 Limit scrolling to 100 screen lines.
15088 (redisplay_window): Even when falling back on "recentering",
15089 position point in the window according to scroll-conservatively,
15090 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15091
15092 (try_scrolling): When point is above the window, allow searching
15093 as far as scroll_max, or one screenful, to compute vertical
15094 distance from PT to the scroll margin position. This prevents
15095 try_scrolling from unnecessarily failing when
15096 scroll-conservatively is set to a value slightly larger than the
15097 window height. Clean up the case of PT below the margin at bottom
15098 of window: scroll_max can no longer be INT_MAX. When aggressive
15099 scrolling is in use, don't let point enter the opposite scroll
15100 margin as result of the scroll.
15101 (syms_of_xdisp) <scroll-conservatively>: Document the
15102 threshold of 100 lines for never-recentering scrolling.
15103
15104 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15105
15106 * dispextern.h (move_it_by_lines):
15107 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15108 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15109 (message_log_check_duplicate): Remove parameters `prev_bol' and
15110 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15111 (redisplay_internal): Remove parameter `preserve_echo_area',
15112 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15113
15114 * indent.c (Fvertical_motion):
15115 * window.c (window_scroll_pixel_based, Frecenter):
15116 Don't pass `need_y_p' to `move_it_by_lines'.
15117
15118 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15119
15120 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15121 steal a few bits to be more compact.
15122 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15123 Remove unneeded casts.
15124
15125 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15126
15127 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15128
15129 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15130 binding" message (bug#7967).
15131
15132 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15133
15134 Fix more problems found by GCC 4.6.0's static checks.
15135
15136 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15137 Remove unused local var.
15138
15139 * editfns.c (Fmessage_box): Remove unused local var.
15140
15141 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15142 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15143 Omit unused local vars.
15144 * window.c (shrink_windows): Omit unused local var.
15145 * menu.c (digest_single_submenu): Omit unused local var.
15146 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15147 Omit unused local var.
15148
15149 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15150 Don't assume string length fits in int.
15151 (keyremap_step, read_key_sequence): Use size_t for sizes.
15152 (read_key_sequence): Don't check last_real_key_start redundantly.
15153
15154 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15155 instead of alloca (Bug#8344).
15156
15157 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15158 (Fbacktrace_frame): Don't assume nframes fits in int.
15159
15160 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15161
15162 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15163 concerns.
15164
15165 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15166
15167 * cm.c (calccost): Turn while-do into do-while, for clarity.
15168
15169 * keyboard.c (syms_of_keyboard): Use the same style as later
15170 in this function when indexing through an array. This also
15171 works around GCC bug 48267.
15172
15173 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15174
15175 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15176
15177 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15178 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15179
15180 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15181 This avoids undefined behavior on integer overflow, and is a bit
15182 more convenient anyway since it is compared to a size_t variable.
15183
15184 Variadic C functions now count arguments with size_t, not int.
15185 This avoids an unnecessary limitation on 64-bit machines, which
15186 caused (substring ...) to crash on large vectors (Bug#8344).
15187 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15188 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15189 All variadic functions and their callers changed accordingly.
15190 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15191 * data.c (arith_driver, float_arith_driver): Likewise.
15192 * editfns.c (general_insert_function): Likewise.
15193 * eval.c (struct backtrace.nargs, interactive_p)
15194 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15195 (funcall_lambda, mark_backtrace): Likewise.
15196 * fns.c (concat): Likewise.
15197 * frame.c (x_set_frame_parameters): Likewise.
15198 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15199 0 if not found, not -1. All callers changed.
15200
15201 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15202 (stack_copy_size): Now size_t, not int.
15203 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15204
15205 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15206
15207 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15208 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15209 All callers changed.
15210
15211 * lisp.h (multibyte_char_to_unibyte):
15212 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15213 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15214 * character.h (CHAR_TO_BYTE8):
15215 * cmds.c (internal_self_insert):
15216 * editfns.c (general_insert_function):
15217 * keymap.c (push_key_description):
15218 * search.c (Freplace_match):
15219 * xdisp.c (message_dolog, set_message_1): All callers changed.
15220
15221 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15222
15223 * keyboard.c (safe_run_hook_funcall): New function.
15224 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15225 don't set the hook to nil, but remove the offending function instead.
15226 (Qcommand_hook_internal): Remove, unused.
15227 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15228 Vcommand_hook_internal.
15229
15230 * eval.c (enum run_hooks_condition): Remove.
15231 (funcall_nil, funcall_not): New functions.
15232 (run_hook_with_args): Call each function through a `funcall' argument.
15233 Remove `cond' argument, now redundant.
15234 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15235 (Frun_hook_with_args_until_failure): Adjust accordingly.
15236 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15237
15238 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15239
15240 * dispextern.h (string_buffer_position): Remove declaration.
15241
15242 * print.c (strout): Remove parameter `multibyte', unused since
15243 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15244
15245 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15246 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15247 All callers changed.
15248
15249 * w32.c (_wsa_errlist): Use braces for struct initializers.
15250
15251 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15252 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15253 All callers changed.
15254 (string_buffer_position): Likewise. Also, make static (it's never
15255 used outside xdisp.c).
15256 (cursor_row_p): Remove parameter `w', unused since
15257 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15258 (decode_mode_spec): Remove parameter `precision', introduced during
15259 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15260 All callers changed.
15261
15262 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15263
15264 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15265
15266 2011-03-27 Anders Lindgren <andlind@gmail.com>
15267
15268 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15269 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15270 (ns_update_auto_hide_menu_bar): New functions.
15271 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15272 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15273 ns_constrain_all_frames.
15274 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15275 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15276
15277 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15278
15279 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15280
15281 2011-03-27 Glenn Morris <rgm@gnu.org>
15282
15283 * syssignal.h: Replace RETSIGTYPE with void.
15284 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15285 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15286 Replace SIGTYPE with void everywhere.
15287 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15288 * s/template.h (SIGTYPE): Remove commented out definition.
15289
15290 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15291
15292 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15293 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15294
15295 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15296
15297 * w32.c (read_unc_volume): Use parameter `henum', instead of
15298 global variable `wget_enum_handle'.
15299
15300 * keymap.c (describe_vector): Remove parameters `indices' and
15301 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15302 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15303
15304 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15305
15306 * keyboard.c (timer_check): Remove parameter `do_it_now',
15307 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15308 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15309 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15310
15311 * keyboard.c (read_char):
15312 * w32menu.c (w32_menu_display_help):
15313 * xmenu.c (show_help_event, menu_help_callback):
15314 Adjust calls to `show_help_echo'.
15315
15316 * gtkutil.c (xg_maybe_add_timer):
15317 * keyboard.c (readable_events):
15318 * process.c (wait_reading_process_output):
15319 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15320
15321 * insdel.c (adjust_markers_gap_motion):
15322 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15323 (gap_left, gap_right): Don't call it.
15324
15325 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15326
15327 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15328 incurred during fontification.
15329
15330 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15331
15332 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15333 (DEFVAR_PER_BUFFER): Don't pass it.
15334
15335 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15336 (scrolling_window): Don't pass it.
15337
15338 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15339
15340 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15341
15342 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15343 and `suffix'.
15344 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15345 of variables specific to SELinux and computation of `encoded_absname'.
15346
15347 * image.c (XPutPixel): Remove unused variable `height'.
15348
15349 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15350
15351 * unexw32.c (get_section_info): Remove unused variable `section'.
15352
15353 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15354 (system_process_attributes): Remove unused variable `sess'.
15355 (sys_read): Remove unused variable `err'.
15356
15357 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15358 (w32_wnd_proc): Remove unused variable `isdead'.
15359 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15360 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15361 (x_create_tip_frame): Remove unused variable `tem'.
15362
15363 * w32inevt.c (w32_console_read_socket):
15364 Remove unused variable `no_events'.
15365
15366 * w32term.c (x_draw_composite_glyph_string_foreground):
15367 Remove unused variable `width'.
15368
15369 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15370
15371 * w32term.c (x_set_glyph_string_clipping):
15372 Don't pass uninitialized region to CombineRgn.
15373
15374 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15375
15376 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15377 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15378 (Fx_close_connection): Remove unused variable `i'.
15379
15380 * w32font.c (w32font_draw): Return number of glyphs.
15381 (w32font_open_internal): Remove unused variable `i'.
15382 (w32font_driver): Add missing initializer.
15383
15384 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15385 (fill_in_menu): Remove unused variable `items_added'.
15386
15387 * w32term.c (last_mouse_press_frame): Remove static global variable.
15388 (w32_clip_to_row): Remove unused variable `f'.
15389 (x_delete_terminal): Remove unused variable `i'.
15390
15391 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15392 (NOTHING): Remove unused static global variable.
15393 (uniscribe_check_otf): Remove unused variable `table'.
15394 (uniscribe_font_driver): Add missing initializers.
15395
15396 2011-03-23 Julien Danjou <julien@danjou.info>
15397
15398 * term.c (Fsuspend_tty, Fresume_tty):
15399 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15400 * window.c (temp_output_buffer_show):
15401 * insdel.c (signal_before_change):
15402 * frame.c (Fhandle_switch_frame):
15403 * fileio.c (Fdo_auto_save):
15404 * emacs.c (Fkill_emacs):
15405 * editfns.c (save_excursion_restore):
15406 * cmds.c (internal_self_insert):
15407 * callint.c (Fcall_interactively):
15408 * buffer.c (Fkill_all_local_variables):
15409 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15410 Use Frun_hooks.
15411 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15412 unconditionally since it does the check itself.
15413
15414 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15415
15416 Fix more problems found by GCC 4.5.2's static checks.
15417
15418 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15419 the first time through the loop, since we know p0 < p1 then.
15420 This also avoids a gcc -Wstrict-overflow warning.
15421
15422 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15423 leading to a memory leak, possible in functions like
15424 load_charset_map_from_file that can allocate an unbounded number
15425 of objects (Bug#8318).
15426
15427 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15428 that could (at least in theory) be that large.
15429
15430 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15431 This is less likely to overflow, and avoids undefined behavior if
15432 overflow does occur. All callers changed. Use strtoul to scan
15433 for the unsigned long integer.
15434 (pint2hrstr): Simplify and tune code slightly.
15435 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
15436
15437 * scroll.c (do_scrolling): Work around GCC bug 48228.
15438 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15439
15440 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15441 This also avoids a warning with gcc -Wstrict-overflow.
15442 (validate_x_resource_name): Simplify count usage.
15443 This also avoids a warning with gcc -Wstrict-overflow.
15444
15445 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15446 fail (Bug#8306).
15447
15448 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
15449
15450 * process.c (Fmake_network_process): Use socklen_t, not int,
15451 where POSIX says socklen_t is required in portable programs.
15452 This fixes a porting bug on hosts like 64-bit HP-UX, where
15453 socklen_t is wider than int (Bug#8277).
15454 (Fmake_network_process, server_accept_connection):
15455 (wait_reading_process_output, read_process_output):
15456 Likewise.
15457
15458 * process.c: Rename or move locals to avoid shadowing.
15459 (list_processes_1, Fmake_network_process):
15460 (read_process_output_error_handler, exec_sentinel_error_handler):
15461 Rename or move locals.
15462 (Fmake_network_process): Define label "retry_connect" only if needed.
15463 (Fnetwork_interface_info): Fix pointer signedness.
15464 (process_send_signal): Add cast to avoid pointer signedness problem.
15465 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
15466 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
15467
15468 Make tparam.h and terminfo.c consistent.
15469 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15470 Include tparam.h instead, since it declares them.
15471 * cm.h (PC): Remove extern decl; tparam.h now does this.
15472 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15473 * terminfo.c: Include tparam.h, to check interfaces.
15474 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15475 (tparam): Adjust signature to match interface in tparam.h;
15476 this removes some undefined behavior. Check that outstring and len
15477 are zero, which they always are with Emacs.
15478 * tparam.h (PC, BC, UP): New extern decls.
15479
15480 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
15481 (xftfont_open): Rename locals to avoid shadowing.
15482
15483 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
15484 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15485 (OTF_TAG_SYM): Omit macro if not needed.
15486 (ftfont_list): Remove unused local.
15487 (get_adstyle_property, ftfont_pattern_entity):
15488 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15489 Rename locals to avoid shadowing.
15490
15491 * xfont.c (xfont_list_family): Mark var as initialized.
15492
15493 * xml.c (make_dom): Now static.
15494
15495 * composite.c (composition_compute_stop_pos): Rename local to
15496 avoid shadowing.
15497 (composition_reseat_it): Remove unused locals.
15498 (find_automatic_composition, composition_adjust_point): Likewise.
15499 (composition_update_it): Mark var as initialized.
15500 (find_automatic_composition): Mark vars as initialized,
15501 with a FIXME (Bug#8290).
15502
15503 character.h: Rename locals to avoid shadowing.
15504 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15505 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15506 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15507 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15508 to avoid shadowing.
15509
15510 * textprop.c (property_change_between_p): Remove; unused.
15511
15512 * intervals.c (interval_start_pos): Now static.
15513
15514 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15515
15516 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15517 Rename locals to avoid shadowing.
15518
15519 * sound.c (wav_play, au_play, Fplay_sound_internal):
15520 Fix pointer signedness.
15521 (alsa_choose_format): Remove unused local var.
15522 (wav_play): Initialize a variable to 0, to prevent undefined
15523 behavior (Bug#8278).
15524
15525 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15526
15527 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15528
15529 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15530 clobbering (Bug#8298).
15531 * sysdep.c (sys_subshell): Likewise.
15532 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
15533
15534 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15535 This should get cleaned up, so that child_setup has the
15536 same signature on all platforms.
15537
15538 * callproc.c (call_process_cleanup): Now static.
15539 (relocate_fd): Rename locals to avoid shadowing.
15540
15541 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
15542
15543 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15544 not to be necessary, and produces flickering.
15545
15546 2011-03-20 Glenn Morris <rgm@gnu.org>
15547
15548 * config.in: Remove file.
15549
15550 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
15551
15552 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15553 are now in src/globals.h.
15554 (syms_of_minibuf): Remove spurious & from previous change.
15555
15556 2011-03-20 Leo Liu <sdl.web@gmail.com>
15557
15558 * minibuf.c (completing-read-function): New variable.
15559 (completing-read-default): Rename from completing-read.
15560 (completing-read): Call completing-read-function.
15561
15562 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15563
15564 * xfaces.c (Fx_load_color_file):
15565 Read color file from absolute filename (bug#8250).
15566
15567 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15568
15569 * makefile.w32-in: Update dependencies.
15570
15571 2011-03-17 Eli Zaretskii <eliz@gnu.org>
15572
15573 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15574
15575 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15576
15577 Fix more problems found by GCC 4.5.2's static checks.
15578
15579 * process.c (make_serial_process_unwind, send_process_trap):
15580 (sigchld_handler): Now static.
15581
15582 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15583 That way, the code declares only the vars that it needs.
15584 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15585 * s/cygwin.h (PTY_ITERATION): Likewise.
15586 * s/darwin.h (PTY_ITERATION): Likewise.
15587 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15588
15589 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15590 * process.c (allocate_pty): Don't declare stb unless it's needed.
15591
15592 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
15593 (CONSTANTLIM): Remove; unused.
15594 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15595 Define only if needed.
15596
15597 * unexelf.c (unexec): Name an expression,
15598 to avoid gcc -Wbad-function-cast warning.
15599 Use a different way to cause a compilation error if anyone uses
15600 n rather than nn, a way that does not involve shadowing.
15601 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
15602
15603 * deps.mk (unexalpha.o): Remove; unused.
15604
15605 New file unexec.h, the (simple) interface for unexec (Bug#8267).
15606 * unexec.h: New file.
15607 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15608 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15609 Depend on unexec.h.
15610 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15611 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15612 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
15613 Change as necessary to match prototype in unexec.h.
15614
15615 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15616 shadowing.
15617 (back_comment, skip_chars): Mark vars as initialized.
15618
15619 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15620 Rename locals to avoid shadowing.
15621
15622 * lread.c (read1): Rewrite so as not to use empty "else".
15623 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
15624
15625 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15626
15627 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15628 warning when compiling print.c.
15629
15630 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15631 instead of using an uninitialized var.
15632 (font_sort_entities): Mark var as initialized.
15633
15634 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15635
15636 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15637 pointers to constants.
15638 (font_parse_fcname): Remove unused vars.
15639 (font_delete_unmatched): Now static.
15640 (font_get_spec): Remove; unused.
15641 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15642 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15643 Rename or move locals to avoid shadowing.
15644
15645 * fns.c (require_nesting_list, require_unwind): Now static.
15646 (Ffillarray): Rename locals to avoid shadowing.
15647
15648 * floatfns.c (domain_error2): Define only if needed.
15649 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
15650
15651 * alloc.c (mark_backtrace): Move decl from here ...
15652 * lisp.h: ... to here, so that it can be checked.
15653
15654 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
15655 (Fdefvar): Rewrite so as not to use empty "else".
15656 (lisp_indirect_variable): Name an expression,
15657 to avoid gcc -Wbad-function-cast warning.
15658 (Fdefvar): Rename locals to avoid shadowing.
15659
15660 * callint.c (quotify_arg, quotify_args): Now static.
15661 (Fcall_interactively): Rename locals to avoid shadowing.
15662 Use const pointer when appropriate.
15663
15664 * lisp.h (get_system_name, get_operating_system_release):
15665 Move decls here, to check interfaces.
15666 * process.c (get_operating_system_release): Move decl to lisp.h.
15667 * xrdb.c (get_system_name): Likewise.
15668 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15669 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15670 some of which prompt warnings from gcc -Wbad-function-cast.
15671 (Fformat_time_string, Fencode_time, Finsert_char):
15672 (Ftranslate_region_internal, Fformat):
15673 Rename or remove local vars to avoid shadowing.
15674 (Ftranslate_region_internal): Mark var as initialized.
15675
15676 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15677 avoid shadowing.
15678
15679 * lisp.h (eassert): Check that the argument compiles, even if
15680 ENABLE_CHECKING is not defined.
15681
15682 * data.c (Findirect_variable): Name an expression, to avoid
15683 gcc -Wbad-function-cast warning.
15684 (default_value, arithcompare, arith_driver, arith_error): Now static.
15685 (store_symval_forwarding): Rename local to avoid shadowing.
15686 (Fmake_variable_buffer_local, Fmake_local_variable):
15687 Mark variables as initialized.
15688 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
15689
15690 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
15691 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15692 Rename locals to avoid shadowing.
15693 (mark_stack): Move local variables into the #ifdef region where
15694 they're used.
15695 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15696 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15697 needed otherwise.
15698 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15699 (GC_STRING_CHARS): Remove; not used.
15700 (Fmemory_limit): Cast sbrk's returned value to char *.
15701
15702 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15703 avoids undefined behavior in theory.
15704
15705 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15706
15707 Use functions, not macros, for up- and down-casing (Bug#8254).
15708 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15709 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15710 to use the following functions instead of these macros.
15711 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15712 EMACS_INT, since callers assume the returned value fits in int.
15713 (upcase1): Likewise, for UPCASE_TABLE.
15714 (uppercasep, lowercasep, upcase): New static inline functions.
15715 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
15716 the race-condition problem in the old DOWNCASE.
15717
15718 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15719 Rename locals to avoid shadowing.
15720 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
15721 (regex_compile, re_search_2, re_match_2_internal):
15722 Remove unused local vars.
15723 (FREE_VAR): Rewrite so as not to use empty "else",
15724 which gcc can warn about.
15725 (regex_compile, re_match_2_internal): Mark locals as initialized.
15726 (RETALLOC_IF): Define only if needed.
15727 (WORDCHAR_P): Likewise. This one is never needed, but is used
15728 only in a comment talking about a compiler bug, so put inside
15729 the #if 0 of that comment.
15730 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15731 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15732 Remove; unused.
15733
15734 * search.c (boyer_moore): Rename locals to avoid shadowing.
15735 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15736 (PREV_CHAR_BOUNDARY): Likewise.
15737
15738 * search.c (simple_search): Remove unused var.
15739
15740 * dired.c (compile_pattern): Move decl from here ...
15741 * lisp.h: ... to here, so that it can be checked.
15742 (struct re_registers): New forward decl.
15743
15744 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15745
15746 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15747 All uses changed.
15748 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15749 Rename locals to avoid shadowing.
15750 (Fvertical_motion): Mark locals as initialized.
15751
15752 * casefiddle.c (casify_object, casify_region): Now static.
15753 (casify_region): Mark local as initialized.
15754
15755 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15756
15757 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15758 New macros, so that the caller can use some names other than
15759 gcpro1, gcpro2, etc.
15760 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15761 of the new macros.
15762 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15763 argument, for consistency with GCPRO2_VAR, etc: it is now the
15764 prefix of the variable, not the variable itself. All uses
15765 changed.
15766 * dired.c (directory_files_internal, file_name_completion):
15767 Rename locals to avoid shadowing.
15768
15769 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15770 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15771 dired.c's scmp function, had undefined behavior.
15772 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15773 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15774 * buffer.h: ... to here, because these macros use current_buffer,
15775 and the new implementation with inline functions needs to have
15776 current_buffer in scope now, rather than later when the macros
15777 are used.
15778 (downcase, upcase1): New static inline functions.
15779 (DOWNCASE, UPCASE1): Reimplement using these functions.
15780 This avoids undefined behavior in expressions like
15781 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15782 from race conditions in accessing the global variables
15783 case_temp1 and case_temp2.
15784 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15785 * lisp.h (case_temp1, case_temp2): Remove their decls.
15786 * character.h (ASCII_CHAR_P): Move from here ...
15787 * lisp.h: ... to here, so that the inline functions mentioned
15788 above can use them.
15789
15790 * dired.c (directory_files_internal_unwind): Now static.
15791
15792 * fileio.c (file_name_as_directory, directory_file_name):
15793 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15794 Now static.
15795 (file_name_as_directory): Use const pointers when appropriate.
15796 (Fexpand_file_name): Likewise. In particular, newdir might
15797 point at constant storage, so make it a const pointer.
15798 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
15799 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15800 signedness issues.
15801 (Fset_file_times, Finsert_file_contents, auto_save_error):
15802 Rename locals to avoid shadowing.
15803
15804 * minibuf.c (choose_minibuf_frame_1): Now static.
15805 (Ftry_completion, Fall_completions): Rename or remove locals
15806 to avoid shadowing.
15807
15808 * marker.c (bytepos_to_charpos): Remove; unused.
15809
15810 * lisp.h (verify_bytepos, count_markers): New decls,
15811 so that gcc does not warn that these functions aren't declared.
15812
15813 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15814 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
15815 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
15816 (copy_text): Remove unused local var.
15817
15818 * filelock.c (within_one_second): Now static.
15819 (lock_file_1): Rename local to avoid shadowing.
15820
15821 * buffer.c (fix_overlays_before): Mark locals as initialized.
15822 (fix_start_end_in_overlays): Likewise. This function should be
15823 simplified by using pointers-to-pointers, but that's a different
15824 matter.
15825 (switch_to_buffer_1): Now static.
15826 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15827 (report_overlay_modification): Rename locals to avoid shadowing.
15828
15829 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
15830 Fix pointer signedness issue.
15831 (sys_subshell): Mark local as volatile if checking for lint,
15832 to suppress a gcc -Wclobbered warning that does not seem to be right.
15833 (MAXPATHLEN): Define only if needed.
15834
15835 * process.c (serial_open, serial_configure): Move decls from here ...
15836 * systty.h: ... to here, so that they can be checked.
15837
15838 * fns.c (get_random, seed_random): Move extern decls from here ...
15839 * lisp.h: ... to here, so that they can be checked.
15840
15841 * sysdep.c (reset_io): Now static.
15842 (wait_for_termination_signal): Remove; unused.
15843
15844 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15845 (copy_keymap_item, append_key, push_text_char_description):
15846 Now static.
15847 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
15848 (DENSE_TABLE_SIZE): Remove; unused.
15849 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15850 (describe_map_tree):
15851 Rename locals to avoid shadowing.
15852
15853 * keyboard.c: Declare functions static if they are not used elsewhere.
15854 (echo_char, echo_dash, cmd_error, top_level_2):
15855 (poll_for_input, handle_async_input): Now static.
15856 (read_char, kbd_buffer_get_event, make_lispy_position):
15857 (make_lispy_event, make_lispy_movement, apply_modifiers):
15858 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15859 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15860 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
15861 (read_key_sequence, read_char): Mark locals as initialized.
15862 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
15863
15864 * keyboard.h (make_ctrl_char): New decl.
15865 (mark_kboards): Move decl here ...
15866 * alloc.c (mark_kboards): ... from here.
15867
15868 * lisp.h (force_auto_save_soon): New decl.
15869
15870 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
15871 (DEFINE_DUMMY_FUNCTION): New macro.
15872 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15873 Use it.
15874 (main): Add casts to avoid warnings
15875 if GCC considers string literals to be constants.
15876
15877 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15878
15879 * dbusbind.c: Pointer signedness fixes.
15880 (xd_signature, xd_append_arg, xd_initialize):
15881 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15882 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15883 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15884 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15885
15886 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15887 if GCC considers string literals to be constants.
15888 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
15889
15890 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15891
15892 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15893 (print_preprocess, print_object): New macro to fix last change.
15894
15895 * print.c (print_preprocess): Don't forget font objects.
15896
15897 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
15898
15899 * emacs.c (USAGE3): Doc fixes.
15900
15901 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15902
15903 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15904 structure.
15905
15906 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
15907
15908 * lisp.h (VWindow_system, Qfile_name_history):
15909 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15910 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15911 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15912
15913 * w32select.c: Don't #include "keyboard.h".
15914 (run_protected): Add extern declaration for waiting_for_input.
15915
15916 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15917 * w32console.c (detect_input_pending, read_input_pending)
15918 (encode_terminal_code):
15919 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15920 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15921 (w32_system_caret_y, Qfile_name_history):
15922 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15923 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15924 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15925 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15926 * w32proc.c (Qlocal, report_file_error):
15927 * w32term.c (Vwindow_system, updating_frame):
15928 * w32uniscribe.c (initialized, uniscribe_font_driver):
15929 Remove unneeded extern declarations.
15930
15931 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
15932
15933 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
15934
15935 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
15936
15937 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15938 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15939 These macros can no longer be used for assignment.
15940
15941 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15942 Assign struct members directly, instead of using BUF_BEGV etc.
15943 (record_buffer_markers, fetch_buffer_markers): New functions for
15944 recording and fetching special buffer markers.
15945 (set_buffer_internal_1, set_buffer_temp): Use them.
15946
15947 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15948
15949 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15950
15951 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15952 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15953
15954 * xdisp.c (hscroll_window_tree):
15955 (reconsider_clip_changes): Use PT instead of BUF_PT.
15956
15957 2011-03-13 Eli Zaretskii <eliz@gnu.org>
15958
15959 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15960 $(EMACS_ROOT)/lib/intprops.h.
15961
15962 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15963
15964 Fix more problems found by GCC 4.5.2's static checks.
15965
15966 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15967 to unsigned char * to avoid compiler diagnostic.
15968 (xg_free_frame_widgets): Make it clear that a local variable is
15969 needed only if USE_GTK_TOOLTIP.
15970 (gdk_window_get_screen): Make it clear that this macro is needed
15971 only if USE_GTK_TOOLTIP.
15972 (int_gtk_range_get_value): New function, which avoids a diagnostic
15973 from gcc -Wbad-function-cast.
15974 (xg_set_toolkit_scroll_bar_thumb): Use it.
15975 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15976 diagnostic from gcc -Wbad-function-cast.
15977 (get_utf8_string, xg_get_file_with_chooser):
15978 Rename locals to avoid shadowing.
15979 (create_dialog): Move locals to avoid shadowing.
15980
15981 * xgselect.c (xg_select): Remove unused var.
15982
15983 * image.c (four_corners_best): Mark locals as initialized.
15984 (gif_load): Initialize transparent_p to zero (Bug#8238).
15985 Mark another local as initialized.
15986 (my_png_error, my_error_exit): Mark with NO_RETURN.
15987
15988 * image.c (clear_image_cache): Now static.
15989 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
15990 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
15991 (x_edge_detection): Remove unnecessary cast that
15992 gcc -Wbad-function-cast diagnoses.
15993 (gif_load): Fix pointer signedness.
15994 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15995 (jpeg_load, gif_load): Rename locals to avoid shadowing.
15996
15997 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
15998
15999 Improve quality of tests for time stamp overflow.
16000 For example, without this patch (encode-time 0 0 0 1 1
16001 1152921504606846976) returns the obviously-bogus value (-948597
16002 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16003 reports time overflow. See
16004 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16005 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16006 * editfns.c: Include limits.h and intprops.h.
16007 (TIME_T_MIN, TIME_T_MAX): New macros.
16008 (time_overflow): Move earlier, to before first use.
16009 (hi_time, lo_time): New functions, for an accurate test for
16010 out-of-range times.
16011 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16012 (Fget_internal_run_time): Don't assume time_t fits in int.
16013 (make_time): Use list2 instead of Fcons twice.
16014 (Fdecode_time): More accurate test for out-of-range times.
16015 (check_tm_member): New function.
16016 (Fencode_time): Use it, to test for out-of-range times.
16017 (lisp_time_argument): Don't rely on undefined left-shift and
16018 right-shift behavior when checking for time stamp overflow.
16019
16020 * editfns.c (time_overflow): New function, refactoring common code.
16021 (Fformat_time_string, Fdecode_time, Fencode_time):
16022 (Fcurrent_time_string): Use it.
16023
16024 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16025 * dired.c (make_time): Move to ...
16026 * editfns.c (make_time): ... here.
16027 * systime.h: Note the move.
16028
16029 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16030
16031 * fringe.c (update_window_fringes): Remove unused variables.
16032
16033 * unexmacosx.c (copy_data_segment): Also copy __got section.
16034 (Bug#8223)
16035
16036 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16037
16038 * termcap.c [MSDOS]: Include "msdos.h".
16039 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16040 Constify `char *' arguments and their references according to
16041 prototypes in tparam.h.
16042
16043 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16044
16045 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16046 Adapt all references accordingly.
16047
16048 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16049
16050 2011-03-11 Tom Tromey <tromey@redhat.com>
16051
16052 * buffer.c (syms_of_buffer): Remove obsolete comment.
16053
16054 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16055
16056 * termhooks.h (encode_terminal_code): Declare prototype.
16057
16058 * msdos.c (encode_terminal_code): Don't declare prototype.
16059
16060 * term.c (encode_terminal_code): Now external again, used by
16061 w32console.c and msdos.c.
16062
16063 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16064 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
16065
16066 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16067
16068 Fix some minor problems found by GCC 4.5.2's static checks.
16069
16070 * fringe.c (update_window_fringes): Mark locals as initialized
16071 (Bug#8227).
16072 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16073
16074 * alloc.c (mark_fringe_data): Move decl from here ...
16075 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16076 to check its interface.
16077 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16078
16079 * fontset.c (free_realized_fontset): Now static.
16080 (Fset_fontset_font): Rename local to avoid shadowing.
16081 (fontset_font): Mark local as initialized.
16082 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16083
16084 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16085
16086 * xselect.c (x_disown_buffer_selections): Remove; not used.
16087 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16088 (x_own_selection, Fx_disown_selection_internal): Rename locals
16089 to avoid shadowing.
16090 (x_handle_dnd_message): Remove local to avoid shadowing.
16091
16092 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16093 so that the caller can use some name other than gcpro1.
16094 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16095 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16096 (Fx_backspace_delete_keys_p):
16097 Use them to avoid shadowing, and rename vars to avoid shadowing.
16098 (x_decode_color, x_set_name, x_window): Now static.
16099 (Fx_create_frame): Add braces to silence GCC warning.
16100 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16101 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16102 Remove unused locals.
16103 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16104 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16105 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16106 macros.
16107
16108 * xterm.h (x_mouse_leave): New decl.
16109
16110 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16111 Remove unused functions.
16112 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16113 (x_calc_absolute_position): Now static.
16114 (XTread_socket): Don't define label "out" unless it's used.
16115 Don't declare local "event" unless it's used.
16116 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16117 unless they are used.
16118 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16119 (x_fatal_error_signal): Remove; not used.
16120 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16121 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16122 (x_error_catcher, x_connection_closed, x_error_handler):
16123 (x_error_quitter, xembed_send_message, x_iconify_frame):
16124 (my_log_handler): Rename locals to avoid shadowing.
16125 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16126 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16127
16128 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16129 Rename or move locals to avoid shadowing.
16130 (tty_defined_color, merge_face_heights): Now static.
16131 (free_realized_faces_for_fontset): Remove; not used.
16132 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16133 does not deduce is never used uninitialized.
16134 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16135 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16136
16137 * terminal.c (store_terminal_param): Now static.
16138
16139 * xmenu.c (menu_highlight_callback): Now static.
16140 (set_frame_menubar): Remove unused local.
16141 (xmenu_show): Rename parameter to avoid shadowing.
16142 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16143 since they might point to immutable storage.
16144 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16145 since it's unused otherwise.
16146
16147 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16148 Add a FIXME, since the code still doesn't look right. (Bug#8215)
16149 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16150 avoids a gcc -Wuninitialized diagnostic.
16151 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16152 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16153 does not deduce are never used uninitialized.
16154
16155 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16156
16157 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16158 * window.c (window_loop, size_window):
16159 (run_window_configuration_change_hook, enlarge_window): Likewise.
16160
16161 * window.c (display_buffer): Now static.
16162 (size_window): Mark variables that gcc -Wuninitialized
16163 does not deduce are never used uninitialized.
16164 * window.h (check_all_windows): New decl, to forestall
16165 gcc -Wmissing-prototypes diagnostic.
16166 * dispextern.h (bidi_dump_cached_states): Likewise.
16167
16168 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16169 shadowing.
16170 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16171 Include <limits.h>.
16172 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16173 and to avoid gcc -Wuninitialized warning.
16174 (load_charset_map): Mark variables that gcc -Wuninitialized
16175 does not deduce are never used uninitialized.
16176 (load_charset): Abort instead of using uninitialized var (Bug#8229).
16177
16178 * coding.c (coding_set_source, coding_set_destination):
16179 Use "else { /* comment */ }" rather than "else /* comment */;"
16180 for clarity, and to avoid gcc -Wempty-body warning.
16181 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16182 a block, when the outer 'i' will do.
16183 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16184 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16185 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16186 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16187 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16188 Rename locals to avoid shadowing.
16189 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16190 * coding.c (emacs_mule_char, encode_invocation_designation):
16191 Now static, since they're not used elsewhere.
16192 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16193 (decode_coding_object, encode_coding_object, detect_coding_system):
16194 (decode_coding_emacs_mule): Mark variables that gcc
16195 -Wuninitialized does not deduce are never used uninitialized.
16196 (detect_coding_iso_2022): Initialize a local variable that might
16197 be used uninitialized. Leave a FIXME because it's not clear that
16198 this initialization is needed. (Bug#8211)
16199 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16200 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16201 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16202 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16203 Remove unused macros.
16204
16205 * category.c (hash_get_category_set): Remove unused local var.
16206 (copy_category_table): Now static, since it's not used elsewhere.
16207 * character.c (string_count_byte8): Likewise.
16208
16209 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16210 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16211
16212 * chartab.c (copy_sub_char_table): Now static, since it's not used
16213 elsewhere.
16214 (sub_char_table_ref_and_range, char_table_ref_and_range):
16215 Rename locals to avoid shadowing.
16216 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16217
16218 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16219 (BIDI_BOB): Remove unused macro.
16220
16221 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16222 deduce are never used uninitialized.
16223 * term.c (encode_terminal_code): Likewise.
16224
16225 * term.c (encode_terminal_code): Now static. Remove unused local.
16226
16227 * tparam.h: New file.
16228 * term.c, tparam.h: Include it.
16229 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16230 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16231 Move these decls to tparam.h, and make them agree with what
16232 is actually in tparam.c. The previous trick of using incompatible
16233 decls in different modules does not conform to the C standard.
16234 All callers of tparam changed to use tparam's actual API.
16235 * tparam.c (tparam1, tparam, tgoto):
16236 Use const pointers where appropriate.
16237
16238 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16239 * cm.h (struct cm): Likewise.
16240 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16241 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16242 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16243 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16244 (turn_on_face, init_tty): Likewise.
16245 * termchar.h (struct tty_display_info): Likewise.
16246
16247 * term.c (term_mouse_position): Rename local to avoid shadowing.
16248
16249 * alloc.c (mark_ttys): Move decl from here ...
16250 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16251
16252 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16253
16254 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16255
16256 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16257
16258 * search.c (compile_pattern_1): Remove argument regp, unused since
16259 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16260 (compile_pattern): Don't pass it.
16261
16262 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16263
16264 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16265 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16266 for ! HAVE_GTK3.
16267 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16268
16269 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16270
16271 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16272 gdk_window_get_screen, gdk_window_get_geometry,
16273 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16274 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16275 (xg_get_pixbuf_from_pixmap): New function.
16276 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16277 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16278 Call xg_get_pixbuf_from_pixmap instead of
16279 gdk_pixbuf_get_from_drawable.
16280 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16281 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16282 (xg_check_special_colors): Use GtkStyleContext and its functions
16283 for HAVE_GTK3.
16284 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16285 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16286 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16287 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16288 Call gtk_widget_get_preferred_size.
16289 (xg_frame_resized): gdk_window_get_geometry only takes 5
16290 parameters.
16291 (xg_win_to_widget, xg_event_is_for_menubar):
16292 Call gdk_x11_window_lookup_for_display.
16293 (xg_set_widget_bg): New function.
16294 (delete_cb): New function.
16295 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16296 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16297 (xg_set_background_color): Call xg_set_widget_bg.
16298 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16299 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16300 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16301 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16302 if ! HAVE_GTK3.
16303 (update_frame_tool_bar): Call gtk_widget_hide.
16304 (xg_initialize): Use GDK_KEY_g.
16305
16306 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16307 if ! HAVE_GTK3
16308 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16309
16310 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16311 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16312 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16313
16314 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16315
16316 * w32xfns.c (select_palette): Check success of RealizePalette against
16317 GDI_ERROR, not zero.
16318
16319 See ChangeLog.11 for earlier changes.
16320
16321 ;; Local Variables:
16322 ;; coding: utf-8
16323 ;; End:
16324
16325 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16326
16327 This file is part of GNU Emacs.
16328
16329 GNU Emacs is free software: you can redistribute it and/or modify
16330 it under the terms of the GNU General Public License as published by
16331 the Free Software Foundation, either version 3 of the License, or
16332 (at your option) any later version.
16333
16334 GNU Emacs is distributed in the hope that it will be useful,
16335 but WITHOUT ANY WARRANTY; without even the implied warranty of
16336 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16337 GNU General Public License for more details.
16338
16339 You should have received a copy of the GNU General Public License
16340 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.