]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix last change in bidi_mirror_char.
[gnu-emacs] / src / ChangeLog
1 2012-05-27 Eli Zaretskii <eliz@gnu.org>
2
3 * bidi.c (bidi_mirror_char): Fix last change.
4
5 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6
7 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8 when referring to sectname field in printf format.
9
10 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11
12 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13 Only r_alloc_inhibit_buffer_relocation needed to be added;
14 the others were already declared.
15
16 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
17 before checking whether it's out of range. Put the check inside
18 eassert. See
19 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
20
21 2012-05-27 Ken Brown <kbrown@cornell.edu>
22
23 * callproc.c (Fcall_process): Restore a line that was accidentally
24 commented out in the 2011-02-13 change (bug#11547).
25
26 2012-05-27 Eli Zaretskii <eliz@gnu.org>
27
28 * lisp.h [REL_ALLOC]: Add prototypes for external functions
29 defined on ralloc.c.
30
31 * buffer.c [REL_ALLOC]: Remove prototypes of
32 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
33 they are now on lisp.h.
34
35 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
36
37 * search.c (search_buffer): Use it to inhibit relocation of buffer
38 text while re_search_2 is doing its job, because re_search_2 is
39 passed C pointers to buffer text. (Bug#11519)
40
41 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
42 Update value to 24.
43
44 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
45 state after an additional call to move_it_in_display_line_to, keep
46 the values of it->max_ascent and it->max_descent found for the
47 entire line.
48 (pos_visible_p): Revert the comparison against bottom_y to what it
49 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
50 (Bug#11464)
51
52 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
53
54 Fix coding-related core dumps with gcc -ftrapv.
55 The code was computing A - B, where A and B are pointers, and B is
56 random garbage. This can lead to core dumps on platforms that
57 have special pointer registers, and it also leads to core dumps on
58 x86-64 when compiled with gcc -ftrapv. The fix is to compute
59 A - B only when B is initialized properly.
60 * coding.c (coding_set_source, coding_set_destination): Return void.
61 (coding_change_source, coding_change_destinations): New functions,
62 with the old behaviors of coding_set_source and coding_set_destination.
63 All callers that need an offset changed to use these new functions.
64
65 2012-05-26 Glenn Morris <rgm@gnu.org>
66
67 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
68
69 2012-05-26 Eli Zaretskii <eliz@gnu.org>
70
71 Extend mouse support on W32 text-mode console.
72 * xdisp.c (draw_row_with_mouse_face): Call
73 tty_draw_row_with_mouse_face for WINDOWSNT as well.
74
75 * w32console.c: Include window.h.
76 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face): New
77 functions.
78 (initialize_w32_display): Initialize mouse-highlight data.
79
80 * w32inevt.c: Include termchar.h and window.h.
81 (do_mouse_event): Support mouse-autoselect-window. When the mouse
82 moves, call note_mouse_highlight. If help_echo changed, call
83 gen_help_event to produce help-echo message in the echo area.
84 Call clear_mouse_face if mouse_face_hidden is set in the mouse
85 highlight info.
86
87 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
88
89 * lread.c (read1): Simplify slightly to avoid an overflow warning
90 with GCC 4.7.0 on x86-64.
91
92 2012-05-26 Eli Zaretskii <eliz@gnu.org>
93
94 * bidi.c (bidi_mirror_char): Revert last change: an int is
95 definitely wide enough here.
96
97 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
98
99 Fix integer width and related bugs (Bug#9874).
100 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
101 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
102 (string_bytes, check_sblock, allocate_string_data):
103 (compact_small_strings, Fmake_bool_vector, make_string)
104 (make_unibyte_string, make_multibyte_string)
105 (make_string_from_bytes, make_specified_string)
106 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
107 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
108 (mark_vectorlike):
109 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
110 (allocate_pseudovector):
111 Use int, not EMACS_INT, where int is wide enough.
112 (inhibit_garbage_collection, Fgarbage_collect):
113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
114 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
115 int might not be wide enough.
116 (bidi_cache_search, bidi_cache_find, bidi_init_it)
117 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
118 (bidi_at_paragraph_end, bidi_find_paragraph_start)
119 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
120 (bidi_level_of_next_char, bidi_move_to_visually_next):
121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
122 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
123 (Fkill_buffer, Fset_buffer_major_mode)
124 (advance_to_char_boundary, Fbuffer_swap_text)
125 (Fset_buffer_multibyte, overlays_at, overlays_in)
126 (overlay_touches_p, struct sortvec, record_overlay_string)
127 (overlay_strings, recenter_overlay_lists)
128 (adjust_overlays_for_insert, adjust_overlays_for_delete)
129 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
130 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
131 (Foverlay_recenter, last_overlay_modification_hooks_used)
132 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
134 (validate_region): Omit unnecessary test for b <= e,
135 since that's guaranteed by the previous test.
136 (adjust_overlays_for_delete): Avoid pos + length overflow.
137 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
138 (report_overlay_modification):
139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
140 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
141 Omit pointer cast, which isn't needed anyway, and doesn't work
142 after the EMACS_INT -> ptrdiff_t change.
143 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
144 * buffer.h: Adjust decls to match defn changes elsewhere.
145 (struct buffer_text, struct buffer):
146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
147 Use EMACS_INT, not int, where int might not be wide enough.
148 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
149 not int, to avoid needless 32-bit limit on 64-bit hosts.
150 (exec_byte_code): Use tighter memory-full test, one that checks
151 for alloca overflow. Don't compute the address of the object just
152 before an array, as that's not portable. Use EMACS_INT, not
153 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
154 * callint.c (Fcall_interactively):
155 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
156 * callproc.c (call_process_kill, Fcall_process):
157 Don't assume pid_t fits into an Emacs fixnum.
158 (call_process_cleanup, Fcall_process, child_setup):
159 Don't assume pid_t fits into int.
160 (call_process_cleanup, Fcall_process, delete_temp_file)
161 (Fcall_process_region):
162 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
163 (Fcall_process): Simplify handling of volatile integers.
164 Use int, not EMACS_INT, where int will do.
165 * casefiddle.c (casify_object, casify_region, operate_on_word)
166 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
168 (casify_object): Avoid integer overflow when overallocating buffer.
169 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
170 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
171 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
172 * category.h (CATEGORYP): Don't assume arg is nonnegative.
173 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
174 integers are now checked earlier. All uses replaced with XINT.
175 (ccl_driver):
176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
177 For CCL_MapSingle, check that content and value are in int range.
178 (ccl_driver, Fregister_code_conversion_map):
179 Check that Vcode_version_map_vector is a vector.
180 (resolve_symbol_ccl_program): Check that vector header is in range.
181 Always copy the vector, so that we can check its contents reliably
182 now rather than having to recheck each instruction as it's being
183 executed. Check that vector words fit in 'int'.
184 (ccl_get_compiled_code, Fregister_ccl_program)
185 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
186 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
187 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
188 contents are in range.
189 (Fccl_execute_on_string): Check that status is in range.
190 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
191 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
192 Accept and return EMACS_INT, not int, because callers can pass values
193 out of 'int' range.
194 (c_string_width, strwidth, lisp_string_width, chars_in_text)
195 (multibyte_chars_in_text, parse_str_as_multibyte)
196 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
197 (str_as_unibyte, str_to_unibyte, string_count_byte8)
198 (string_escape_byte8, Fget_byte):
199 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
200 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
201 avoid mishandling large integers.
202 * character.h: Adjust decls to match defn changes elsewhere.
203 * charset.c (load_charset_map_from_file, find_charsets_in_text)
204 (Ffind_charset_region):
205 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
206 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
207 (load_charset_map_from_vector, Fdefine_charset_internal):
208 Don't assume fixnum fits in int.
209 (load_charset_map_from_vector, Fmap_charset_chars):
210 Remove now-unnecessary CHECK_NATNUMs.
211 (Fdefine_charset_internal): Check ranges here, more carefully.
212 Don't rely on undefined behavior with signed left shift overflow.
213 Don't assume unsigned int fits into fixnum, or that fixnum fits
214 into unsigned int. Don't require max_code to be a valid fixnum;
215 that's not true for gb10830 4-byte on a 32-bit host. Allow
216 invalid_code to be a cons, for the same reason. Require code_offset
217 to be a character. Avoid int overflow if max_char is close
218 to INT_MAX.
219 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
220 this is intended anyway and avoids some undefined behavior.
221 (load_charset_map): Pass unsigned, not int, as 2nd arg of
222 INDEX_TO_CODE_POINT, as that's what it expects.
223 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
224 * charset.h (DECODE_CHAR): Return int, not unsigned;
225 this is what was intended anyway, and it avoids undefined behavior.
226 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
227 integer-overflow issues.
228 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
229 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
230 where the argument is EMACS_INT, and this behavior is not intended.
231 * chartab.c (Fmake_char_table, Fset_char_table_range)
232 (uniprop_get_decoder, uniprop_get_encoder):
233 Don't assume fixnum fits in int.
234 * cmds.c (move_point): New function, that does the gist of
235 Fforward_char and Fbackward_char, but does so while checking
236 for integer overflow more accurately.
237 (Fforward_char, Fbackward_char): Use it.
238 (Fforward_line, Fend_of_line, internal_self_insert)
239 (internal_self_insert):
240 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
241 Fix a FIXME, by checking for integer overflow when calculating
242 target_clm and actual_clm.
243 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
244 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
245 (ASSURE_DESTINATION, coding_alloc_by_realloc)
246 (coding_alloc_by_making_gap, alloc_destination)
247 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
248 (encode_coding_utf_16, detect_coding_emacs_mule)
249 (decode_coding_emacs_mule, encode_coding_emacs_mule)
250 (detect_coding_iso_2022, decode_coding_iso_2022)
251 (encode_invocation_designation, encode_designation_at_bol)
252 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
253 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
254 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
255 (encode_coding_ccl, encode_coding_raw_text)
256 (detect_coding_charset, decode_coding_charset)
257 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
258 (produce_composition, produce_charset, produce_annotation)
259 (decode_coding, handle_composition_annotation)
260 (handle_charset_annotation, consume_chars, decode_coding_gap)
261 (decode_coding_object, encode_coding_object, detect_coding_system)
262 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
263 (code_convert_region, code_convert_string)
264 (Fdefine_coding_system_internal)
265 (coding_set_source, coding_set_destination):
266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
267 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
268 (Fdefine_coding_system_internal):
269 Don't assume fixnums fit in int.
270 (decode_coding_gap, decode_coding_object, encode_coding_object)
271 (Fread_coding_system, Fdetect_coding_region)
272 (Funencodable_char_position, Fcheck_coding_systems_region)
273 (get_translation, handle_composition_annotation, consume_chars):
274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
275 (consume_chars): Rewrite to not calculate an address outside buffer.
276 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
277 Don't access memory outside of the args array.
278 (Fdefine_coding_system_internal): Check for charset-id overflow.
279 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
280 result of ENCODE_CHAR.
281 * coding.h: Adjust decls to match defn changes elsewhere.
282 (struct coding_system):
283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
284 * composite.c (get_composition_id, find_composition)
285 (run_composition_function, update_compositions)
286 (compose_text, composition_gstring_put_cache)
287 (composition_gstring_p, composition_gstring_width)
288 (fill_gstring_header, fill_gstring_body, autocmp_chars)
289 (composition_compute_stop_pos, composition_reseat_it)
290 (composition_update_it, struct position_record)
291 (find_automatic_composition, composition_adjust_point)
292 (Fcomposition_get_gstring, Ffind_composition_internal):
293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
294 (update_compositions):
295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
296 * composite.h: Adjust decls to match defn changes elsewhere.
297 (struct composition):
298 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
299 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
300 Do not attempt to compute the address of the object just before a
301 buffer; this is not portable.
302 (Faref, Faset):
303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
304 (Faset): Use int, not EMACS_INT, where int is wide enough.
305 (Fstring_to_number): Don't assume fixnums fit in int.
306 (Frem): Don't assume arg is nonnegative.
307 * dbusbind.c (xd_append_arg): Check for integers out of range.
308 (Fdbus_call_method): Don't overflow the timeout int.
309 (extract_signed, extract_unsigned): New functions.
310 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
311 (xd_get_connection_references): Return ptrdiff_t, not int.
312 All uses changed.
313 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
314 (xd_read_message_1):
315 Use int, not unsigned, where the dbus API uses int.
316 (Fdbus_message_internal): Don't overflow mtype.
317 (syms_of_dbusbind): Allocate right-sized buffer for integers.
318 * dired.c (directory_files_internal, file_name_completion, scmp)
319 (file_name_completion_stat):
320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
321 (file_name_completion): Don't overflow matchcount.
322 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
323 * dispextern.h: Adjust decls to match defn changes elsewhere.
324 (struct text_pos, struct glyph, struct bidi_saved_info)
325 (struct bidi_string_data, struct bidi_it, struct composition_it)
326 (struct it):
327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
328 (struct display_pos, struct composition_it, struct it):
329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
330 * dispnew.c (increment_matrix_positions)
331 (increment_row_positions, mode_line_string)
332 (marginal_area_string):
333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
334 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
336 (duration_to_sec_usec): New function, to check for overflow better.
337 (Fsleep_for, sit_for): Use it.
338 * doc.c (get_doc_string, store_function_docstring):
339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
340 (get_doc_string, Fsnarf_documentation):
341 Use int, not EMACS_INT, where int is wide enough.
342 (get_doc_string):
343 Use SAFE_ALLOCA, not alloca.
344 Check for overflow when converting EMACS_INT to off_t.
345 * doprnt.c (doprnt):
346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
347 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
348 Don't assume uid_t fits into fixnum.
349 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
350 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
351 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
352 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
353 (general_insert_function)
354 (Finsert_char, make_buffer_string, make_buffer_string_both)
355 (update_buffer_properties, Fbuffer_substring)
356 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
357 (Fsubst_char_in_region, check_translation)
358 (Ftranslate_region_internal, save_restriction_restore, Fformat)
359 (transpose_markers, Ftranspose_regions):
360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
361 (clip_to_bounds): Move to lisp.h as an inline function).
362 (Fconstrain_to_field): Don't assume integers are nonnegative.
363 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
364 (Fsubst_char_in_region, Fsave_restriction):
365 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
366 (Femacs_pid): Don't assume pid_t fits into fixnum.
367 (lo_time): Use int, not EMACS_INT, when int suffices.
368 (lisp_time_argument): Check for usec out of range.
369 (Fencode_time): Don't assume fixnum fits in int.
370 (Fuser_login_name, Fuser_full_name): Signal an error
371 if a uid argument is out of range, rather than relying on
372 undefined behavior.
373 (Fformat_time_string): Remove now-unnecessary check.
374 lisp_time_argument checks for out-of-range usec now.
375 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
376 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
377 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
378 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
379 (init_cmdargs, Fdump_emacs):
380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
381 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
382 the bottom (typically) 32 bits of the fixnum.
383 * eval.c (specpdl_size, call_debugger):
384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
385 (when_entered_debugger, Fbacktrace_debug):
386 Don't assume fixnum can fit in int.
387 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
388 the object just before a buffer; this is not portable.
389 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
390 (grow_specpdl, unbind_to):
391 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
392 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
393 (grow_specpdl): Simplify allocation by using xpalloc.
394 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
395 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
396 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
398 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
399 (a_write, e_write):
400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
401 (Fcopy_file, non_regular_nbytes, read_non_regular)
402 (Finsert_file_contents):
403 Use int, not EMACS_INT, where int is wide enough.
404 (READ_BUF_SIZE): Verify that it fits in int.
405 (Finsert_file_contents): Check that counts are in proper range,
406 rather than assuming fixnums fit into ptrdiff_t etc.
407 Don't assume fixnums fit into int.
408 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
409 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
410 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
411 (string_char_to_byte, string_byte_to_char)
412 (string_make_multibyte, string_to_multibyte)
413 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
414 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
415 (substring_both, Fdelete, internal_equal, Ffillarray)
416 (Fclear_string, mapcar1)
417 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
418 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
419 (larger_vector, make_hash_table, maybe_resize_hash_table)
420 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
421 (Fmaphash, secure_hash):
422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
423 (concat): Check for string index and length overflow.
424 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
425 (Frequire):
426 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
427 (larger_vector): New API (vec, incr_min, size_max) replaces old
428 one (vec, new_size, init). This catches size overflow.
429 INIT was removed because it was always Qnil.
430 All callers changed.
431 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
432 the upper bound on a hash table index size.
433 (make_hash_table, maybe_resize_hash_table): Use it.
434 (secure_hash): Computer start_byte and end_byte only after
435 they're known to be in ptrdiff_t range.
436 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
437 (Ffont_get_glyphs, Ffont_at):
438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
439 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
440 (Flist_fonts, Fopen_font):
441 Don't assume fixnum can fit in int.
442 (check_gstring): Don't assume index can fit in int.
443 (font_match_p): Check that fixnum is a character, not a nonnegative
444 fixnum, since the later code needs to stuff it into an int.
445 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
446 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
447 conversion overflow issues.
448 (Fopen_font): Check for integer out of range.
449 (Ffont_get_glyphs): Don't assume index can fit in int.
450 * font.h: Adjust decls to match defn changes elsewhere.
451 * fontset.c (reorder_font_vector): Redo score calculation to avoid
452 integer overflow.
453 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
454 printmax_t, where ptrdiff_t is wide enough.
455 (Finternal_char_font):
456 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
457 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
458 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
459 (Fset_frame_position, x_set_frame_parameters)
460 (x_set_line_spacing, x_set_border_width)
461 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
462 Check that fixnums are in proper range for system types.
463 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
465 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
466 Use SAFE_ALLOCA_LISP, not alloca.
467 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
468 intptr_t is wide enough.
469 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
470 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
471 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
472 Check for fixnum out of range.
473 * ftfont.c (ftfont_list): Don't assume index fits in int.
474 Check that fixnums are in proper range for system types.
475 (ftfont_shape_by_flt):
476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
477 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
479 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
480 Check that fixnums are in proper range for system types.
481 * gnutls.h: Adjust decls to match defn changes elsewhere.
482 * gtkutil.c (xg_dialog_run):
483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
484 (update_frame_tool_bar):
485 Check that fixnums are in proper range for system types.
486 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
487 (lookup_image): Check that fixnums are in range for system types.
488 * indent.c (last_known_column, last_known_column_point):
489 (current_column_bol_cache):
490 (skip_invisible, current_column, check_display_width):
491 (check_display_width, scan_for_column, current_column_1)
492 (Findent_to, Fcurrent_indentation, position_indentation)
493 (indented_beyond_p, Fmove_to_column, compute_motion):
494 (Fcompute_motion, Fvertical_motion):
495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
496 (last_known_column_modified): Use EMACS_INT, not int.
497 (check_display_width):
498 (Fcompute_motion):
499 Check that fixnums and floats are in proper range for system types.
500 (compute_motion): Don't assume index or fixnum fits in int.
501 (compute_motion, Fcompute_motion):
502 Use int, not EMACS_INT, when it is wide enough.
503 (vmotion): Omit local var start_hpos that is always 0; that way
504 we don't need to worry about overflow in expressions involving it.
505 * indent.h: Adjust decls to match defn changes elsewhere.
506 (struct position):
507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
508 Use int, not EMACS_INT, where int is wide enough.
509 Remove unused members ovstring_chars_done and tab_offset;
510 all uses removed.
511 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
512 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
513 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
514 (make_gap, copy_text, insert, insert_and_inherit)
515 (insert_before_markers, insert_before_markers_and_inherit)
516 (insert_1, count_combining_before, count_combining_after)
517 (insert_1_both, insert_from_string)
518 (insert_from_string_before_markers, insert_from_string_1)
519 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
520 (adjust_after_replace, adjust_after_insert, replace_range)
521 (replace_range_2, del_range, del_range_1, del_range_byte)
522 (del_range_both, del_range_2, modify_region)
523 (prepare_to_modify_buffer, signal_before_change)
524 (signal_after_change, Fcombine_after_change_execute):
525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
526 * intervals.c (traverse_intervals, rotate_right, rotate_left)
527 (balance_an_interval, split_interval_right, split_interval_left)
528 (find_interval, next_interval, update_interval)
529 (adjust_intervals_for_insertion, delete_node, delete_interval)
530 (interval_deletion_adjustment, adjust_intervals_for_deletion)
531 (static_offset_intervals, offset_intervals)
532 (merge_interval_right, merge_interval_left, make_new_interval)
533 (graft_intervals_into_buffer, temp_set_point_both)
534 (temp_set_point, set_point, adjust_for_invis_intang)
535 (set_point_both, move_if_not_intangible, get_property_and_range)
536 (get_local_map, copy_intervals, copy_intervals_to_string)
537 (compare_string_intervals, set_intervals_multibyte_1):
538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
539 * intervals.h: Adjust decls to match defn changes elsewhere.
540 (struct interval):
541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
542 * keyboard.c (this_command_key_count, this_single_command_key_start)
543 (before_command_key_count, before_command_echo_length, echo_now)
544 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
545 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
546 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
547 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
549 (last_non_minibuf_size, last_point_position, echo_truncate)
550 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
551 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
552 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
553 (stuff_buffered_input):
554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
555 (last_auto_save, command_loop_1, read_char):
556 Use EMACS_INT, not int, to avoid integer overflow.
557 (record_char): Avoid overflow in total_keys computation.
558 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
559 * keyboard.h: Adjust decls to match defn changes elsewhere.
560 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
561 (Fkey_description, Fdescribe_vector, Flookup_key):
562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
563 (click_position): New function, to check that positions are in range.
564 (Fcurrent_active_maps):
565 (describe_command):
566 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
567 (Faccessible_keymaps, Fkey_description):
568 (preferred_sequence_p):
569 Don't assume fixnum can fit into int.
570 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
571 Check for integer overflow in size calculations.
572 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
573 avoid mishandling large integers.
574 * lisp.h: Adjust decls to match defn changes elsewhere.
575 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
576 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
577 (struct Lisp_Marker):
578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
579 (clip_to_bounds): Now an inline function, moved here from editfns.c.
580 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
581 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
582 All callers changed.
583 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
584 Assume the arg has valid form, since it always does.
585 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
586 unsigned integer system type.
587 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
588 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
589 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
590 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
591 (duration_to_sec_usec): New decl.
592 * lread.c (read_from_string_index, read_from_string_index_byte)
593 (read_from_string_limit, readchar, unreadchar, openp)
594 (read_internal_start, read1, oblookup):
595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
596 (Fload, readevalloop, Feval_buffer, Feval_region):
597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
598 (openp): Check for out-of-range argument to 'access'.
599 (read1): Use int, not EMACS_INT, where int is wide enough.
600 Don't assume fixnum fits into int.
601 Fix off-by-one error that can read outside a buffer.
602 (read_filtered_event): Use duration_to_sec_usec
603 to do proper overflow checking on durations.
604 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
605 in size calculation.
606 (Fexecute_kbd_macro):
607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
608 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
609 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
610 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
611 (set_marker_both, set_marker_restricted_both, marker_position)
612 (marker_byte_position, Fbuffer_has_markers_at):
613 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
614 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
615 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
616 It now merely ensures that the menu is large enough, without
617 necessarily growing it, as this avoids some integer overflow issues.
618 All callers changed.
619 (keymap_panes, parse_single_submenu, Fx_popup_menu):
620 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
621 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
622 Use SAFE_ALLOCA_LISP, not alloca.
623 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
624 to EMACS_INT. Check that fixnums are in proper range for system types.
625 * minibuf.c (minibuf_prompt_width, string_to_object)
626 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
627 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
629 (get_minibuffer, read_minibuf_unwind):
630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
631 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
632 this simplifies overflow checking. All callers changed.
633 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
634 (Ftest_completion):
635 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
636 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
637 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
638 Check that fixnums are in proper range for system types.
639 (Fx_create_frame, Fx_show_tip):
640 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
641 * nsfont.m (ns_findfonts, nsfont_list_family):
642 Don't assume fixnum fits in long.
643 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
645 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
646 wide enough.
647 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
649 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
650 (PRINTDECLARE, PRINTPREPARE):
651 (strout, print_string):
652 (print, print_preprocess, print_check_string_charset_prop)
653 (print_object):
654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
655 (PRINTDECLARE):
656 (temp_output_buffer_setup, Fprin1_to_string, print_object):
657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
658 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
659 (printchar, strout): Use xpalloc to catch size calculation overflow.
660 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
661 (print_error_message): Use SAFE_ALLOCA, not alloca.
662 (print_object): Use int, not EMACS_INT, where int is wide enough.
663 (print_depth, new_backquote_output, print_number_index):
664 Use ptrdiff_t, not int, where int might not be wide enough.
665 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
666 (Fset_process_window_size, Fformat_network_address)
667 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
668 (sigchld_handler):
669 Check that fixnums are in proper range for system types.
670 (Fsignal_process): Simplify by avoiding a goto.
671 Check for process-ids out of pid_t range rather than relying on
672 undefined behavior.
673 (process_tick, update_tick): Use EMACS_INT, not int.
674 (Fformat_network_address, read_process_output, send_process)
675 (Fprocess_send_region, status_notify):
676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
677 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
678 (wait_reading_process_output, read_process_output, exec_sentinel):
679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
680 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
681 (Faccept_process_output): Use duration_to_sec_usec to do proper
682 overflow checking on durations.
683 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
684 Don't assume pid_t fits in int.
685 * process.h (struct Lisp_Process): Members tick and update_tick
686 are now of type EMACS_INT, not int.
687 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
688 configured --with-wide-int.
689 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
690 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
691 * search.c (looking_at_1, string_match_1):
692 (fast_string_match, fast_c_string_match_ignore_case)
693 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
694 (scan_newline, find_before_next_newline, search_command)
695 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
696 (set_search_regs, wordify):
697 (Freplace_match):
698 (Fmatch_data):
699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
700 (string_match_1, search_buffer, set_search_regs):
701 (Fmatch_data):
702 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
703 (wordify): Check for overflow in size calculation.
704 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
705 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
706 Check that fixnums are in proper range for system types.
707 * sound.c (struct sound_device)
708 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
710 (Fplay_sound_internal):
711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
712 * syntax.c (struct lisp_parse_state, find_start_modiff)
713 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
714 (Fparse_partial_sexp):
715 Don't assume fixnums can fit in int.
716 (struct lisp_parse_state, find_start_pos, find_start_value)
717 (find_start_value_byte, find_start_begv)
718 (update_syntax_table, char_quoted, dec_bytepos)
719 (find_defun_start, prev_char_comend_first, back_comment):
720 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
721 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
722 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
723 (Finternal_describe_syntax_value): Check that match_lisp is a
724 character, not an integer, since the code stuffs it into int.
725 (scan_words, scan_sexps_forward):
726 Check that fixnums are in proper range for system types.
727 (Fforward_word):
728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
729 (scan_sexps_forward):
730 Use CHARACTERP, not INTEGERP, since the value must fit into int.
731 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
732 * syntax.h: Adjust decls to match defn changes elsewhere.
733 (struct gl_state_s):
734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
735 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
736 MOST_POSITIVE_FIXNUM.
737 * sysdep.c (wait_for_termination_1, wait_for_termination)
738 (interruptible_wait_for_termination, mkdir):
739 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
740 (emacs_read, emacs_write):
741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
742 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
743 and double all fit in int.
744 * term.c (set_tty_color_mode):
745 Check that fixnums are in proper range for system types.
746 * termhooks.h (struct input_event):
747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
748 * textprop.c (validate_interval_range, interval_of)
749 (Fadd_text_properties, set_text_properties_1)
750 (Fremove_text_properties, Fremove_list_of_text_properties)
751 (Ftext_property_any, Ftext_property_not_all)
752 (copy_text_properties, text_property_list, extend_property_ranges)
753 (verify_interval_modification):
754 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
755 (Fnext_single_char_property_change)
756 (Fprevious_single_char_property_change):
757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
758 (copy_text_properties):
759 Check for integer overflow in index calculation.
760 * undo.c (last_boundary_position, record_point, record_insert)
761 (record_delete, record_marker_adjustment, record_change)
762 (record_property_change):
763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
764 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
766 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
767 (Fx_hide_tip, Fx_file_dialog):
768 * w32menu.c (set_frame_menubar):
769 Use ptrdiff_t, not int, for consistency with rest of code.
770 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
771 (select_window, Fdelete_other_windows_internal)
772 (window_scroll_pixel_based, window_scroll_line_based)
773 (Frecenter, Fset_window_configuration):
774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
775 (Fset_window_hscroll, run_window_configuration_change_hook)
776 (set_window_buffer, temp_output_buffer_show, scroll_command)
777 (Fscroll_other_window, Frecenter):
778 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
779 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
780 Don't assume fixnum fits in int.
781 (Fset_window_scroll_bars):
782 Check that fixnums are in proper range for system types.
783 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
784 (string_pos, c_string_pos, number_of_chars, init_iterator)
785 (in_ellipses_for_invisible_text_p, init_from_display_pos)
786 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
787 (compute_display_string_end, handle_face_prop)
788 (face_before_or_after_it_pos, handle_invisible_prop)
789 (handle_display_prop, handle_display_spec, handle_single_display_spec)
790 (display_prop_intangible_p, string_buffer_position_lim)
791 (string_buffer_position, handle_composition_prop, load_overlay_strings)
792 (get_overlay_strings_1, get_overlay_strings)
793 (iterate_out_of_display_property, forward_to_next_line_start)
794 (back_to_previous_visible_line_start, reseat, reseat_to_string)
795 (get_next_display_element, set_iterator_to_next)
796 (get_visually_first_element, compute_stop_pos_backwards)
797 (handle_stop_backwards, next_element_from_buffer)
798 (move_it_in_display_line_to, move_it_in_display_line)
799 (move_it_to, move_it_vertically_backward, move_it_by_lines)
800 (add_to_log, message_dolog, message_log_check_duplicate)
801 (message2, message2_nolog, message3, message3_nolog
802 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
803 (current_message_1, truncate_echo_area, truncate_message_1)
804 (set_message, set_message_1, store_mode_line_noprop)
805 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
806 (text_outside_line_unchanged_p, check_point_in_composition)
807 (reconsider_clip_changes)
808 (redisplay_internal, set_cursor_from_row, try_scrolling)
809 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
810 (redisplay_window, find_last_unchanged_at_beg_row)
811 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
812 (trailing_whitespace_p, find_row_edges, display_line)
813 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
814 (display_mode_element, store_mode_line_string)
815 (pint2str, pint2hrstr, decode_mode_spec)
816 (display_count_lines, display_string, draw_glyphs)
817 (x_produce_glyphs, x_insert_glyphs)
818 (rows_from_pos_range, mouse_face_from_buffer_pos)
819 (fast_find_string_pos, mouse_face_from_string_pos)
820 (note_mode_line_or_margin_highlight, note_mouse_highlight):
821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
822 (safe_call, init_from_display_pos, handle_fontified_prop)
823 (handle_single_display_spec, load_overlay_strings)
824 (with_echo_area_buffer, setup_echo_area_for_printing)
825 (display_echo_area, echo_area_display)
826 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
827 (update_tool_bar, hscroll_window_tree, redisplay_internal)
828 (redisplay_window, dump_glyph_row, display_mode_line)
829 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
830 (handle_display_spec, display_prop_string_p):
831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
832 (handle_single_display_spec, build_desired_tool_bar_string)
833 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
834 (get_specified_cursor_type):
835 Check that fixnums are in proper range for system types.
836 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
837 (Flookup_image_map):
838 Don't assume fixnums fit in int.
839 (compare_overlay_entries):
840 Avoid mishandling comparisons due to subtraction overflow.
841 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
842 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
843 (handle_tool_bar_click):
844 Use int, not unsigned, since we prefer signed and the signedness
845 doesn't matter here.
846 (get_next_display_element, next_element_from_display_vector):
847 Use int, not EMACS_INT, when int is wide enough.
848 (start_hourglass): Use duration_to_sec_usec to do proper
849 overflow checking on durations.
850 * xfaces.c (Fbitmap_spec_p):
851 Check that fixnums are in proper range for system types.
852 (compare_fonts_by_sort_order):
853 Avoid mishandling comparisons due to subtraction overflow.
854 (Fx_family_fonts, realize_basic_faces):
855 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
856 (Fx_family_fonts):
857 Don't assume fixnum fits in int.
858 Use SAFE_ALLOCA_LISP, not alloca.
859 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
860 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
861 (face_at_buffer_position, face_for_overlay_string)
862 (face_at_string_position):
863 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
864 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
865 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
866 (Fx_show_tip):
867 Check that fixnums are in proper range for system types.
868 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
869 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
871 (Fx_change_window_property): Don't assume fixnums fit in int.
872 * xfont.c (xfont_chars_supported):
873 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
874 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
875 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
877 * xml.c (parse_region):
878 * xrdb.c (magic_file_p):
879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
880 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
881 (x_get_local_selection, x_reply_selection_request)
882 (x_handle_selection_request, wait_for_property_change):
883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
884 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
885 short is wide enough.
886 (x_send_client_event): Don't assume fixnum fits in int.
887 * xterm.c (x_x_to_emacs_modifiers):
888 Don't assume EMACS_INT overflows nicely into int.
889 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
890 may come from Lisp.
891 (handle_one_xevent): NATNUMP can eval its arg twice.
892 (x_connection_closed):
893 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
894 * xterm.h: Adjust decls to match defn changes elsewhere.
895 (struct scroll_bar): Use struct vectorlike_header
896 rather than rolling our own approximation.
897 (SCROLL_BAR_VEC_SIZE): Remove; not used.
898
899 2012-05-25 Glenn Morris <rgm@gnu.org>
900
901 * lisp.mk (lisp): Update for more files being compiled now.
902
903 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
904
905 * lread.c: Remove `read_pure' which makes no difference.
906 (read_pure): Remove var.
907 (unreadpure): Remove function.
908 (readevalloop): Don't call read_list with -1 flag.
909 (read1, read_vector): Don't test read_pure any more.
910 (read_list): Simplify.
911
912 * fileio.c, character.h: Minor style tweaks.
913
914 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
915
916 * window.h (clip_changed): Remove useless declaration.
917
918 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
919
920 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
921 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
922
923 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
924
925 Remove src/m/*.
926 This directory predates autoconf and is no longer needed nowadays.
927 Move its few remaining bits of functionality to where they're needed.
928 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
929 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
930 * m/template.h: Remove.
931 * Makefile.in (M_FILE): Remove. All uses removed.
932 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
933 * lisp.h (USE_LSB_TAG):
934 * mem-limits.h (EXCEEDS_LISP_PTR):
935 Use VAL_MAX, not VALBITS, in #if.
936 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
937 (EMACS_UINT): Define unconditionally now.
938 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
939 (BITS_PER_EMACS_INT): New constants, replacing
940 what used to be in config.h, but not useful in #if.
941 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
942 define them any more.
943 (VAL_MAX): New macro.
944 (VALMASK): Use it.
945 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
946 BITS_PER_EMACS_INT, in #if.
947 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
948 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
949 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
950 * s/ms-w32.h (DATA_START):
951 Move here from removed file m/intel386.h.
952 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
953 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
954
955 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
956
957 Assume C89 or later.
958 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
959 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
960 (xrealloc):
961 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
962 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
963 * textprop.c, tparam.c (NULL): Remove.
964 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
965 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
966 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
967 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
968 * xterm.c (input_signal_count): Assume volatile works.
969
970 2012-05-21 Ken Brown <kbrown@cornell.edu>
971
972 * xgselect.c (xg_select): Fix first argument in call to 'select'
973 (bug#11508).
974
975 2012-05-20 Ken Brown <kbrown@cornell.edu>
976
977 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
978 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
979
980 2012-05-19 Ken Brown <kbrown@cornell.edu>
981
982 * xfns.c (x_in_use): Remove `static' qualifier.
983 * xterm.h (x_in_use): Declare.
984 * xgselect.c: Include xterm.h.
985 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
986 and `display_arg' (bug#9754).
987
988 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
989
990 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
991
992 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
993 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
994
995 2012-05-18 Eli Zaretskii <eliz@gnu.org>
996
997 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
998
999 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
1000 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
1001
1002 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
1003 reference to image_cache->refcount.
1004 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
1005
1006 2012-05-17 Juri Linkov <juri@jurta.org>
1007
1008 * search.c (Fword_search_regexp, Fword_search_backward)
1009 (Fword_search_forward, Fword_search_backward_lax)
1010 (Fword_search_forward_lax): Move functions to isearch.el
1011 (bug#10145, bug#11381).
1012
1013 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
1014
1015 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
1016
1017 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
1018
1019 * lread.c (init_obarray): Declare Qt and Qnil as special.
1020
1021 2012-05-14 Glenn Morris <rgm@gnu.org>
1022
1023 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
1024 Put "libexec" before "bin", for the sake of init_callproc_1.
1025
1026 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
1027
1028 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
1029
1030 * unexaix.c: Port to more-recent AIX compilers.
1031 (report_error, report_error_1, make_hdr, copy_sym)
1032 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
1033 Make arguments const char *, not char *, to avoid violations of C
1034 standard and to fix some AIX warnings reported by Gilles Pion.
1035
1036 2012-05-14 Eli Zaretskii <eliz@gnu.org>
1037
1038 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
1039 already have overlays loaded.
1040 (handle_single_display_spec): Before returning without displaying
1041 fringe bitmap, synchronize the bidi iterator with the main display
1042 iterator, by calling iterate_out_of_display_property.
1043 (iterate_out_of_display_property): Detect buffer iteration by
1044 testing that it->string is a Lisp string.
1045 (get_next_display_element): When the current object is exhausted,
1046 and there's something on it->stack, call set_iterator_to_next to
1047 proceed with what's on the stack, instead of returning zero.
1048 (set_iterator_to_next): If called at the end of a Lisp string,
1049 proceed to consider_string_end without incrementing string
1050 position. Don't increment display vector index past the end of
1051 the display vector. (Bug#11417)
1052 (pos_visible_p): Don't report a position visible when move_it_to
1053 stopped at the last line of window, which happens to be scanned
1054 backwards by the bidi iteration. (Bug#11464)
1055
1056 2012-05-14 Eli Zaretskii <eliz@gnu.org>
1057
1058 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
1059 and right-margin display specs even if the spec is invalid or we
1060 are on a TTY, and thus unable to display on the fringes. That's
1061 because the text with the property will not be displayed anyway,
1062 so we need to signal to the caller that this is a "replacing"
1063 display spec. This fixes display when the spec is invalid or we
1064 are on a TTY.
1065
1066 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
1067
1068 * unexaix.c (make_hdr): Fix typo in prototype.
1069 This bug broke the build on AIX. Problem reported by Gilles Pion.
1070
1071 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
1072
1073 * keyboard.c (kbd_buffer_get_event): Read special events also in
1074 batch mode. (Bug#11415)
1075
1076 2012-05-12 Glenn Morris <rgm@gnu.org>
1077
1078 * ns.mk: Update for ns_appbindir no longer having trailing "/".
1079
1080 2012-05-12 Eli Zaretskii <eliz@gnu.org>
1081
1082 * lisp.mk (lisp): Add newcomment.elc.
1083
1084 2012-05-12 Glenn Morris <rgm@gnu.org>
1085
1086 * Makefile.in (MKDIR_P): New, set by configure.
1087 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
1088
1089 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
1090
1091 Remove unused function hourglass_started.
1092 * dispextern.h (hourglass_started):
1093 * w32fns.c (hourglass_started):
1094 * xdisp.c (hourglass_started): Remove.
1095
1096 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
1097
1098 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
1099 Update dependencies.
1100
1101 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
1102
1103 * xgselect.c (xg_select): Put maxfds+1 into a var.
1104 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
1105
1106 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
1107
1108 2012-05-10 Dave Abrahams <dave@boostpro.com>
1109
1110 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
1111 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
1112
1113 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
1114
1115 * dbusbind.c (xd_registered_buses): New internal Lisp object.
1116 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
1117 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
1118 Initialize xd_registered_buses.
1119
1120 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
1121
1122 Untag more efficiently if USE_LSB_TAG.
1123 This is based on a proposal by YAMAMOTO Mitsuharu in
1124 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
1125 For an admittedly artificial (nth 8000 longlist) benchmark on
1126 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
1127 Emacs's overall text size by 1%.
1128 * lisp.h (XUNTAG): New macro.
1129 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
1130 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
1131 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
1132 * eval.c (Fautoload):
1133 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
1134 * frame.h (XFRAME): Use XUNTAG.
1135
1136 Port recent dbusbind.c changes to 32-bit --with-wide-int.
1137 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
1138 Remove unportable assumptions about print widths of types like
1139 dbus_uint32_t.
1140 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
1141 intptr_t when converting between pointer and integer, to avoid GCC
1142 warnings about wrong width.
1143
1144 2012-05-09 Eli Zaretskii <eliz@gnu.org>
1145
1146 * w32proc.c (new_child): Force Windows to reserve only 64KB of
1147 stack for each reader_thread, instead of defaulting to 8MB
1148 determined by the linker. This avoids failures in creating
1149 subprocesses on Windows 7, see the discussion in this thread:
1150 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
1151
1152 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
1153
1154 Fix up display of the *Minibuf-0* buffer in the mini window.
1155 * keyboard.c (read_char): Don't clear the echo area if there's no
1156 message to clear.
1157 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
1158 contents of *Minibuf-0*) if there's no message displayed in its stead.
1159
1160 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
1161
1162 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
1163 batch mode.
1164
1165 2012-05-06 Chong Yidong <cyd@gnu.org>
1166
1167 * lisp.mk (lisp): Update.
1168
1169 2012-05-05 Jim Meyering <meyering@redhat.com>
1170
1171 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
1172
1173 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
1174
1175 * data.c (PUT_ERROR): New macro.
1176 (syms_of_data): Use it. Add new error type `user-error'.
1177 * undo.c (user_error): New function.
1178 (Fprimitive_undo): Use it.
1179 * print.c (print_error_message): Adjust print style for `user-error'.
1180 * keyboard.c (user_error): New function.
1181 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
1182
1183 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
1184
1185 Do not limit current-time-string to years 1000..9999.
1186 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
1187 (Fcurrent_time_string): Support any year that is supported by the
1188 underlying localtime representation. Don't use asctime, as it
1189 has undefined behavior for years outside the range -999..9999.
1190
1191 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
1192
1193 Fix race conditions involving setenv, gmtime, localtime, asctime.
1194 Without this fix, interrupts could mess up code that uses these
1195 nonreentrant functions, since setting TZ invalidates existing
1196 tm_zone or tzname values, and since most of these functions return
1197 pointers to static storage.
1198 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
1199 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
1200 Grow the critical sections to include not just invoking
1201 localtime/gmtime, but also accessing these functions' results
1202 including their tm_zone values if any, and any related TZ setting.
1203 (format_time_string): Last arg is now struct tm *, not struct tm **,
1204 so that the struct tm is saved in the critical section.
1205 All callers changed. Simplify allocation of initial buffer, partly
1206 motivated by the fact that memory allocation needs to be outside
1207 the critical section.
1208
1209 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
1210
1211 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
1212 with RESET_INTERVAL.
1213
1214 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1215 Remove duplicated buffer name initialization.
1216
1217 2012-05-02 Jim Meyering <jim@meyering.net>
1218
1219 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
1220
1221 * xfns.c (x_window): Use xstrdup (Bug#11375).
1222
1223 2012-05-02 Eli Zaretskii <eliz@gnu.org>
1224
1225 * xdisp.c (pos_visible_p): If already at a newline from the
1226 display string before the 'while' loop, don't walk back the glyphs
1227 from it3.glyph_row. Solves assertion violation when the display
1228 string begins with a newline (egg.el). (Bug#11367)
1229
1230 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
1231
1232 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
1233 Move to simple.el.
1234
1235 2012-05-01 Glenn Morris <rgm@gnu.org>
1236
1237 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
1238 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
1239 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
1240 All were removed before 23.1.
1241
1242 * dispnew.c: Remove HAVE_LIBNCURSES test;
1243 it is always true on relevant platforms.
1244
1245 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
1246 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
1247
1248 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
1249
1250 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
1251
1252 * .gdbinit (xpr): Remove checks for no longer existing misc types.
1253 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
1254 Remove.
1255
1256 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
1257
1258 Do not avoid creating empty evaporating overlays (Bug#9642).
1259 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
1260 That is, do not delete an evaporating overlay if it becomes
1261 empty after its bounds are adjusted to fit within its buffer.
1262 This fix caused other problems, and I'm reverting it until we get
1263 to the bottom of them.
1264
1265 2012-04-27 Chong Yidong <cyd@gnu.org>
1266
1267 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
1268
1269 2012-04-27 Eli Zaretskii <eliz@gnu.org>
1270
1271 * xdisp.c (pos_visible_p): If the window start position is beyond
1272 ZV, start the display from buffer beginning. Prevents assertion
1273 violation in init_iterator when the minibuffer window is scrolled
1274 via the scroll bar.
1275
1276 * window.c (window_scroll_pixel_based): Likewise.
1277
1278 2012-04-27 Chong Yidong <cyd@gnu.org>
1279
1280 * keymap.c (where_is_internal): Doc fix (Bug#10872).
1281
1282 2012-04-27 Glenn Morris <rgm@gnu.org>
1283
1284 * fileio.c (Fcopy_file, Fset_file_selinux_context):
1285 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
1286
1287 2012-04-27 Eli Zaretskii <eliz@gnu.org>
1288
1289 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
1290 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
1291
1292 2012-04-26 Eli Zaretskii <eliz@gnu.org>
1293
1294 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
1295 display element, check also the underlying string or buffer
1296 character. (Bug#11341)
1297
1298 * w32menu.c: Include w32heap.h.
1299 (add_menu_item): If the call to AppendMenuW (via
1300 unicode_append_menu) fails, disable Unicode menus only if we are
1301 running on Windows 9X/Me.
1302
1303 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
1304
1305 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
1306 (xgetint): Add missing shift for LSB tags.
1307
1308 2012-04-24 Martin Rudalics <rudalics@gmx.at>
1309
1310 * keyboard.c (read_char): Don't wipe echo area for select window
1311 events: These might get delayed via `mouse-autoselect-window'
1312 (Bug#11304).
1313
1314 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
1315
1316 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
1317 manipulation of :loaded-from data.
1318
1319 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
1320
1321 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
1322 now a cons (bug#11311).
1323
1324 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
1325
1326 Do not create empty overlays with the evaporate property (Bug#9642).
1327 * buffer.c (Fmove_overlay): Delete an evaporating overlay
1328 if it becomes empty after its bounds are adjusted to fit within
1329 its buffer. Without this fix, in a nonempty buffer (let ((o
1330 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
1331 yields an empty overlay that has the evaporate property, which is
1332 not supposed to happen.
1333
1334 Fix minor GTK3 problems found by static checking.
1335 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1336 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1337 (struct _EmacsFixedClass, emacs_fixed_get_type):
1338 Move decls here from emacsgtkfixed.h, since they needn't be public.
1339 (emacs_fixed_get_type): Now static.
1340 (emacs_fixed_class_init): Omit unused local.
1341 (emacs_fixed_child_type): Remove; unused.
1342 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1343 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1344 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
1345 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
1346 (EMACS_FIXED_GET_CLASS): Remove; unused.
1347 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
1348
1349 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
1350 Problem reported by Juanma Barranquero for Windows -Wunused-function.
1351
1352 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1353
1354 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
1355 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
1356 (__malloc_size_t, __malloc_ptrdiff_t):
1357 Remove. All uses removed, replaced by the definiens if needed,
1358 since we can assume C89 or better now.
1359 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
1360 (protect_malloc_state, align, get_contiguous_space)
1361 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
1362 (malloc_atfork_handler_child, malloc_enable_thread)
1363 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
1364 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
1365 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
1366 (special_realloc, _realloc_internal_nolock, _realloc_internal)
1367 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
1368 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
1369 Define using prototypes, not old style.
1370 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
1371 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
1372 (align): Don't assume that signed integer overflow wraps around.
1373 Omit unused local var.
1374 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
1375 (_free_internal_nolock, memalign, mallochook, reallochook):
1376 Omit no-longer-needed casts.
1377 (valloc): Use getpagesize, not __getpagesize.
1378 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
1379 (struct hdr): The 'magic' member is now size_t, not unsigned long.
1380
1381 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
1382
1383 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
1384
1385 Move functions from C to Lisp. Make non-blocking method calls
1386 the default. Implement further D-Bus standard interfaces.
1387
1388 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
1389 (QCdbus_request_name_allow_replacement)
1390 (QCdbus_request_name_replace_existing)
1391 (QCdbus_request_name_do_not_queue)
1392 (QCdbus_request_name_reply_primary_owner)
1393 (QCdbus_request_name_reply_in_queue)
1394 (QCdbus_request_name_reply_exists)
1395 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
1396 (QCdbus_registered_serial, QCdbus_registered_method)
1397 (QCdbus_registered_signal): New Lisp objects.
1398 (XD_DEBUG_MESSAGE): Use sizeof.
1399 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
1400 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
1401 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
1402 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
1403 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
1404 (xd_signature, xd_append_arg): Allow float for integer types.
1405 (xd_get_connection_references): New function.
1406 (xd_get_connection_address): Rename from xd_initialize.
1407 Return cached address.
1408 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
1409 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
1410 level.
1411 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
1412 Return number of refcounts.
1413 (Fdbus_get_unique_name): Make stronger parameter check.
1414 (Fdbus_message_internal): New defun.
1415 (Fdbus_call_method, Fdbus_call_method_asynchronously)
1416 (Fdbus_method_return_internal, Fdbus_method_error_internal)
1417 (Fdbus_send_signal, Fdbus_register_service)
1418 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
1419 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
1420 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
1421 (Vdbus_compiled_version, Vdbus_runtime_version)
1422 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
1423 (Vdbus_message_type_method_return, Vdbus_message_type_error)
1424 (Vdbus_message_type_signal): New defvars.
1425 (Vdbus_registered_buses, Vdbus_registered_objects_table):
1426 Adapt docstring.
1427
1428 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1429
1430 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
1431 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
1432 Do not assume ptrdiff_t is the same width as 'int'.
1433
1434 * alloc.c: Handle unusual debugging option combinations.
1435 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
1436 since the two debugging options are incompatible.
1437 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
1438 is defined.
1439 (mem_init, mem_insert, mem_insert_fixup):
1440 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
1441 (NEED_MEM_INSERT): Remove; no longer needed.
1442
1443 2012-04-22 Leo Liu <sdl.web@gmail.com>
1444
1445 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
1446
1447 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1448
1449 * sysdep.c [__FreeBSD__]: Minor cleanups.
1450 (list_system_processes, system_process_attributes) [__FreeBSD__]:
1451 Use Emacs indenting style more consistently. Avoid some casts.
1452 Use 'double' consistently rather than mixing 'float' and 'double'.
1453
1454 2012-04-21 Eduard Wiebe <usenet@pusto.de>
1455
1456 * sysdep.c (list_system_processes, system_process_attributes):
1457 Add implementation for FreeBSD (Bug#5243).
1458
1459 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
1460
1461 * lisp.mk (lisp): Update.
1462
1463 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
1464
1465 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
1466 It is never used otherwise.
1467
1468 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
1469
1470 * print.c (print_preprocess): Only check print_depth if print-circle
1471 is nil.
1472 (print_object): Check for cycles even when print-circle is nil and
1473 print-gensym is t, but only check print_depth if print-circle is nil.
1474
1475 2012-04-20 Chong Yidong <cyd@gnu.org>
1476
1477 * process.c (wait_reading_process_output): If EIO occurs on a pty,
1478 set the status to "failed" and ensure that sentinel is run.
1479
1480 2012-04-20 Glenn Morris <rgm@gnu.org>
1481
1482 * process.c (Fset_process_inherit_coding_system_flag)
1483 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
1484 (Fmake_network_process, Fmake_serial_process): Doc fix.
1485
1486 2012-04-20 Eli Zaretskii <eliz@gnu.org>
1487
1488 * xdisp.c (string_buffer_position_lim): Limit starting position to
1489 BEGV.
1490 (set_cursor_from_row): If called for a mode-line or header-line
1491 row, return zero immediately.
1492 (try_cursor_movement): If inside continuation line, don't back up
1493 farther than the first row after the header line, if any.
1494 Don't consider the header-line row as "partially visible", even if
1495 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
1496
1497 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
1498
1499 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
1500 (bug#11238).
1501
1502 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
1503 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
1504
1505 configure: new option --enable-gcc-warnings (Bug#11207)
1506 * Makefile.in (C_WARNINGS_SWITCH): Remove.
1507 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
1508 (ALL_CFLAGS): Use new macros rather than old.
1509 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
1510 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
1511 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
1512 -Wunused-result, -Wunused-variable. This should go away once
1513 the Emacs and Gnulib regex code is merged.
1514 (xmalloc, xrealloc): Now static.
1515
1516 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
1517
1518 * dired.c (Fsystem_groups): Remove unused local.
1519
1520 2012-04-17 Glenn Morris <rgm@gnu.org>
1521
1522 * dired.c (Fsystem_users): Doc fix.
1523
1524 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
1525
1526 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
1527 (syms_of_dired): Add them.
1528
1529 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
1530
1531 Fix minor alloc.c problems found by static checking.
1532 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
1533 New extern decls, to avoid calling undeclared functions.
1534 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
1535 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
1536 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
1537 (NEED_MEM_INSERT): New macro.
1538 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
1539 Remove one incorrect comment and fix another.
1540
1541 Fix minor ralloc.c problems found by static checking.
1542 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1543 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
1544 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
1545 (r_alloc_sbrk): Now static.
1546
1547 Improve ralloc.c interface checking.
1548 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1549 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
1550 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
1551 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
1552 [REL_ALLOC]: ... to here, to check interface.
1553 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
1554 Remove decls. This fixes an "It stinks!".
1555
1556 * alloc.c (which_symbols): Fix alignment issue / type clash.
1557
1558 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
1559
1560 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
1561 (struct Lisp_Misc_Any): Likewise.
1562 (struct Lisp_Free): Likewise.
1563 * alloc.c (union aligned_Lisp_Symbol): Define.
1564 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
1565 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
1566 (union aligned_Lisp_Misc): Define.
1567 (MARKER_BLOCK_SIZE, struct marker_block): Use union
1568 aligned_Lisp_Misc instead of union Lisp_Misc.
1569 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
1570
1571 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
1572
1573 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
1574 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
1575 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
1576 * s/netbsd.h, s/sol2-6.h:
1577 Remove definition of GC_MARK_STACK, since the default now works.
1578 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
1579 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
1580 no longer the default.
1581 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
1582
1583 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
1584
1585 * lread.c (lisp_file_lexically_bound_p):
1586 Fix hang at ";-*-\n" (bug#11238).
1587
1588 2012-04-14 Eli Zaretskii <eliz@gnu.org>
1589
1590 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
1591 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
1592
1593 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
1594
1595 * nsterm.m (constrainFrameRect): Always constrain when there is only
1596 one screen (Bug#10962).
1597
1598 2012-04-13 Ken Brown <kbrown@cornell.edu>
1599
1600 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
1601
1602 2012-04-13 Reuben Thomas <rrt@sc3d.org>
1603
1604 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
1605
1606 2012-04-11 Daniel Colascione <dancol@dancol.org>
1607
1608 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
1609 against is gone. It's better to use vfork now so that when Cygwin
1610 gains a new, working vfork, we use it automatically (bug#10398).
1611
1612 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1613
1614 * window.c (save_window_save): Obey window-point-insertion-type.
1615
1616 2012-04-11 Glenn Morris <rgm@gnu.org>
1617
1618 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
1619
1620 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1621
1622 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
1623
1624 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
1625
1626 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
1627 (force_quit_count): New var.
1628 (handle_interrupt): Use it.
1629
1630 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
1631
1632 * w32.c (w32_delayed_load): Record the full path of the library
1633 being loaded (bug#10424).
1634
1635 2012-04-09 Glenn Morris <rgm@gnu.org>
1636
1637 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
1638 not just in the obarray, before snarfing them. (Bug#11036)
1639
1640 * Makefile.in ($(leimdir)/leim-list.el):
1641 Pass EMACS rather than BUILT_EMACS.
1642
1643 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
1644
1645 * process.c (make_process):
1646 * process.h: Add integer `gnutls_handshakes_tried' member to
1647 process struct.
1648
1649 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
1650 Add convenience `GNUTLS_LOG2i' macro.
1651
1652 * gnutls.c (gnutls_log_function2i): Convenience log function.
1653 (emacs_gnutls_read): Use new log functions,
1654 `gnutls_handshakes_tried' process member, and
1655 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
1656 attempts per process (connection).
1657
1658 2012-04-09 Chong Yidong <cyd@gnu.org>
1659
1660 * eval.c (Fuser_variable_p, user_variable_p_eh)
1661 (lisp_indirect_variable): Functions deleted.
1662 (Fdefvar): Caller changed.
1663
1664 * callint.c (Finteractive, Fcall_interactively):
1665 * minibuf.c (Fread_variable): Callers changed.
1666
1667 2012-04-09 Eli Zaretskii <eliz@gnu.org>
1668
1669 * xdisp.c (set_cursor_from_row): If the display string appears in
1670 the buffer at position that is closer to point than the position
1671 after the display string, display the cursor on the first glyph of
1672 the display string. Fixes cursor display when a 'display' text
1673 property immediately follows invisible text. (Bug#11094)
1674
1675 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
1676
1677 composite.c: use 'double' consistently
1678 * composite.c (get_composition_id): Use 'double' consistently
1679 instead of converting 'float' to 'double' and vice versa; this is
1680 easier to understand and avoids a GCC warning.
1681
1682 2012-04-09 Glenn Morris <rgm@gnu.org>
1683
1684 * Makefile.in: Generate leim-list with bootstrap-emacs, in
1685 preparation for dumping it with emacs. (Bug#4789)
1686 (leimdir): New variable.
1687 ($(leimdir)/leim-list.el): New rule.
1688 (emacs$(EXEEXT)): Depend on leim-list.el.
1689
1690 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
1691 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
1692 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
1693
1694 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
1695
1696 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
1697 proper alignment.
1698
1699 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
1700
1701 * xml.c (init_libxml2_functions) [WINDOWSNT]:
1702 Remove unused local variable.
1703
1704 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1705
1706 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
1707 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
1708 (mark_memory): Mark Lisp_Objects only if pointers might hide in
1709 objects, as mark_maybe_pointer will catch them otherwise.
1710 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
1711 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
1712
1713 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1714
1715 Fix typo that broke non-Windows builds.
1716 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
1717
1718 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1719
1720 Support building on MS-Windows with libxml2.
1721
1722 * makefile.w32-in (OBJ2): Add xml.$(O).
1723 (GLOBAL_SOURCES): Add xml.c.
1724 ($(BLD)/xml.$(O)): New dependency list.
1725
1726 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
1727 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
1728 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
1729 [!WINDOWSNT]: New macros.
1730 (init_libxml2_functions, libxml2_loaded_p): New functions.
1731 (parse_region): Call fn_xmlCheckVersion instead of using the macro
1732 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
1733 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
1734 Calls xmlCleanupParser only if libxml2 was loaded (or statically
1735 linked in).
1736 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
1737 Call init_libxml2_functions before calling libxml2 functions.
1738 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
1739
1740 * emacs.c: Don't include libxml/parser.h.
1741 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
1742 xmlCleanupParser directly.
1743
1744 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
1745
1746 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1747
1748 * indent.c (Fvertical_motion): If there is a display string at
1749 point, use it.vpos to compute how many lines to backtrack after
1750 move_it_to point. (Bug#11133)
1751
1752 2012-04-06 Eli Zaretskii <eliz@gnu.org>
1753
1754 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
1755 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
1756 about subtle differences between FETCH_CHAR* and STRING_CHAR*
1757 macros related to unification of CJK characters. For the details,
1758 see the discussion following the message here:
1759 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
1760
1761 2012-04-04 Chong Yidong <cyd@gnu.org>
1762
1763 * keyboard.c (Vdelayed_warnings_list): Doc fix.
1764
1765 2012-04-01 Eli Zaretskii <eliz@gnu.org>
1766
1767 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
1768 instead of alloca. (Bug#11138)
1769
1770 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
1771
1772 * w32menu.c (is_simple_dialog): Properly check lisp types.
1773 (Bug#11141)
1774
1775 2012-03-31 Eli Zaretskii <eliz@gnu.org>
1776
1777 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
1778 position we get to after a call to move_it_to fails the
1779 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
1780 only if we wind up in a string from display property. (Bug#11063)
1781
1782 * window.c (Fdelete_other_windows_internal): Invalidate the row
1783 and column information about mouse highlight, so that redisplay
1784 restores it after reallocating the glyph matrices. (Bug#7464)
1785
1786 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
1787 string comes from a `display' text property, use the buffer
1788 position of that property as if we actually saw that position in
1789 the row's glyphs.
1790 (move_it_by_lines): Remove the assertion that
1791 "it->current_x == 0 && it->hpos == 0" which can be legitimately
1792 violated when there's a before-string at the beginning of a line.
1793 (Bug#11063)
1794
1795 2012-03-30 Eli Zaretskii <eliz@gnu.org>
1796
1797 * xdisp.c (append_space_for_newline): If the default face was
1798 remapped, use the remapped face for the appended newline.
1799 (extend_face_to_end_of_line): Use the remapped default face for
1800 extending the face to the end of the line.
1801 (display_line): Call extend_face_to_end_of_line when the default
1802 face was remapped. (Bug#11068)
1803
1804 2012-03-29 Eli Zaretskii <eliz@gnu.org>
1805
1806 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
1807
1808 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1809
1810 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
1811
1812 2012-03-27 Glenn Morris <rgm@gnu.org>
1813
1814 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
1815 Doc fixes.
1816
1817 2012-03-26 Kenichi Handa <handa@m17n.org>
1818
1819 * dispextern.h (struct glyph): Fix previous change. Change the
1820 bit length of glyphless.ch to 25 (Bug#11082).
1821
1822 2012-03-26 Chong Yidong <cyd@gnu.org>
1823
1824 * keyboard.c (Vselection_inhibit_update_commands): New variable.
1825 (command_loop_1): Use it; inhibit selection update for
1826 handle-select-window too (Bug#8996).
1827
1828 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
1829
1830 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
1831
1832 2012-03-25 Kenichi Handa <handa@m17n.org>
1833
1834 * dispextern.h (struct glyph): Change the bit length of
1835 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
1836
1837 2012-03-24 Eli Zaretskii <eliz@gnu.org>
1838
1839 * s/ms-w32.h (tzname): Include time.h before redirecting to
1840 _tzname. Fixes the MSVC build. (Bug#9960)
1841
1842 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
1843
1844 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1845 characters.
1846
1847 * xterm.c (XTread_socket): Only modify handling_signal if
1848 !SYNC_INPUT. (Bug#11080)
1849
1850 2012-03-23 Eli Zaretskii <eliz@gnu.org>
1851
1852 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1853 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1854 when fetching a multibyte character consumes more bytes than
1855 CHAR_BYTES returns, due to unification of CJK characters in
1856 string_char. (Bug#11073)
1857
1858 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
1859
1860 * process.c (wait_reading_process_output): Handle pty disconnect
1861 by refraining from sending oneself a SIGCHLD (bug#10933).
1862
1863 2012-03-22 Chong Yidong <cyd@gnu.org>
1864
1865 * dispextern.h (struct it): New member string_from_prefix_prop_p.
1866
1867 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
1868 Mark string as coming from a prefix property.
1869 (handle_face_prop): Use default face for prefix strings (Bug#4281).
1870 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
1871
1872 2012-03-21 Chong Yidong <cyd@gnu.org>
1873
1874 * xfaces.c (Vface_remapping_alist): Doc fix.
1875
1876 2012-03-20 Eli Zaretskii <eliz@gnu.org>
1877
1878 * w32proc.c (Fw32_set_console_codepage)
1879 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
1880 Doc fixes.
1881
1882 2012-03-20 Chong Yidong <cyd@gnu.org>
1883
1884 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
1885 to reflect default non-nil value of redisplay-dont-pause.
1886
1887 2012-03-19 Kenichi Handa <handa@m17n.org>
1888
1889 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
1890 it fit in a valid range (Bug#11003).
1891
1892 2012-03-18 Eli Zaretskii <eliz@gnu.org>
1893
1894 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
1895 that is not from display property, accept the row as a "cursor
1896 row" if one of the string's character has a non-nil `cursor'
1897 property. Fixes cursor positioning when there are newlines in
1898 overlay strings, e.g. in icomplete.el. (Bug#11035)
1899
1900 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
1901
1902 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
1903
1904 2012-03-12 Chong Yidong <cyd@gnu.org>
1905
1906 * eval.c (inhibit_lisp_code): Rename from
1907 inhibit_window_configuration_change_hook; move from window.c.
1908
1909 * xfns.c (unwind_create_frame_1, Fx_create_frame):
1910 * window.c (run_window_configuration_change_hook)
1911 (syms_of_window): Callers changed.
1912
1913 2012-03-11 Chong Yidong <cyd@gnu.org>
1914
1915 * keymap.c (Fkey_description): Doc fix (Bug#9700).
1916
1917 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
1918
1919 2012-03-10 Chong Yidong <cyd@gnu.org>
1920
1921 * frame.c (other_visible_frames): Don't assume the selected frame
1922 is visible (Bug#10955).
1923
1924 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1925
1926 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1927
1928 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1929
1930 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1931 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1932 zero (Bug#10954).
1933
1934 2012-03-03 Glenn Morris <rgm@gnu.org>
1935
1936 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
1937
1938 2012-03-02 Eli Zaretskii <eliz@gnu.org>
1939
1940 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1941 position past the first glyph_row that ends at ZV. (Bug#10902)
1942 (redisplay_window, next_element_from_string): Fix typos in
1943 comments.
1944 (redisplay_window): Pass to move_it_vertically the margin in
1945 pixels, not in screen lines.
1946
1947 2012-03-02 Glenn Morris <rgm@gnu.org>
1948
1949 * buffer.c (buffer-list-update-hook): Doc fix.
1950
1951 2012-02-29 Eli Zaretskii <eliz@gnu.org>
1952
1953 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1954 push_it before setting up the iterator for the first overlay
1955 string, even if we have an empty string loaded.
1956 (next_overlay_string): If there's an empty string on the iterator
1957 stack, pop the stack. (Bug#10903)
1958
1959 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1960
1961 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1962 Suggested by Stefan Monnier in
1963 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1964 * alloc.c (widen_to_Lisp_Object): New static function.
1965 (mark_memory): Also mark Lisp_Objects by fetching pointer words
1966 and widening them to Lisp_Objects. This would work even if
1967 USE_LSB_TAG is defined and wide integers are used, which might
1968 happen in a future version of Emacs.
1969
1970 2012-02-25 Chong Yidong <cyd@gnu.org>
1971
1972 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
1973 Doc fix.
1974
1975 * xselect.c (Fx_selection_exists_p): Doc fix.
1976 (x_clipboard_manager_save_all): Print an informative message
1977 before saving to clipboard manager.
1978
1979 2012-02-24 Chong Yidong <cyd@gnu.org>
1980
1981 * keyboard.c (process_special_events): Handle all X selection
1982 requests in kbd_buffer, not just the next one (Bug#8869).
1983
1984 2012-02-23 Chong Yidong <cyd@gnu.org>
1985
1986 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
1987 call when setting menu-bar-lines and tool-bar-lines parameters.
1988 (unwind_create_frame_1): New helper function.
1989
1990 * window.c (inhibit_window_configuration_change_hook): New var.
1991 (run_window_configuration_change_hook): Obey it.
1992 (syms_of_window): Initialize it.
1993
1994 2012-02-22 Chong Yidong <cyd@gnu.org>
1995
1996 * xterm.c (x_draw_image_relief): Add missing type check for
1997 Vtool_bar_button_margin (Bug#10743).
1998
1999 2012-02-21 Chong Yidong <cyd@gnu.org>
2000
2001 * fileio.c (Vfile_name_handler_alist): Doc fix.
2002
2003 * buffer.c (Fget_file_buffer): Protect against invalid file
2004 handler return value.
2005
2006 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
2007
2008 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
2009 when computing $valmask.
2010
2011 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
2012 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
2013 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
2014 It's useless in that case, and it can cause problems on hosts
2015 that allocate halves of EMACS_INT values separately.
2016 Reported by Dan Horák. Diagnosed by Andreas Schwab in
2017 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
2018 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
2019 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
2020 it avoids undefined behavior on hosts where shifting right by more
2021 than the word width has undefined behavior.
2022
2023 2012-02-19 Chong Yidong <cyd@gnu.org>
2024
2025 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
2026 (Funhandled_file_name_directory, Ffile_name_as_directory)
2027 (Fdirectory_file_name, Fexpand_file_name)
2028 (Fsubstitute_in_file_name): Protect against invalid file handler
2029 return values (Bug#10845).
2030
2031 2012-02-18 Eli Zaretskii <eliz@gnu.org>
2032
2033 * .gdbinit (pitx): Fix incorrect references to fields of the
2034 iterator stack.
2035
2036 2012-02-17 Chong Yidong <cyd@gnu.org>
2037
2038 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
2039
2040 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
2041
2042 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
2043 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
2044
2045 2012-02-15 Chong Yidong <cyd@gnu.org>
2046
2047 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
2048 marked as special. Also, starting docstrings with * is obsolete.
2049
2050 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
2051
2052 * gnutls.c (emacs_gnutls_write): Fix last change.
2053
2054 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2055
2056 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
2057 send_process.
2058
2059 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2060
2061 * keymap.c (Fsingle_key_description): Handle char ranges.
2062
2063 2012-02-12 Chong Yidong <cyd@gnu.org>
2064
2065 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
2066 as that creates a dangerous corner case.
2067
2068 * window.c (Fdelete_window_internal): Invalidate the mouse
2069 highlight (Bug#9904).
2070
2071 2012-02-12 Glenn Morris <rgm@gnu.org>
2072
2073 * xselect.c (Fx_own_selection_internal)
2074 (Fx_get_selection_internal, Fx_disown_selection_internal)
2075 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
2076 * nsselect.m (Fx_own_selection_internal)
2077 (Fx_disown_selection_internal, Fx_selection_exists_p)
2078 (Fx_selection_owner_p, Fx_get_selection_internal):
2079 Sync docs and argument specs with the xselect.c versions.
2080
2081 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
2082
2083 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
2084
2085 2012-02-11 Eli Zaretskii <eliz@gnu.org>
2086
2087 * w32select.c (Fx_selection_exists_p): Sync doc string and
2088 argument list with xselect.c. (Bug#10783)
2089
2090 * w16select.c (Fx_selection_exists_p): Sync doc string and
2091 argument list with xselect.c. (Bug#10783)
2092
2093 2012-02-10 Glenn Morris <rgm@gnu.org>
2094
2095 * fns.c (Fsecure_hash): Doc fix.
2096
2097 2012-02-09 Kenichi Handa <handa@m17n.org>
2098
2099 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
2100
2101 2012-02-07 Chong Yidong <cyd@gnu.org>
2102
2103 * buffer.c (Fbuffer_local_variables)
2104 (buffer_lisp_local_variables): Handle unbound vars correctly;
2105 don't let Qunbound leak into Lisp.
2106
2107 2012-02-07 Glenn Morris <rgm@gnu.org>
2108
2109 * image.c (Fimagemagick_types): Doc fix.
2110
2111 * image.c (imagemagick-render-type): Change it from a lisp object
2112 to an integer. Move the doc here from the lisp manual.
2113 Treat all values not equal to 0 the same.
2114
2115 2012-02-06 Chong Yidong <cyd@gnu.org>
2116
2117 * doc.c (store_function_docstring): Avoid applying docstring of
2118 alias to base function (Bug#2603).
2119
2120 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
2121
2122 * .gdbinit (pp1, pv1): Remove redundant defines.
2123 (pr): Use pp.
2124
2125 2012-02-04 Chong Yidong <cyd@gnu.org>
2126
2127 * nsterm.m: Declare a global (Bug#10694).
2128
2129 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2130
2131 * w32.c (get_emacs_configuration_options):
2132 Include --enable-checking, if specified, in the return value.
2133
2134 2012-02-04 Martin Rudalics <rudalics@gmx.at>
2135
2136 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
2137 after rounding frame sizes. (Bug#9723)
2138
2139 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2140
2141 * keyboard.c (adjust_point_for_property): Don't position point
2142 before BEGV. (Bug#10696)
2143
2144 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
2145
2146 Handle overflow when computing char display width (Bug#9496).
2147 * character.c (char_width): Return EMACS_INT, not int.
2148 (char_width, c_string_width): Check for overflow when
2149 computing the width; this is possible now that individual
2150 characters can have unbounded width. Problem introduced
2151 by merge from Emacs 23 on 2012-01-19.
2152
2153 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
2154
2155 * dbusbind.c (Fdbus_register_method): Mention the return value
2156 :ignore in the docstring.
2157
2158 2012-02-02 Glenn Morris <rgm@gnu.org>
2159
2160 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
2161
2162 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2163 Unconditionally set to t. (Bug#10673)
2164 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2165 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2166 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
2167
2168 2012-02-02 Kenichi Handa <handa@m17n.org>
2169
2170 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
2171 0, do not call append_composite_glyph.
2172
2173 2012-02-02 Kenichi Handa <handa@m17n.org>
2174
2175 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
2176 NULL (Bug#6988).
2177 (x_produce_glyphs): If the component of a composition is a null
2178 string, set it->pixel_width to 1 to avoid zero-width glyph.
2179
2180 2012-02-01 Eli Zaretskii <eliz@gnu.org>
2181
2182 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
2183 first 2 arguments are identical. This makes inserting large
2184 output from a subprocess an order of magnitude faster on
2185 MS-Windows, where all sbrk'ed memory is always contiguous.
2186
2187 2012-01-31 Glenn Morris <rgm@gnu.org>
2188
2189 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2190 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2191 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
2192
2193 2012-01-29 Glenn Morris <rgm@gnu.org>
2194
2195 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
2196
2197 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
2198
2199 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
2200
2201 2012-01-28 Chong Yidong <cyd@gnu.org>
2202
2203 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
2204
2205 2012-01-26 Chong Yidong <cyd@gnu.org>
2206
2207 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
2208
2209 * search.c (Fsearch_forward, Fsearch_backward): Document negative
2210 repeat counts (Bug#10507).
2211
2212 2012-01-26 Glenn Morris <rgm@gnu.org>
2213
2214 * lread.c (syms_of_lread): Doc fix.
2215
2216 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
2217
2218 * coding.c (encode_designation_at_bol): Change return value to
2219 EMACS_INT.
2220
2221 2012-01-25 Chong Yidong <cyd@gnu.org>
2222
2223 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
2224
2225 2012-01-21 Chong Yidong <cyd@gnu.org>
2226
2227 * floatfns.c (Fcopysign): Make the second argument non-optional,
2228 since nil is not allowed anyway.
2229
2230 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
2231
2232 * process.c (read_process_output): Use p instead of XPROCESS (proc).
2233 (send_process): Likewise.
2234
2235 2012-01-19 Martin Rudalics <rudalics@gmx.at>
2236
2237 * window.c (save_window_save, Fcurrent_window_configuration)
2238 (Vwindow_persistent_parameters): Do not use Qstate.
2239 Rewrite doc-strings.
2240
2241 2012-01-19 Kenichi Handa <handa@m17n.org>
2242
2243 * character.c (char_width): New function.
2244 (Fchar_width, c_string_width, lisp_string_width):
2245 Use char_width (Bug#9496).
2246
2247 2012-01-16 Martin Rudalics <rudalics@gmx.at>
2248
2249 * window.c (Vwindow_persistent_parameters): New variable.
2250 (Fset_window_configuration, save_window_save): Handle persistent
2251 window parameters.
2252
2253 2012-01-14 Eli Zaretskii <eliz@gnu.org>
2254
2255 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
2256 thrashing the stack of the thread. (Bug#9087)
2257
2258 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
2259
2260 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
2261
2262 2012-01-11 Eli Zaretskii <eliz@gnu.org>
2263
2264 * xdisp.c (rows_from_pos_range): Handle the case where the
2265 highlight ends on a newline. (Bug#10464)
2266 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
2267 he end column for display of highlight that ends on a newline
2268 before a R2L line.
2269
2270 2012-01-11 Glenn Morris <rgm@gnu.org>
2271
2272 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
2273 from load-path also when installation-directory is nil. (Bug#10208)
2274
2275 2012-01-10 Glenn Morris <rgm@gnu.org>
2276
2277 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
2278
2279 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
2280 Update template values to be closer to their typical values these days.
2281
2282 2012-01-09 Eli Zaretskii <eliz@gnu.org>
2283
2284 * xdisp.c (rows_from_pos_range): Accept additional argument
2285 DISP_STRING, and accept any glyph in a row whose object is that
2286 string as eligible for mouse highlight. Fixes mouse highlight of
2287 display strings from overlays. (Bug#10464)
2288
2289 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
2290
2291 emacs: fix an auto-save permissions race condition (Bug#10400)
2292 * fileio.c (auto_saving_dir_umask): New static var.
2293 (Fmake_directory_internal): Use it.
2294 (do_auto_save_make_dir): Set it, instead of invoking chmod after
2295 creating the directory. The old code temporarily assigns
2296 too-generous permissions to the directory.
2297 (do_auto_save_eh): Clear it.
2298 (Fdo_auto_save): Catch all errors, not just file errors, so
2299 that the var is always cleared.
2300
2301 2012-01-07 Eli Zaretskii <eliz@gnu.org>
2302
2303 * search.c (scan_buffer): Pass character positions to
2304 know_region_cache, not byte positions. (Bug#6540)
2305
2306 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
2307
2308 * w32.c (sys_rename): Report EXDEV when rename of a directory
2309 fails because the target is on another logical disk. (Bug#10284)
2310
2311 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
2312
2313 * xterm.c (x_embed_request_focus): New function.
2314
2315 * xterm.h: Add prototype.
2316
2317 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
2318
2319 2012-01-05 Glenn Morris <rgm@gnu.org>
2320
2321 * emacs.c (emacs_copyright): Update short copyright year to 2012.
2322
2323 2012-01-01 Eli Zaretskii <eliz@gnu.org>
2324
2325 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
2326 Load gnutls_transport_set_lowat only if GnuTLS version is below
2327 2.11.1.
2328 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
2329 GnuTLS versions below 2.11.1.
2330
2331 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
2332
2333 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
2334 to the doc string advising against its use for altering the way
2335 windows are scrolled.
2336
2337 2011-12-28 Kenichi Handa <handa@m17n.org>
2338
2339 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
2340 coding-system ASCII compatible only when it does not produce BOM
2341 on encoding (Bug#10383).
2342
2343 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
2344
2345 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
2346 can scroll.
2347 (create_and_show_popup_menu): Always use menu_position_func for
2348 Gtk3 (Bug#10361).
2349
2350 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
2351
2352 * callint.c (Fcall_interactively): Don't truncate prompt string.
2353
2354 2011-12-23 Eli Zaretskii <eliz@gnu.org>
2355
2356 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
2357 property that ends at ZV, so that the bidi iteration could be
2358 resumed from there (after widening). (Bug#10360)
2359
2360 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
2361
2362 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
2363
2364 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
2365
2366 * nsterm.m (x_free_frame_resources):
2367 Release f->output_data.ns->miniimage.
2368 (ns_index_color): Fix indentation. Do not retain
2369 color_table->colors[i].
2370
2371 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
2372 before returning.
2373
2374 * nsfns.m (x_set_background_color): Assign return value from
2375 ns_index_color to face-background instead of NSColor*.
2376 (ns_implicitly_set_icon_type): Fix indentation.
2377 Change assignment in for loop to comparison.
2378
2379 * emacs.c (ns_pool): New variable.
2380 (main): Assign ns_pool.
2381 (Fkill_emacs): Call ns_release_autorelease_pool.
2382
2383 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
2384 autorelease fdesc, release fdAttrs and tdict.
2385 (ns_get_covering_families): Release charset.
2386 (ns_findfonts): Release NSFontDescriptor created with new.
2387 (ns_uni_to_glyphs): Fix indentation.
2388 (setString): Release attrStr before assigning new value.
2389
2390 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2391
2392 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
2393 and NS_IMPL_COCOA.
2394 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
2395 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
2396
2397 2011-12-18 David Reitter <reitter@cmu.edu>
2398
2399 * nsterm.m (ns_term_init): Subscribe for notifications
2400 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
2401 to method trackingNotification in EmacsMenu.
2402
2403 * nsmenu.m (trackingMenu): New variable.
2404 (trackingNotification): New method (from Aquamacs).
2405 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
2406 from Aquamacs (Bug#7030).
2407
2408 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2409
2410 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
2411 (symbol_to_nsstring): Fix indentation.
2412 (ns_symbol_to_pb): New function.
2413 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
2414 (Fns_rotate_cut_buffers_internal): Remove.
2415 (Fns_store_selection_internal): Rename from
2416 Fns_store_cut_buffer_internal.
2417 (ns_get_foreign_selection, Fx_own_selection_internal)
2418 (Fx_disown_selection_internal, Fx_selection_exists_p)
2419 (Fns_get_selection_internal, Fns_store_selection_internal):
2420 Use ns_symbol_to_pb and check if return value is nil.
2421 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
2422 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
2423 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
2424 renamed to Sns_store_selection_internal.
2425 (ns_handle_selection_request): Move code to Fx_own_selection_internal
2426 and remove this function.
2427 (ns_handle_selection_clear): Remove, never used.
2428 (Fx_own_selection_internal): Move code from ns_handle_selection_request
2429 here.
2430
2431 2011-12-17 Ken Brown <kbrown@cornell.edu>
2432
2433 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
2434 GID is unknown (Bug#10257).
2435
2436 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
2437
2438 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
2439 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
2440 which caused a build failure on GNU/Linux IA-64. This problem was
2441 introduced by my 2011-10-07 patch.
2442
2443 2011-12-15 Juri Linkov <juri@jurta.org>
2444
2445 * image.c (imagemagick_error): New function. (Bug#10112)
2446 (imagemagick_load_image): Comment out `MagickSetResolution' call.
2447 Use `imagemagick_error' where ImageMagick functions return
2448 `MagickFalse'.
2449 (Fimagemagick_types): Add `Fnreverse' to return the list in the
2450 proper order.
2451
2452 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2453
2454 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
2455 fill background (Bug#8992).
2456
2457 2011-12-13 Martin Rudalics <rudalics@gmx.at>
2458
2459 * window.c (Vwindow_combination_resize)
2460 (Vwindow_combination_limit): Use t instead of non-nil in
2461 doc-strings.
2462 (Vrecenter_redisplay): Add first sentence of doc-string on
2463 separate line.
2464 (Frecenter): Fix doc-string typo.
2465
2466 2011-12-11 Kenichi Handa <handa@m17n.org>
2467
2468 * coding.c (Funencodable_char_position): Pay attention to the
2469 buffer text relocation (Bug#9389).
2470
2471 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2472
2473 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
2474 gtk_init (Bug#10100).
2475
2476 2011-12-10 Eli Zaretskii <eliz@gnu.org>
2477
2478 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
2479 IT->string is nil. (Bug#10263)
2480
2481 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2482
2483 * nsterm.h (x_free_frame_resources): Declare.
2484
2485 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
2486 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
2487
2488 * nsterm.h (ns_get_defaults_value): Declare.
2489
2490 * nsterm.m (ns_default): Call ns_get_defaults_value.
2491
2492 2011-12-09 Eli Zaretskii <eliz@gnu.org>
2493
2494 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
2495 (Bug#10170)
2496
2497 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2498
2499 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
2500 that where the value of an _OBJC_* symbol points to is in the .bss
2501 section (Bug#10240).
2502
2503 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2504
2505 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2506 after the loop to call ccl_driver at least once (Bug#8619).
2507
2508 2011-12-08 Kenichi Handa <handa@m17n.org>
2509
2510 * ftfont.c (get_adstyle_property): Fix previous change
2511 (Bug#10233).
2512
2513 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
2514
2515 * w32.c (init_environment): If no_site_lisp, remove site-lisp
2516 dirs from the default value of EMACSLOADPATH (bug#10208).
2517
2518 2011-12-07 Glenn Morris <rgm@gnu.org>
2519
2520 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
2521 installation and source directories as well. (Bug#10208)
2522
2523 2011-12-06 Chong Yidong <cyd@gnu.org>
2524
2525 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
2526
2527 2011-12-06 Glenn Morris <rgm@gnu.org>
2528
2529 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
2530 as an error, not just -1. (Bug#10217)
2531
2532 2011-12-05 Chong Yidong <cyd@gnu.org>
2533
2534 * keyboard.c (process_special_events): New function.
2535 (swallow_events, Finput_pending_p): Use it (Bug#10195).
2536
2537 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
2538
2539 * coding.c (encode_designation_at_bol): Don't use uninitialized
2540 local variable (Bug#9318).
2541
2542 2011-12-05 Kenichi Handa <handa@m17n.org>
2543
2544 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
2545 return Qnil (Bug#8046, Bug#10193).
2546
2547 2011-12-05 Kenichi Handa <handa@m17n.org>
2548
2549 * coding.c (encode_designation_at_bol): New args charbuf_end and
2550 dst. Return the number of produced bytes. Callers changed.
2551 (coding_set_source): Return how many bytes coding->source was
2552 relocated.
2553 (coding_set_destination): Return how many bytes
2554 coding->destination was relocated.
2555 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
2556 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
2557
2558 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2559
2560 * coding.c (CODING_CHAR_CHARSET_P): New macro.
2561 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
2562 macro (Bug#9318).
2563
2564 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
2565
2566 The following changes are to fix Bug#9318.
2567
2568 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
2569 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
2570 (encode_coding_iso_2022, encode_coding_sjis)
2571 (encode_coding_big5, encode_coding_charset): Use the above macros.
2572
2573 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
2574
2575 * lisp.h (process_quit_flag): Fix external declaration.
2576
2577 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
2578
2579 Don't macro-inline non-performance-critical code.
2580 * eval.c (process_quit_flag): New function.
2581 * lisp.h (QUIT): Use it.
2582
2583 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
2584
2585 * nsfns.m (get_geometry_from_preferences): New function.
2586 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
2587
2588 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
2589
2590 * emacs.c (Qkill_emacs): Define.
2591 (syms_of_emacs): Initialize it.
2592 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
2593 Qquit_flag to `kill-emacs' instead.
2594 (quit_throw_to_read_char): Add parameter `from_signal'.
2595 All callers changed. Call Fkill_emacs if requested and safe.
2596 * lisp.h (QUIT): Call Fkill_emacs if requested.
2597
2598 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
2599
2600 * widget.c (update_wm_hints): Return if wmshell is null.
2601 (widget_update_wm_size_hints): New function.
2602
2603 * widget.h (widget_update_wm_size_hints): Declare.
2604
2605 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
2606 widget_update_wm_size_hints (Bug#10104).
2607
2608 2011-12-03 Eli Zaretskii <eliz@gnu.org>
2609
2610 * xdisp.c (handle_invisible_prop): If the invisible text ends just
2611 before a newline, prepare the bidi iterator for consuming the
2612 newline, and keep the current paragraph direction. (Bug#10183)
2613 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
2614
2615 2011-12-02 Juri Linkov <juri@jurta.org>
2616
2617 * search.c (Fword_search_regexp): New Lisp function created from
2618 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
2619 (Fword_search_backward, Fword_search_forward)
2620 (Fword_search_backward_lax, Fword_search_forward_lax):
2621 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
2622 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
2623
2624 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
2625
2626 * fileio.c (Finsert_file_contents): Move after-change-function call
2627 to before the "handled:" label, since all "goto handled" appear in
2628 cases where the *-change-functions have already been properly called
2629 (bug#10117).
2630
2631 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
2632
2633 * keyboard.c (interrupt_signal): Don't call kill-emacs when
2634 waiting for input. (Bug#10169)
2635
2636 2011-11-30 Eli Zaretskii <eliz@gnu.org>
2637
2638 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
2639 verifies glyph row's hash code--we have just reallocated the
2640 glyphs, so their contents can be complete garbage. (Bug#10164)
2641
2642 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
2643
2644 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
2645
2646 2011-11-30 Eli Zaretskii <eliz@gnu.org>
2647
2648 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
2649 attributes are tested _before_ calling verify_row_hash, to protect
2650 against GCC re-ordering of the tests. (Bug#10164)
2651
2652 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
2653
2654 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
2655
2656 * xterm.c (handle_one_xevent): Only set async_visible and friends
2657 if net_wm_state_hidden_seen is non-zero (Bug#10002)
2658 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2659 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2660
2661 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
2662
2663 Remove GCPRO-related macros that exist only to avoid shadowing locals.
2664 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
2665 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
2666 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2667 All uses changed to use GCPRO1 etc.
2668 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
2669 Revert to old implementation (i.e., before 2011-03-11).
2670
2671 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2672
2673 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
2674 of scroll runs so as to avoid assigning disabled bogus rows and
2675 unnecessary graphics copy operations.
2676
2677 2011-11-27 Eli Zaretskii <eliz@gnu.org>
2678
2679 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
2680 (snprintf) [_MSC_VER]: Redirect to _snprintf.
2681 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
2682 (malloc, free, realloc, calloc): Redirect to e_* only when
2683 compiling Emacs.
2684
2685 * lisp.h (GCTYPEBITS): Move before first use.
2686 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
2687 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
2688 this macro definition.
2689
2690 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
2691 _MSC_VER.
2692
2693 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
2694
2695 * gtkutil.c (xg_create_frame_widgets):
2696 Call gtk_window_set_has_resize_grip (FALSE) if that function is
2697 present with Gtk+ 2.0.
2698
2699 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2700
2701 * fileio.c (Finsert_file_contents): Undo previous change; see
2702 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2703
2704 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2705
2706 Rename locals to avoid shadowing.
2707 * fileio.c (Finsert_file_contents):
2708 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
2709 * process.c (wait_reading_process_output):
2710 Rename inner 'proc' to 'p' to avoid shadowing.
2711 Indent for consistency with usual Emacs style.
2712
2713 2011-11-25 Eli Zaretskii <eliz@gnu.org>
2714
2715 * xdisp.c (redisplay_window): If cursor row is not fully visible
2716 after recentering, and scroll-conservatively is set to a large
2717 number, scroll window by a few more lines to make the cursor fully
2718 visible and out of scroll-margin. (Bug#10105)
2719 (start_display): Don't move to the next line if the display should
2720 start at a newline that is part of a display vector or an overlay
2721 string. (Bug#10119)
2722
2723 2011-11-24 Juri Linkov <juri@jurta.org>
2724
2725 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
2726 after the `MagickPingImage' call. (Bug#10112)
2727
2728 2011-11-23 Chong Yidong <cyd@gnu.org>
2729
2730 * window.c (Fcoordinates_in_window_p): Accept only live windows.
2731
2732 2011-11-23 Martin Rudalics <rudalics@gmx.at>
2733
2734 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
2735 making another buffer current. (Bug#10114)
2736
2737 2011-11-23 Glenn Morris <rgm@gnu.org>
2738
2739 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
2740
2741 2011-11-23 Chong Yidong <cyd@gnu.org>
2742
2743 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
2744 using it (Bug#5984).
2745
2746 2011-11-22 Eli Zaretskii <eliz@gnu.org>
2747
2748 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
2749 and header-lines, as they don't have one computed for them.
2750 (Bug#10098)
2751
2752 * .gdbinit (prow): Make displayed values more self-explaining.
2753 Add row's hash code.
2754
2755 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2756
2757 * process.c (wait_reading_process_output): Fix asynchrounous
2758 GnuTLS socket handling on some versions of the GnuTLS library.
2759 (wait_reading_process_output): Add comment and URL.
2760
2761 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
2762
2763 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
2764
2765 2011-11-21 Chong Yidong <cyd@gnu.org>
2766
2767 * window.c (Fnext_window, Fprevious_window): Doc fix.
2768
2769 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2770
2771 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
2772
2773 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2774
2775 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
2776
2777 2011-11-20 Martin Rudalics <rudalics@gmx.at>
2778
2779 * window.c (Fset_window_combination_limit): Rename argument
2780 STATUS to LIMIT.
2781 (Vwindow_combination_limit): Remove "status" from doc-string.
2782
2783 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
2784
2785 * m/ibms390.h: Remove.
2786 * m/ibms390x.h: Don't include "ibms390.h".
2787
2788 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2789
2790 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
2791 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
2792
2793 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2794
2795 * casetab.c (Fset_case_table):
2796 * charset.c (Fcharset_after): Fix typos.
2797
2798 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
2799
2800 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
2801 Otherwise, valgrind does not work on some platforms.
2802 Problem reported by Andreas Schwab in
2803 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
2804 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
2805 is set, removing the need for VIRT_ADDRESS_VARIES.
2806 (PURE_P): Use a more-efficient implementation that needs just one
2807 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
2808 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
2809 to 4 (xorl, subq, cmpq, setbe).
2810 * alloc.c (pure): Always extern now, since that's the
2811 VIRT_ADDR_VARIES behavior.
2812 (PURE_POINTER_P): Use a single comparison, not two, for
2813 consistency with the new puresize.h.
2814 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
2815 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
2816 Remove VIRT_ADDR_VARIES no longer needed.
2817
2818 2011-11-19 Eli Zaretskii <eliz@gnu.org>
2819
2820 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
2821 (erase_phys_cursor, update_window_cursor, show_mouse_face)
2822 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
2823 behave as if the cursor position were at the window margin.
2824
2825 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
2826 and the cursor position is out of bounds, behave as if the cursor
2827 position were at the window margin. (Bug#10075)
2828
2829 2011-11-18 Chong Yidong <cyd@gnu.org>
2830
2831 * window.c (Fwindow_combination_limit): Make first argument
2832 non-optional, since it is meaningless for live windows like the
2833 selected window.
2834
2835 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
2836
2837 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
2838
2839 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2840
2841 * intervals.c: Fix grafting over the whole buffer (bug#10071).
2842 (graft_intervals_into_buffer): Simplify.
2843
2844 2011-11-18 Eli Zaretskii <eliz@gnu.org>
2845
2846 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2847 hash values of the two rows.
2848 (copy_row_except_pointers): Preserve the used[] arrays and the
2849 hash values of the two rows. (Bug#10035)
2850 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
2851
2852 * xdisp.c (row_hash): New function, body extracted from
2853 compute_line_metrics.
2854 (compute_line_metrics): Call row_hash, instead of computing the
2855 hash code inline.
2856
2857 * dispnew.c (verify_row_hash): Call row_hash for computing the
2858 hash code of a row, instead of duplicating code from xdisp.c.
2859
2860 * dispextern.h (row_hash): Add prototype.
2861
2862 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
2863
2864 * frame.c (delete_frame): Don't delete the terminal when the last
2865 X frame is closed if emacs is built with GTK toolkit.
2866
2867 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
2868
2869 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
2870
2871 2011-11-17 Martin Rudalics <rudalics@gmx.at>
2872
2873 * window.c (Vwindow_splits): Rename to
2874 Vwindow_combination_resize. Suggested by Juri Linkov.
2875 (Fsplit_window_internal): Use Vwindow_combination_resize instead
2876 of Vwindow_splits.
2877
2878 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
2879
2880 * nsfns.m (Fns_font_name):
2881 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
2882
2883 2011-11-16 Martin Rudalics <rudalics@gmx.at>
2884
2885 * window.h (window): Rename slot "nest" to "combination_limit".
2886 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
2887 (Fset_window_nest): Rename to Fset_window_combination_limit.
2888 (Vwindow_nest): Rename to Vwindow_combination_limit.
2889 (recombine_windows, make_parent_window, make_window)
2890 (Fsplit_window_internal, saved_window)
2891 (Fset_window_configuration, save_window_save): Rename all
2892 occurrences of window_nest to window_combination_limit.
2893
2894 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
2895
2896 * image.c (imagemagick_load_image): Fix typo.
2897
2898 2011-11-14 Eli Zaretskii <eliz@gnu.org>
2899
2900 * xdisp.c (display_line): Move the call to
2901 highlight_trailing_whitespace before the call to
2902 compute_line_metrics, since the latter needs to see the final
2903 faces of all the glyphs to compute ROW's hash value.
2904 Fixes assertion violations in row_equal_p. (Bug#10035)
2905
2906 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
2907
2908 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
2909 just return (bug#10044).
2910
2911 2011-11-12 Eli Zaretskii <eliz@gnu.org>
2912
2913 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
2914 with user-defined heap size. Bump the default size of the temacs
2915 heap to 27MB, to avoid memory warning when running temacs.
2916 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
2917
2918 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
2919 current_matrix and desired_matrix. (Bug#9990)
2920 (verify_row_hash) [XASSERTS]: New function.
2921 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2922 that the hash value of glyph rows is correct.
2923
2924 2011-11-12 Martin Rudalics <rudalics@gmx.at>
2925
2926 * window.h (window): Remove splits slot.
2927 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2928 (Fdelete_other_windows_internal, make_parent_window)
2929 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2930 (Fset_window_configuration, save_window_save): Don't deal with
2931 split status of windows.
2932 (saved_window): Remove splits slot.
2933 (Vwindow_splits): Rewrite doc-string.
2934
2935 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2936
2937 * xfns.c (unwind_create_frame):
2938 * nsfns.m (unwind_create_frame):
2939 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2940 Vframe_list (Bug#9999).
2941
2942 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2943
2944 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
2945
2946 2011-11-11 Kenichi Handa <handa@m17n.org>
2947
2948 * callproc.c (Fcall_process): Set the member dst_multibyte of
2949 process_coding.
2950
2951 2011-11-11 Johan Bockgård <bojohan@gnu.org>
2952
2953 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2954 avoid a crash (bug#9496).
2955
2956 2011-11-09 Chong Yidong <cyd@gnu.org>
2957
2958 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2959 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2960
2961 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2962
2963 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2964
2965 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2966
2967 Avoid some portability problems by eschewing 'extern inline' functions.
2968 The trivial performance wins aren't worth the portability hassles; see
2969 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
2970 et seq.
2971 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2972 (window_box_width, window_box_left, window_box_left_offset)
2973 (window_box_right, window_box_right_offset): Undo previous change,
2974 by removing the "extern"s.
2975 * intervals.c (adjust_intervals_for_insertion)
2976 (adjust_intervals_for_deletion): Undo previous change,
2977 making these static again.
2978 (offset_intervals, temp_set_point_both, temp_set_point)
2979 (copy_intervals_to_string): No longer inline.
2980 * xdisp.c (window_text_bottom_y, window_box_width)
2981 (window_box_height, window_box_left_offset)
2982 (window_box_right_offset, window_box_left, window_box_right)
2983 (window_box): No longer inline.
2984
2985 2011-11-08 Chong Yidong <cyd@gnu.org>
2986
2987 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
2988 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
2989 Signal an error if not a live window.
2990 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
2991 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
2992
2993 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
2994
2995 * lisp.h (syms_of_abbrev): Remove declaration.
2996 Reported by CHENG Gao <chenggao@royau.me>.
2997
2998 2011-11-07 Eli Zaretskii <eliz@gnu.org>
2999
3000 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
3001 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
3002 of temacs in GUI mode.
3003
3004 2011-11-07 Martin Rudalics <rudalics@gmx.at>
3005
3006 * window.h: Declare delete_all_child_windows instead of
3007 delete_all_subwindows.
3008 * window.c (Fwindow_nest, Fset_window_nest)
3009 (Fset_window_new_total, Fset_window_new_normal)
3010 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
3011 (delete_all_subwindows): Rename to delete_all_child_windows.
3012 (Fdelete_other_windows_internal, Fset_window_configuration):
3013 Call delete_all_child_windows instead of delete_all_subwindows.
3014 * frame.c (delete_frame): Call delete_all_child_windows instead
3015 of delete_all_subwindows.
3016
3017 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
3018
3019 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
3020 This is also needed for porting to any host where GC_MARK_STACK is
3021 not GC_MAKE_GCPROS_NOOPS.
3022 (which_symbols): Use it.
3023
3024 2011-11-07 Kenichi Handa <handa@m17n.org>
3025
3026 * coding.c (coding_set_destination): Check coding->src_pos only
3027 when coding->src_object is a buffer (bug#9910).
3028
3029 * process.c (send_process): Set the member src_multibyte of coding
3030 to 0 (bug#9911) when sending a unibyte text.
3031
3032 * callproc.c (Fcall_process): Set the member src_multibyte of
3033 process_coding to 0 (bug#9912).
3034
3035 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3036
3037 * xmenu.c (cleanup_widget_value_tree): New function.
3038 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
3039 calling free_menubar_widget_value_tree directly (Bug#9830).
3040
3041 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 Fix some portability problems with 'inline'.
3044 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
3045 (window_box_width, window_box_left, window_box_left_offset)
3046 (window_box_right, window_box_right_offset): Declare extern.
3047 Otherwise, these inline functions do not conform to C99 and
3048 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
3049 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
3050 * intervals.c (adjust_intervals_for_insertion)
3051 (adjust_intervals_for_deletion): Now extern, because otherwise the
3052 extern inline functions 'offset_intervals' couldn't refer to it.
3053 (static_offset_intervals): Remove.
3054 (offset_intervals): Rewrite using the old contents of
3055 static_offset_intervals. The old version didn't conform to C99
3056 because an extern inline function contained a reference to an
3057 identifier with static linkage.
3058
3059 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
3060
3061 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
3062 GC.
3063
3064 2011-11-06 Eli Zaretskii <eliz@gnu.org>
3065
3066 * xdisp.c (init_iterator, reseat_to_string): Don't set the
3067 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
3068 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
3069 return Qleft_to_right.
3070
3071 2011-11-06 Chong Yidong <cyd@gnu.org>
3072
3073 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
3074 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
3075 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
3076 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
3077 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
3078 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
3079 (Fwindow_vscroll): Doc fix.
3080 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
3081 argument, since it makes no sense to pass a live window and for
3082 consistency with window-child.
3083
3084 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
3085
3086 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
3087 support MSVC.
3088
3089 2011-11-05 Jason Rumney <jasonr@gnu.org>
3090
3091 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
3092 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
3093 fonts (Bug#6029).
3094 (add_font_entity_to_list): Fix logic errors in mixed boolean and
3095 bitwise arithmetic preventing use of unicode-sip and non-truetype
3096 opentype fonts.
3097
3098 2011-11-05 Eli Zaretskii <eliz@gnu.org>
3099
3100 * s/ms-w32.h (fstat, stat, utime): Move redirections to
3101 "emacs"-only part.
3102
3103 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
3104 initialization code to keep similarity to xfns.c after changes
3105 from 2011-11-05.
3106
3107 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
3108
3109 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
3110 (unwind_create_frame): New function (Bug#9943).
3111 (Fx_create_frame): Restructure code to be more similar to the one in
3112 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
3113 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
3114 Move terminal->reference_count++ just before making the frame official
3115 (Bug#9943).
3116
3117 * nsterm.m (x_free_frame_resources): New function.
3118 (x_destroy_window): Move code to x_free_frame_resources.
3119
3120 * xfns.c (unwind_create_frame): Fix comment.
3121 (Fx_create_frame, x_create_tip_frame):
3122 Move terminal->reference_count++ just before making the frame
3123 official. Move initialization of image_cache_refcount and
3124 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
3125
3126 2011-11-05 Eli Zaretskii <eliz@gnu.org>
3127
3128 Support MSVC build with newer versions of Visual Studio.
3129 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
3130 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
3131 nt/gmake.defs.
3132
3133 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
3134 which are not supported by MSVC.
3135 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
3136 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
3137 bitfields.
3138 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
3139 types in bitfields.
3140 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
3141
3142 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
3143
3144 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
3145
3146 Support MSVC build with newer versions of Visual Studio.
3147 * w32.c: Don't include w32api.h for MSVC.
3148 (init_environment) [_MSC_VER]: Call sys_access, not _access.
3149
3150 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
3151 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
3152 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
3153 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
3154 e_* cousins.
3155 (alloca) [_MSC_VER]: Define to _alloca.
3156
3157 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
3158
3159 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
3160
3161 2011-11-04 Eli Zaretskii <eliz@gnu.org>
3162
3163 * xdisp.c (note_mouse_highlight): If either of
3164 previous/next-single-property-change returns nil, treat that as
3165 the beginning or the end of the buffer. (Bug#9955)
3166
3167 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
3168
3169 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
3170 label is not null (Bug#9951).
3171 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
3172 may be NULL.
3173
3174 2011-11-04 Eli Zaretskii <eliz@gnu.org>
3175
3176 * window.c (Fwindow_body_size): Mention in the doc string that the
3177 return value is in frame's canonical units. (Bug#9949)
3178
3179 2011-11-03 Eli Zaretskii <eliz@gnu.org>
3180
3181 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
3182
3183 * w32fns.c (unwind_create_frame): If needed, free the glyph
3184 matrices of the partially constructed frame. (Bug#9943)
3185 * xfns.c (unwind_create_frame): Likewise.
3186
3187 2011-11-01 Eli Zaretskii <eliz@gnu.org>
3188
3189 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
3190 Don't stop backward scan on the continuation glyph, even though
3191 its CHARPOS is positive.
3192 (mouse_face_from_buffer_pos, note_mouse_highlight):
3193 Rename cover_string to disp_string.
3194
3195 2011-11-01 Martin Rudalics <rudalics@gmx.at>
3196
3197 * window.c (temp_output_buffer_show): Don't use
3198 Vtemp_buffer_show_specifiers.
3199 (Vtemp_buffer_show_specifiers): Remove unused variable.
3200
3201 2011-10-30 Eli Zaretskii <eliz@gnu.org>
3202
3203 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
3204 past the beginning of the current glyph matrix.
3205
3206 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3207
3208 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
3209 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
3210 HAVE_GTK3 (Bug#9869).
3211
3212 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
3213 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
3214
3215 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
3216
3217 * xterm.c: Declare x_handle_net_wm_state to return int.
3218 (handle_one_xevent): Check if we are iconified but don't have
3219 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
3220 (get_current_wm_state): Return non-zero if not hidden,
3221 check for _NET_WM_STATE_HIDDEN (Bug#9893).
3222 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
3223 (x_handle_net_wm_state): Return what get_current_wm_state returns.
3224 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
3225
3226 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
3227
3228 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
3229 so that this new function doesn't get optimized away by a
3230 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
3231
3232 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3233
3234 * frame.h (MOUSE_HL_INFO): Remove excess parens.
3235
3236 2011-10-29 Eli Zaretskii <eliz@gnu.org>
3237
3238 Fix the `xbytecode' command.
3239 * .gdbinit (xprintbytestr): New command.
3240 (xwhichsymbols): Rename from `which'; all callers changed.
3241 (xbytecode): Print the byte-code string as well.
3242
3243 2011-10-29 Kim Storm <storm@cua.dk>
3244
3245 * alloc.c (which_symbols): New function.
3246
3247 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3248
3249 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
3250 line. (Bug#9903)
3251
3252 2011-10-29 Glenn Morris <rgm@gnu.org>
3253
3254 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
3255 Not clear what it was for, and it causes various bugs. (Bug#9839)
3256
3257 2011-10-28 Eli Zaretskii <eliz@gnu.org>
3258
3259 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
3260 possible random value that matches one of those tested as
3261 condition to clear the mouse face.
3262
3263 2011-10-28 Chong Yidong <cyd@gnu.org>
3264
3265 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
3266
3267 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
3268
3269 * window.c (make_window): Initialize phys_cursor_on_p.
3270
3271 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3272
3273 * lisp.h (struct Lisp_Symbol): Update comments.
3274
3275 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
3276
3277 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
3278
3279 2011-10-28 Eli Zaretskii <eliz@gnu.org>
3280
3281 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
3282 <oslsachem@gmail.com> for helping to debug this.
3283
3284 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
3285 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
3286 (g_b_init_get_glyph_outline_w): New static variables.
3287 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
3288 (GetGlyphOutlineW_Proc): New typedefs.
3289 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
3290 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
3291 New functions.
3292 (w32font_open_internal, compute_metrics):
3293 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
3294 instead of calling the "wide" APIs directly.
3295
3296 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
3297
3298 * w32.h (syms_of_w32font): Add prototype.
3299
3300 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
3301
3302 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
3303 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
3304 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
3305 (Fmove_to_window_line): Doc fix.
3306
3307 2011-10-27 Chong Yidong <cyd@gnu.org>
3308
3309 * process.c (make_process): Set gnutls_state to NULL.
3310
3311 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
3312 non-NULL, regardless of GNUTLS_INITSTAGE.
3313 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
3314 an error. Set process slots as soon as we allocate them.
3315
3316 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
3317
3318 2011-10-27 Chong Yidong <cyd@gnu.org>
3319
3320 * gnutls.c (emacs_gnutls_deinit): New function.
3321 Deallocate credentials structures as well as calling gnutls_deinit.
3322 (Fgnutls_deinit, Fgnutls_boot): Use it.
3323
3324 * process.c (make_process): Initialize GnuTLS credentials to NULL.
3325 (deactivate_process): Call emacs_gnutls_deinit.
3326
3327 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
3328
3329 * image.c (x_create_x_image_and_pixmap):
3330 * w32.c (sys_rename, w32_delayed_load):
3331 * w32font.c (fill_in_logfont):
3332 * w32reg.c (x_get_string_resource): Silence compiler warnings.
3333
3334 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
3335
3336 * w32fns.c (w32_default_color_map): New function,
3337 extracted from Fw32_default_color_map.
3338 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
3339
3340 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
3341
3342 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
3343
3344 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
3345
3346 * keyboard.c (test_undefined): New function (bug#9751).
3347 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
3348
3349 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
3350
3351 * sysdep.c (init_sys_modes): Fix the check for the controlling
3352 terminal (Bug#6649).
3353
3354 2011-10-20 Eli Zaretskii <eliz@gnu.org>
3355
3356 * dispextern.h (struct bidi_it): New member next_en_type.
3357
3358 * bidi.c (bidi_line_init): Initialize the next_en_type member.
3359 (bidi_resolve_explicit_1): When next_en_pos is valid for the
3360 current character, check also for next_en_type being WEAK_EN.
3361 (bidi_resolve_weak): Don't enter the expensive loop if the current
3362 position is before next_en_pos. Record the bidi type of the first
3363 non-ET, non-BN character we find, in addition to its position.
3364 (bidi_level_of_next_char): Invalidate next_en_type when
3365 next_en_pos is over-stepped.
3366
3367 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
3368
3369 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
3370 * editfns.c: Rewrite current-time-zone so that it invokes
3371 the equivalent of (format-time-string "%Z") to get the time zone name.
3372 This fixes a bug when the time zone name contains characters that
3373 need converting from the system time locale to Emacs internal format.
3374 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
3375 that patch fixed format-time-string to do the conversion, but
3376 I forgot to fix current-time-zone.
3377 (format_time_string): New function, containing most of
3378 what Fformat_time_string used to contain.
3379 (Fformat_time_string): Rewrite in terms of format_time_string.
3380 This doesn't change this function's behavior.
3381 (current-time-zone): Rewrite to use format_time_string.
3382 This fixes the bug reported by Michael Schierl in
3383 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
3384 Jason Rumney's 2007-06-07 change worked around this bug, but
3385 didn't fix it.
3386 * systime.h (tzname, timezone): Remove no-longer-used declarations.
3387
3388 2011-10-19 Eli Zaretskii <eliz@gnu.org>
3389
3390 * xdisp.c (start_display): If the character at POS is displayed
3391 via a display vector, reset IT->current.dpvec_index to zero.
3392 (try_window_reusing_current_matrix): If a line ends in a display
3393 vector or the next line starts in a display vector, continue
3394 redrawing the window even though the character position of
3395 start_row was reached.
3396 (Bug#9771, part 2)
3397
3398 2011-10-18 Chong Yidong <cyd@gnu.org>
3399
3400 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
3401 with nobreak-char-display too.
3402
3403 2011-10-18 Eli Zaretskii <eliz@gnu.org>
3404
3405 Fix part 3 of bug#9771.
3406 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
3407 (bidi_resolve_neutral): Don't enter the expensive loop looking for
3408 non-neutral characters if the current character is a paragraph
3409 separator (a.k.a. Newline). This avoids running the same
3410 expensive loop twice, once when we consume the preceding newline
3411 and the other time when the line actually needs to be displayed.
3412 Avoid the loop when we see neutrals on the base embedding level
3413 following a character whose directionality is the same as the
3414 paragraph's. This avoids running the expensive loop when a line
3415 ends in a long sequence of neutrals, like control characters.
3416 Add assertion against STRONG_AL type. Slightly rearrange code
3417 that determines the type of a neutral given the first non-neutral
3418 that follows it.
3419 (bidi_level_of_next_char): Set next_en_pos to zero when
3420 invalidating its info.
3421
3422 2011-10-17 Eli Zaretskii <eliz@gnu.org>
3423
3424 * xdisp.c (push_display_prop): Determine whether to record string
3425 or buffer position by IT->string, not by IT->method. Allow
3426 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
3427 (move_it_vertically_backward): Don't look for character position
3428 immediately after the newline when in a continuation line.
3429 (Bug#9771, part 1)
3430
3431 2011-10-15 Martin Rudalics <rudalics@gmx.at>
3432
3433 * window.c (coordinates_in_window): Rewrite and delabelize
3434 vertical border check. (Bug#5357) (Bug#9618)
3435
3436 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
3437
3438 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
3439 errors in XSetWindowBorder (bug#9310).
3440
3441 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
3442
3443 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
3444 avoid crash when xmalloc overrun checking is enabled.
3445
3446 2011-10-13 Eli Zaretskii <eliz@gnu.org>
3447
3448 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
3449 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
3450 cursor motion with <left> and <right> arrow keys.
3451
3452 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
3453 some callers set that themselves.
3454
3455 2011-10-12 Eli Zaretskii <eliz@gnu.org>
3456
3457 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
3458 display string and the previous row comes from the same string and
3459 is empty. (Bug#9739) (Bug#9738)
3460
3461 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3462
3463 * doc.c (get_doc_string): Encode file name (bug#9735).
3464
3465 2011-10-12 Eli Zaretskii <eliz@gnu.org>
3466
3467 * bidi.c (bidi_level_of_next_char):
3468 * xdisp.c (get_visually_first_element): Remove old incorrect
3469 comments regarding the Unicode Line Separator character.
3470
3471 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
3472
3473 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
3474
3475 * alloc.c (Fgc_status): Do not access beyond zombies array
3476 boundary if nzombies > MAX_ZOMBIES.
3477 * alloc.c (dump_zombies): Add missing format specifier.
3478
3479 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
3480
3481 * xdisp.c (set_cursor_from_row): Simplify conditionals,
3482 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
3483
3484 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
3485 Some packages use them to denote characters with modifiers.
3486
3487 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
3488
3489 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
3490 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
3491 matching a pp-number. Rename parameter var to var1.
3492
3493 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3494
3495 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
3496
3497 2011-10-08 Glenn Morris <rgm@gnu.org>
3498
3499 * callint.c (Fcall_interactively): Give a more explicit error for the
3500 'c' case with a non-character input. (Bug#8479)
3501
3502 2011-10-08 Eli Zaretskii <eliz@gnu.org>
3503
3504 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
3505 lines.
3506 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
3507 lines that are hscrolled on the left.
3508
3509 * dispnew.c (buffer_posn_from_coords): Account for a possible
3510 presence of header-line. (Bug#4426)
3511
3512 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
3513
3514 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
3515 Don't advertise functionality which we discourage or doesn't work.
3516
3517 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
3520 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
3521 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
3522 this makes Emacs dump core during garbage collection on rare
3523 occasions. sizeof is obviously inferior to offsetof here, so
3524 stick with offsetof.
3525 (GC_POINTER_ALIGNMENT): New macro.
3526 (mark_memory): Omit 3rd (offset) arg; caller changed.
3527 Don't assume EMACS_INT alignment is the same as pointer alignment.
3528
3529 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
3530
3531 * keyboard.c (read_key_sequence_remapped): New var.
3532 (read_key_sequence): Compute remapping in the right buffer.
3533 (command_loop_1): Use read_key_sequence's remapping directly.
3534
3535 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3536
3537 * dired.c (file_name_completion): Don't expand file name.
3538 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
3539 before checking file name handler.
3540
3541 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
3542 they've been requested explicitly (bug#9591).
3543
3544 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
3545
3546 * keymap.c (Fsingle_key_description): Use make_specified_string
3547 instead of build_string to build string from push_key_description.
3548 (Bug#5193)
3549
3550 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3551
3552 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
3553 This fixes a Y2038 bug on 64-bit hosts.
3554 * buffer.c (reset_buffer):
3555 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
3556 (Fclear_buffer_auto_save_failure):
3557 Use 0, not -1, to represent an unset failure time, since time_t
3558 might not be signed.
3559
3560 Remove dependency on glibc malloc internals.
3561 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3562 Move back here from lisp.h, but with their new implementations.
3563 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3564 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
3565 * charset.c (charset_table_init): New static var.
3566 (syms_of_charset): Use it instead of xmalloc. This removes a
3567 dependency on glibc malloc internals. See Eli Zaretskii's comment in
3568 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
3569 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3570 Move back to alloc.c.
3571 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3572 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
3573
3574 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
3575
3576 * nsterm.m (windowDidResize): Call x_set_window_size only when
3577 ns_in_resize is true. Otherwise set pixelwidth/height and
3578 call change_frame_size (Bug#9628).
3579
3580 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3581
3582 Port --enable-checking=all to Fedora 14 x86-64.
3583 * charset.c (syms_of_charset): Also account for glibc malloc's
3584 internal overhead when calculating the initial malloc maximum.
3585
3586 Port --enable-checking=all to Fedora 14 x86.
3587 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3588 Move to lisp.h.
3589 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
3590 (overrun_check_realloc, overrun_check_free):
3591 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
3592 That way, xmalloc returns a properly-aligned pointer even if
3593 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
3594 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
3595 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
3596 into account when calculating the initial malloc maximum.
3597 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3598 Move here from alloc.c, so that charset.c can use it too.
3599 Properly align; the old code wasn't right for common 32-bit hosts
3600 when configured with --enable-checking=all.
3601 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3602 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
3603
3604 2011-09-29 Eli Zaretskii <eliz@gnu.org>
3605
3606 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
3607 use EDOM.
3608
3609 2011-09-28 Eli Zaretskii <eliz@gnu.org>
3610
3611 * xdisp.c (compute_display_string_end): If there's no display
3612 string at CHARPOS, return -1.
3613
3614 * bidi.c (bidi_fetch_char): When compute_display_string_end
3615 returns a negative value, treat the character as a normal
3616 character not covered by a display string. (Bug#9624)
3617
3618 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
3619
3620 * lread.c (Fread_from_string): Fix typo in docstring.
3621
3622 2011-09-27 Eli Zaretskii <eliz@gnu.org>
3623
3624 * xdisp.c (handle_invisible_prop): If invisible text ends on a
3625 newline, reseat the iterator instead of bidi-iterating there one
3626 character at a time. (Bug#9610)
3627 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
3628 TO_CHARPOS if the bidi iterator is at base embedding level.
3629
3630 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
3631
3632 * lread.c (readevalloop): Use correct code for NBSP.
3633 (read1): Likewise. (Bug#9608)
3634
3635 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
3636
3637 * dbusbind.c (Fdbus_register_signal): When service is not
3638 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
3639
3640 2011-09-25 Glenn Morris <rgm@gnu.org>
3641
3642 * buffer.c (truncate-lines): Doc fix.
3643
3644 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
3645
3646 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
3647 (Fset_window_next_buffers): Doc fix.
3648
3649 2011-09-24 Glenn Morris <rgm@gnu.org>
3650
3651 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
3652
3653 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
3654
3655 Fix minor problems found by static checking.
3656 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
3657 * indent.c (Fvertical_motion): Fix == vs = typo.
3658
3659 2011-09-24 Eli Zaretskii <eliz@gnu.org>
3660
3661 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
3662 Default value is now t. Doc fix.
3663
3664 * indent.c (Fvertical_motion): Compute and apply the overshoot
3665 logic when moving up, not only when moving down. Fix the
3666 confusing name and values of the it_overshoot_expected variable;
3667 logic changes accordingly. (Bug#9254) (Bug#9549)
3668
3669 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
3670 CHARPOS is covered by a display string which includes newlines.
3671 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
3672 is covered by a display string with embedded newlines.
3673
3674 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
3675
3676 * dbusbind.c (Fdbus_register_signal): Add match rule to
3677 Vdbus_registered_objects_table. (Bug#9581)
3678 (Fdbus_register_method, Vdbus_registered_objects_table):
3679 Fix docstring.
3680
3681 2011-09-24 Jim Meyering <meyering@redhat.com>
3682
3683 do not ignore write error for any output size
3684 The previous change was incomplete.
3685 While it makes emacs --batch detect the vast majority of stdout
3686 write failures, errors were still ignored whenever the output size is
3687 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
3688 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
3689 && echo FAIL: ignored write error
3690 FAIL: ignored write error
3691 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
3692 && echo FAIL: ignored write error
3693 FAIL: ignored write error
3694 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
3695
3696 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
3697
3698 * emacs.c (Fkill_emacs): In noninteractive mode exit
3699 non-successfully if a write error occurred on stdout. (Bug#9574)
3700
3701 2011-09-21 Eli Zaretskii <eliz@gnu.org>
3702
3703 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
3704 the xassert test.
3705
3706 * dispextern.h (struct it): Update the comment documenting what
3707 can it->OBJECT be.
3708
3709 2011-09-20 Eli Zaretskii <eliz@gnu.org>
3710
3711 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
3712 a display string, extend search for cursor position to end of row.
3713 (find_row_edges): If the row ends in a newline from a display
3714 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
3715 Handle the case of a display string with multiple newlines.
3716 (Fcurrent_bidi_paragraph_direction): Fix search for previous
3717 non-empty line. Fixes confusing cursor motion with arrow keys at
3718 the beginning of a line that starts with whitespace.
3719
3720 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
3721
3722 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
3723 (bug#9493).
3724
3725 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
3726
3727 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
3728 boolean (Bug#9154).
3729
3730 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3731
3732 * xdisp.c (display_line): Record maximum and minimum buffer
3733 positions even if no glyphs were produced (e.g., by a zero-width
3734 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
3735 buffer positions that will be removed from the glyph row because
3736 they don't fit.
3737 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
3738 column is beyond frame width: don't subtract 1 "pixel" when
3739 computing width of the stretch.
3740 (reseat_at_next_visible_line_start): Undo the change made on
3741 2011-09-17 that saved paragraph information and restored it after
3742 the call to `reseat'. (Bug#9545)
3743
3744 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3745
3746 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
3747 and turn window cursor on if cleared (Bug#9415).
3748
3749 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
3750
3751 * search.c (boyer_moore): Take unibyte characters from pattern
3752 literally. (Bug#9458)
3753
3754 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3755
3756 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
3757
3758 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
3759
3760 Fix minor problem found by static checking.
3761 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
3762 initialized, to pacify gcc -Wuninitialized.
3763
3764 * fileio.c: Report proper errno when syscall falls.
3765 (Finsert_file_contents): Save and restore errno,
3766 so that report_file_error outputs the correct diagnostic.
3767 (Fwrite_region) [CLASH_DETECTION]: Likewise.
3768
3769 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3770
3771 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
3772
3773 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3774
3775 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
3776 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
3777
3778 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3779
3780 * xdisp.c (reseat_at_next_visible_line_start): Keep information
3781 about the current paragraph and restore it after the call to reseat.
3782
3783 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
3784 (bidi_find_paragraph_start): Search back for paragraph beginning
3785 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
3786 (bidi_move_to_visually_next): Only trigger paragraph-related
3787 computations when the last character is a newline or at EOB, not
3788 just any NEUTRAL_B. (Bug#9470)
3789
3790 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
3791 truncated lines if point is covered by a display string. (Bug#9524)
3792
3793 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
3794
3795 * xselect.c: Relax test for outgoing X longs (Bug#9498).
3796 (cons_to_x_long): New function.
3797 (lisp_data_to_selection_data): Use it. Correct the test for
3798 short-versus-long data; it was negated. Break out of vector
3799 loop, for efficiency, when a long datum is discovered.
3800
3801 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
3802
3803 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
3804
3805 2011-09-16 Eli Zaretskii <eliz@gnu.org>
3806
3807 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
3808 GCC PR/17406) by declaring this function with external scope.
3809
3810 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3811
3812 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
3813 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
3814
3815 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
3816
3817 * editfns.c (Fformat): Correctly handle text properties on "%%".
3818
3819 2011-09-15 Eli Zaretskii <eliz@gnu.org>
3820
3821 * xterm.c (x_draw_composite_glyph_string_foreground):
3822 * w32term.c (x_draw_composite_glyph_string_foreground):
3823 * term.c (encode_terminal_code):
3824 * composite.c (composition_update_it, get_composition_id):
3825 * xdisp.c (get_next_display_element)
3826 (fill_composite_glyph_string): Add comments about special meaning
3827 of TAB characters in a composition.
3828
3829 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3830
3831 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
3832 This occurs when processing a multibyte format.
3833 Problem reported by Wolfgang Jenker.
3834
3835 2011-09-15 Johan Bockgård <bojohan@gnu.org>
3836
3837 * xdisp.c (try_cursor_movement): Only check for exact match if
3838 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
3839
3840 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3841
3842 Remove unused external symbols.
3843 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3844 * xdisp.c (calc_pixel_width_or_height): Now static.
3845 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3846 * indent.c (check_display_width):
3847 * w32term.c: Fix comment to match code.
3848 * xterm.c, xterm.h (x_catching_errors): Remove.
3849
3850 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3851
3852 * xselect.c: Use signed conversions more consistently (Bug#9498).
3853 (selection_data_to_lisp_data): Assume incoming selection data are
3854 signed integers, not unsigned. This is to be consistent with
3855 outgoing selection data, which was modified to use signed integers
3856 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3857 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
3858 expects long, not unsigned long.
3859
3860 2011-09-14 Eli Zaretskii <eliz@gnu.org>
3861
3862 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
3863 computation of loop end. Reported by Johan Bockgård
3864 <bojohan@gnu.org>.
3865
3866 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
3867
3868 * frame.c (Fother_visible_frames_p): Function deleted.
3869
3870 2011-09-12 Eli Zaretskii <eliz@gnu.org>
3871
3872 * indent.c (compute_motion): Process display vector front to back
3873 rather than the other way around. (Bug#2496)
3874
3875 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3876
3877 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
3878
3879 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
3880
3881 * minibuf.c (Fread_from_minibuffer): Doc fix.
3882
3883 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3884
3885 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
3886 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
3887
3888 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3889
3890 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
3891 value for non-existent files.
3892
3893 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3894
3895 * fileio.c (Finsert_file_contents): If the file cannot be opened,
3896 set its "size" to -1. This will set the modtime_size field of
3897 the corresponding buffer to -1, which is what
3898 verify-visited-file-modtime expects for files that do not exist.
3899 (Bug#9139)
3900
3901 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
3902
3903 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
3904 here ...
3905 * lisp.h: ... from here. push_key_description is no longer
3906 defined in keyboard.c, so its declaration should not be in
3907 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
3908 logically belongs with push_key_description.
3909
3910 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
3911
3912 * buffer.h: Include <sys/types.h> instead of <time.h>.
3913 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
3914 Problem reported by Herbert J. Skuhra.
3915
3916 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3917
3918 * xml.c (parse_region): Make the parsing work for
3919 non-comment-starting XML files again (bug#9144).
3920
3921 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3922
3923 * image.c (gif_load): Fix calculation of bottom and right corner.
3924 (Bug#9468)
3925
3926 2011-09-10 Eli Zaretskii <eliz@gnu.org>
3927
3928 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3929 redisplay in small windows.
3930
3931 2011-09-09 Eli Zaretskii <eliz@gnu.org>
3932
3933 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3934
3935 2011-09-08 Martin Rudalics <rudalics@gmx.at>
3936
3937 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3938 Operate on live windows only.
3939
3940 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
3941
3942 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3943
3944 2011-09-07 Eli Zaretskii <eliz@gnu.org>
3945
3946 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3947 only under bidi iteration.
3948
3949 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3950
3951 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3952
3953 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3954
3955 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3956 Without this fix, the command to link temacs failed due to an
3957 undefined symbol __builtin_isnan. This is because
3958 /usr/include/iso/math_c99.h #defines isnan(x) to
3959 __builtin_isnan(x), but the bundled gcc, which identifies itself
3960 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3961 a __builtin_isnan.
3962 * floatfns.c (isnan): #undef, and then #define to a clone of
3963 what's in data.c.
3964 (Fisnan): Always define, since it's always available now.
3965 (syms_of_floatfns): Always define isnan at the Lisp level.
3966
3967 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3968
3969 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
3970
3971 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3972
3973 * fileio.c: Fix bugs with large file offsets (Bug#9428).
3974 The previous code assumed that file offsets (off_t values) fit in
3975 EMACS_INT variables, which is not true on typical 32-bit hosts.
3976 The code messed up by falsely reporting buffer overflow in cases
3977 such as (insert-file-contents "big" nil 1 2) into an empty buffer
3978 when "big" contains more than 2**29 bytes, even though this
3979 inserts just one byte and does not overflow the buffer.
3980 (Finsert_file_contents): Store file offsets as off_t
3981 values, not as EMACS_INT values. Check for overflow when
3982 converting between EMACS_INT and off_t. When checking for
3983 buffer overflow or for overlap, take the offsets into account.
3984 Don't use EMACS_INT for small values where int suffices.
3985 When checking for overlap, fix a typo: ZV was used where
3986 ZV_BYTE was intended.
3987 (Fwrite_region): Don't assume off_t fits into 'long'.
3988 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
3989
3990 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
3991
3992 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
3993
3994 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3995
3996 sprintf-related integer and memory overflow issues (Bug#9412).
3997
3998 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
3999 (esprintf, exprintf, evxprintf): New functions.
4000 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
4001 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
4002 (modify_event_symbol): Do not assume that the length of
4003 name_alist_or_stem is safe to alloca and fits in int.
4004 (Fexecute_extended_command): Likewise for function name and binding.
4005 (Frecursion_depth): Wrap around reliably on integer overflow.
4006 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
4007 since some callers pass EMACS_INT values.
4008 (Fsingle_key_description): Don't crash if symbol name contains more
4009 than MAX_ALLOCA bytes.
4010 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
4011 (get_minibuffer): Arg is now EMACS_INT, not int.
4012 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
4013 (esprintf, exprintf, evxprintf): New decls.
4014 * window.h (command_loop_level, minibuf_level): Reflect API changes.
4015
4016 * dbusbind.c (signature_cat): New function.
4017 (xd_signature, Fdbus_register_signal):
4018 Do not overrun buffer; instead, report string overflow.
4019
4020 * dispnew.c (add_window_display_history): Don't overrun buffer.
4021 Truncate instead; this is OK since it's just a log.
4022
4023 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
4024 even if the time zone offset is outlandishly large.
4025 Don't mishandle offset == INT_MIN.
4026
4027 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
4028 when creating daemon; the previous buffer-overflow check was incorrect.
4029
4030 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
4031 which has the guts of the old verror function.
4032
4033 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
4034 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
4035
4036 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
4037 (font_unparse_xlfd): Don't blindly alloca long strings.
4038 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
4039 fits in int, when using sprintf. Use single snprintf to count
4040 length of string rather than counting it via multiple sprintfs;
4041 that's simpler and more reliable.
4042 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
4043 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
4044 sprintf, in case result does not fit in int.
4045
4046 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
4047 (fontset_from_font): Print it.
4048
4049 * frame.c (tty_frame_count): Now printmax_t, not int.
4050 (make_terminal_frame, set_term_frame_name): Print it.
4051 (x_report_frame_params): In X, window IDs are unsigned long,
4052 not signed long, so print them as unsigned.
4053 (validate_x_resource_name): Check for implausibly long names,
4054 and don't assume name length fits in 'int'.
4055 (x_get_resource_string): Don't blindly alloca invocation name;
4056 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
4057 not fit in int.
4058
4059 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
4060 (xg_check_special_colors, xg_set_geometry):
4061 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
4062
4063 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
4064 Use esprintf, not sprintf, in case result does not fit in int.
4065
4066 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4067 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
4068 it as a large positive number.
4069 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
4070 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4071
4072 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
4073 in case result does not fit in int.
4074
4075 * print.c (float_to_string): Detect width overflow more reliably.
4076 (print_object): Make sprintf buffer a bit bigger, to avoid potential
4077 buffer overrun. Don't assume list length fits in 'int'. Treat
4078 print length of 0 as 0, not as infinity; to be consistent with other
4079 uses of print length in this function. Don't overflow print length
4080 index. Don't assume hash table size fits in 'long', or that
4081 vectorlike size fits in 'unsigned long'.
4082
4083 * process.c (make_process): Use printmax_t, not int, to format
4084 process-name gensyms.
4085
4086 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
4087
4088 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
4089 to avoid potential buffer overrun.
4090
4091 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
4092 if X resource line is longer than 512 bytes.
4093
4094 * xfns.c (x_window): Make sprintf buffer a bit bigger
4095 to avoid potential buffer overrun.
4096
4097 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
4098
4099 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
4100
4101 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
4102
4103 Integer overflow fixes for scrolling, etc.
4104 Without these, Emacs silently mishandles large integers sometimes.
4105 For example, "C-u 4294967297 M-x recenter" was treated as if
4106 it were "C-u 1 M-x recenter" on a typical 64-bit host.
4107
4108 * xdisp.c (try_window_id): Check Emacs fixnum range before
4109 converting to 'int'.
4110
4111 * window.c (window_scroll_line_based, Frecenter):
4112 Check that an Emacs fixnum is in range before assigning it to 'int'.
4113 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
4114 values converted from Emacs fixnums.
4115 (Frecenter): Don't wrap around a line count if it is out of 'int'
4116 range; instead, treat it as an extreme value.
4117 (Fset_window_configuration, compare_window_configurations):
4118 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
4119
4120 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
4121 that can exceed INT_MAX. Check that EMACS_INT value is in range
4122 before assigning it to the (possibly-narrower) index.
4123 (match_limit): Don't assume that a fixnum can fit in 'int'.
4124
4125 * print.c (print_object): Use ptrdiff_t, not int, for index that can
4126 exceed INT_MAX.
4127
4128 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
4129 (Fvertical_motion): Don't wrap around LINES values that don't fit
4130 in 'int'. Instead, treat them as extreme values. This is good
4131 enough for windows, which can't have more than INT_MAX lines anyway.
4132
4133 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
4134
4135 * Require libxml/parser.h to avoid compilation warning.
4136
4137 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
4138
4139 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
4140 since this reportedly can destroy thread storage.
4141
4142 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
4143
4144 * syntax.c (find_defun_start): Update all cache variables if
4145 exiting early (Bug#9401).
4146
4147 2011-08-30 Eli Zaretskii <eliz@gnu.org>
4148
4149 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
4150
4151 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
4152 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
4153 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
4154
4155 * term.c (tty_append_glyph): New function.
4156 (produce_stretch_glyph): Static function and its prototype deleted.
4157
4158 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
4159 Add prototypes.
4160
4161 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
4162
4163 * image.c (parse_image_spec): Check for nonnegative, not for positive,
4164 when checking :margin (Bug#9390).
4165 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
4166 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
4167 so that the name doesn't mislead. All uses changed.
4168
4169 2011-08-28 Johan Bockgård <bojohan@gnu.org>
4170
4171 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
4172 set_tty_hooks.
4173
4174 2011-08-27 Eli Zaretskii <eliz@gnu.org>
4175
4176 * xdisp.c (move_it_to): Don't bail out early when reaching
4177 position beyond to_charpos, if we are scanning backwards.
4178 (move_it_vertically_backward): When DY == 0, make sure we get to
4179 the first character in the line after the newline.
4180
4181 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
4182
4183 * ccl.c: Improve and simplify overflow checking (Bug#9196).
4184 (ccl_driver): Do not generate an out-of-range pointer.
4185 (Fccl_execute_on_string): Remove unnecessary check for
4186 integer overflow, noted by Stefan Monnier in
4187 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
4188 Remove a FIXME that didn't need fixing.
4189 Simplify the newly-introduced buffer reallocation code.
4190
4191 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
4192
4193 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
4194
4195 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
4196
4197 Integer and memory overflow issues (Bug#9196).
4198
4199 * doc.c (get_doc_string): Rework so that
4200 get_doc_string_buffer_size is the actual buffer size, rather than
4201 being 1 less than the actual buffer size; this makes xpalloc more
4202 convenient.
4203
4204 * image.c (x_allocate_bitmap_record, cache_image):
4205 * xselect.c (Fx_register_dnd_atom):
4206 Simplify previous changes by using xpalloc.
4207
4208 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
4209 since either will do and ptrdiff_t is convenient with xpalloc.
4210
4211 * charset.c (charset_table_size)
4212 (struct charset_sort_data.priority): Now ptrdiff_t.
4213 (charset_compare): Don't overflow if priorities differ greatly.
4214 (Fsort_charsets): Don't assume list length fits in int.
4215 Check for size-calculation overflow when allocating sort data.
4216 (syms_of_charset): Allocate an initial charset table that is
4217 just under 64 KiB, to avoid problems with glibc malloc and mmap.
4218
4219 * cmds.c (internal_self_insert): Check for size-calculation overflow.
4220
4221 * composite.h (struct composition.glyph_len): Now int, not unsigned.
4222 The actual value is always <= INT_MAX, and leaving it unsigned made
4223 overflow checking harder.
4224
4225 * dispextern.h (struct glyph_matrix.rows_allocated)
4226 (struct face_cache.size): Now ptrdiff_t, for convenience in use
4227 with xpalloc. The values are still always <= INT_MAX.
4228
4229 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
4230
4231 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
4232 (SAFE_NALLOCA): New macro.
4233
4234 * region-cache.c (struct boundary.pos, find_cache_boundary)
4235 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
4236 (set_cache_region, invalidate_region_cache)
4237 (revalidate_region_cache, know_region_cache, region_cache_forward)
4238 (region_cache_backward, pp_cache):
4239 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
4240 so that ptrdiff_t * can be passed to xpalloc.
4241 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
4242 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
4243 (pp_cache): Don't assume cache_len fits in int.
4244 * region-cache.h: Adjust extern decls to match.
4245
4246 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
4247 EMACS_INT, since either will do, for xpalloc.
4248
4249 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
4250 (xnmalloc, xnrealloc, xpalloc): New functions.
4251
4252 * bidi.c (bidi_shelve_header_size): New constant.
4253 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
4254 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
4255
4256 * bidi.c (bidi_cache_shrink):
4257 * buffer.c (overlays_at, overlays_in, record_overlay_string)
4258 (overlay_strings):
4259 Don't update size of array until after memory allocation succeeds,
4260 because xmalloc/xrealloc may not return.
4261 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
4262 now that we have proper integer overflow checking.
4263 (record_overlay_string, overlay_strings): Catch overflows when
4264 calculating size of overlay_str_buf.
4265
4266 * callproc.c (Fcall_process): Check for size overflow when
4267 calculating size of args2.
4268 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
4269 Normally we prefer signed values, but sticking with ptrdiff_t would
4270 require adding more-complicated checks.
4271
4272 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
4273 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
4274 Redo buffer-overflow calculations to avoid integer overflow.
4275 Add a FIXME comment where memory seems to be over-allocated.
4276
4277 * character.c (Fstring): Check for size-calculation overflow.
4278
4279 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
4280 unnecessary integer overflow. Check for size overflow.
4281 (encode_coding_object): Don't update size until xmalloc succeeds.
4282
4283 * composite.c (get_composition_id): Check for overflow in glyph
4284 length calculations.
4285
4286 Integer and memory overflow fixes for display code.
4287 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
4288 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
4289 (scrolling_window): Check for overflow in size calculations.
4290 (line_draw_cost, realloc_glyph_pool, add_row_entry):
4291 Don't assume glyph table len fits in int.
4292 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
4293 (row_table_size): Now ptrdiff_t, not int.
4294 (scrolling_window): Avoid overflow in size calculations.
4295 Don't update size until allocation succeeds.
4296 * fns.c (concat): Check for overflow in size calculations.
4297 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
4298 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4299 (NEXT_ALMOST_PRIME_LIMIT): New constant.
4300
4301 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
4302 (get_doc_string): Check for size calculation overflow.
4303 Don't update size until allocation succeeds.
4304 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
4305 EMACS_INT, where ptrdiff_t will do.
4306 (Fsubstitute_command_keys): Check for string overflow.
4307
4308 * editfns.c (set_time_zone_rule): Don't assume environment length
4309 fits in int.
4310 (message_length): Now ptrdiff_t, not int.
4311 (Fmessage_box): Don't update size until allocation succeeds.
4312 Don't assume message length fits in int.
4313 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
4314
4315 * emacs.c (main): Do not reallocate argv, since there is a null at
4316 the end that can be overwritten, and this way there's no need to
4317 worry about size-calculation overflow.
4318 (sort_args): Check for size-calculation overflow.
4319
4320 * eval.c (init_eval_once, grow_specpdl): Don't update size until
4321 alloc succeeds.
4322 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
4323
4324 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
4325 (x_set_scroll_bar_width, x_figure_window_size):
4326 Check for integer overflow.
4327 (x_set_alpha): Do not assume XINT fits in int.
4328
4329 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
4330 This is for the members text_lines, text_cols, total_lines, total_cols,
4331 where the system imposes an 'int' limit.
4332
4333 * fringe.c (Fdefine_fringe_bitmap):
4334 Don't update size until alloc works.
4335
4336 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
4337 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
4338
4339 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
4340 Check for size-calculation overflow.
4341 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
4342 do, as we prefer signed integers.
4343 (id_to_widget.max_size, id_to_widget.used)
4344 (xg_store_widget_in_map, xg_remove_widget_from_map)
4345 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
4346 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
4347 Use and return ptrdiff_t, not int.
4348 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
4349 * gtkutil.h: Change prototypes to match the above.
4350
4351 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
4352 are duplicate now that they've been promoted to lisp.h.
4353 (x_allocate_bitmap_record, x_alloc_image_color)
4354 (make_image_cache, cache_image, xpm_load):
4355 Don't update size until alloc is done.
4356 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
4357 (x_detect_edges):
4358 Check for size calculation overflow.
4359 (ct_colors_allocated_max): New constant.
4360 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
4361 overflow.
4362
4363 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
4364 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
4365 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
4366 Use ptrdiff_t, not int, to count maps.
4367 (read_char_minibuf_menu_prompt): Check for overflow in size
4368 calculations. Don't update size until allocation succeeds.
4369 Redo calculations to avoid overflow.
4370 * keyboard.h: Change prototypes to match the above.
4371
4372 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
4373 to count maps.
4374 (current_minor_maps): Check for size calculation overflow.
4375 * keymap.h: Change prototypes to match the above.
4376
4377 * lread.c (read1, init_obarray): Don't update size until alloc done.
4378
4379 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
4380 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
4381
4382 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
4383 Now ptrdiff_t, not int.
4384 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
4385 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
4386
4387 * process.c (Fnetwork_interface_list): Check for overflow
4388 in size calculation.
4389
4390 * region-cache.c (move_cache_gap): Check for size calculation overflow.
4391
4392 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
4393 overflow. Don't bother calling xmalloc when xrealloc will do.
4394
4395 * search.c (Freplace_match): Check for size calculation overflow.
4396 (Fset_match_data): Don't assume list lengths fit in 'int'.
4397
4398 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
4399 for command line length. Do not attempt to address one before the
4400 beginning of an array, as that's not portable.
4401
4402 * term.c (max_frame_lines): Remove; unused.
4403 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
4404 not int.
4405 (encode_terminal_code, calculate_costs): Check for size
4406 calculation overflow.
4407 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
4408 table lengths and related sizes. Don't update size until alloc
4409 done. Redo calculations to avoid overflow.
4410 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
4411
4412 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
4413 subtracting pointers.
4414 (gobble_line): Check for overflow more carefully. Don't update size
4415 until alloc done.
4416
4417 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
4418 Don't update size until alloc done.
4419 Redo size calculations to avoid overflow.
4420 Check for size calculation overflow.
4421 (main) [DEBUG]: Fix typo in invoking tparam1.
4422
4423 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
4424 Use ptrdiff_t, not int, for sizes.
4425 (store_mode_line_noprop_char): Don't update size until alloc done.
4426
4427 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
4428 Use ptrdiff_t, not int, for sizes.
4429 (Finternal_make_lisp_face, cache_face):
4430 Check for size calculation overflow.
4431 (cache_face): Treat size calculation overflows as if they were
4432 memory exhaustion (the usual treatment), rather than aborting.
4433
4434 * xfns.c (x_encode_text, x_set_name_internal)
4435 (Fx_change_window_property): Use ptrdiff_t, not int, to count
4436 sizes, since they can exceed INT_MAX in size. Check for size
4437 calculation overflow.
4438
4439 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
4440 (xg_select): Check for size calculation overflow.
4441 Don't update size until alloc done.
4442
4443 * xrdb.c (get_environ_db): Don't assume path length fits in int,
4444 as sprintf is limited to int lengths.
4445
4446 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
4447 (X_LONG_MIN): New macros.
4448 Use them to make the following changes clearer.
4449 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
4450 This change doesn't affect the value now, but it may help remind
4451 future maintainers not to raise the value too much later.
4452 (SELECTION_QUANTUM): Remove, replacing with ...
4453 (selection_quantum): ... new function, which avoids overflow.
4454 All uses changed.
4455 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
4456 assumption that selection length fits in 'int'.
4457 (x_reply_selection_request, x_handle_selection_request)
4458 (x_get_window_property, receive_incremental_selection)
4459 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
4460 (lisp_data_to_selection_data, clean_local_selection_data):
4461 Use ptrdiff_t, not int, to record length of selection.
4462 (x_reply_selection_request, x_get_window_property)
4463 (receive_incremental_selection, x_property_data_to_lisp):
4464 Redo calculations to avoid overflow.
4465 (x_reply_selection_request): When sending hint, ceiling it at
4466 X_LONG_MAX rather than relying on wraparound overflow to send
4467 something.
4468 (x_get_window_property, receive_incremental_selection)
4469 (lisp_data_to_selection_data, x_property_data_to_lisp):
4470 Check for size-calculation overflow.
4471 (x_get_window_property, receive_incremental_selection)
4472 (lisp_data_to_selection_data, Fx_register_dnd_atom):
4473 Don't store size until memory allocation succeeds.
4474 (x_get_window_property): Plug memory leak on memory exhaustion.
4475 Don't double-block input; malloc is safe here. Don't assume 2**34
4476 - 4 fits in unsigned long. Add an xassert to check
4477 XGetWindowProperty overflow. Be more careful about overflow
4478 calculations, and distinguish size from memory overflow better.
4479 (receive_incremental_selection): When tracing, don't assume
4480 unsigned int is less than INT_MAX.
4481 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
4482 harmful) conversions of unsigned short to int.
4483 (lisp_data_to_selection_data): Don't assume that integers
4484 in the range -65535 through -1 fit in an X unsigned short.
4485 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
4486 result parameters unless successful. Rely on cons_to_unsigned
4487 to report problems with elements; the old code wasn't right anyway.
4488 (x_check_property_data): Check for int overflow; we cannot use
4489 a wider type due to X limits.
4490 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
4491
4492 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
4493
4494 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
4495 (x_term_init): Check for size calculation overflow.
4496 (x_color_cells): Don't store size until memory allocation succeeds.
4497 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
4498 Don't assume alloca size is less than MAX_ALLOCA.
4499 (x_term_init): Don't assume length fits in int (sprintf is limited
4500 to int size).
4501
4502 Use ptrdiff_t for composition IDs.
4503 * character.c (lisp_string_width):
4504 * composite.c (composition_table_size, n_compositions)
4505 (get_composition_id, composition_gstring_from_id):
4506 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
4507 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
4508 * window.c (Frecenter):
4509 Use ptrdiff_t, not int, for composition IDs.
4510 * composite.c (get_composition_id): Check for integer overflow.
4511 * composite.h: Adjust prototypes to match the above changes.
4512
4513 Use ptrdiff_t for hash table indexes.
4514 * category.c (hash_get_category_set):
4515 * ccl.c (ccl_driver):
4516 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
4517 * coding.c (coding_system_charset_list, detect_coding_system):
4518 * coding.h (struct coding_system.id):
4519 * composite.c (get_composition_id, gstring_lookup_cache):
4520 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
4521 * image.c (xpm_get_color_table_h):
4522 * lisp.h (hash_lookup, hash_put):
4523 * minibuf.c (Ftest_completion):
4524 Use ptrdiff_t for hash table indexes, not int (which is too
4525 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
4526 32-bit --with-wide-int hosts).
4527
4528 * charset.c (Fdefine_charset_internal): Check for integer overflow.
4529 Add a FIXME comment about memory leaks.
4530 (syms_of_charset): Don't assume xmalloc returns.
4531
4532 Don't assume that stated character widths fit in int.
4533 * character.c (Fchar_width, c_string_width, lisp_string_width):
4534 * character.h (CHAR_WIDTH):
4535 * indent.c (MULTIBYTE_BYTES_WIDTH):
4536 Use sanitize_char_width to avoid undefined and/or bad behavior
4537 with outlandish widths.
4538 * character.h (sanitize_tab_width): Rename from sanitize_width,
4539 now that we have two such functions. All uses changed.
4540 (sanitize_char_width): New inline function.
4541
4542 Don't assume that tab-width fits in int.
4543 * character.h (sanitize_width): New inline function.
4544 (SANE_TAB_WIDTH): New macro.
4545 (ASCII_CHAR_WIDTH): Use it.
4546 * indent.c (sane_tab_width): Remove. All uses replaced by
4547 SANE_TAB_WIDTH (current_buffer).
4548 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
4549
4550 * fileio.c: Integer overflow issues with file modes.
4551 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
4552
4553 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
4554 Remove unreachable code.
4555 (read_hex, load_charset_map_from_file): Check for integer overflow.
4556
4557 * xterm.c: Don't go over XClientMessageEvent limit.
4558 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
4559 (x_send_scroll_bar_event): Likewise. Check that the size does not
4560 exceed limits imposed by XClientMessageEvent, as well as the usual
4561 ptrdiff_t and size_t limits.
4562
4563 * keyboard.c: Overflow, signedness and related fixes.
4564 (make_lispy_movement): Use same integer type in forward decl
4565 that is used in the definition.
4566 (read_key_sequence, keyremap_step):
4567 Change bufsize argument back to int, undoing my 2011-03-30 change.
4568 We prefer signed types, and int is wide enough here.
4569 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
4570 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
4571 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
4572 length, not size_t. Use ptrdiff_t for index, not int.
4573 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
4574 possibility of integer overflow.
4575
4576 Overflow, signedness and related fixes for images.
4577
4578 * dispextern.h (struct it.stack[0].u.image.image_id)
4579 (struct_it.image_id, struct image.id, struct image_cache.size)
4580 (struct image_cache.used, struct image_cache.ref_count):
4581 * gtkutil.c (update_frame_tool_bar):
4582 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
4583 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
4584 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
4585 * nsmenu.m (update_frame_tool_bar):
4586 * xdisp.c (calc_pixel_width_or_height):
4587 * xfns.c (image_cache_refcount):
4588 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
4589 on typical 64-bit hosts.
4590
4591 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4592 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
4593 Omit unnecessary casts to int.
4594 (parse_image_spec): Check that integers fall into 'int' range
4595 when the callers expect that.
4596 (image_ascent): Redo ascent calculation to avoid int overflow.
4597 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
4598 (lookup_image): Remove unnecessary tests.
4599 (xbm_image_p): Locals are now of int, not EMACS_INT,
4600 since parse_image_check makes sure they fit into int.
4601 (png_load, gif_load, svg_load_image):
4602 Prefer int to unsigned where either will do.
4603 (tiff_handler): New function, combining the cores of the
4604 old tiff_error_handler and tiff_warning_handler.
4605 This function is rewritten to use vsnprintf and thereby avoid
4606 stack buffer overflows. It uses only the features of vsnprintf
4607 that are common to both POSIX and native Microsoft.
4608 (tiff_error_handler, tiff_warning_handler): Use it.
4609 (tiff_load, gif_load, imagemagick_load_image):
4610 Don't assume :index value fits in 'int'.
4611 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
4612 (imagemagick_load_image): Check that crop parameters fit into
4613 the integer types that MagickCropImage accepts. Don't assume
4614 Vimagemagick_render_type has a nonnegative value. Don't assume
4615 size_t fits in 'long'.
4616 (gs_load): Use printmax_t to print the widest integers possible.
4617 Check for integer overflow when computing image height and width.
4618
4619 2011-08-26 Eli Zaretskii <eliz@gnu.org>
4620
4621 * xdisp.c (redisplay_window): Don't force window start if point
4622 will be invisible in the resulting window. (Bug#9324)
4623
4624 2011-08-25 Eli Zaretskii <eliz@gnu.org>
4625
4626 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
4627 the display spec is of the form `(space ...)'.
4628 (handle_display_spec): Return the value returned by
4629 handle_single_display_spec, not just 1 or zero.
4630 (handle_single_display_spec): If the display spec is of the form
4631 `(space ...)', and specifies display in the text area, return 2
4632 rather than 1.
4633 (try_cursor_movement): Check for the need to scroll more
4634 accurately, and prefer exact match for point under bidi.
4635 Don't advance `row' beyond the last row of the window.
4636
4637 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
4638 into disp_prop; all users changed.
4639
4640 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
4641 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
4642 for the text covered by the display property.
4643
4644 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
4645
4646 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4647 Change return value to nil.
4648 (Frecord_buffer): Delete unused function.
4649
4650 2011-08-24 Eli Zaretskii <eliz@gnu.org>
4651
4652 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
4653 buffers, return left-to-right.
4654 (set_cursor_from_row): Consider candidate row a win if its glyph
4655 represents a newline and point is on that newline. Fixes cursor
4656 positioning on the newline at EOL of R2L text within L2R
4657 paragraph, and vice versa.
4658 (try_cursor_movement): Check continued rows, in addition to
4659 continuation rows. Fixes unwarranted scroll when point enters a
4660 continued line of R2L text within an L2R paragraph, or vice versa.
4661 (cursor_row_p): Consider the case of point being equal to
4662 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
4663 from the end of a short line to the beginning of a continued line
4664 of R2L text within L2R paragraph.
4665 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
4666 composed characters.
4667
4668 * bidi.c (bidi_check_type): Use xassert.
4669 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
4670 members.
4671
4672 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4673
4674 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
4675 a character.
4676
4677 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
4678
4679 * nsfont.m (ns_otf_to_script): Fix typo.
4680
4681 2011-08-22 Kenichi Handa <handa@m17n.org>
4682
4683 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4684 extra slot even if the purpose is char-code-property-table.
4685
4686 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4687
4688 * xdisp.c (redisplay_window): When computing centering_position,
4689 account for the height of the header line. (Bug#8874)
4690
4691 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4692 instead of CHAR_TO_BYTE. Fixes a crash when a completion
4693 candidate is selected by the mouse, and that candidate has a
4694 composed character under the mouse.
4695
4696 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
4697 coordinates reported by pos-visible-in-window-p for a composed
4698 character in column zero.
4699
4700 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
4701
4702 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
4703
4704 2011-08-22 Eli Zaretskii <eliz@gnu.org>
4705
4706 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
4707 consider it a hit if to_charpos is anywhere in the range of the
4708 composed buffer positions.
4709
4710 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
4711
4712 * image.c (gif_load): Don't assume that each subimage has the same
4713 dimensions as the base image. Handle disposal method that is
4714 "undefined" by the gif spec (Bug#9335).
4715
4716 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
4717
4718 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
4719 (Fcondition_case): Document `debug' symbol in error handler.
4720
4721 2011-08-19 Eli Zaretskii <eliz@gnu.org>
4722
4723 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4724 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
4725 from an Org mode buffer to a Speedbar frame.
4726
4727 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4728 a composition, take its buffer position from IT->cmp_it.charpos.
4729 Fixes cursor positioning at the beginning of a line that begins
4730 with a composed character.
4731
4732 2011-08-18 Eli Zaretskii <eliz@gnu.org>
4733
4734 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
4735 character bidirectional type, use STRONG_L instead. Fixes crashes
4736 in a buffer produced by `describe-categories'.
4737
4738 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
4739 members before the level stack, so they would be saved and
4740 restored when copying iterator state. Fixes incorrect reordering
4741 around TABs covered by display properties.
4742
4743 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
4744
4745 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
4746
4747 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
4748
4749 * eval.c (internal_condition_case, internal_condition_case_1)
4750 (internal_condition_case_2, internal_condition_case_n):
4751 Remove unnecessary aborts (Bug#9081).
4752
4753 2011-08-17 Eli Zaretskii <eliz@gnu.org>
4754
4755 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4756 has no `load' handler, try opening the file locally. (Bug#9311)
4757
4758 2011-08-16 Ken Brown <kbrown@cornell.edu>
4759
4760 * gmalloc.c: Expand comment.
4761
4762 2011-08-16 Eli Zaretskii <eliz@gnu.org>
4763
4764 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
4765 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
4766
4767 2011-08-16 Ken Brown <kbrown@cornell.edu>
4768
4769 Fix memory allocation problems in Cygwin build (Bug#9273).
4770
4771 * unexcw.c ( __malloc_initialized): Declare external variable.
4772 (fixup_executable): Force the dumped emacs to reinitialize malloc.
4773
4774 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
4775 New variables.
4776 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
4777 dumped emacs.
4778 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
4779 in the static heap.
4780 [CYGWIN] (special_realloc): New function.
4781 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
4782 requests to realloc storage in the static heap.
4783
4784 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 * bidi.c (bidi_initialize): Remove unused local.
4787
4788 2011-08-15 Eli Zaretskii <eliz@gnu.org>
4789
4790 * bidimirror.h:
4791 * biditype.h: Remove file.
4792 * makefile.w32-in ($(BLD)/bidi.$(O)):
4793 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
4794
4795 * dispextern.h: Fix a typo in the comment to bidi_type_t.
4796
4797 * chartab.c: Improve commentary for the uniprop_table API.
4798
4799 * bidi.c (bidi_paragraph_init): Support zero value of
4800 bidi_ignore_explicit_marks_for_paragraph_level.
4801 (bidi_initialize): Use uniprop_table instead of including
4802 biditype.h and bidimirror.h.
4803
4804 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
4805 coordinates of the iterator when restoring from ppos_it.
4806 (Bug#9296)
4807
4808 2011-08-14 Kenichi Handa <handa@m17n.org>
4809
4810 * process.c (create_process): Call setup_process_coding_systems
4811 after the pid of the process is set to -1 (Bug#8162).
4812
4813 2011-08-14 Eli Zaretskii <eliz@gnu.org>
4814
4815 * xdisp.c (move_it_in_display_line_to): Don't invoke
4816 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
4817 ppos_it. Fixes vertical cursor motion when line beginning is
4818 covered by an image. (Bug#9296)
4819
4820 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
4821
4822 * nsterm.h (ns_run_ascript): Declare.
4823 (NSAPP_DATA2_RUNASSCRIPT): Define.
4824
4825 * nsfns.m (as_script, as_result, as_status): New static variables.
4826 (ns_run_ascript): New function.
4827 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
4828 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
4829 the event loop. Get status from as_status (Bug#7276).
4830
4831 * nsterm.m (sendEvent): If event is NSApplicationDefined and
4832 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
4833 the event loop (Bug#7276).
4834
4835 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
4836
4837 * gnutls.c (QCgnutls_bootprop_priority)
4838 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
4839 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
4840 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
4841 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
4842 (QCgnutls_bootprop_verify_hostname_error)
4843 (QCgnutls_bootprop_callbacks_verify): Rename from
4844 Qgnutls_bootprop_..., all uses changed.
4845
4846 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4847 uses changed.
4848
4849 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4850
4851 * xfaces.c (Qframe_set_background_mode): Now static.
4852 * dispextern.h (Qframe_set_background_mode): Remove decl.
4853
4854 * process.c (Fnetwork_interface_info): Declare local only if needed.
4855
4856 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4857
4858 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
4859 (Fnetwork_interface_list): Allocate in increments of bytes instead
4860 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
4861 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
4862 sockaddr.
4863 (struct ifflag_def): notrailers is smart on OSX.
4864 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
4865 Get hardware address with getifaddrs if available.
4866
4867 2011-08-12 Eli Zaretskii <eliz@gnu.org>
4868
4869 * xdisp.c (iterate_out_of_display_property): xassert that
4870 IT->position is set to within IT->object's boundaries. Break from
4871 the loop as soon as EOB is reached; avoids infloops in redisplay
4872 when IT->position is set up wrongly due to some bug.
4873 Set IT->current to match the bidi iterator unconditionally.
4874 (push_display_prop): Allow GET_FROM_STRING as IT->method on
4875 entry. Force push_it to save on the stack the current
4876 buffer/string position, to be restored by pop_it. Fix flags in
4877 the iterator structure wrt the object coming from a display
4878 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
4879 properties. (Bug#9284)
4880
4881 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
4882
4883 * fontset.c (fontset_get_font_group): Add proper type checks.
4884 (Bug#9172)
4885
4886 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4887
4888 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
4889 and LC_VERSION_MIN_MACOSX.
4890 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
4891 (dump_it) [LC_FUNCTION_STARTS]: Use it.
4892
4893 2011-08-08 Eli Zaretskii <eliz@gnu.org>
4894
4895 * xdisp.c (forward_to_next_line_start): Allow to use the
4896 no-display-properties-and-no-overlays under bidi display.
4897 Set disp_pos in the bidi iterator to avoid searches for display
4898 properties and overlays.
4899
4900 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
4901
4902 * editfns.c (Fset_time_zone_rule): Document relationship with the
4903 setenv function.
4904
4905 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
4906 the font entity extracted from the cache (Bug#8109).
4907
4908 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
4909
4910 * composite.c (autocmp_chars): Don't reset point. That is done by
4911 restore_point_unwind (Bug#5984).
4912
4913 2011-08-07 Juri Linkov <juri@jurta.org>
4914
4915 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
4916 to show the arg `TIME' instead of `TIMEVAL'.
4917
4918 2011-08-06 Eli Zaretskii <eliz@gnu.org>
4919
4920 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4921 display property strides EOL and includes a newline, as in
4922 longlines-mode. (Bug#9254)
4923 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4924 word-wrap under bidirectional display. (Bug#9224)
4925
4926 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4927 is non-zero, even if the data buffer is NULL. Fixes a crash in
4928 vertical-motion with longlines-mode. (Bug#9254)
4929
4930 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4931
4932 * bidi.c <bidi_cache_total_alloc>: Now static.
4933 (bidi_initialize): Initialize bidi_cache_total_alloc.
4934
4935 * xdisp.c (display_line): Release buffer allocated for shelved bidi
4936 cache. (Bug#9221)
4937
4938 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4939 amount allocated this far in `bidi_cache_total_alloc'.
4940 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4941 non-zero, only free the data buffer without restoring the cache
4942 contents. All callers changed.
4943
4944 * dispextern.h (bidi_unshelve_cache): Update prototype.
4945
4946 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4947 (move_it_in_display_line, move_it_to)
4948 (move_it_vertically_backward, move_it_by_lines): Replace the call
4949 to xfree to an equivalent call to bidi_unshelve_cache.
4950 (move_it_in_display_line_to): Fix logic of returning
4951 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
4952
4953 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4954
4955 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4956 came from a string character with a `cursor' property. (Bug#9229)
4957
4958 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4959
4960 * Makefile.in (LIB_PTHREAD): New variable.
4961 (LIBES): Add LIB_PTHREAD (Bug#9216).
4962
4963 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4964 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4965
4966 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
4967
4968 * regex.c (re_iswctype): Remove some redundant boolean conversions.
4969
4970 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4971
4972 * xterm.c (x_find_topmost_parent): New function.
4973 (x_set_frame_alpha): Find topmost parent window with
4974 x_find_topmost_parent and set the property there also (bug#9181).
4975 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
4976
4977 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
4978
4979 * callproc.c (Fcall_process): Avoid vfork clobbering
4980 the local vars buffer, coding_systems, current_dir.
4981
4982 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
4983
4984 * keymap.c (Fmake_composed_keymap): Move to subr.el.
4985
4986 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
4989 so that it is not optimized away.
4990
4991 * xdisp.c (compute_display_string_pos): Remove unused local.
4992
4993 2011-08-02 Eli Zaretskii <eliz@gnu.org>
4994
4995 Fix slow cursor motion and scrolling in large buffers with
4996 selective display, like Org Mode buffers. (Bug#9218)
4997
4998 * dispextern.h (struct bidi_it): New member disp_prop_p.
4999
5000 * xdisp.c: Remove one-slot cache of display string positions.
5001 (compute_display_string_pos): Accept an additional argument
5002 DISP_PROP_P; callers changed. Scan at most 5K characters forward
5003 for a display string or property. If found, set DISP_PROP_P
5004 non-zero.
5005
5006 * bidi.c (bidi_fetch_char): Accept an additional argument
5007 DISP_PROP_P, and pass it to compute_display_string_pos.
5008 Only handle text covered by a display string if DISP_PROP_P is returned
5009 non-zero. All callers of bidi_fetch_char changed.
5010
5011 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
5012
5013 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
5014
5015 2010-12-03 Don March <don@ohspite.net>
5016
5017 * keymap.c (Fdefine_key): Fix non-prefix key error message when
5018 last character M-[char] is translated to ESC [char] (bug#7541).
5019
5020 2011-08-02 Kenichi Handa <handa@m17n.org>
5021
5022 * lisp.h (uniprop_table): Extern it.
5023
5024 * chartab.c (uniprop_table): Make it non-static.
5025
5026 2011-08-01 Eli Zaretskii <eliz@gnu.org>
5027
5028 * xdisp.c (forward_to_next_line_start): Accept additional argument
5029 BIDI_IT_PREV, and store into it the state of the bidi iterator had
5030 on the newline.
5031 (reseat_at_next_visible_line_start): Use the bidi iterator state
5032 returned by forward_to_next_line_start to restore the state of
5033 it->bidi_it after backing up to previous newline. (Bug#9212)
5034
5035 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
5036
5037 * regex.c (re_comp): Protoize.
5038 (re_exec): Fix return type.
5039 (regexec): Fix type of `ret'. (Bug#9203)
5040
5041 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5042
5043 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
5044 This is needed if max-image-size is a floating-point number.
5045
5046 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5047
5048 * print.c (print_object): Print empty symbol as ##.
5049
5050 * lread.c (read1): Read ## as empty symbol.
5051
5052 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
5053
5054 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
5055 setting frame foreground color (Bug#9175).
5056 (x_set_background_color): Likewise.
5057
5058 * nsmenu.m (-setText): Size tooltip dimensions precisely to
5059 contents (Bug#9176).
5060 (EmacsTooltip -init): Remove bezels and add shadows to
5061 tooltip windows.
5062
5063 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
5064 or scroll bar (Bug#8470).
5065
5066 * nsfont.m (nsfont_open): Remove assignment to voffset and
5067 unnecessary vars hshink, expand, hd, full_height, min_height.
5068 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
5069
5070 * nsterm.h (nsfont_info): Remove voffset field.
5071
5072 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
5073
5074 Implement strike-through and overline on NextStep (Bug#8863).
5075
5076 * nsfont.m (nsfont_open): Use underline position provided by font,
5077 instead of hard-coded value of 2.
5078 (nsfont_draw): Call ns_draw_text_decoration instead.
5079
5080 * nsterm.h: Add declaration for ns_draw_text_decoration.
5081
5082 * nsterm.m (ns_draw_text_decoration): New function for drawing
5083 underline, overline, and strike-through.
5084 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
5085 ns_draw_text_decoration. Change treatment of cursor drawing to
5086 accommodate underlining, etc.
5087
5088 2011-07-28 Eli Zaretskii <eliz@gnu.org>
5089
5090 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
5091 default.
5092
5093 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5094
5095 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
5096 Without this fix, if a signal arrives just after memory fills up,
5097 'malloc' might be invoked reentrantly.
5098
5099 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
5100 In other words, assume that every image size is allowed, on non-X
5101 hosts. This assumption is probably wrong, but it lets Emacs compile.
5102
5103 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5104
5105 * regex.c (re_iswctype): Convert return values to boolean.
5106
5107 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
5108
5109 * xdisp.c (compute_display_string_pos): Don't use cached display
5110 string position if the buffer had its restriction changed.
5111 (Bug#9184)
5112
5113 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5114
5115 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5116
5117 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5118
5119 Integer signedness and overflow and related fixes. (Bug#9079)
5120
5121 * bidi.c: Integer size and overflow fixes.
5122 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
5123 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
5124 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5125 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
5126 (bidi_find_other_level_edge):
5127 Use ptrdiff_t instead of EMACS_INT where either will do.
5128 This works better on 32-bit hosts configured --with-wide-int.
5129 (bidi_cache_ensure_space): Check for size-calculation overflow.
5130 Use % rather than repeated addition, for better worst-case speed.
5131 Don't set bidi_cache_size until after xrealloc returns, because it
5132 might not return.
5133 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
5134 (bidi_cache_ensure_space): Also check that the bidi cache size
5135 does not exceed that of the largest Lisp string or buffer. See Eli
5136 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
5137
5138 * alloc.c (__malloc_size_t): Remove.
5139 All uses replaced by size_t. See Andreas Schwab's note
5140 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
5141
5142 * image.c: Improve checking for integer overflow.
5143 (check_image_size): Assume that f is nonnull, since
5144 it is always nonnull in practice. This is one less thing to
5145 worry about when checking for integer overflow later.
5146 (x_check_image_size): New function, which checks for integer
5147 overflow issues inside X.
5148 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
5149 This removes the need for a memory_full check.
5150 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
5151 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
5152 (xbm_read_bitmap_data): Change locals back to 'int', since
5153 their values must fit in 'int'.
5154 (xpm_load_image, png_load, tiff_load):
5155 Invoke x_create_x_image_and_pixmap earlier,
5156 to avoid much needless work if the image is too large.
5157 (tiff_load): Treat overly large images as if
5158 x_create_x_image_and_pixmap failed, not as malloc failures.
5159 (gs_load): Use x_check_image_size.
5160
5161 * gtkutil.c: Omit integer casts.
5162 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
5163 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
5164
5165 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
5166
5167 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
5168 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
5169 would wrongly return t on a 64-bit host.
5170
5171 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
5172 The plain *_OVERFLOW macros run afoul of GCC bug 49705
5173 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
5174 and therefore cause GCC to emit a bogus diagnostic in some cases.
5175
5176 * image.c: Integer signedness and overflow and related fixes.
5177 This is not an exhaustive set of fixes, but it's time to
5178 record what I've got.
5179 (lookup_pixel_color, check_image_size): Remove redundant decls.
5180 (check_image_size): Don't assume that arbitrary EMACS_INT values
5181 fit in 'int', or that arbitrary 'double' values fit in 'int'.
5182 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
5183 (tiff_load, imagemagick_load_image):
5184 Check for overflow in size calculations.
5185 (x_create_x_image_and_pixmap): Remove unnecessary test for
5186 xmalloc returning NULL; that can't happen.
5187 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
5188 (xpm_color_bucket): Use better integer hashing function.
5189 (xpm_cache_color): Don't possibly over-allocate memory.
5190 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
5191 (gif_memory_source):
5192 Use ptrdiff_t, not int or size_t, to record sizes.
5193 (png_load): Don't assume values greater than 2**31 fit in 'int'.
5194 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
5195 either works, as we prefer signed integers.
5196 (tiff_read_from_memory, tiff_write_from_memory):
5197 Return tsize_t, not size_t, since that's what the TIFF API wants.
5198 (tiff_read_from_memory): Don't fail simply because the read would
5199 go past EOF; instead, return a short read.
5200 (tiff_load): Omit no-longer-needed casts.
5201 (Fimagemagick_types): Don't assume size fits into 'int'.
5202
5203 Improve hashing quality when configured --with-wide-int.
5204 * fns.c (hash_string): New function, taken from sxhash_string.
5205 Do not discard information about ASCII character case; this
5206 discarding is no longer needed.
5207 (sxhash-string): Use it. Change sig to match it. Caller changed.
5208 * lisp.h: Declare it.
5209 * lread.c (hash_string): Remove, since we now use fns.c's version.
5210 The fns.c version returns a wider integer if --with-wide-int is
5211 specified, so this should help the quality of the hashing a bit.
5212
5213 * emacs.c: Integer overflow minor fix.
5214 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
5215 Define only if GNU_LINUX.
5216 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
5217
5218 * dispnew.c: Integer signedness and overflow fixes.
5219 Remove unnecessary forward decls, that were a maintenance hassle.
5220 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
5221 All uses changed.
5222 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
5223 (scrolling_window): Use ptrdiff_t, not int, for byte count.
5224 (prepare_desired_row, line_draw_cost):
5225 Use int, not unsigned, where either works.
5226 (save_current_matrix, restore_current_matrix):
5227 Use ptrdiff_t, not size_t, where either works.
5228 (init_display): Check for overflow more accurately, and without
5229 relying on undefined behavior.
5230
5231 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
5232 Remove, replacing with the new symbols in lisp.h. All uses changed.
5233 * fileio.c (make_temp_name):
5234 * filelock.c (lock_file_1, lock_file):
5235 * xdisp.c (message_dolog):
5236 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
5237 Use pMd etc. instead.
5238 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
5239 replacing the pWIDE etc. symbols removed from editfns.c.
5240
5241 * keyboard.h (num_input_events): Now uintmax_t.
5242 This is (very slightly) less likely to mess up due to wraparound.
5243 All uses changed.
5244
5245 * buffer.c: Integer signedness fixes.
5246 (alloc_buffer_text, enlarge_buffer_text):
5247 Use ptrdiff_t rather than size_t when either will do, as we prefer
5248 signed integers.
5249
5250 * alloc.c: Integer signedness and overflow fixes.
5251 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
5252 (__malloc_size_t): Default to size_t, not to int.
5253 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
5254 (Fgarbage_collect, mark_object_loop_halt, mark_object):
5255 Prefer ptrdiff_t to size_t when either would do, as we prefer
5256 signed integers.
5257 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
5258 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
5259 Now const. Initialize with values that are in range even if char
5260 is signed.
5261 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
5262 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
5263 These functions do the right thing with sizes > 2**32.
5264 (check_depth): Now ptrdiff_t, not int.
5265 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
5266 Adjust to new way of storing sizes. Check for size overflow bugs
5267 in rest of code.
5268 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
5269 slightly wrong anyway, as it missed one instance of
5270 XMALLOC_OVERRUN_CHECK_OVERHEAD.
5271 (refill_memory_reserve): Omit needless cast to size_t.
5272 (mark_object_loop_halt): Mark as externally visible.
5273
5274 * xselect.c: Integer signedness and overflow fixes.
5275 (Fx_register_dnd_atom, x_handle_dnd_message):
5276 Use ptrdiff_t, not size_t, since we prefer signed.
5277 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
5278 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
5279 x_dnd_atoms_size and x_dnd_atoms_length.
5280
5281 * doprnt.c: Prefer signed to unsigned when either works.
5282 * eval.c (verror):
5283 * doprnt.c (doprnt):
5284 * lisp.h (doprnt):
5285 * xdisp.c (vmessage):
5286 Use ptrdiff_t, not size_t, when using or implementing doprnt,
5287 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
5288 prefer signed arithmetic to avoid comparison confusion.
5289 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
5290 but is a bit tricky.
5291
5292 Assume freestanding C89 headers, string.h, stdlib.h.
5293 * data.c, doprnt.c, floatfns.c, print.c:
5294 Include float.h unconditionally.
5295 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
5296 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
5297 * regex.c: Likewise for stddef.h, string.h.
5298 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
5299 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
5300 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
5301 (STDC_HEADERS): Remove obsolete defines.
5302 * sysdep.c: Include limits.h unconditionally.
5303
5304 Assume support for memcmp, memcpy, memmove, memset.
5305 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
5306 * regex.c (memcmp, memcpy):
5307 Remove; we assume C89 now.
5308
5309 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
5310 (__malloc_safe_bcopy): Remove; no longer needed.
5311
5312 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
5313 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
5314 well either way, and we prefer signed to unsigned.
5315
5316 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
5317
5318 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
5319 closes the connection while we're reading (bug#9182).
5320
5321 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
5322
5323 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
5324 are specified (Bug#9168).
5325
5326 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
5327
5328 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
5329 Found by GCC static checking and --with-wide-int on a 32-bit host.
5330
5331 2011-07-25 Eli Zaretskii <eliz@gnu.org>
5332
5333 * xdisp.c (compute_display_string_pos): Fix logic of caching
5334 previous display string position. Initialize cached_prev_pos to
5335 -1. Fixes slow-down at the beginning of a buffer.
5336
5337 2011-07-24 Eli Zaretskii <eliz@gnu.org>
5338
5339 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
5340 for attrs[LFACE_FONTSET_INDEX].
5341
5342 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
5343
5344 * xml.c (parse_region): Remove unused local
5345 that was recently introduced.
5346
5347 2011-07-23 Eli Zaretskii <eliz@gnu.org>
5348
5349 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
5350 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
5351
5352 * xdisp.c (move_it_in_display_line_to): Record the best matching
5353 position for TO_CHARPOS while scanning the line, and restore it on
5354 exit if none of the characters scanned was an exact match.
5355 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
5356 when exact match is impossible due to invisible text, and the
5357 lines are truncated.
5358
5359 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
5360
5361 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
5362 for OSX >= 10.7.
5363
5364 2011-07-22 Eli Zaretskii <eliz@gnu.org>
5365
5366 Fix a significant slow-down of cursor motion with C-n, C-p,
5367 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
5368 auto-repeat under bidi redisplay in fontified buffers.
5369 * xdisp.c (compute_stop_pos_backwards): New function.
5370 (next_element_from_buffer): Call compute_stop_pos_backwards to
5371 find a suitable prev_stop when we find ourselves before
5372 base_level_stop.
5373 (reseat): Don't look for prev_stop, as that could mean a very long
5374 run.
5375 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
5376 <cached_disp_overlay_modiff>: Cache for last found display string
5377 position.
5378 (compute_display_string_pos): Return the cached position if asked
5379 about the same buffer in the same area of character positions, and
5380 the buffer wasn't changed since the time the display string
5381 position was cached.
5382
5383 2011-07-22 Eli Zaretskii <eliz@gnu.org>
5384
5385 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
5386 is an integer, which is important for empty lines. (Bug#9149)
5387
5388 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
5389
5390 * frame.c (Fmodify_frame_parameters): In tty case, update the
5391 default face if necessary (Bug#4238).
5392
5393 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
5394
5395 * editfns.c (Fstring_to_char): No need to explain what a character
5396 is in the docstring (Bug#6576).
5397
5398 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5399
5400 * xml.c (parse_region): Make sure we always return a tree.
5401
5402 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
5403
5404 * xml.c (parse_region): If a document contains only comments,
5405 return that, too.
5406
5407 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5408
5409 * xml.c (make_dom): Return comments, too.
5410
5411 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
5412
5413 Port to OpenBSD.
5414 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
5415 and the surrounding thread.
5416 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
5417 rather than fgets, and retry after EINTR. Otherwise, 'emacs
5418 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
5419 timer goes off.
5420 * s/openbsd.h (BROKEN_SIGIO): Define.
5421 * unexelf.c (unexec) [__OpenBSD__]:
5422 Don't update the .mdebug section of the Alpha COFF symbol table.
5423
5424 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5425
5426 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
5427 (bug#8460).
5428
5429 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
5430
5431 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
5432 This fixes some race conditions on the permissions of any newly
5433 created file.
5434
5435 * alloc.c (valid_pointer_p): Use pipe, not open.
5436 This fixes some permissions issues when debugging.
5437
5438 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
5439 If fchown fails to set both uid and gid, try to set just gid,
5440 as that is sometimes allowed. Adjust the file's mode to eliminate
5441 setuid or setgid bits that are inappropriate if fchown fails.
5442
5443 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5444
5445 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
5446 to compare Lisp_Objects.
5447 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
5448 global_gnutls_log_level, don't mistake it for a Lisp_Object.
5449 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
5450
5451 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
5452
5453 * lread.c (read_integer): Unread even EOF character.
5454 (read1): Likewise. Properly record start position of symbol.
5455
5456 * lread.c (read1): Read `#:' as empty uninterned symbol if no
5457 symbol character follows.
5458
5459 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
5460
5461 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
5462 This works around a problem with the previous change to Fcopy_file.
5463 Recent glibc declares fchown with __attribute__((warn_unused_result)),
5464 and without this change, GCC might complain about discarding
5465 fchown's return value.
5466
5467 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
5468
5469 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
5470
5471 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
5472
5473 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
5474
5475 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
5476
5477 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
5478 it's used from the C level.
5479
5480 * process.c: Use the same condition for POLL_FOR_INPUT in both
5481 keyboard.c and process.c (bug#1858).
5482
5483 2011-07-09 Lawrence Mitchell <wence@gmx.li>
5484
5485 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
5486 (Fgnutls_boot): Use it.
5487
5488 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
5489
5490 * doc.c (Fsubstitute_command_keys): Revert last change.
5491
5492 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
5493
5494 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
5495 quotes the next character, and doesn't affect other longer
5496 sequences (bug#8935).
5497
5498 * lread.c (syms_of_lread): Clarify that is isn't only
5499 `eval-buffer' and `eval-defun' that's affected by
5500 `lexical-binding' (bug#8460).
5501
5502 2011-07-15 Eli Zaretskii <eliz@gnu.org>
5503
5504 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
5505 bidi redisplay when a line includes both an image and is truncated.
5506
5507 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
5508
5509 Fix minor problems found by static checking.
5510 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
5511 (elsz): Now a signed constant, not a size_t var. We prefer signed
5512 types to unsigned, to avoid integer comparison confusion. Without
5513 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
5514 "cannot optimize loop, the loop counter may overflow", a symptom
5515 of the confusion.
5516 * indent.c (Fvertical_motion): Mark locals as initialized.
5517 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
5518
5519 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5520
5521 * search.c (Fre_search_backward): Mention `case-fold-search' in
5522 all the re_search_* functions (bug#8138).
5523
5524 * keyboard.c (Fopen_dribble_file): Document when the file is
5525 closed (bug#8056).
5526
5527 2011-07-14 Eli Zaretskii <eliz@gnu.org>
5528
5529 * bidi.c (bidi_dump_cached_states): Fix format of displaying
5530 bidi_cache_idx.
5531
5532 Support bidi reordering of display and overlay strings.
5533 * xdisp.c (compute_display_string_pos)
5534 (compute_display_string_end): Accept additional argument STRING.
5535 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
5536 (reseat_to_string): Initialize bidi_it->string.s and
5537 bidi_it->string.schars.
5538 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
5539 NULL (avoids a crash in bidi_paragraph_init).
5540 Initialize itb.string.lstring.
5541 (init_iterator): Call bidi_init_it only of a valid
5542 buffer position was specified. Initialize paragraph_embedding to
5543 L2R.
5544 (reseat_to_string): Initialize the bidi iterator.
5545 (display_string): If we need to ignore text properties of
5546 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
5547 original value of -1 will not work with bidi.)
5548 (compute_display_string_pos): First arg is now struct
5549 `text_pos *'; all callers changed. Support display properties on
5550 Lisp strings.
5551 (compute_display_string_end): Support display properties on Lisp
5552 strings.
5553 (init_iterator, reseat_1, reseat_to_string): Initialize the
5554 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
5555 when iterating on a string not from display properties).
5556 (compute_display_string_pos, compute_display_string_end):
5557 Fix calculation of the object to scan. Fixes an error when using
5558 arrow keys.
5559 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
5560 base_level_stop; instead, set base_level_stop to BEGV.
5561 Fixes crashes in vertical-motion.
5562 (next_element_from_buffer): Improve commentary for when
5563 the iterator is before prev_stop.
5564 (init_iterator): Initialize bidi_p from the default value of
5565 bidi-display-reordering, not from buffer-local value. Use the
5566 buffer-local value only if initializing for buffer iteration.
5567 (handle_invisible_prop): Support invisible properties on strings
5568 that are being bidi-reordered.
5569 (set_iterator_to_next): Support bidi reordering of C strings and
5570 Lisp strings.
5571 (next_element_from_string): Support bidi reordering of Lisp
5572 strings.
5573 (handle_stop_backwards): Support Lisp strings as well.
5574 (display_string): Support display of R2L glyph rows.
5575 Use IT_STRING_CHARPOS when displaying from a Lisp string.
5576 (init_iterator): Don't initialize it->bidi_p for strings
5577 here.
5578 (reseat_to_string): Initialize it->bidi_p for strings here.
5579 (next_element_from_string, next_element_from_c_string)
5580 (next_element_from_buffer): Add xassert's for correspondence
5581 between IT's object being iterated and it->bidi_it.string
5582 structure.
5583 (face_before_or_after_it_pos): Support bidi iteration.
5584 (next_element_from_c_string): Handle the case of the first string
5585 character that is not the first one in the visual order.
5586 (get_visually_first_element): New function, refactored from common
5587 parts of next_element_from_buffer, next_element_from_string, and
5588 next_element_from_c_string.
5589 (tool_bar_lines_needed, redisplay_tool_bar)
5590 (display_menu_bar): Force left-to-right direction. Add a FIXME
5591 comment for making that be controlled by a user option.
5592 (push_it, pop_it): Save and restore the state of the
5593 bidi iterator. Save and restore the bidi_p flag.
5594 (pop_it): Iterate out of display property for string iteration as
5595 well.
5596 (iterate_out_of_display_property): Support iteration over strings.
5597 (handle_single_display_spec): Set up it->bidi_it for iteration
5598 over a display string, and call bidi_init_it.
5599 (handle_single_display_spec, next_overlay_string)
5600 (get_overlay_strings_1, push_display_prop): Set up the bidi
5601 iterator for displaying display or overlay strings.
5602 (forward_to_next_line_start): Don't use the shortcut if
5603 bidi-iterating.
5604 (back_to_previous_visible_line_start): If handle_display_prop
5605 pushed the iterator stack, restore the internal state of the bidi
5606 iterator by calling bidi_pop_it same number of times.
5607 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
5608 and we are bidi-iterating, don't decrement the iterator position;
5609 instead, set the first_elt flag in the bidi iterator, to produce
5610 the same effect.
5611 (reseat_1): Remove redundant setting of string_from_display_prop_p.
5612 (push_display_prop): xassert that we are iterating a buffer.
5613 (push_it, pop_it): Save and restore paragraph_embedding member.
5614 (handle_single_display_spec, next_overlay_string)
5615 (get_overlay_strings_1, reseat_1, reseat_to_string)
5616 (push_display_prop): Set up the `unibyte' member of bidi_it.string
5617 correctly. Don't assume unibyte strings are not bidi-reordered.
5618 (compute_display_string_pos)
5619 (compute_display_string_end): Fix handling the case of C string.
5620 (push_it, pop_it): Save and restore from_disp_prop_p.
5621 (handle_single_display_spec, push_display_prop): Set the
5622 from_disp_prop_p flag.
5623 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
5624 (pop_it): Call iterate_out_of_display_property only if we are
5625 popping after iteration over a string that came from a display
5626 property. Fix a typo in popping stretch info. Add an assertion
5627 for verifying that the iterator position is in sync with the bidi
5628 iterator.
5629 (handle_single_display_spec, get_overlay_strings_1)
5630 (push_display_prop): Fix initialization of paragraph direction for
5631 string when that of the parent object is not yet determined.
5632 (reseat_1): Call bidi_init_it to resync the bidi
5633 iterator with IT's position. (Bug#7616)
5634 (find_row_edges): If ROW->start.pos gives position
5635 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
5636 (handle_stop, back_to_previous_visible_line_start, reseat_1):
5637 Reset the from_disp_prop_p flag.
5638 (SAVE_IT, RESTORE_IT): New macros.
5639 (pos_visible_p, face_before_or_after_it_pos)
5640 (back_to_previous_visible_line_start)
5641 (move_it_in_display_line_to, move_it_in_display_line)
5642 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5643 (try_scrolling, redisplay_window, display_line): Use them when
5644 saving a temporary copy of the iterator and restoring it back.
5645 (back_to_previous_visible_line_start, reseat_1)
5646 (init_iterator): Empty the bidi cache "stack".
5647 (move_it_in_display_line_to): If iterator ended up at
5648 EOL, but we never saw any buffer positions smaller than
5649 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
5650 motion in bidi-reordered lines.
5651 (move_it_in_display_line_to): Record prev_method and prev_pos
5652 immediately before the call to set_iterator_to_next. Fixes cursor
5653 motion in bidi-reordered lines with stretch glyphs and strings
5654 displayed in margins. (Bug#8133) (Bug#8867)
5655 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
5656 TO_CHARPOS.
5657 (pos_visible_p): Support positions in bidi-reordered lines.
5658 Save and restore bidi cache.
5659
5660 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
5661 (bidi_paragraph_info): Delete unused struct.
5662 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
5663 (bidi_cache_start): New variable.
5664 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
5665 to zero.
5666 (bidi_cache_fetch_state, bidi_cache_search)
5667 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5668 (bidi_cache_find, bidi_peek_at_next_level)
5669 (bidi_level_of_next_char, bidi_find_other_level_edge)
5670 (bidi_move_to_visually_next): Compare cache index with
5671 bidi_cache_start rather than with zero.
5672 (bidi_fetch_char): Accept new argument STRING; all callers
5673 changed. Support iteration over a string. Support strings with
5674 display properties. Support unibyte strings. Fix the type of
5675 `len' according to what STRING_CHAR_AND_LENGTH expects.
5676 (bidi_paragraph_init, bidi_resolve_explicit_1)
5677 (bidi_resolve_explicit, bidi_resolve_weak)
5678 (bidi_level_of_next_char, bidi_move_to_visually_next):
5679 Support iteration over a string.
5680 (bidi_set_sor_type, bidi_resolve_explicit_1)
5681 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
5682 can now be zero (for strings); special values 0 and -1 were
5683 changed to -1 and -2, respectively.
5684 (bidi_char_at_pos): New function.
5685 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
5686 Call it instead of FETCH_MULTIBYTE_CHAR.
5687 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
5688 initialized to valid values.
5689 (bidi_init_it): Don't initialize charpos and bytepos with invalid
5690 values.
5691 (bidi_level_of_next_char): Allow the sentinel "position" to pass
5692 the test for valid cached positions. Fix the logic for looking up
5693 the sentinel state in the cache. GCPRO the Lisp string we are
5694 iterating.
5695 (bidi_push_it, bidi_pop_it): New functions.
5696 (bidi_initialize): Initialize the bidi cache start stack pointer.
5697 (bidi_cache_ensure_space): New function, refactored from part of
5698 bidi_cache_iterator_state. Don't assume the required size is just
5699 one BIDI_CACHE_CHUNK away.
5700 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
5701 (bidi_count_bytes, bidi_char_at_pos): New functions.
5702 (bidi_cache_search): Don't assume bidi_cache_last_idx is
5703 always valid if bidi_cache_idx is valid.
5704 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
5705 is valid if it's going to be used.
5706 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
5707 (bidi_cache_fetch_state, bidi_cache_search)
5708 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5709 (bidi_cache_iterator_state, bidi_cache_find)
5710 (bidi_find_other_level_edge, bidi_cache_start_stack):
5711 All variables related to cache indices are now EMACS_INT.
5712
5713 * dispextern.h (struct bidi_string_data): New structure.
5714 (struct bidi_it): New member `string'. Make flag members be 1-bit
5715 fields, and put them last in the struct.
5716 (compute_display_string_pos, compute_display_string_end):
5717 Update prototypes.
5718 (bidi_push_it, bidi_pop_it): Add prototypes.
5719 (struct iterator_stack_entry): New members bidi_p,
5720 paragraph_embedding, and from_disp_prop_p.
5721 (struct it): Member bidi_p is now a bit field 1 bit wide.
5722 (bidi_shelve_cache, bidi_unshelve_cache):
5723 Declare prototypes.
5724
5725 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
5726 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
5727 and vector-like objects.
5728
5729 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
5730 cache around display iteration.
5731
5732 * window.c (Fwindow_end, window_scroll_pixel_based)
5733 (displayed_window_lines, Frecenter): Save and restore the bidi
5734 cache around display iteration.
5735
5736 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5737
5738 * editfns.c (Fdelete_region): Clarify the use of the named
5739 parameters (bug#6788).
5740
5741 2011-07-14 Martin Rudalics <rudalics@gmx.at>
5742
5743 * indent.c (Fvertical_motion): Set and restore w->pointm when
5744 saving and restoring the window's buffer (Bug#9006).
5745
5746 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
5747
5748 * editfns.c (Fstring_to_char): Clarify just what is returned
5749 (bug#6576). Text by Eli Zaretskii.
5750
5751 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
5752
5753 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
5754
5755 2011-07-13 Eli Zaretskii <eliz@gnu.org>
5756
5757 * buffer.c (mmap_find): Fix a typo.
5758
5759 2011-07-13 Johan Bockgård <bojohan@gnu.org>
5760
5761 Fix execution of x selection hooks.
5762 * xselect.c (Qx_lost_selection_functions)
5763 (Qx_sent_selection_functions): New vars.
5764 (syms_of_xselect): DEFSYM them.
5765 (x_handle_selection_request): Pass Qx_sent_selection_functions
5766 rather than Vx_sent_selection_functions to Frun_hook_with_args.
5767 (x_handle_selection_clear,x_clear_frame_selections):
5768 Pass Qx_lost_selection_functions rather than
5769 Vx_lost_selection_functions to Frun_hook_with_args.
5770
5771 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
5772
5773 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
5774 The old code sometimes used this field without initializing it.
5775
5776 * alloc.c (gc_sweep): Don't read past end of array.
5777 In theory, the old code could also have corrupted Emacs internals,
5778 though it'd be very unlikely.
5779
5780 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
5781
5782 * character.c (Fcharacterp): Don't advertise optional ignored
5783 argument. (Bug#4026)
5784
5785 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
5786
5787 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
5788 key" (bug#4257).
5789
5790 * window.c (Fset_window_start): Doc fix (bug#4199).
5791 (Fset_window_hscroll): Ditto.
5792
5793 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
5794
5795 Fix minor new problems caught by GCC 4.6.1.
5796 * term.c (init_tty): Remove unused local.
5797 * xsettings.c (store_monospaced_changed): Define this function only
5798 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
5799 not used otherwise.
5800
5801 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
5802
5803 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
5804
5805 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5806
5807 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
5808 are the mini-buffer and the echo area (bug#3320).
5809
5810 * term.c (init_tty): Remove support for supdup, c10 and perq
5811 terminals, which are no longer supported (bug#1482).
5812
5813 2011-07-10 Johan Bockgård <bojohan@gnu.org>
5814
5815 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
5816
5817 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
5818
5819 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
5820 for non-popups (Bug#3642).
5821
5822 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
5823
5824 * alloc.c (reset_malloc_hooks): Protoize.
5825 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
5826 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
5827 * cm.c (losecursor): Likewise.
5828 * data.c (fmod): Likewise.
5829 * dispnew.c (swap_glyphs_in_rows): Likewise.
5830 * emacs.c (memory_warning_signal): Likewise.
5831 * floatfns.c (float_error): Likewise.
5832 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
5833 (otf_open, font_otf_capability, generate_otf_features)
5834 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
5835 Likewise.
5836 * image.c (pbm_read_file): Likewise.
5837 * indent.c (string_display_width): Likewise.
5838 * intervals.c (check_for_interval, search_for_interval)
5839 (inc_interval_count, count_intervals, root_interval)
5840 (adjust_intervals_for_insertion, make_new_interval): Likewise.
5841 * lread.c (defalias): Likewise.
5842 * ralloc.c (r_alloc_check): Likewise.
5843 * regex.c (set_image_of_range_1, set_image_of_range)
5844 (regex_grow_registers): Likewise.
5845 * sysdep.c (strerror): Likewise.
5846 * termcap.c (valid_filename_p, tprint, main): Likewise.
5847 * tparam.c (main): Likewise.
5848 * unexhp9k800.c (run_time_remap, save_data_space)
5849 (update_file_ptrs, read_header, write_header, calculate_checksum)
5850 (copy_file, copy_rest, display_header): Likewise.
5851 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5852 Likewise.
5853 * xdisp.c (check_it): Likewise.
5854 * xfaces.c (register_color, unregister_color, unregister_colors):
5855 Likewise.
5856 * xfns.c (print_fontset_result): Likewise.
5857 * xrdb.c (member, fatal, main): Likewise.
5858
5859 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 Fix minor problems found by static checking (Bug#9031).
5862 * chartab.c (char_table_set_range, map_sub_char_table):
5863 Remove unused locals.
5864 (uniprop_table): Now static.
5865 * composite.c (_work_char): Remove unused static var.
5866
5867 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
5868
5869 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
5870
5871 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
5872
5873 * gtkutil.c (qttip_cb): Remove code without function.
5874
5875 2011-07-09 Eli Zaretskii <eliz@gnu.org>
5876
5877 * w32.c (pthread_sigmask): New stub.
5878
5879 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
5880
5881 Use pthread_sigmask, not sigprocmask (Bug#9010).
5882 sigprocmask is portable only for single-threaded applications, and
5883 Emacs can be multi-threaded when it uses GTK.
5884 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
5885 (LIBES): Use it.
5886 * callproc.c (Fcall_process):
5887 * process.c (create_process):
5888 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
5889 Use pthread_sigmask, not sigprocmask.
5890
5891 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5892
5893 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
5894 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
5895 wrong (Bug#8591).
5896
5897 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5898
5899 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
5900 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
5901 (xg_hide_tooltip): Fix comment.
5902
5903 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
5904 in registerServicesMenuSendTypes.
5905 (validRequestorForSendType): Don't check ns_return_types.
5906
5907 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
5908 ns_return_type.
5909
5910 2011-07-08 Jason Rumney <jasonr@gnu.org>
5911
5912 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
5913 SH_SHOW for hidden windows (Bug#5482).
5914
5915 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
5916 frame struct members of non-existent frames (Bug#6284).
5917
5918 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5919
5920 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
5921 variable firstTime not needed on OSX >= 10.6.
5922 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5923 >= 10.5. Use setKnobProportion, setDoubleValue.
5924
5925 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5926 (MAC_OS_X_VERSION_10_5): Define if not defined.
5927 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5928 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5929 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5930
5931 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5932 cString and lossyCString on OSX >= 10.4
5933
5934 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
5935 sizeToFit on OSX >= 10.2.
5936
5937 * nsimage.m (allocInitFromFile): Don't use deprecated method
5938 bestRepresentationForDevice on OSX >= 10.6.
5939
5940 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5941 to avoid warning.
5942
5943 * emacs.c: Declare unexec_init_emacs_zone.
5944
5945 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5946
5947 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5948
5949 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5950 on svcsMenu (Bug#8842).
5951
5952 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5953 ns_return_types.
5954 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5955
5956 * nsterm.m (QUTF8_STRING): Declare.
5957 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5958 (validRequestorForSendType): Return type is (id).
5959 Change indexOfObjectIdenticalTo to indexOfObject.
5960 Check if we have local selection before returning self (Bug#8842).
5961 (writeSelectionToPasteboard): Put local selection into paste board
5962 if we have a local selection (Bug#8842).
5963 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5964
5965 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
5966 (ns_get_local_selection): Declare.
5967
5968 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
5969
5970 * keymap.c (describe_map_tree): Don't insert a double newline at
5971 the end of the buffer (bug#1169) and return whether we inserted
5972 something.
5973
5974 * callint.c (Fcall_interactively): Change "reading args" to
5975 "providing args" to try to clarify what it does (bug#1010).
5976
5977 2011-07-07 Kenichi Handa <handa@m17n.org>
5978
5979 * composite.c (composition_compute_stop_pos): Ignore a static
5980 composition starting before CHARPOS (Bug#8915).
5981
5982 * xdisp.c (handle_composition_prop): Likewise.
5983
5984 2011-07-07 Eli Zaretskii <eliz@gnu.org>
5985
5986 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
5987 (Bug#9015)
5988
5989 2011-07-07 Kenichi Handa <handa@m17n.org>
5990
5991 * character.h (unicode_category_t): New enum type.
5992
5993 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
5994 (Qchar_code_property_table): New variable.
5995 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
5996 (UNIPROP_COMPRESSED_FORM_P): New macros.
5997 (char_table_ascii): Uncompress the compressed values.
5998 (sub_char_table_ref): New arg is_uniprop. Callers changed.
5999 Uncompress the compressed values.
6000 (sub_char_table_ref_and_range): Likewise.
6001 (char_table_ref_and_range): Uncompress the compressed values.
6002 (sub_char_table_set): New arg is_uniprop. Callers changed.
6003 Uncompress the compressed values.
6004 (sub_char_table_set_range): Args changed. Callers changed.
6005 (char_table_set_range): Adjuted for the above change.
6006 (map_sub_char_table): Delete args default_val and parent. Add arg
6007 top. Give decoded values to a Lisp function.
6008 (map_char_table): Adjust for the above change. Give decoded
6009 values to a Lisp function. Gcpro more variables.
6010 (uniprop_table_uncompress)
6011 (uniprop_decode_value_run_length): New functions.
6012 (uniprop_decoder, uniprop_decoder_count): New variables.
6013 (uniprop_get_decoder, uniprop_encode_value_character)
6014 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
6015 New functions.
6016 (uniprop_encoder, uniprop_encoder_count): New variables.
6017 (uniprop_get_encoder, uniprop_table)
6018 (Funicode_property_table_internal, Fget_unicode_property_internal)
6019 (Fput_unicode_property_internal): New functions.
6020 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
6021 Sunicode_property_table_internal, Sget_unicode_property_internal,
6022 and Sput_unicode_property_internal. Defvar_lisp
6023 char-code-property-alist.
6024
6025 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
6026 Vunicode_category_table.
6027
6028 * font.c (font_range): Adjust for the change of
6029 Vunicode_category_table.
6030
6031 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
6032
6033 * m/iris4d.h: Remove file, move contents ...
6034 * s/irix6-5.h: ... here.
6035
6036 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
6037
6038 Remove unportable assumption about struct layout (Bug#8884).
6039 * alloc.c (mark_buffer):
6040 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
6041 (clone_per_buffer_values): Don't assume that
6042 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
6043 This isn't true in general, and it's particularly not true
6044 if Emacs is configured with --with-wide-int.
6045 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
6046 New macros, used in the buffer.c change.
6047
6048 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
6049
6050 * xsettings.c: Use both GConf and GSettings if both are available.
6051 (store_config_changed_event): Add comment.
6052 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
6053 (store_tool_bar_style_changed): New functions.
6054 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
6055 (struct xsettings): Move font inside HAVE_XFT.
6056 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
6057 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
6058 Move inside HAVE_XFT.
6059 (something_changed_gsettingsCB): Rename from something_changedCB.
6060 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
6061 also.
6062 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
6063 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
6064 (something_changed_gconfCB): Rename from something_changedCB.
6065 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
6066 (parse_settings): Move check for font inside HAVE_XFT.
6067 (read_settings, apply_xft_settings): Add comment.
6068 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
6069 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
6070 call store_font_name_changed.
6071 (xft_settings_event): Add comment.
6072 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
6073 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
6074 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
6075 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
6076 (xsettings_initialize): Call init_gsettings last.
6077 (xsettings_get_system_font, xsettings_get_system_normal_font):
6078 Add comment.
6079
6080 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 Random fixes. E.g., (random) never returned negative values.
6083 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
6084 subseconds part to the entropy, as that's a bit more random.
6085 Prefer signed to unsigned, since the signedness doesn't matter and
6086 in general we prefer signed. When given a limit, use a
6087 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
6088 latter isn't right if USE_2_TAGS_FOR_INTS.
6089 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
6090 not 0..VALMASK. Don't discard "excess" bits that random () returns.
6091
6092 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6093
6094 * textprop.c (text_property_stickiness):
6095 Obey Vtext_property_default_nonsticky.
6096 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
6097 * w32fns.c (syms_of_w32fns):
6098 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
6099
6100 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
6103 This is more efficient than Ffile_directory_p and avoids a minor race.
6104
6105 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
6106
6107 * buffer.c (Foverlay_put): Say what the return value is
6108 (bug#7835).
6109
6110 * fileio.c (barf_or_query_if_file_exists): Check first if the file
6111 is a directory before asking whether to use the file name
6112 (bug#7564).
6113 (barf_or_query_if_file_exists): Make the "File is a directory"
6114 error be more correct.
6115
6116 * fns.c (Frequire): Remove the mention of the .gz files, since
6117 that's installation-specific, but keep the mention of
6118 `get-load-suffixes'.
6119
6120 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6121
6122 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
6123 Report string overflow if the output is too long.
6124
6125 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
6126
6127 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
6128 (syms_of_gnutls): Remove duplicate DEFSYM for
6129 Qgnutls_bootprop_verify_hostname_error, an error for
6130 Qgnutls_bootprop_verify_error (which is no longer used).
6131
6132 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
6133 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
6134 Also (re)move comments that are misplaced or no longer relevant.
6135
6136 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6137
6138 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
6139
6140 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
6141
6142 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
6143 and background color parameters if they have been changed.
6144
6145 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6146
6147 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
6148
6149 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
6150
6151 * xsettings.c (SYSTEM_FONT): Define only when used.
6152 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
6153
6154 * keymap.c (access_keymap_1): Now static.
6155
6156 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
6157
6158 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
6159 leave any prefix arg for the up event (Bug#1586).
6160
6161 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
6162
6163 * lread.c (syms_of_lread): Mention single symbols defined by
6164 `defvar' or `defconst' (bug#7154).
6165
6166 * fns.c (Frequire): Mention .el.gz files (bug#7314).
6167 (Frequire): Mention get-load-suffixes.
6168
6169 2011-07-02 Martin Rudalics <rudalics@gmx.at>
6170
6171 * window.h (window): Remove clone_number slot.
6172 * window.c (Fwindow_clone_number, Fset_window_clone_number):
6173 Remove.
6174 (make_parent_window, make_window, saved_window)
6175 (Fset_window_configuration, save_window_save): Don't deal with
6176 clone numbers.
6177 * buffer.c (Qclone_number): Remove declaration.
6178 (sort_overlays, overlay_strings): Don't deal with clone numbers.
6179
6180 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
6181
6182 Add multiple inheritance to keymaps.
6183 * keymap.c (Fmake_composed_keymap): New function.
6184 (Fset_keymap_parent): Simplify.
6185 (fix_submap_inheritance): Remove.
6186 (access_keymap_1): New function extracted from access_keymap to handle
6187 embedded parents and handle lists of maps.
6188 (access_keymap): Use it.
6189 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
6190 (Fcopy_keymap): Handle embedded parents.
6191 (Fcommand_remapping, define_as_prefix): Simplify.
6192 (Fkey_binding): Simplify.
6193 (syms_of_keymap): Move minibuffer-local-completion-map,
6194 minibuffer-local-filename-completion-map,
6195 minibuffer-local-must-match-map, and
6196 minibuffer-local-filename-must-match-map to Elisp.
6197 (syms_of_keymap): Defsubr make-composed-keymap.
6198 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
6199 (parse_menu_item): Trivial simplification.
6200
6201 2011-07-01 Glenn Morris <rgm@gnu.org>
6202
6203 * Makefile.in (SETTINGS_LIBS): Fix typo.
6204
6205 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
6206
6207 * coding.c (Fencode_coding_string): Record the last coding system
6208 used, as the function doc string says (bug#8738).
6209
6210 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
6211
6212 * xsettings.c (store_monospaced_changed): Take new font as arg and
6213 check for change against current_mono_font.
6214 (EMACS_TYPE_SETTINGS): Remove this and related defines.
6215 (emacs_settings_constructor, emacs_settings_get_property)
6216 (emacs_settings_set_property, emacs_settings_class_init)
6217 (emacs_settings_init, gsettings_obj): Remove.
6218 (something_changedCB): New function for HAVE_GSETTINGS.
6219 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
6220 with value as argument.
6221 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
6222 g_settings_new (Bug#8967). Do not create gsettings_obj.
6223 Remove calls to g_settings_bind. Connect something_changedCB to
6224 "changed".
6225
6226 * xgselect.c: Add defined (HAVE_GSETTINGS).
6227 (xgselect_initialize): Ditto.
6228
6229 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
6230 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
6231 xg_select.
6232
6233 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
6234
6235 * eval.c (struct backtrace): Simplify and port the data structure.
6236 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
6237 signed bit field, as this assumption is not portable and it makes
6238 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
6239 "char debug_on_exit : 1" as this is not portable either; instead,
6240 use the portable "unsigned int debug_on_exit : 1". Remove unused
6241 member evalargs. Remove obsolete comments about cc bombing out.
6242
6243 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
6244
6245 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
6246 Let HAVE_GSETTINGS override HAVE_GCONF.
6247 (store_monospaced_changed): New function.
6248 (EMACS_SETTINGS): A new type derived from GObject to handle
6249 GSettings notifications.
6250 (emacs_settings_constructor, emacs_settings_get_property)
6251 (emacs_settings_set_property, emacs_settings_class_init):
6252 New functions.
6253 (gsettings_client, gsettings_obj): New variables.
6254 (GSETTINGS_SCHEMA): New define.
6255 (something_changedCB): Call store_monospaced_changed.
6256 (init_gsettings): New function.
6257 (xsettings_initialize): Call init_gsettings.
6258 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
6259 to NULL.
6260
6261 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
6262 GCONF_CFLAGS/LIBS.
6263
6264 2011-06-29 Martin Rudalics <rudalics@gmx.at>
6265
6266 * window.c (resize_root_window, grow_mini_window)
6267 (shrink_mini_window): Rename Qresize_root_window to
6268 Qwindow_resize_root_window and Qresize_root_window_vertically to
6269 Qwindow_resize_root_window_vertically.
6270
6271 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
6272
6273 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
6274
6275 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
6276
6277 * makefile.w32-in: Redesign dependencies so they reflect more
6278 clearly which files are directly included by each source file,
6279 and not through other includes.
6280
6281 2011-06-27 Martin Rudalics <rudalics@gmx.at>
6282
6283 * buffer.c (Qclone_number): Declare static and DEFSYM it.
6284 (sort_overlays, overlay_strings): When an overlay's clone number
6285 matches the window's clone number process the overlay even if
6286 the overlay's window property doesn't match the current window.
6287
6288 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
6289 (Fwindow_hchild): Rename to Fwindow_left_child.
6290 (Fwindow_next): Rename to Fwindow_next_sibling.
6291 (Fwindow_prev): Rename to Fwindow_prev_sibling.
6292 (resize_window_check): Rename to window_resize_check.
6293 (resize_window_apply): Rename to window_resize_apply.
6294 (Fresize_window_apply): Rename to Fwindow_resize_apply.
6295 (Fdelete_other_windows_internal, resize_frame_windows)
6296 (Fsplit_window_internal, Fdelete_window_internal)
6297 (grow_mini_window, shrink_mini_window)
6298 (Fresize_mini_window_internal): Fix callers accordingly.
6299
6300 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
6301
6302 * emacsgtkfixed.h: State that this is only used with Gtk+3.
6303 (emacs_fixed_set_min_size): Remove.
6304 (emacs_fixed_new): Take frame as argument.
6305
6306 * emacsgtkfixed.c: State that this is only used with Gtk+3.
6307 (_EmacsFixedPrivate): Remove minwidth/height.
6308 Add struct frame *f.
6309 (emacs_fixed_init): Initialize priv->f.
6310 (get_parent_class, emacs_fixed_set_min_size): Remove.
6311 (emacs_fixed_new): Set priv->f to argument.
6312 (emacs_fixed_get_preferred_width)
6313 (emacs_fixed_get_preferred_height): Use min_width/height from
6314 frames size_hint to set minimum and natural (Bug#8919).
6315 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
6316 and use min_width/height from frames size_hint to set
6317 min_width/height (Bug#8919).
6318
6319 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
6320 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
6321 Fix indentation.
6322
6323 2011-06-26 Eli Zaretskii <eliz@gnu.org>
6324
6325 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
6326 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
6327 called at ZV.
6328
6329 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
6330
6331 * process.c (wait_reading_process_output): Bypass select if
6332 waiting for a cell while ignoring keyboard input, and input is
6333 pending. Suggested by Jan Djärv (Bug#8869).
6334
6335 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
6336
6337 Use gnulib's dup2 module instead of rolling our own.
6338 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
6339
6340 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6341
6342 * dispnew.c (scrolling_window): Before scrolling, turn off a
6343 mouse-highlight in the window being scrolled.
6344
6345 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
6346
6347 Move DEFSYM to lisp.h and use everywhere.
6348
6349 * character.h (DEFSYM): Move declaration...
6350 * lisp.h (DEFSYM): ...here.
6351
6352 * gnutls.c:
6353 * minibuf.c:
6354 * w32menu.c:
6355 * w32proc.c:
6356 * w32select.c: Don't include character.h.
6357
6358 * alloc.c (syms_of_alloc):
6359 * buffer.c (syms_of_buffer):
6360 * bytecode.c (syms_of_bytecode):
6361 * callint.c (syms_of_callint):
6362 * casefiddle.c (syms_of_casefiddle):
6363 * casetab.c (init_casetab_once):
6364 * category.c (init_category_once, syms_of_category):
6365 * ccl.c (syms_of_ccl):
6366 * cmds.c (syms_of_cmds):
6367 * composite.c (syms_of_composite):
6368 * dbusbind.c (syms_of_dbusbind):
6369 * dired.c (syms_of_dired):
6370 * dispnew.c (syms_of_display):
6371 * doc.c (syms_of_doc):
6372 * editfns.c (syms_of_editfns):
6373 * emacs.c (syms_of_emacs):
6374 * eval.c (syms_of_eval):
6375 * fileio.c (syms_of_fileio):
6376 * fns.c (syms_of_fns):
6377 * frame.c (syms_of_frame):
6378 * fringe.c (syms_of_fringe):
6379 * insdel.c (syms_of_insdel):
6380 * keymap.c (syms_of_keymap):
6381 * lread.c (init_obarray, syms_of_lread):
6382 * macros.c (syms_of_macros):
6383 * msdos.c (syms_of_msdos):
6384 * print.c (syms_of_print):
6385 * process.c (syms_of_process):
6386 * search.c (syms_of_search):
6387 * sound.c (syms_of_sound):
6388 * syntax.c (init_syntax_once, syms_of_syntax):
6389 * terminal.c (syms_of_terminal):
6390 * textprop.c (syms_of_textprop):
6391 * undo.c (syms_of_undo):
6392 * w32.c (globals_of_w32):
6393 * window.c (syms_of_window):
6394 * xdisp.c (syms_of_xdisp):
6395 * xfaces.c (syms_of_xfaces):
6396 * xfns.c (syms_of_xfns):
6397 * xmenu.c (syms_of_xmenu):
6398 * xsettings.c (syms_of_xsettings):
6399 * xterm.c (syms_of_xterm): Use DEFSYM.
6400
6401 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
6402
6403 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
6404
6405 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
6406
6407 Integer and buffer overflow fixes (Bug#8873).
6408
6409 * print.c (printchar, strout): Check for string overflow.
6410 (PRINTPREPARE, printchar, strout):
6411 Don't set size unless allocation succeeds.
6412
6413 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
6414 for sizes. Check for string overflow more accurately.
6415 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
6416
6417 * macros.c: Integer and buffer overflow fixes.
6418 * keyboard.h (struct keyboard.kbd_macro_bufsize):
6419 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
6420 Use ptrdiff_t, not int, for sizes.
6421 Don't increment bufsize until after realloc succeeds.
6422 Check for size-calculation overflow.
6423 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
6424
6425 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
6426
6427 * lread.c: Integer overflow fixes.
6428 (read_integer): Radix is now EMACS_INT, not int,
6429 to improve quality of diagnostics for out-of-range radices.
6430 Calculate buffer size correctly for out-of-range radices.
6431 (read1): Check for integer overflow in radices, and in
6432 read-circle numbers.
6433 (read_escape): Avoid int overflow.
6434 (Fload, openp, read_buffer_size, read1)
6435 (substitute_object_recurse, read_vector, read_list, map_obarray):
6436 Use ptrdiff_t, not int, for sizes.
6437 (read1): Use EMACS_INT, not int, for sizes.
6438 Check for size overflow.
6439
6440 * image.c (cache_image): Check for size arithmetic overflow.
6441
6442 * lread.c: Integer overflow issues.
6443 (saved_doc_string_size, saved_doc_string_length)
6444 (prev_saved_doc_string_size, prev_saved_doc_string_length):
6445 Now ptrdiff_t, not int.
6446 (read1): Don't assume doc string length fits in int. Check for
6447 out-of-range doc string lengths.
6448 (read_list): Don't assume file position fits in int.
6449 (read_escape): Check for hex character overflow.
6450
6451 2011-06-22 Leo Liu <sdl.web@gmail.com>
6452
6453 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
6454 Move to minibuffer.el.
6455
6456 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6457
6458 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
6459 The following patches are for when GLYPH_DEBUG && !XASSERT.
6460 * dispextern.h (trace_redisplay_p, dump_glyph_string):
6461 * dispnew.c (flush_stdout):
6462 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
6463 Mark as externally visible.
6464 * dispnew.c (check_window_matrix_pointers): Now static.
6465 * dispnew.c (window_to_frame_vpos):
6466 * xfns.c (unwind_create_frame):
6467 * xterm.c (x_check_font): Remove unused local.
6468 * scroll.c (CHECK_BOUNDS):
6469 * xfaces.c (cache_fache): Rename local to avoid shadowing.
6470 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
6471 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
6472 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
6473 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
6474 Now static.
6475 (debug_method_add): Use va_list and vsprintf rather than relying
6476 on undefined behavior with wrong number of arguments.
6477 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
6478 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
6479 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
6480 since we're not interested in debugging glyphs with old libraries.
6481 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
6482 GCC 4.6.0's static checking.
6483
6484 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6485
6486 Integer overflow and signedness fixes (Bug#8873).
6487 A few related buffer overrun fixes, too.
6488
6489 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
6490
6491 * dispextern.h (struct face.stipple):
6492 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
6493 (x_bitmap_mask, x_allocate_bitmap_record)
6494 (x_create_bitmap_from_data, x_create_bitmap_from_file)
6495 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
6496 (x_create_bitmap_from_xpm_data):
6497 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
6498 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
6499 (.bitmaps_last):
6500 * xfaces.c (load_pixmap):
6501 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
6502 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
6503 (.bitmaps_last, struct x_output.icon_bitmap):
6504 Use ptrdiff_t, not int, for bitmap indexes.
6505 (x_allocate_bitmap_record): Check for size overflow.
6506 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
6507
6508 Use ptrdiff_t, not int, for overlay counts.
6509 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
6510 * editfns.c (overlays_around, get_pos_property):
6511 * textprop.c (get_char_property_and_overlay):
6512 * xdisp.c (next_overlay_change, note_mouse_highlight):
6513 * xfaces.c (face_at_buffer_position):
6514 * buffer.c (OVERLAY_COUNT_MAX): New macro.
6515 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
6516 (Fnext_overlay_change, Fprevious_overlay_change)
6517 (mouse_face_overlay_overlaps, Foverlays_in):
6518 Use ptrdiff_t, not int, for sizes.
6519 (overlays_at, overlays_in): Check for size-calculation overflow.
6520
6521 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
6522
6523 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
6524 (x_session_initialize): Do not assume string length fits in int.
6525
6526 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
6527 This is unlikely, but can occur if DPI is outlandish.
6528
6529 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
6530 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
6531
6532 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
6533 * xrdb.c (magic_file_p, search_magic_path):
6534 Omit last arg SUFFIX; it was always 0. All callers changed.
6535 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
6536
6537 * xfont.c (xfont_match): Avoid need for strlen.
6538
6539 * xfns.c: Don't assume strlen fits in int.
6540 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
6541
6542 * xdisp.c (message_log_check_duplicate): Return intmax_t,
6543 not unsigned long, as we prefer signed integers. All callers changed.
6544 Detect integer overflow in repeat count.
6545 (message_dolog): Don't assume print length fits in 39 bytes.
6546 (display_mode_element): Don't assume strlen fits in int.
6547
6548 * termcap.c: Don't assume sizes fit in int and never overflow.
6549 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
6550 (gobble_line): Check for size-calculation overflow.
6551
6552 * minibuf.c (Fread_buffer):
6553 * lread.c (intern, intern_c_string):
6554 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
6555 Don't assume string length fits in int.
6556
6557 * keyboard.c (parse_tool_bar_item):
6558 * gtkutil.c (style_changed_cb): Avoid need for strlen.
6559
6560 * font.c: Don't assume string length fits in int.
6561 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
6562 Use ptrdiff_t, not int.
6563 (font_intern_prop): Don't assume string length fits in int.
6564 Don't assume integer property fits in fixnum.
6565 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
6566
6567 * filelock.c: Fix some buffer overrun and integer overflow issues.
6568 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
6569 Reformulate so as not to need the command string.
6570 Invoke gzip -cd rather than gunzip, as it's more portable.
6571 (lock_info_type, lock_file_1, lock_file):
6572 Don't assume pid_t and time_t fit in unsigned long.
6573 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
6574 (current_lock_owner): Prefer signed type for sizes.
6575 Use memcpy, not strncpy, where memcpy is what is really wanted.
6576 Don't assume (via atoi) that time_t and pid_t fit in int.
6577 Check for time_t and/or pid_t out of range, e.g., via a network share.
6578 Don't alloca where an auto var works fine.
6579
6580 * fileio.c: Fix some integer overflow issues.
6581 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
6582 Don't assume string length fits in int.
6583 (directory_file_name): Don't assume string length fits in long.
6584 (make_temp_name): Don't assume pid fits in int, or that its print
6585 length is less than 20.
6586
6587 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
6588
6589 * coding.c (make_subsidiaries): Don't assume string length fits in int.
6590
6591 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
6592
6593 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
6594 We prefer signed integers, even for size calculations.
6595
6596 * emacs.c: Don't assume string length fits in 'int'.
6597 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
6598 (main): Don't invoke strlen when not needed.
6599
6600 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
6601 (XD_DEBUG_MESSAGE): Don't waste a byte.
6602
6603 * callproc.c (getenv_internal_1, getenv_internal)
6604 (Fgetenv_internal):
6605 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
6606
6607 * lread.c (invalid_syntax): Omit length argument.
6608 All uses changed. This doesn't fix a bug, but it simplifies the
6609 code away from its former Hollerith-constant appearance, and it's
6610 one less 'int' to worry about when looking at integer-overflow issues.
6611 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
6612
6613 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
6614 This didn't break anything, but it didn't help either.
6615 It's confusing to put a bogus integer in a place where the actual
6616 value does not matter.
6617 (LIST_END_P): Remove unused macro and its bogus comment.
6618 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
6619
6620 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
6621 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
6622 implementation.
6623 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
6624 We prefer signed types, and the value cannot exceed the EMACS_INT
6625 range anyway (because otherwise the length would not be representable).
6626 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
6627 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
6628 This avoids a GCC warning when WIDE_EMACS_INT.
6629
6630 * indent.c (sane_tab_width): New function.
6631 (current_column, scan_for_column, Findent_to, position_indentation)
6632 (compute_motion): Use it. This is just for clarity.
6633 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
6634
6635 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
6636
6637 * lisp.h (lint_assume): New macro.
6638 * composite.c (composition_gstring_put_cache):
6639 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
6640
6641 * editfns.c, insdel.c:
6642 Omit unnecessary forward decls, to simplify future changes.
6643
6644 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
6645
6646 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
6647
6648 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
6649 Use much-faster test for byte-length change.
6650 Don't assume string byte-length fits in 'int'.
6651 Check that character arg fits in 'int'.
6652 (mapcar1): Declare byte as byte, for clarity.
6653
6654 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
6655
6656 * fns.c (concat): Catch string overflow earlier.
6657 Do not rely on integer wraparound.
6658
6659 * dispextern.h (struct it.overlay_strings_charpos)
6660 (struct it.selective): Now EMACS_INT, not int.
6661 * xdisp.c (forward_to_next_line_start)
6662 (back_to_previous_visible_line_start)
6663 (reseat_at_next_visible_line_start, next_element_from_buffer):
6664 Don't arbitrarily truncate the value of 'selective' to int.
6665
6666 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
6667
6668 * composite.c: Don't truncate sizes to 'int'.
6669 (composition_gstring_p, composition_reseat_it)
6670 (composition_adjust_point): Use EMACS_INT, not int.
6671 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
6672 not EMACS_UINT, for indexes.
6673
6674 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
6675
6676 * buffer.c: Include <verify.h>.
6677 (struct sortvec.priority, struct sortstr.priority):
6678 Now EMACS_INT, not int.
6679 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
6680 (struct sortstr.size, record_overlay_string)
6681 (struct sortstrlist.size, struct sortlist.used):
6682 Don't truncate size to int.
6683 (record_overlay_string): Check for size-calculation overflow.
6684 (init_buffer_once): Check at compile-time, not run-time.
6685
6686 2011-06-22 Jim Meyering <meyering@redhat.com>
6687
6688 Don't leak an XBM-image-sized buffer
6689 * image.c (xbm_load): Free the image buffer after using it.
6690
6691 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
6692
6693 Port to Sun C.
6694 * composite.c (find_automatic_composition): Omit needless 'return 0;'
6695 that Sun C diagnosed.
6696 * fns.c (secure_hash): Fix pointer signedness issue.
6697 * intervals.c (static_offset_intervals): New function.
6698 (offset_intervals): Use it.
6699
6700 2011-06-21 Leo Liu <sdl.web@gmail.com>
6701
6702 * deps.mk (fns.o):
6703 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
6704 sha512.h.
6705
6706 * fns.c (secure_hash): Rename from crypto_hash_function and change
6707 the first arg to accept symbols.
6708 (Fsecure_hash): New primitive.
6709 (syms_of_fns): New symbols.
6710
6711 2011-06-20 Deniz Dogan <deniz@dogan.se>
6712
6713 * process.c (Fset_process_buffer): Clarify return value in
6714 docstring.
6715
6716 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
6717
6718 * dispnew.c (add_window_display_history): Use BVAR.
6719
6720 * xdisp.c (debug_method_add): Use BVAR.
6721 (check_window_end, dump_glyph_matrix, dump_glyph)
6722 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
6723
6724 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
6725 Likewise.
6726
6727 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
6728 check till after the cache is created in init_frame_faces.
6729
6730 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
6731
6732 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
6733
6734 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
6735
6736 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
6737 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
6738 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
6739
6740 Improve buffer-overflow checking (Bug#8873).
6741 * fileio.c (Finsert_file_contents):
6742 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
6743 Remove the old (too-loose) buffer overflow checks.
6744 They weren't needed, since make_gap checks for buffer overflow.
6745 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
6746 The old code merely checked for Emacs fixnum overflow, and relied
6747 on undefined (wraparound) behavior. The new code avoids undefined
6748 behavior, and also checks for ptrdiff_t and/or size_t overflow.
6749
6750 * editfns.c (Finsert_char): Don't dump core with very negative counts.
6751 Tune. Don't use wider integers than needed. Don't use alloca.
6752 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
6753
6754 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
6755
6756 * insdel.c, lisp.h (buffer_overflow): New function.
6757 (insert_from_buffer_1, replace_range, replace_range_2):
6758 * insdel.c (make_gap_larger):
6759 * editfns.c (Finsert_char):
6760 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
6761
6762 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
6763
6764 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
6767
6768 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
6769 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
6770
6771 * fileio.c: Don't assume EMACS_INT fits in off_t.
6772 (emacs_lseek): New static function.
6773 (Finsert_file_contents, Fwrite_region): Use it.
6774 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
6775
6776 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
6777
6778 * fns.c: Don't overflow int when computing a list length.
6779 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
6780 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
6781 truncation on 64-bit hosts. Check for QUIT every
6782 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
6783 faster and is responsive enough.
6784 (Flength): Report an error instead of overflowing an integer.
6785 (Fsafe_length): Return a float if the value is not representable
6786 as a fixnum. This shouldn't happen except in contrived situations.
6787 (Fnthcdr, Fsort): Don't assume list length fits in int.
6788 (Fcopy_sequence): Don't assume vector length fits in int.
6789
6790 * alloc.c: Check that resized vectors' lengths fit in fixnums.
6791 (header_size, word_size): New constants.
6792 (allocate_vectorlike): Don't check size overflow here.
6793 (allocate_vector): Check it here instead, since this is the only
6794 caller of allocate_vectorlike that could cause overflow.
6795 Check that the new vector's length is representable as a fixnum.
6796
6797 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
6798 The previous code was bogus. For example, next_almost_prime (32)
6799 returned 39, which is undesirable as it is a multiple of 3; and
6800 next_almost_prime (24) returned 25, which is a multiple of 5 so
6801 why was the code bothering to check for multiples of 7?
6802
6803 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
6804
6805 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
6806
6807 Variadic C functions now count arguments with ptrdiff_t.
6808 This partly undoes my 2011-03-30 change, which replaced int with size_t.
6809 Back then I didn't know that the Emacs coding style prefers signed int.
6810 Also, in the meantime I found a few more instances where arguments
6811 were being counted with int, which may truncate counts on 64-bit
6812 machines, or EMACS_INT, which may be unnecessarily wide.
6813 * lisp.h (struct Lisp_Subr.function.aMANY)
6814 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
6815 Arg counts are now ptrdiff_t, not size_t.
6816 All variadic functions and their callers changed accordingly.
6817 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
6818 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
6819 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
6820 * callint.c (Fcall_interactively): Check arg count for overflow,
6821 to avoid potential buffer overrun. Use signed char, not 'int',
6822 for 'varies' array, so that we needn't bother to check its size
6823 calculation for overflow.
6824 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
6825 * eval.c (apply_lambda):
6826 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
6827 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
6828 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
6829
6830 * callint.c (Fcall_interactively): Don't use index var as event count.
6831
6832 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
6833 * mem-limits.h (SIZE): Remove; no longer used.
6834
6835 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
6836
6837 Remove unnecessary casts.
6838 * xterm.c (x_term_init):
6839 * xfns.c (x_set_border_pixel):
6840 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
6841 These aren't needed now that we assume ANSI C.
6842
6843 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6844 It's more likely to cause problems (due to unsigned overflow)
6845 than to cure them.
6846
6847 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6848
6849 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6850
6851 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6852
6853 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6854
6855 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6856
6857 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
6858
6859 GLYPH_CODE_FACE returns EMACS_INT, not int.
6860 * dispextern.h (merge_faces):
6861 * xfaces.c (merge_faces):
6862 * xdisp.c (get_next_display_element, next_element_from_display_vector):
6863 Don't assume EMACS_INT fits in int.
6864
6865 * character.h (CHAR_VALID_P): Remove unused parameter.
6866 * fontset.c, lisp.h, xdisp.c: All uses changed.
6867
6868 * editfns.c (Ftranslate_region_internal): Omit redundant test.
6869
6870 * fns.c (concat): Minor tuning based on overflow analysis.
6871 This doesn't fix any bugs. Use int to hold character, instead
6872 of constantly refetching from Emacs object. Use XFASTINT, not
6873 XINT, for value known to be a character. Don't bother comparing
6874 a single byte to 0400, as it's always less.
6875
6876 * floatfns.c (Fexpt):
6877 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
6878
6879 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
6880 for characters.
6881
6882 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
6883
6884 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
6885 Without this fix, on a 64-bit host (aset S 0 4294967386) would
6886 incorrectly succeed when S was a string, because 4294967386 was
6887 truncated before it was used.
6888
6889 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
6890 Otherwise, an out-of-range integer could cause undefined behavior
6891 on a 64-bit host.
6892
6893 * composite.c: Use int, not EMACS_INT, for characters.
6894 (fill_gstring_body, composition_compute_stop_pos): Use int, not
6895 EMACS_INT, for values that are known to be in character range.
6896 This doesn't fix any bugs but is the usual style inside Emacs and
6897 may generate better code on 32-bit machines.
6898
6899 Make sure a 64-bit char is never passed to ENCODE_CHAR.
6900 This is for reasons similar to the recent CHAR_STRING fix.
6901 * charset.c (Fencode_char): Check that character arg is actually
6902 a character. Pass an int to ENCODE_CHAR.
6903 * charset.h (ENCODE_CHAR): Verify that the character argument is no
6904 wider than 'int', as a compile-time check to prevent future regressions
6905 in this area.
6906
6907 * character.c (char_string): Remove unnecessary casts.
6908
6909 Make sure a 64-bit char is never passed to CHAR_STRING.
6910 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
6911 by silently ignoring the top 32 bits, allowing some values
6912 that were far too large to be valid characters.
6913 * character.h: Include <verify.h>.
6914 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
6915 arguments are no wider than unsigned, as a compile-time check
6916 to prevent future regressions in this area.
6917 * data.c (Faset):
6918 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
6919 (Fsubst_char_in_region):
6920 * fns.c (concat):
6921 * xdisp.c (decode_mode_spec_coding):
6922 Adjust to CHAR_STRING's new requirement.
6923 * editfns.c (Finsert_char, Fsubst_char_in_region):
6924 * fns.c (concat): Check that character args are actually
6925 characters. Without this test, these functions did the wrong
6926 thing with wildly out-of-range values on 64-bit hosts.
6927
6928 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6929 These casts should not be needed on 32-bit hosts, either.
6930 * keyboard.c (read_char):
6931 * lread.c (Fload): Remove casts to unsigned.
6932
6933 * lisp.h (UNSIGNED_CMP): New macro.
6934 This fixes comparison bugs on 64-bit hosts.
6935 (ASCII_CHAR_P): Use it.
6936 * casefiddle.c (casify_object):
6937 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
6938 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6939 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6940 * dispextern.h (FACE_FROM_ID):
6941 * keyboard.c (read_char): Use UNSIGNED_CMP.
6942
6943 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6944 not to EMACS_INT, to avoid GCC warning.
6945
6946 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6947
6948 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6949 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6950 isn't needed on 32-bit machines.
6951
6952 * buffer.c (Fgenerate_new_buffer_name):
6953 Use EMACS_INT for count, not int.
6954 (advance_to_char_boundary): Return EMACS_INT, not int.
6955
6956 * data.c (Qcompiled_function): Now static.
6957
6958 * window.c (window_body_lines): Now static.
6959
6960 * image.c (gif_load): Rename local to avoid shadowing.
6961
6962 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6963 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6964 * alloc.c (make_save_value): Integer argument is now of type
6965 ptrdiff_t, not int.
6966 (mark_object): Use ptrdiff_t, not int.
6967 * lisp.h (pD): New macro.
6968 * print.c (print_object): Use it.
6969
6970 * alloc.c: Use EMACS_INT, not int, to count objects.
6971 (total_conses, total_markers, total_symbols, total_vector_size)
6972 (total_free_conses, total_free_markers, total_free_symbols)
6973 (total_free_floats, total_floats, total_free_intervals)
6974 (total_intervals, total_strings, total_free_strings):
6975 Now EMACS_INT, not int. All uses changed.
6976 (Fgarbage_collect): Compute overall total using a double, so that
6977 integer overflow is less likely to be a problem. Check for overflow
6978 when converting back to an integer.
6979 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
6980 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
6981 These were 'int' variables that could overflow on 64-bit hosts;
6982 they were never used, so remove them instead of repairing them.
6983 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6984 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
6985 Previously, this ceilinged at INT_MAX, but that doesn't work on
6986 64-bit machines.
6987 (allocate_pseudovector): Don't use EMACS_INT when int would do.
6988
6989 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
6990 (allocate_vectorlike): Check for ptrdiff_t overflow.
6991 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
6992 when a (possibly-narrower) signed value would do just as well.
6993 We prefer using signed arithmetic, to avoid comparison confusion.
6994
6995 * alloc.c: Catch some string size overflows that we were missing.
6996 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
6997 for convenience in STRING_BYTES_MAX.
6998 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
6999 The definition here is exact; the one in lisp.h was approximate.
7000 (allocate_string_data): Check for string overflow. This catches
7001 some instances we weren't catching before. Also, it catches
7002 size_t overflow on (unusual) hosts where SIZE_MAX <= min
7003 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
7004 and ptrdiff_t and EMACS_INT are both 64 bits.
7005
7006 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
7007 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
7008 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
7009
7010 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
7011
7012 * alloc.c (Fmake_string): Check for out-of-range init.
7013
7014 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
7015
7016 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
7017
7018 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
7019
7020 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
7021 xg_get_default_scrollbar_width.
7022
7023 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
7024 (int_gtk_range_get_value): Move to the scroll bar part of the file.
7025 (style_changed_cb): Call update_theme_scrollbar_width and call
7026 x_set_scroll_bar_default_width and xg_frame_set_char_size for
7027 all frames (Bug#8505).
7028 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
7029 Call gtk_window_set_resizable if HAVE_GTK3.
7030 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
7031 and height if HAVE_GTK3 (Bug#8505).
7032 (scroll_bar_width_for_theme): New variable.
7033 (update_theme_scrollbar_width): New function.
7034 (xg_get_default_scrollbar_width): Move code to
7035 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
7036 (xg_initialize): Call update_theme_scrollbar_width.
7037
7038 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
7039
7040 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
7041
7042 2011-06-12 Martin Rudalics <rudalics@gmx.at>
7043
7044 * frame.c (make_frame): Call other_buffer_safely instead of
7045 other_buffer.
7046
7047 * window.c (temp_output_buffer_show): Call display_buffer with
7048 second argument Vtemp_buffer_show_specifiers and reset latter
7049 immediately after the call.
7050 (Vtemp_buffer_show_specifiers): New variable.
7051 (auto_window_vscroll_p, next_screen_context_lines)
7052 (Vscroll_preserve_screen_position): Remove leading asterisks from
7053 doc-strings.
7054
7055 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
7056
7057 Fix minor problems found by GCC 4.6.0 static checking.
7058 * buffer.c (Qclone_number): Remove for now, as it's unused.
7059 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
7060 (record_buffer): Remove unused local.
7061 * frame.c (other_visible_frames, frame_buffer_list): Now static.
7062 (set_frame_buffer_list): Remove; unused.
7063 * frame.h (other_visible_frames): Remove decl.
7064 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
7065 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
7066 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
7067 if HAVE_GPM.
7068 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
7069 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
7070 Define only if HAVE_GPM.
7071 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
7072 (update_hints_inhibit): Remove; never set. All uses removed.
7073 * widgetprv.h (emacsFrameClassRec): Remove decl.
7074 * window.c (delete_deletable_window): Now returns void, since it
7075 wasn't returning anything.
7076 (compare_window_configurations): Remove unused locals.
7077 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
7078 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
7079 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
7080 the same widths as pointers. This follows up on the 2011-05-06 patch.
7081 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
7082 * xterm.h: Likewise.
7083 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
7084
7085 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
7086
7087 * makefile.w32-in: Update dependencies.
7088 (LISP_H): Add lib/intprops.h.
7089
7090 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
7091
7092 * image.c (gif_load): Add animation frame delay to the metadata.
7093 (syms_of_image): Use DEFSYM. New symbol `delay'.
7094
7095 2011-06-11 Martin Rudalics <rudalics@gmx.at>
7096
7097 * window.c (delete_deletable_window): Re-add.
7098 (Fset_window_configuration): Rewrite to handle dead buffers and
7099 consequently deletable windows.
7100 (window_tree, Fwindow_tree): Remove. Supply functionality in
7101 window.el.
7102 (compare_window_configurations): Simplify code.
7103
7104 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
7105
7106 * image.c (imagemagick_load_image): Fix type mismatch.
7107 (Fimagemagick_types): Likewise.
7108
7109 * window.h (replace_buffer_in_windows): Declare.
7110
7111 2011-06-11 Martin Rudalics <rudalics@gmx.at>
7112
7113 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
7114 Qclone_number. Remove external declaration of Qdelete_window.
7115 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
7116 code.
7117 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
7118 Run Qbuffer_list_update_hook if allowed.
7119 (Fother_buffer): Rewrite doc-string. Major rewrite for new
7120 buffer list implementation.
7121 (other_buffer_safely): New function.
7122 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
7123 calls to replace_buffer_in_windows and
7124 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
7125 if allowed.
7126 (record_buffer): Inhibit quitting and rewrite using quittable
7127 functions. Run Qbuffer_list_update_hook if allowed.
7128 (Frecord_buffer, Funrecord_buffer): New functions.
7129 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
7130 Move switch-to-buffer to window.el.
7131 (bury-buffer): Move to window.el.
7132 (Vbuffer_list_update_hook): New variable.
7133
7134 * lisp.h (other_buffer_safely): Add prototype in buffer.c
7135 section.
7136
7137 * window.h (resize_frame_windows): Move up in code.
7138 (Fwindow_frame): Remove EXFUN.
7139 (replace_buffer_in_all_windows): Remove prototype.
7140 (replace_buffer_in_windows_safely): Add prototype.
7141
7142 * window.c: Declare Qdelete_window static again. Move down
7143 declaration of select_count.
7144 (Fnext_window, Fprevious_window): Rewrite doc-strings.
7145 (Fother_window): Move to window.el.
7146 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
7147 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
7148 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
7149 window.el.
7150 (replace_buffer_in_windows): Implement by calling
7151 Qreplace_buffer_in_windows.
7152 (replace_buffer_in_all_windows): Remove with some functionality
7153 moved into replace_buffer_in_windows_safely.
7154 (replace_buffer_in_windows_safely): New function.
7155 (select_window_norecord, select_frame_norecord): Move in front
7156 of run_window_configuration_change_hook. Remove now obsolete
7157 declarations.
7158 (Fset_window_buffer): Rewrite doc-string.
7159 Call Qrecord_window_buffer.
7160 (keys_of_window): Move binding for other-window to window.el.
7161
7162 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
7163
7164 * dispextern.h (struct image): Replace data member, whose int_val
7165 and ptr_val fields were not used by anything, with a single
7166 lisp_val object.
7167
7168 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
7169 (gif_clear_image, gif_load, imagemagick_load_image)
7170 (gs_clear_image, gs_load): Callers changed.
7171
7172 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * buffer.h: Include <time.h>, for time_t.
7175 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
7176
7177 Fix minor problems found by static checking.
7178
7179 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
7180
7181 Make identifiers static if they are not used in other modules.
7182 * data.c (Qcompiled_function, Qframe, Qvector):
7183 * image.c (QimageMagick, Qsvg):
7184 * minibuf.c (Qmetadata):
7185 * window.c (resize_window_check, resize_root_window): Now static.
7186 * window.h (resize_window_check, resize_root_window): Remove decls.
7187
7188 * window.c (window_deletion_count, delete_deletable_window):
7189 Remove; unused.
7190 (window_body_lines): Now static.
7191 (Fdelete_other_windows_internal): Mark vars as initialized.
7192 Make sure 'resize_failed' is initialized.
7193 (run_window_configuration_change_hook): Rename local to avoid shadowing.
7194 (resize_window_apply): Remove unused local.
7195 * window.h (delete_deletable_window): Remove decl.
7196
7197 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
7198 (imagemagick_load_image): Fix pointer signedness problem by changing
7199 last arg from unsigned char * to char *. All uses changed.
7200 Also, fix a local for similar reasons.
7201 Remove unused locals. Remove locals to avoid shadowing.
7202 (fn_rsvg_handle_free): Remove; unused.
7203 (svg_load, svg_load_image): Fix pointer signedness problem.
7204 (imagemagick_load_image): Don't use garbage pointer image_wand.
7205
7206 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
7207
7208 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
7209
7210 * image.c (gif_load): Fix omitted cast error introduced by
7211 2011-06-06 change.
7212
7213 2011-06-10 Martin Rudalics <rudalics@gmx.at>
7214
7215 * window.h (resize_proportionally, orig_total_lines)
7216 (orig_top_line): Remove from window structure.
7217 (set_window_height, set_window_width, change_window_heights)
7218 (Fdelete_window): Remove prototypes.
7219 (resize_frame_windows): Remove duplicate declaration.
7220
7221 2011-06-10 Eli Zaretskii <eliz@gnu.org>
7222
7223 * window.h (resize_frame_windows, resize_window_check)
7224 (delete_deletable_window, resize_root_window)
7225 (resize_frame_windows): Declare prototypes.
7226
7227 * window.c (resize_window_apply): Make definition be "static" to
7228 match the prototype.
7229
7230 2011-06-10 Martin Rudalics <rudalics@gmx.at>
7231
7232 * window.c: Remove declarations of Qwindow_size_fixed,
7233 window_min_size_1, window_min_size_2, window_min_size,
7234 size_window, window_fixed_size_p, enlarge_window, delete_window.
7235 Remove static from declaration of Qdelete_window, it's
7236 temporarily needed by Fbury_buffer.
7237 (replace_window): Don't assign orig_top_line and
7238 orig_total_lines.
7239 (Fdelete_window, delete_window): Remove. Window deletion is
7240 handled by window.el.
7241 (window_loop): Remove DELETE_OTHER_WINDOWS case.
7242 Replace Fdelete_window calls with calls to Qdelete_window.
7243 (Fdelete_other_windows): Remove. Deleting other windows is
7244 handled by window.el.
7245 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
7246 handled in window.el.
7247 (window_min_size_2, window_min_size_1, window_min_size): Remove.
7248 Window minimum sizes are handled in window.el.
7249 (shrink_windows, size_window, set_window_height)
7250 (set_window_width, change_window_heights, window_height)
7251 (window_width, CURBEG, CURSIZE, enlarge_window)
7252 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
7253 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
7254 handled in window.el.
7255 (make_dummy_parent): Rename to make_parent_window and give it a
7256 second argument horflag.
7257 (make_window): Don't set resize_proportionally any more.
7258 (Fsplit_window): Remove. Windows are split in window.el.
7259 (save_restore_action, save_restore_orig_size)
7260 (shrink_window_lowest_first, save_restore_orig_size): Remove.
7261 Resize mini windows in window.el.
7262 (grow_mini_window, shrink_mini_window): Implement by calling
7263 Qresize_root_window_vertically, resize_window_check and
7264 resize_window_apply.
7265 (saved_window, Fset_window_configuration, save_window_save):
7266 Do not handle orig_top_line, orig_total_lines, and
7267 resize_proportionally.
7268 (window_min_height, window_min_width): Move to window.el.
7269 (keys_of_window): Move bindings for delete-other-windows,
7270 split-window, delete-window and enlarge-window to window.el.
7271
7272 * buffer.c: Temporarily extern Qdelete_window.
7273 (Fbury_buffer): Temporarily call Qdelete_window instead of
7274 Fdelete_window (Fbury_buffer will move to window.el soon).
7275
7276 * frame.c (set_menu_bar_lines_1): Remove code handling
7277 orig_top_line and orig_total_lines.
7278
7279 * dispnew.c (adjust_frame_glyphs_initially): Don't use
7280 set_window_height but set heights directly.
7281 (change_frame_size_1): Use resize_frame_windows.
7282
7283 * xdisp.c (init_xdisp): Don't use set_window_height but set
7284 heights directly.
7285
7286 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
7287 Use resize_frame_windows instead of change_window_heights and run
7288 run_window_configuration_change_hook.
7289
7290 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
7291 instead of change_window_heights and run
7292 run_window_configuration_change_hook.
7293
7294 2011-06-09 Martin Rudalics <rudalics@gmx.at>
7295
7296 * window.c (replace_window): Rename second argument REPLACEMENT to
7297 NEW. New third argument SETFLAG. Rewrite.
7298 (delete_window, make_dummy_parent): Call replace_window with
7299 third argument 1.
7300 (window_list_1): Move down in code.
7301 (run_window_configuration_change_hook): Move set_buffer part
7302 before select_frame_norecord part in order to unwind correctly.
7303 Rename count1 to count.
7304 (recombine_windows, delete_deletable_window, resize_root_window)
7305 (Fdelete_other_windows_internal)
7306 (Frun_window_configuration_change_hook, make_parent_window)
7307 (resize_window_check, resize_window_apply, Fresize_window_apply)
7308 (resize_frame_windows, Fsplit_window_internal)
7309 (Fdelete_window_internal, Fresize_mini_window_internal):
7310 New functions.
7311 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
7312
7313 2011-06-08 Martin Rudalics <rudalics@gmx.at>
7314
7315 * window.h (window): Add some new members to window structure -
7316 normal_lines, normal_cols, new_total, new_normal, clone_number,
7317 splits, nest, prev_buffers, next_buffers.
7318 (WINDOW_TOTAL_SIZE): Move here from window.c.
7319 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
7320
7321 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
7322 Remove.
7323 (make_dummy_parent): Set new members of windows structure.
7324 (make_window): Move down in code. Handle new members of window
7325 structure.
7326 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
7327 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
7328 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
7329 (Fset_window_prev_buffers, Fwindow_next_buffers)
7330 (Fset_window_next_buffers, Fset_window_clone_number):
7331 New functions.
7332 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
7333 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
7334 Doc-string fixes.
7335 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
7336 Argument WINDOW can be now internal window too.
7337 (Fwindow_use_time): Move up in code.
7338 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
7339 Rewrite doc-string.
7340 (Fset_window_configuration, saved_window)
7341 (Fcurrent_window_configuration, save_window_save): Handle new
7342 members of window structure.
7343 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
7344 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
7345 (syms_of_window): New Lisp objects Qrecord_window_buffer,
7346 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
7347 Qget_mru_window, Qresize_root_window,
7348 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
7349 Qauto_buffer_name; staticpro them.
7350
7351 2011-06-07 Martin Rudalics <rudalics@gmx.at>
7352
7353 * window.c (Fwindow_total_size, Fwindow_left_column)
7354 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
7355 (Fwindow_list_1): New functions.
7356 (window_box_text_cols): Replace with window_body_cols.
7357 (Fwindow_width, Fscroll_left, Fscroll_right):
7358 Use window_body_cols instead of window_box_text_cols.
7359 (delete_window, Fset_window_configuration):
7360 Call delete_all_subwindows with window as argument.
7361 (delete_all_subwindows): Take a window as argument and not a
7362 structure. Rewrite.
7363 (window_loop): Remove handling of GET_LRU_WINDOW and
7364 GET_LARGEST_WINDOW.
7365 (Fget_lru_window, Fget_largest_window): Move to window.el.
7366
7367 * window.h: Extern window_body_cols instead of
7368 window_box_text_cols. delete_all_subwindows now takes a
7369 Lisp_Object as argument.
7370
7371 * indent.c (compute_motion, Fcompute_motion):
7372 Use window_body_cols instead of window_box_text_cols.
7373
7374 * frame.c (delete_frame): Call delete_all_subwindows with root
7375 window as argument.
7376
7377 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
7378
7379 * fns.c (Fputhash): Document return value.
7380
7381 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
7382
7383 * image.c (gif_load): Implement gif89a spec "no disposal" method.
7384
7385 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7386
7387 Cons<->int and similar integer overflow fixes (Bug#8794).
7388
7389 Check for overflow when converting integer to cons and back.
7390 * charset.c (Fdefine_charset_internal, Fdecode_char):
7391 Use cons_to_unsigned to catch overflow.
7392 (Fencode_char): Use INTEGER_TO_CONS.
7393 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
7394 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
7395 * data.c (long_to_cons, cons_to_long): Remove.
7396 (cons_to_unsigned, cons_to_signed): New functions.
7397 These signal an error for invalid or out-of-range values.
7398 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
7399 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
7400 * font.c (Ffont_variation_glyphs):
7401 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
7402 * lisp.h: Include <intprops.h>.
7403 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
7404 (cons_to_signed, cons_to_unsigned): New decls.
7405 (long_to_cons, cons_to_long): Remove decls.
7406 * undo.c (record_first_change): Use INTEGER_TO_CONS.
7407 (Fprimitive_undo): Use CONS_TO_INTEGER.
7408 * xfns.c (Fx_window_property): Likewise.
7409 * xselect.c: Include <limits.h>.
7410 (x_own_selection, selection_data_to_lisp_data):
7411 Use INTEGER_TO_CONS.
7412 (x_handle_selection_request, x_handle_selection_clear)
7413 (x_get_foreign_selection, Fx_disown_selection_internal)
7414 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
7415 (lisp_data_to_selection_data): Use cons_to_unsigned.
7416 (x_fill_property_data): Use cons_to_signed.
7417 Report values out of range.
7418
7419 Check for buffer and string overflow more precisely.
7420 * buffer.h (BUF_BYTES_MAX): New macro.
7421 * lisp.h (STRING_BYTES_MAX): New macro.
7422 * alloc.c (Fmake_string):
7423 * character.c (string_escape_byte8):
7424 * coding.c (coding_alloc_by_realloc):
7425 * doprnt.c (doprnt):
7426 * editfns.c (Fformat):
7427 * eval.c (verror):
7428 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
7429 since they may not be the same number.
7430 * editfns.c (Finsert_char):
7431 * fileio.c (Finsert_file_contents):
7432 Likewise for BUF_BYTES_MAX.
7433
7434 * image.c: Use ptrdiff_t, not int, for sizes.
7435 (slurp_file): Switch from int to ptrdiff_t.
7436 All uses changed.
7437 (slurp_file): Check that file size fits in both size_t (for
7438 malloc) and ptrdiff_t (for sanity and safety).
7439
7440 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
7441 if b->modtime has its maximal value.
7442
7443 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
7444
7445 Don't assume time_t can fit into int.
7446 * buffer.h (struct buffer.modtime): Now time_t, not int.
7447 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
7448 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
7449
7450 Minor fixes for signed vs unsigned integers.
7451 * character.h (MAYBE_UNIFY_CHAR):
7452 * charset.c (maybe_unify_char):
7453 * keyboard.c (read_char, reorder_modifiers):
7454 XINT -> XFASTINT, since the integer must be nonnegative.
7455 * ftfont.c (ftfont_spec_pattern):
7456 * keymap.c (access_keymap, silly_event_symbol_error):
7457 XUINT -> XFASTINT, since the integer must be nonnegative.
7458 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
7459 since it makes no difference and we prefer signed.
7460 * keyboard.c (record_char): Use XUINT when all the neighbors do.
7461 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
7462 nonnegative.
7463
7464 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
7465
7466 * window.h (Fwindow_frame): Declare.
7467
7468 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7469
7470 * alloc.c: Simplify handling of large-request failures (Bug#8800).
7471 (SPARE_MEMORY): Always define.
7472 (LARGE_REQUEST): Remove.
7473 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
7474
7475 2011-06-06 Martin Rudalics <rudalics@gmx.at>
7476
7477 * lisp.h: Move EXFUNS for Fframe_root_window,
7478 Fframe_first_window and Fset_frame_selected_window to window.h.
7479
7480 * window.h: Move EXFUNS for Fframe_root_window,
7481 Fframe_first_window and Fset_frame_selected_window here from
7482 lisp.h.
7483
7484 * frame.c (Fwindow_frame, Fframe_first_window)
7485 (Fframe_root_window, Fframe_selected_window)
7486 (Fset_frame_selected_window): Move to window.c.
7487 (Factive_minibuffer_window): Move to minibuf.c.
7488 (Fother_visible_frames_p): New function.
7489
7490 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
7491
7492 * window.c (decode_window, decode_any_window): Move up in code.
7493 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
7494 (inhibit_frame_unsplittable): Remove unused variable.
7495 (Fwindow_buffer): Move up and rewrite doc-string.
7496 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
7497 (Fwindow_prev): New functions.
7498 (Fwindow_frame): Move here from frame.c. Accept any window as
7499 argument.
7500 (Fframe_root_window, Fframe_first_window)
7501 (Fframe_selected_window): Move here from frame.c. Accept frame
7502 or arbitrary window as argument. Update doc-strings.
7503 (Fminibuffer_window): Move up in code.
7504 (Fwindow_minibuffer_p): Move up in code and simplify.
7505 (Fset_frame_selected_window): Move here from frame.c.
7506 Marginal rewrite.
7507 (Fselected_window, select_window, Fselect_window): Move up in
7508 code. Minor doc-string fixes.
7509
7510 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7511
7512 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
7513 Do not assume that spare memory exists; that assumption is valid
7514 only if SYSTEM_MALLOC.
7515 (LARGE_REQUEST): New macro, so that the issue of large requests
7516 is separated from the issue of spare memory.
7517
7518 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
7519
7520 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
7521 format. (Bug#8806)
7522
7523 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
7524
7525 * xfns.c (x_set_scroll_bar_default_width): Move declarations
7526 before statements.
7527
7528 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
7529
7530 * gtkutil.c (xg_get_default_scrollbar_width): New function.
7531
7532 * gtkutil.h: Declare xg_get_default_scrollbar_width.
7533
7534 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
7535 min width by calling x_set_scroll_bar_default_width (Bug#8505).
7536
7537 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
7538
7539 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
7540
7541 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
7542
7543 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
7544 (x_clipboard_manager_save): Add return value.
7545 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
7546 New error handlers.
7547 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
7548 Obey Vx_select_enable_clipboard_manager. Catch errors in
7549 x_clipboard_manager_save (Bug#8779).
7550 (Vx_select_enable_clipboard_manager): New variable.
7551 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
7552
7553 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
7554
7555 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
7556
7557 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7558
7559 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
7560 in the current matrix if keep_current_p is non-zero.
7561
7562 2011-06-04 Eli Zaretskii <eliz@gnu.org>
7563
7564 * bidi.c (bidi_level_of_next_char): Fix last change.
7565
7566 2011-06-03 Eli Zaretskii <eliz@gnu.org>
7567
7568 Support bidi reordering of text covered by display properties.
7569
7570 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
7571 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
7572 (bidi_cache_search, bidi_cache_iterator_state)
7573 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7574 (bidi_level_of_next_char, bidi_move_to_visually_next):
7575 Support character positions inside a run of characters covered by a
7576 display string.
7577 (bidi_paragraph_init, bidi_resolve_explicit_1)
7578 (bidi_level_of_next_char): Call bidi_fetch_char and
7579 bidi_fetch_char_advance instead of FETCH_CHAR and
7580 FETCH_CHAR_ADVANCE.
7581 (bidi_init_it): Initialize new members.
7582 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
7583 definitions.
7584 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
7585 instead of using explicit *_CHAR codes.
7586 (bidi_resolve_explicit, bidi_resolve_weak):
7587 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
7588 bidirectional text is supported only in multibyte buffers.
7589 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
7590 it to initialize the frame_window_p member of struct bidi_it.
7591 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
7592 (bidi_resolve_explicit, bidi_resolve_weak)
7593 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
7594 bidi_it->nchars is non-positive.
7595 (bidi_level_of_next_char): Don't try to lookup the cache for the
7596 next/previous character if nothing is cached there yet, or if we
7597 were just reseat()'ed to a new position.
7598
7599 * xdisp.c (set_cursor_from_row): Set start and stop points
7600 according to the row's direction when priming the loop that looks
7601 for the glyph on which to display cursor.
7602 (single_display_spec_intangible_p): Function deleted.
7603 (display_prop_intangible_p): Reimplement to call
7604 handle_display_spec instead of single_display_spec_intangible_p.
7605 Accept 3 additional arguments needed by handle_display_spec.
7606 This fixes incorrect cursor motion across display property with complex
7607 values: lists, `(when COND...)' forms, etc.
7608 (single_display_spec_string_p): Support property values that are
7609 lists with the argument STRING its top-level element.
7610 (display_prop_string_p): Fix the condition for processing a
7611 property that is a list to be consistent with handle_display_spec.
7612 (handle_display_spec): New function, refactored from the
7613 last portion of handle_display_prop.
7614 (compute_display_string_pos): Accept additional argument
7615 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
7616 value of a `display' property is a "replacing spec".
7617 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
7618 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
7619 the display property, but just return a value indicating whether
7620 the display property will replace the characters it covers.
7621 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
7622 frame_window_p members of struct bidi_it.
7623 (compute_display_string_pos, compute_display_string_end):
7624 New functions.
7625 (push_it): Accept second argument POSITION, where pop_it should
7626 jump to continue iteration.
7627 (reseat_1): Initialize bidi_it.disp_pos.
7628
7629 * keyboard.c (adjust_point_for_property): Adjust the call to
7630 display_prop_intangible_p to its new signature.
7631
7632 * dispextern.h (struct bidi_it): New member frame_window_p.
7633 (bidi_init_it): Update prototypes.
7634 (display_prop_intangible_p): Update prototype.
7635 (compute_display_string_pos, compute_display_string_end):
7636 Declare prototypes.
7637 (struct bidi_it): New members nchars and disp_pos. ch_len is now
7638 EMACS_INT.
7639
7640 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
7641
7642 Malloc failure behavior now depends on size of allocation.
7643 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
7644 * lisp.h: Change signatures accordingly.
7645 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
7646 All callers changed. (Bug#8762)
7647
7648 * gnutls.c: Use Emacs's memory allocators.
7649 Without this change, the gnutls library would invoke malloc etc.
7650 directly, which causes problems on non-SYNC_INPUT hosts, and which
7651 runs afoul of improving memory_full behavior. (Bug#8761)
7652 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
7653 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
7654 xfree instead of the default malloc, realloc, free.
7655 (Fgnutls_boot): No need to check for memory allocation failure,
7656 since xmalloc does that for us.
7657
7658 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
7659 * category.c (hash_get_category_set):
7660 * ccl.c (ccl_driver):
7661 * charset.c (Fdefine_charset_internal):
7662 * charset.h (struct charset.hash_index):
7663 * composite.c (get_composition_id, gstring_lookup_cache)
7664 (composition_gstring_put_cache):
7665 * composite.h (struct composition.hash_index):
7666 * dispextern.h (struct image.hash):
7667 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
7668 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
7669 (hashfn_equal, hashfn_user_defined, make_hash_table)
7670 (maybe_resize_hash_table, hash_lookup, hash_put)
7671 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
7672 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
7673 (Fsxhash, Fgethash, Fputhash, Fmaphash):
7674 * image.c (make_image, search_image_cache, lookup_image)
7675 (xpm_put_color_table_h):
7676 * lisp.h (struct Lisp_Hash_Table):
7677 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
7678 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
7679 for hashes and hash indexes, instead of 'unsigned' and 'int'.
7680 * alloc.c (allocate_vectorlike):
7681 Check for overflow in vector size calculations.
7682 * ccl.c (ccl_driver):
7683 Check for overflow when converting EMACS_INT to int.
7684 * fns.c, image.c: Remove unnecessary static decls that would otherwise
7685 need to be updated by these changes.
7686 * fns.c (make_hash_table, maybe_resize_hash_table):
7687 Check for integer overflow with large hash tables.
7688 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
7689 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
7690 (SXHASH_REDUCE): New macro.
7691 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
7692 Use it instead of discarding useful hash info with large hash values.
7693 (sxhash_float): New function.
7694 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
7695 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
7696 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
7697 Rewrite to use FIXNUM_BITS, as this simplifies things.
7698 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
7699 Adjust signatures to match updated version of code.
7700 (consing_since_gc): Now EMACS_INT, since a single hash table can
7701 use more than INT_MAX bytes.
7702
7703 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
7704
7705 Make it possible to build with GCC-4.6+ -O2 -flto.
7706
7707 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
7708
7709 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
7710
7711 * minibuf.c (get_minibuffer, read_minibuf_unwind):
7712 Call minibuffer-inactive-mode.
7713
7714 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
7715
7716 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
7717 Update dependencies.
7718
7719 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7720
7721 * data.c (init_data): Remove code for UTS, this system is not
7722 supported anymore.
7723
7724 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7725
7726 Don't force ./temacs to start in terminal mode.
7727
7728 * frame.c (make_initial_frame): Initialize faces in all cases, not
7729 only when CANNOT_DUMP is defined.
7730 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
7731
7732 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7733
7734 * dispnew.c (add_window_display_history): Use const for the string
7735 pointer. Remove declaration, not needed.
7736
7737 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7738
7739 Use 'inline', not 'INLINE'.
7740 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
7741 * alloc.c, fontset.c (INLINE): Remove.
7742 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
7743 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
7744 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
7745 * gmalloc.c (register_heapinfo): Use inline unconditionally.
7746 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
7747
7748 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7749
7750 Make it possible to run ./temacs.
7751
7752 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
7753 syms_of_callproc does the same thing. Remove test for
7754 "initialized", do it in the caller.
7755 * emacs.c (main): Avoid calling set_initial_environment when dumping.
7756
7757 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
7758
7759 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
7760 (read_minibuf): Use get_minibuffer.
7761 (syms_of_minibuf): Use DEFSYM.
7762 (Qmetadata): New var.
7763 * data.c (Qbuffer): Don't make it static.
7764 (syms_of_data): Use DEFSYM.
7765
7766 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7767
7768 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
7769 (CCL_CODE_MIN): New macro.
7770
7771 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
7772
7773 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
7774
7775 * eval.c (Qdebug): Now static.
7776 * lisp.h (Qdebug): Remove decl. This reverts a part of the
7777 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
7778 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
7779
7780 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7781
7782 * image.c: Various fixes to ImageMagick code comments.
7783 (Fimagemagick_types): Doc fix.
7784
7785 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
7786
7787 Minor fixes prompted by GCC 4.6.0 warnings.
7788
7789 * xselect.c (converted_selections, conversion_fail_tag): Now static.
7790
7791 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
7792 (x_clipboard_manager_save_all): Move extern decl to ...
7793 * xterm.h: ... here, so that it can be checked for consistency.
7794
7795 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7796
7797 * xselect.c (x_clipboard_manager_save_frame)
7798 (x_clipboard_manager_save_all): New functions.
7799 (Fx_clipboard_manager_save): Lisp function deleted.
7800
7801 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
7802 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
7803
7804 * xterm.h: Update prototype.
7805
7806 2011-05-28 William Xu <william.xwl@gmail.com>
7807
7808 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
7809 exiting (Bug#8239).
7810
7811 2011-05-28 Jim Meyering <meyering@redhat.com>
7812
7813 Avoid a sign-extension bug in crypto_hash_function.
7814 * fns.c (to_uchar): Define.
7815 (crypto_hash_function): Use it to convert some newly-signed
7816 variables to unsigned, to avoid sign-extension bugs. For example,
7817 without this change, (md5 "truc") would evaluate to
7818 45723a2aff78ff4fff7fff1114760e62 rather than the expected
7819 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
7820 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
7821
7822 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7823
7824 Integer overflow fixes.
7825
7826 * dbusbind.c: Serial number integer overflow fixes.
7827 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
7828 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
7829 to hold a serial number that is too large for a fixnum.
7830 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7831 Check for serial numbers out of range. Decode any serial number
7832 that was so large that it became a float. (Bug#8722)
7833
7834 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
7835 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7836 Use XFASTINT rather than XUINT when numbers are nonnegative.
7837 (xd_append_arg, Fdbus_method_return_internal):
7838 (Fdbus_method_error_internal): Likewise. Also, for unsigned
7839 arguments, check that Lisp number is nonnegative, rather than
7840 silently wrapping negative numbers around. (Bug#8722)
7841 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
7842 (Bug#8722)
7843
7844 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7845
7846 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7847
7848 ccl: Add integer overflow checks.
7849 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7850 (IN_INT_RANGE): New macros.
7851 (ccl_driver): Use them to check for integer overflow when
7852 decoding a CCL program. Many of the new checks are whether XINT (x)
7853 fits in int; it doesn't always, on 64-bit hosts. The new version
7854 doesn't catch all possible integer overflows, but it's an
7855 improvement. (Bug#8719)
7856
7857 * alloc.c (make_event_array): Use XINT, not XUINT.
7858 There's no need for unsigned here.
7859
7860 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
7861 This follows up to the 2011-05-06 change that substituted uintptr_t
7862 for EMACS_INT. This case wasn't caught back then.
7863
7864 Rework Fformat to avoid integer overflow issues.
7865 * editfns.c: Include <float.h> unconditionally, as it's everywhere
7866 now (part of C89). Include <verify.h>.
7867 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
7868 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
7869 (Fformat): Avoid the prepass trying to compute sizes; it was only
7870 approximate and thus did not catch overflow reliably. Instead, walk
7871 through the format just once, formatting and computing sizes as we go,
7872 checking for integer overflow at every step, and allocating a larger
7873 buffer as needed. Keep track separately whether the format is
7874 multibyte. Keep only the most-recently calculated precision, rather
7875 than them all. Record whether each argument has been converted to
7876 string. Use EMACS_INT, not int, for byte and char and arg counts.
7877 Support field widths and precisions larger than INT_MAX. Avoid
7878 sprintf's undefined behavior with conversion specifications such as %#d
7879 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
7880 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
7881 formatting out-of-range floating point numbers with int
7882 formats. (Bug#8668)
7883
7884 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
7885
7886 * data.c: Avoid integer truncation in expressions involving floats.
7887 * data.c: Include <intprops.h>.
7888 (arith_driver): When there's an integer overflow in an expression
7889 involving floating point, convert the integers to floating point
7890 so that the resulting value does not suffer from catastrophic
7891 integer truncation. For example, on a 64-bit host (* 4
7892 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
7893 Do not rely on undefined behavior after integer overflow.
7894
7895 merge count_size_as_multibyte, parse_str_to_multibyte
7896 * character.c, character.h (count_size_as_multibyte):
7897 Rename from parse_str_to_multibyte; all uses changed.
7898 Check for integer overflow.
7899 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
7900 since it's now a duplicate of the other. This is more of
7901 a character than a buffer op, so better that it's in character.c.
7902 * fns.c, print.c: Adjust to above changes.
7903
7904 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
7905
7906 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
7907
7908 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7909
7910 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7911 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
7912 (x_clipboard_manager_save): Now static.
7913 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
7914
7915 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7916 (crypto_hash_function): Now static.
7917 Fix pointer signedness problems. Avoid unnecessary initializations.
7918
7919 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
7920
7921 * termhooks.h (Vselection_alist): Make it terminal-local.
7922
7923 * terminal.c (create_terminal): Initialize it.
7924
7925 * xselect.c: Support for clipboard managers.
7926 (Vselection_alist): Move to termhooks.h as terminal-local var.
7927 (LOCAL_SELECTION): New macro.
7928 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7929 (symbol_to_x_atom): Remove gratuitous arg.
7930 (x_handle_selection_request, lisp_data_to_selection_data)
7931 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
7932 (x_own_selection, x_get_local_selection, x_convert_selection):
7933 New arg, specifying work frame. Use terminal-local Vselection_alist.
7934 (some_frame_on_display): Delete unused function.
7935 (Fx_own_selection_internal, Fx_get_selection_internal)
7936 (Fx_disown_selection_internal, Fx_selection_owner_p)
7937 (Fx_selection_exists_p): New optional frame arg.
7938 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7939 (x_handle_selection_clear): Don't treat other terminals with the
7940 same keyboard specially. Use the terminal-local Vselection_alist.
7941 (x_clear_frame_selections): Use Frun_hook_with_args.
7942
7943 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7944
7945 * xterm.h: Add support for those atoms.
7946
7947 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
7948
7949 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7950 (converted_selections, conversion_fail_tag): New global variables.
7951 (x_selection_request_lisp_error): Free the above.
7952 (x_get_local_selection): Remove unnecessary code.
7953 (x_reply_selection_request): Args changed; handle arbitrary array
7954 of converted selections stored in converted_selections.
7955 Separate the XChangeProperty and SelectionNotify steps.
7956 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7957 (x_convert_selection): New function.
7958 (x_handle_selection_event): Simplify.
7959 (x_get_foreign_selection): Don't ignore incoming requests while
7960 waiting for an answer; this will fail when we implement
7961 SAVE_TARGETS, and seems unnecessary anyway.
7962 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7963 (Vx_sent_selection_functions): Doc fix.
7964
7965 2011-05-26 Leo Liu <sdl.web@gmail.com>
7966
7967 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
7968
7969 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7970
7971 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
7972
7973 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
7974 for fringe update if it has periodic bitmap.
7975 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
7976 and fringe_bitmap_periodic_p.
7977
7978 * fringe.c (get_fringe_bitmap_data): New function.
7979 (draw_fringe_bitmap_1, update_window_fringes): Use it.
7980 (update_window_fringes): Record periodicity of fringe bitmap in glyph
7981 row. Mark glyph row for fringe update if periodicity changed.
7982
7983 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
7984 for fringe update unless it has periodic bitmap.
7985
7986 2011-05-25 Kenichi Handa <handa@m17n.org>
7987
7988 * xdisp.c (get_next_display_element): Set correct it->face_id for
7989 a static composition.
7990
7991 2011-05-24 Leo Liu <sdl.web@gmail.com>
7992
7993 * deps.mk (fns.o):
7994 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
7995
7996 * fns.c (crypto_hash_function, Fsha1): New function.
7997 (Fmd5): Use crypto_hash_function.
7998 (syms_of_fns): Add Ssha1.
7999
8000 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8001
8002 * gnutls.c: Remove unused macros.
8003 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
8004 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
8005 Remove macros that are defined and never used.
8006 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
8007
8008 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
8009
8010 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
8011 (Fx_get_selection_internal): Minor cleanup.
8012 (Fx_own_selection_internal): Rename arguments for consistency with
8013 select.el.
8014
8015 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8016
8017 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
8018
8019 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
8020
8021 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
8022
8023 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8024
8025 * dispnew.c (scrolling_window): Don't exclude the case that the
8026 last enabled row in the desired matrix touches the bottom boundary.
8027
8028 2011-05-21 Glenn Morris <rgm@gnu.org>
8029
8030 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
8031 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
8032 and add some more files.
8033
8034 2011-05-20 Eli Zaretskii <eliz@gnu.org>
8035
8036 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
8037 report_file_error introduced by the change from 2011-05-07.
8038
8039 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
8040
8041 * systime.h (Time): Define only if emacs is defined.
8042 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
8043 where the include path doesn't have X11/X.h by default. See
8044 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
8045
8046 2011-05-20 Kenichi Handa <handa@m17n.org>
8047
8048 * composite.c (find_automatic_composition): Fix previous change.
8049
8050 2011-05-20 Glenn Morris <rgm@gnu.org>
8051
8052 * lisp.mk: New file, split from Makefile.in.
8053 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
8054 (shortlisp): Remove.
8055 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
8056
8057 2011-05-19 Glenn Morris <rgm@gnu.org>
8058
8059 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
8060 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
8061 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
8062 (lisp): Set the order to that of loadup.el.
8063 (shortlisp): Make it a copy of $lisp.
8064 (SOME_MACHINE_LISP): Remove.
8065 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
8066 Use just $shortlisp, not $SOME_MACHINE_LISP too.
8067
8068 2011-05-18 Kenichi Handa <handa@m17n.org>
8069
8070 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
8071 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
8072 (find_automatic_composition): Mostly rewrite for efficiency.
8073
8074 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
8075
8076 * makefile.w32-in: Update dependencies.
8077
8078 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
8079
8080 * menu.c: Include limits.h (fixes the MS-Windows build broken by
8081 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8082
8083 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
8084
8085 Fix some integer overflow issues, such as string length overflow.
8086
8087 * insdel.c (count_size_as_multibyte): Check for string overflow.
8088
8089 * character.c (lisp_string_width): Check for string overflow.
8090 Use EMACS_INT, not int, for string indexes and lengths; in
8091 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
8092 the resulting string length overflows an EMACS_INT; instead,
8093 report a string overflow if no precision given. When checking for
8094 precision exhaustion, use a check that cannot possibly have
8095 integer overflow. (Bug#8675)
8096 * character.h (lisp_string_width): Adjust to new signature.
8097
8098 * alloc.c (string_overflow): New function.
8099 (Fmake_string): Use it. This doesn't change behavior, but saves
8100 a few bytes and will simplify future changes.
8101 * character.c (string_escape_byte8): Likewise.
8102 * lisp.h (string_overflow): New decl.
8103
8104 Fixups, following up to the user-interface timestamp change.
8105 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
8106 for UI timestamps, instead of unsigned long.
8107 * msdos.c (mouse_get_pos): Likewise.
8108 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
8109 * w32gui.h (Time): Define by including "systime.h" rather than by
8110 declaring it ourselves. (Bug#8664)
8111
8112 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
8113 * image.c (clear_image_cache): Likewise.
8114
8115 * term.c (term_mouse_position): Don't assume time_t wraparound.
8116
8117 Be more systematic about user-interface timestamps.
8118 Before, the code sometimes used 'Time', sometimes 'unsigned long',
8119 and sometimes 'EMACS_UINT', to represent these timestamps.
8120 This change causes it to use 'Time' uniformly, as that's what X uses.
8121 This makes the code easier to follow, and makes it easier to catch
8122 integer overflow bugs such as Bug#8664.
8123 * frame.c (Fmouse_position, Fmouse_pixel_position):
8124 Use Time, not unsigned long, for user-interface timestamps.
8125 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
8126 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
8127 * keyboard.h (last_event_timestamp): Likewise.
8128 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
8129 * menu.h (xmenu_show): Likewise.
8130 * term.c (term_mouse_position): Likewise.
8131 * termhooks.h (struct input_event.timestamp): Likewise.
8132 (struct terminal.mouse_position_hook): Likewise.
8133 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
8134 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
8135 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
8136 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
8137 what it was before.
8138 * menu.h, termhooks.h: Include "systime.h", for Time.
8139
8140 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
8141 Don't assume that the difference between two unsigned long values
8142 can fit into an integer. At this point, we know button_down_time
8143 <= event->timestamp, so the difference must be nonnegative, so
8144 there's no need to cast the result if double-click-time is
8145 nonnegative, as it should be; check that it's nonnegative, just in
8146 case. This bug is triggered when events are more than 2**31 ms
8147 apart (about 25 days). (Bug#8664)
8148
8149 * xselect.c (last_event_timestamp): Remove duplicate decl.
8150 (x_own_selection): Remove needless cast to unsigned long.
8151
8152 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
8153 that always fit in int. Use a sentinel instead of a counter, to
8154 avoid a temp and to allay GCC's concerns about possible int overflow.
8155 * frame.h (struct frame): Use int for menu_bar_items_used
8156 instead of EMACS_INT, since it always fits in int.
8157
8158 * menu.c (grow_menu_items): Check for int overflow.
8159
8160 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
8161
8162 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
8163 Before, the code was not consistent. These values cannot exceed
8164 2**31 - 1 so there's no need to make them unsigned.
8165 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
8166 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
8167 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
8168 as modifiers.
8169 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
8170
8171 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
8172 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
8173 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
8174 presumably because the widths might not match.
8175
8176 * window.c (size_window): Avoid needless test at loop start.
8177
8178 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
8179
8180 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
8181
8182 2011-05-12 Drew Adams <drew.adams@oracle.com>
8183
8184 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
8185
8186 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8187
8188 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
8189 `width' to `bar_area_x' and `bar_area_width', respectively.
8190 (x_scroll_run): Take account of fringe background extension.
8191
8192 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
8193 Rename local vars `left' and `width' to `bar_area_x' and
8194 `bar_area_width', respectively.
8195 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
8196 background extension.
8197
8198 2011-05-10 Jim Meyering <meyering@redhat.com>
8199
8200 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
8201
8202 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
8203
8204 * image.c (Finit_image_library): Return t for built-in image types,
8205 like pbm and xbm. (Bug#8640)
8206
8207 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
8208
8209 * w32menu.c (set_frame_menubar): Fix submenu allocation.
8210
8211 2011-05-07 Eli Zaretskii <eliz@gnu.org>
8212
8213 * w32console.c (Fset_screen_color): Doc fix.
8214 (Fget_screen_color): New function.
8215 (syms_of_ntterm): Defsubr it.
8216
8217 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
8218 unlink the temporary file if Fcall_process didn't create it in the
8219 first place.
8220 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
8221 child process will be redirected to a file specified with `:file'.
8222 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
8223 cue to call_process_cleanup not to close that handle.
8224
8225 2011-05-07 Ben Key <bkey76@gmail.com>
8226
8227 * makefile.w32-in: The bootstrap-temacs rule now makes use of
8228 one of two shell specific rules, either bootstrap-temacs-CMD or
8229 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
8230 to the previous implementation of the bootstrap-temacs rule.
8231 The bootstrap-temacs-CMD rule is similar to the previous
8232 implementation of the bootstrap-temacs rule except that it
8233 makes use of the ESC_CFLAGS variable instead of the CFLAGS
8234 variable.
8235
8236 These changes, along with some changes to nt/configure.bat,
8237 nt/gmake.defs, and nt/nmake.defs, are required to extend my
8238 earlier fix to add support for --cflags and --ldflags options
8239 that include quotes so that it works whether make uses cmd or
8240 sh as the shell.
8241
8242 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
8243
8244 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
8245 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
8246 is a constant.
8247 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
8248 a string. Handle both cases.
8249 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
8250 (Fdbus_register_method): Use Qinvalid_function.
8251
8252 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
8253
8254 * makefile.w32-in: Update dependencies.
8255 (LISP_H): Add inttypes.h and stdin.h.
8256 (PROCESS_H): Add unistd.h.
8257
8258 2011-05-06 Eli Zaretskii <eliz@gnu.org>
8259
8260 * lread.c: Include limits.h (fixes the MS-Windows build broken by
8261 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
8262
8263 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
8264
8265 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
8266
8267 * term.c (vfatal): Remove stray call to va_end.
8268 It's not needed and the C Standard doesn't allow it here anyway.
8269
8270 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
8271 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
8272
8273 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
8274 bytes.
8275
8276 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
8277
8278 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8279
8280 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
8281
8282 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
8283
8284 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
8285
8286 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
8287 * charset.c (Fdefine_charset_internal): Don't initialize
8288 charset.code_space[15]. The value was garbage, on hosts with
8289 32-bit int (Bug#8600).
8290
8291 * lread.c (read_integer): Be more consistent with string-to-number.
8292 Use string_to_number to do the actual conversion; this avoids
8293 rounding errors and fixes some other screwups. Without this fix,
8294 for example, #x1fffffffffffffff was misread as -2305843009213693952.
8295 (digit_to_number): Move earlier, for benefit of read_integer.
8296 Return -1 if the digit is out of range for the base, -2 if it is
8297 not a digit in any supported base. (Bug#8602)
8298
8299 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
8300
8301 * dispnew.c (scrolling_window): Return 1 if we scrolled,
8302 to match comment at start of function. This also removes a
8303 GCC warning about overflow in a 32+64-bit port.
8304
8305 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
8306
8307 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
8308 Reported by Stefan Monnier in
8309 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
8310 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8311 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
8312
8313 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
8314 (EMACS_UINTPTR): Likewise, with uintptr_t.
8315
8316 * lisp.h: Prefer 64-bit EMACS_INT if available.
8317 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
8318 on 32-bit hosts that have 64-bit int, so that they can access
8319 large files.
8320 However, temporarily disable this change unless the temporary
8321 symbol WIDE_EMACS_INT is defined.
8322
8323 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
8324
8325 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
8326 This removes an assumption that EMACS_INT and long are the same
8327 width as pointers. The assumption is true for Emacs porting targets
8328 now, but we want to make other targets possible.
8329 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
8330 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
8331 In the rest of the code, change types of integers that hold casted
8332 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
8333 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
8334 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
8335 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
8336 No need to cast type when ORing.
8337 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
8338 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
8339 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
8340 assume EMACS_INT is the same width as char *.
8341 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
8342 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
8343 Remove no-longer-needed casts.
8344 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
8345 (xg_tool_bar_help_callback, xg_make_tool_item):
8346 Use EMACS_INTPTR to hold an integer
8347 that will be cast to void *; this can avoid a GCC warning
8348 if EMACS_INT is not the same width as void *.
8349 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
8350 * xdisp.c (display_echo_area_1, resize_mini_window_1):
8351 (current_message_1, set_message_1):
8352 Use a local to convert to proper width without a cast.
8353 * xmenu.c (dialog_selection_callback): Likewise.
8354
8355 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
8356 Also, don't assume VALBITS / RAND_BITS is less than 5,
8357 and don't rely on undefined behavior when shifting a 1 left into
8358 the sign bit.
8359 * lisp.h (get_random): Change signature to match.
8360
8361 * lread.c (hash_string): Use size_t, not int, for hash computation.
8362 Normally we prefer signed values; but hashing is special, because
8363 it's better to use unsigned division on hash table sizes so that
8364 the remainder is nonnegative. Also, size_t is the natural width
8365 for hashing into memory. The previous code used 'int', which doesn't
8366 retain enough info to hash well into very large tables.
8367 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
8368
8369 * dbusbind.c: Don't possibly lose pointer info when converting.
8370 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8371 Use XPNTR rather than XHASH, so that the high-order bits of
8372 the pointer aren't lost when converting through void *.
8373
8374 * eval.c (Fautoload): Don't double-shift a pointer.
8375
8376 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
8377
8378 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
8379
8380 * gnutls.c (DEF_GNUTLS_FN):
8381 * image.c (DEF_IMGLIB_FN): Make function pointers static.
8382
8383 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
8384
8385 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
8386 marker. (Bug#8610)
8387
8388 2011-05-05 Eli Zaretskii <eliz@gnu.org>
8389
8390 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
8391 New version that can reserve upto 2GB of heap space.
8392
8393 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
8394
8395 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
8396
8397 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
8398
8399 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
8400 `gnutls_certificate_set_x509_key_file'.
8401
8402 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
8403
8404 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
8405 Update dependencies.
8406
8407 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8408
8409 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
8410 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8411 Remove unused parameter `fildes'.
8412 * process.c (read_process_output, send_process): Don't pass it.
8413
8414 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8415
8416 Fix previous change: the library cache is defined in w32.c.
8417 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
8418 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
8419
8420 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8421
8422 Implement dynamic loading of GnuTLS on Windows.
8423
8424 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
8425 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
8426 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8427 Declare.
8428
8429 * gnutls.c (Qgnutls_dll): Define.
8430 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
8431 (gnutls_*): Declare function pointers.
8432 (init_gnutls_functions): New function to initialize function pointers.
8433 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
8434 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
8435 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8436 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
8437 (emacs_gnutls_write, emacs_gnutls_read)
8438 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
8439 (Fgnutls_available_p): New function.
8440 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
8441 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
8442 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
8443
8444 * image.c: Include w32.h.
8445 (Vimage_type_cache): Delete.
8446 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
8447 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
8448 (w32_delayed_load): Move to w32.c.
8449
8450 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
8451
8452 * w32.c (QCloaded_from, Vlibrary_cache): Define.
8453 (w32_delayed_load): Move from image.c. When loading a library, record
8454 its filename in the :loaded-from property of the library id.
8455 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
8456 Initialize and staticpro them.
8457 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
8458
8459 * process.c: Include lisp.h before w32.h, not after.
8460 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
8461 instead of gnutls_record_check_pending.
8462
8463 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
8464
8465 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
8466
8467 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
8468 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
8469 as passed in.
8470
8471 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
8472
8473 * xterm.c (x_set_frame_alpha): Do not set property on anything
8474 else than FRAME_X_OUTER_WINDOW (Bug#8608).
8475
8476 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
8477
8478 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
8479
8480 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
8481
8482 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
8483 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
8484 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
8485 (gnutls_global_initialized, Qgnutls_bootprop_priority)
8486 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
8487 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
8488 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
8489 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
8490 (Qgnutls_bootprop_callbacks_verify): Make static.
8491
8492 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
8493
8494 * callproc.c: Indentation fixup.
8495
8496 * sysdep.c (wait_for_termination_1): Make static.
8497 (wait_for_termination, interruptible_wait_for_termination):
8498 Move after wait_for_termination_1.
8499
8500 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
8501
8502 * sysdep.c (interruptible_wait_for_termination): New function
8503 which is like wait_for_termination, but allows keyboard
8504 interruptions.
8505
8506 * callproc.c (Fcall_process): Add (:file "file") as an option for
8507 the STDOUT buffer.
8508 (Fcall_process_region): Ditto.
8509
8510 2011-04-30 Eli Zaretskii <eliz@gnu.org>
8511
8512 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
8513 rather than `XVECTOR (FOO)->size'.
8514
8515 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
8516 inttypes.h, as a gnulib replacement is used if it not available in
8517 system headers.
8518
8519 2011-04-21 Eli Zaretskii <eliz@gnu.org>
8520
8521 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
8522 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
8523 of MOST_POSITIVE_FIXNUM. (Bug#8528)
8524
8525 * coding.c (coding_alloc_by_realloc): Error out if destination
8526 will grow beyond MOST_POSITIVE_FIXNUM.
8527 (decode_coding_emacs_mule): Abort if there isn't enough place in
8528 charbuf for the composition carryover bytes. Reserve an extra
8529 space for up to 2 characters produced in a loop.
8530 (decode_coding_iso_2022): Abort if there isn't enough place in
8531 charbuf for the composition carryover bytes.
8532
8533 2011-04-21 Eli Zaretskii <eliz@gnu.org>
8534
8535 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
8536 aborting when %lld or %lll format is passed.
8537 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
8538 %llo or %llx format is passed. (Bug#8545)
8539
8540 * window.c (window_scroll_line_based): Use a marker instead of
8541 simple variables to record original value of point. (Bug#7952)
8542
8543 * doprnt.c (doprnt): Fix the case where a multibyte sequence
8544 produced by %s or %c overflows available buffer space. (Bug#8545)
8545
8546 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
8547
8548 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
8549 (SIZE_MAX): Move defn after all includes, as they might #define it.
8550
8551 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8552
8553 * w32.c (init_environment): Warn about defaulting HOME to C:\.
8554
8555 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8556
8557 * keyboard.c (Qdelayed_warnings_hook): Define.
8558 (command_loop_1): Run `delayed-warnings-hook'
8559 if Vdelayed_warnings_list is non-nil.
8560 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
8561 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
8562
8563 2011-04-28 Eli Zaretskii <eliz@gnu.org>
8564
8565 * doprnt.c (doprnt): Don't return value smaller than the buffer
8566 size if the message was truncated. (Bug#8545).
8567
8568 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8569
8570 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
8571 (Fx_window_property): #if-0 the whole functions, not just the bodies.
8572
8573 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8574
8575 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
8576
8577 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
8578
8579 * makefile.w32-in: Update dependencies.
8580
8581 2011-04-27 Eli Zaretskii <eliz@gnu.org>
8582
8583 Improve `doprnt' and its usage. (Bug#8545)
8584 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
8585 `format_end'. Remove support for %l as a conversion specifier.
8586 Don't use xrealloc. Improve diagnostics when the %l size modifier
8587 is used. Update the commentary.
8588
8589 * eval.c (verror): Simplify calculation of size_t.
8590
8591 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
8592 messages.
8593
8594 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
8595
8596 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
8597 change.
8598
8599 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8600
8601 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
8602 This makes this file independent of the recent pseudovector change.
8603
8604 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
8605
8606 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
8607
8608 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
8609 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8610 Remove unused local.
8611 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
8612
8613 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
8614 GCC 4.6.0 optimizes based on type-based alias analysis.
8615 For example, if b is of type struct buffer * and v of type struct
8616 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
8617 != &v->size, and therefore "v->size = 1; b->size = 2; return
8618 v->size;" must therefore return 1. This assumption is incorrect
8619 for Emacs, since it type-puns struct Lisp_Vector * with many other
8620 types. To fix this problem, this patch adds a new type struct
8621 vectorlike_header that documents the constraints on layout of vectors
8622 and pseudovectors, and helps optimizing compilers not get fooled
8623 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
8624 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
8625 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
8626 the size member.
8627 (XSETPVECTYPE): Rewrite in terms of new macro.
8628 (XSETPVECTYPESIZE): New macro, specifying both type and size.
8629 This is a bit clearer, and further avoids the possibility of
8630 undesirable aliasing.
8631 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
8632 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
8633 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
8634 since Lisp_Subr is a special case (no "next" field).
8635 (ASIZE): Now uses header.size rather than size.
8636 All previous uses of XVECTOR (foo)->size replaced to use this macro,
8637 to avoid the hassle of writing XVECTOR (foo)->header.size.
8638 (struct vectorlike_header): New type.
8639 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
8640 object, to help avoid aliasing.
8641 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
8642 (SUBRP): Likewise, since Lisp_Subr is a special case.
8643 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
8644 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
8645 (struct Lisp_Hash_Table): Combine first two members into a single
8646 struct vectorlike_header member. All uses of "size" and "next" members
8647 changed to be "header.size" and "header.next".
8648 * buffer.h (struct buffer): Likewise.
8649 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
8650 * frame.h (struct frame): Likewise.
8651 * process.h (struct Lisp_Process): Likewise.
8652 * termhooks.h (struct terminal): Likewise.
8653 * window.c (struct save_window_data, struct saved_window): Likewise.
8654 * window.h (struct window): Likewise.
8655 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
8656 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
8657 * buffer.c (init_buffer_once): Likewise.
8658 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
8659 special case.
8660 * process.c (Fformat_network_address): Use local var for size,
8661 for brevity.
8662
8663 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
8664
8665 Make the Lisp reader and string-to-float more consistent (Bug#8525)
8666 * data.c (atof): Remove decl; no longer used or needed.
8667 (digit_to_number): Move to lread.c.
8668 (Fstring_to_number): Use new string_to_number function, to be
8669 consistent with how the Lisp reader treats infinities and NaNs.
8670 Do not assume that floating-point numbers represent EMACS_INT
8671 without losing information; this is not true on most 64-bit hosts.
8672 Avoid double-rounding errors, by insisting on integers when
8673 parsing non-base-10 numbers, as the documentation specifies.
8674 * lisp.h (string_to_number): New decl, replacing ...
8675 (isfloat_string): Remove.
8676 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
8677 (read1): Do not accept +. and -. as integers; this
8678 appears to have been a coding error. Similarly, do not accept
8679 strings like +-1e0 as floating point numbers. Do not report
8680 overflow for integer overflows unless the base is not 10 which
8681 means we have no simple and reliable way to continue.
8682 Break out the floating-point parsing into a new
8683 function string_to_number, so that Fstring_to_number parses
8684 floating point numbers consistently with the Lisp reader.
8685 (digit_to_number): Move here from data.c. Make it static inline.
8686 (E_CHAR, EXP_INT): Remove, replacing with ...
8687 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
8688 (string_to_number): New function, replacing isfloat_string.
8689 This function checks for valid syntax and produces the resulting
8690 Lisp float number too. Rework it so that string-to-number
8691 no longer mishandles examples like "1.0e+". Use strtoumax,
8692 so that overflow for non-base-10 numbers is reported only when
8693 there's no portable and simple way to convert to floating point.
8694
8695 * textprop.c (set_text_properties_1): Rewrite for clarity,
8696 and to avoid GCC warning about integer overflow.
8697
8698 * intervals.h (struct interval): Use EMACS_INT for members
8699 where EMACS_UINT might cause problems. See
8700 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
8701 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
8702 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
8703 All uses changed.
8704 (offset_intervals): Tell GCC not to worry about length overflow
8705 when negating a negative length.
8706
8707 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
8708 (overrun_check_free): Likewise.
8709
8710 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
8711 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
8712 word size.
8713
8714 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8715 (gnutls_make_error): Rename local to avoid shadowing.
8716 (gnutls_emacs_global_deinit): ifdef out; not used.
8717 (Fgnutls_boot): Use const for pointer to readonly storage.
8718 Comment out unused local. Fix pointer signedness problems.
8719
8720 * lread.c (openp): Don't stuff size_t into an 'int'.
8721 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
8722 about possible signed overflow.
8723
8724 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8725 (GDK_KEY_g): Don't define if already defined.
8726 (xg_prepare_tooltip): Avoid pointer signedness problem.
8727 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
8728
8729 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
8730 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
8731
8732 * xfns.c (Fx_window_property): Simplify a bit,
8733 to make a bit faster and to avoid GCC 4.6.0 warning.
8734 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
8735
8736 * fns.c (internal_equal): Don't assume size_t fits in int.
8737
8738 * alloc.c (compact_small_strings): Tighten assertion a little.
8739
8740 Replace pEd with more-general pI, and fix some printf arg casts.
8741 * lisp.h (pI): New macro, generalizing old pEd macro to other
8742 conversion specifiers. For example, use "...%"pI"d..." rather
8743 than "...%"pEd"...".
8744 (pEd): Remove. All uses replaced with similar uses of pI.
8745 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
8746 * alloc.c (check_pure_size): Don't overflow by converting size to int.
8747 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
8748 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
8749 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
8750 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
8751 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
8752 64-bit hosts.
8753 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
8754 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
8755 * print.c (safe_debug_print, print_object): Likewise.
8756 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
8757 to int.
8758 Use pI instead of if-then-else-abort. Use %p to avoid casts,
8759 avoiding the 0 flag, which is not portable.
8760 * process.c (Fmake_network_process): Use pI to avoid cast.
8761 * region-cache.c (pp_cache): Likewise.
8762 * xdisp.c (decode_mode_spec): Likewise.
8763 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
8764 behavior on 64-bit hosts with printf arg.
8765 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
8766 (x_stop_queuing_selection_requests): Likewise.
8767 (x_get_window_property): Don't truncate byte count to an 'int'
8768 when tracing.
8769
8770 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
8771 here, since it parses constructs like leading '-' and spaces,
8772 which are not wanted; and it overflows with large numbers.
8773 Instead, simply match F[0-9]+, which is what is wanted anyway.
8774
8775 * alloc.c: Remove unportable assumptions about struct layout.
8776 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
8777 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
8778 (allocate_vectorlike, make_pure_vector): Use the new macros,
8779 plus offsetof, to remove unportable assumptions about struct layout.
8780 These assumptions hold on all porting targets that I know of, but
8781 they are not guaranteed, they're easy to remove, and removing them
8782 makes further changes easier.
8783
8784 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
8785 This doesn't fix a bug but makes the code clearer.
8786 (string_overrun_cookie): Now const. Use initializers that
8787 don't formally overflow signed char, to avoid warnings.
8788 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8789 can cause Emacs to crash when string overrun checking is enabled.
8790 (allocate_buffer): Don't assume sizeof (struct buffer) is a
8791 multiple of sizeof (EMACS_INT); it need not be, if
8792 alignof(EMACS_INT) < sizeof (EMACS_INT).
8793 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
8794
8795 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
8796
8797 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
8798
8799 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
8800
8801 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
8802 supposed to be handshaking. (Bug#8556)
8803 Reported by Paul Eggert <eggert@cs.ucla.edu>.
8804
8805 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
8806
8807 * lisp.h (Qdebug): List symbol.
8808 * eval.c (Qdebug): Restore global linkage.
8809 * keyboard.c (debug-on-event): New variable.
8810 (handle_user_signal): Break into debugger when debug-on-event
8811 matches the current signal symbol.
8812
8813 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
8814
8815 * alloc.c (check_sblock, check_string_bytes)
8816 (check_string_free_list): Convert to standard C.
8817
8818 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
8819
8820 * w32.c (emacs_gnutls_push): Fix typo.
8821
8822 2011-04-25 Eli Zaretskii <eliz@gnu.org>
8823
8824 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
8825 "cast to pointer from integer of different size".
8826
8827 Improve doprnt and its use in verror. (Bug#8545)
8828 * doprnt.c (doprnt): Document the set of format control sequences
8829 supported by the function. Use SAFE_ALLOCA instead of always
8830 using `alloca'.
8831
8832 * eval.c (verror): Don't limit the buffer size at size_max-1, that
8833 is one byte too soon. Don't use xrealloc; instead xfree and
8834 xmalloc anew.
8835
8836 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
8837
8838 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
8839 callbacks stage.
8840
8841 * gnutls.c: Renamed global_initialized to
8842 gnutls_global_initialized. Added internals for the
8843 :verify-hostname-error, :verify-error, and :verify-flags
8844 parameters of `gnutls-boot' and documented those parameters in the
8845 docstring. Start callback support.
8846 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8847 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8848 on error. Return error code.
8849 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8850 (emacs_gnutls_read): Likewise.
8851 (Fgnutls_boot): Return handshake error code.
8852 (emacs_gnutls_handle_error): New function.
8853 (wsaerror_to_errno): Likewise.
8854
8855 * w32.h (emacs_gnutls_pull): Add prototype.
8856 (emacs_gnutls_push): Likewise.
8857
8858 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
8859 (emacs_gnutls_push): Likewise.
8860
8861 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
8862
8863 * process.c (wait_reading_process_output): Check if GnuTLS
8864 buffered some data internally if no FDs are set for TLS
8865 connections.
8866
8867 * makefile.w32-in (OBJ2): Add gnutls.$(O).
8868 (LIBS): Link to USER_LIBS.
8869 ($(BLD)/gnutls.$(0)): New target.
8870
8871 2011-04-24 Eli Zaretskii <eliz@gnu.org>
8872
8873 * xdisp.c (handle_single_display_spec): Rename the
8874 display_replaced_before_p argument into display_replaced_p, to
8875 make it consistent with the commentary. Fix typos in the
8876 commentary.
8877
8878 * textprop.c (syms_of_textprop): Remove dead code.
8879 (copy_text_properties): Delete obsolete commentary about an
8880 interface that was deleted long ago. Fix typos in the description
8881 of arguments.
8882
8883 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
8884 to changes in oldXMenu/XMenu.h from 2011-04-16.
8885 <menu_help_message, prev_menu_help_message>: Constify.
8886 (IT_menu_make_room): menu->help_text is now `const char **';
8887 adjust.
8888
8889 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
8890 to changes in oldXMenu/XMenu.h from 2011-04-16.
8891 (struct XMenu): Declare `help_text' `const char **'.
8892
8893 * xfaces.c <Qunspecified>: Make extern again.
8894
8895 * syntax.c: Include sys/types.h before including regex.h, as
8896 required by POSIX.
8897
8898 * doc.c (get_doc_string): Improve the format passed to `error'.
8899
8900 * doprnt.c (doprnt): Improve commentary.
8901
8902 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
8903
8904 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
8905 them with etags.
8906
8907 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
8908 changes in globals.h immediately force recompilation.
8909 (TAGS): Depend on $(CURDIR)/m/intel386.h and
8910 $(CURDIR)/s/ms-w32.h.
8911 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
8912
8913 * character.c (Fchar_direction): Function deleted.
8914 (syms_of_character): Don't defsubr it.
8915 <char-direction-table>: Deleted.
8916
8917 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8918
8919 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
8920 * doprnt.c: Include limits.h.
8921 (SIZE_MAX): New macro.
8922 (doprnt): Return a size_t value. 2nd arg is now size_t.
8923 Many local variables are now size_t instead of int or unsigned.
8924 Improve overflow protection. Support `l' modifier for integer
8925 conversions. Support %l conversion. Don't assume an EMACS_INT
8926 argument for integer conversions and for %c.
8927
8928 * lisp.h (doprnt): Restore prototype.
8929
8930 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8931 $(SRC)/character.h.
8932
8933 * Makefile.in (base_obj): Add back doprnt.o.
8934
8935 * deps.mk (doprnt.o): Add back prerequisites.
8936 (callint.o): Depend on character.h.
8937
8938 * eval.c (internal_lisp_condition_case): Include the handler
8939 representation in the error message.
8940 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8941 when breaking from the loop.
8942
8943 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8944
8945 * callint.c (Fcall_interactively): When displaying error message
8946 about invalid control letter, pass the character's codepoint, not
8947 a pointer to its multibyte form. Improve display of the character
8948 in octal and display also its hex code.
8949
8950 * character.c (char_string): Use %x to display the (unsigned)
8951 codepoint of an invalid character, to avoid displaying a bogus
8952 negative value.
8953
8954 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8955 `error', not SYMBOL_NAME itself.
8956
8957 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8958 character arguments to `error'.
8959
8960 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8961 to `error' in error message about FINAL_CHAR argument. Make sure
8962 FINAL_CHAR is a character, and use %c when it is passed as
8963 argument to `error'.
8964
8965 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8966
8967 * s/ms-w32.h (localtime): Redirect to sys_localtime.
8968
8969 * w32.c: Include <time.h>.
8970 (sys_localtime): New function.
8971
8972 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
8973
8974 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
8975
8976 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
8977
8978 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
8979
8980 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
8981 zombies (Bug#8467).
8982
8983 2011-04-19 Eli Zaretskii <eliz@gnu.org>
8984
8985 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
8986 gl_state.e_property when gl_state.object is Qt.
8987
8988 * insdel.c (make_gap_larger): Remove limitation of buffer size
8989 to <= INT_MAX.
8990
8991 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
8992
8993 * xdisp.c (lookup_glyphless_char_display)
8994 (produce_glyphless_glyph): Handle cons cell entry in
8995 glyphless-char-display.
8996 (Vglyphless_char_display): Document it.
8997
8998 * term.c (produce_glyphless_glyph): Handle cons cell entry in
8999 glyphless-char-display.
9000
9001 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
9002
9003 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
9004
9005 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
9006
9007 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
9008 definition for no-X builds.
9009
9010 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
9011
9012 Static checks with GCC 4.6.0 and non-default toolkits.
9013
9014 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
9015
9016 * process.c (keyboard_bit_set): Define only if SIGIO.
9017 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
9018 (send_process): Repair possible setjmp clobbering.
9019
9020 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
9021
9022 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
9023
9024 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
9025
9026 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
9027 Define only if needed.
9028
9029 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
9030 by pacifying GCC about it. Maybe it's time to retire it?
9031 * xfaces.c (USG, __TIMEVAL__): Likewise.
9032
9033 * dispextern.h (struct redisplay_interface): Rename param
9034 to avoid shadowing.
9035 * termhooks.h (struct terminal): Likewise.
9036 * xterm.c (xembed_send_message): Likewise.
9037
9038 * insdel.c (make_gap_smaller): Define only if
9039 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
9040
9041 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
9042 it.
9043
9044 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
9045 so that we aren't warned about unused symbols.
9046
9047 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
9048
9049 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
9050
9051 * xfns.c (x_real_positions): Mark locals as initialized.
9052
9053 * xmenu.c (xmenu_show): Don't use uninitialized vars.
9054
9055 * xterm.c: Fix problems found by static analysis with other toolkits.
9056 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
9057 (x_dispatch_event): Declare static if USE_GTK, and
9058 define if USE_GTK || USE_X_TOOLKIT.
9059 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
9060 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
9061 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
9062 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
9063
9064 * xmenu.c (menu_help_callback): Pointer type fixes.
9065 Use const pointers when pointing at readonly data. Avoid pointer
9066 signedness clashes.
9067 (FALSE): Remove unused macro.
9068 (update_frame_menubar): Remove unused decl.
9069
9070 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
9071
9072 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
9073 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
9074 (single_menu_item): Rename local to avoid shadowing.
9075
9076 * keyboard.c (make_lispy_event): Remove unused local var.
9077
9078 * frame.c, frame.h (x_get_resource_string): Bring this back, but
9079 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
9080
9081 * bitmaps: Change bitmaps from unsigned char back to the X11
9082 compatible char. Avoid the old compiler warnings about
9083 out-of-range initializers by using, for example, '\xab' rather
9084 than 0xab.
9085
9086 * xgselect.c (xgselect_initialize): Check vs interface
9087 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
9088
9089 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
9090
9091 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
9092 to read-only memory.
9093
9094 * fns.c (vector): Remove; this old hack is no longer needed.
9095
9096 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
9097 Remove unused var.
9098 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
9099
9100 * xrdb.c (x_load_resources): Omit unused local.
9101
9102 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
9103 (x_window): Rename locals to avoid shadowing.
9104 (USG): Use the kludged USG macro, to pacify gcc.
9105
9106 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
9107 (x_term_init): Remove local to avoid shadowing.
9108
9109 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
9110
9111 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
9112 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
9113
9114 2011-04-16 Eli Zaretskii <eliz@gnu.org>
9115
9116 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
9117
9118 Fix regex.c, syntax.c and friends for buffers > 2GB.
9119 * syntax.h (struct gl_state_s): Declare character position members
9120 EMACS_INT.
9121
9122 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
9123
9124 * textprop.c (verify_interval_modification, interval_of):
9125 Declare arguments EMACS_INT.
9126
9127 * intervals.c (adjust_intervals_for_insertion): Declare arguments
9128 EMACS_INT.
9129
9130 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
9131
9132 * indent.c (Fvertical_motion): Local variable it_start is now
9133 EMACS_INT.
9134
9135 * regex.c (re_match, re_match_2, re_match_2_internal)
9136 (bcmp_translate, regcomp, regexec, print_double_string)
9137 (group_in_compile_stack, re_search, re_search_2, regex_compile)
9138 (re_compile_pattern, re_exec): Declare arguments and local
9139 variables `size_t' and `ssize_t' and return values `regoff_t', as
9140 appropriate.
9141 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
9142 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
9143 <compile_stack_type>: `size' and `avail' are now `size_t'.
9144
9145 * regex.h <regoff_t>: Use ssize_t, not int.
9146 (re_search, re_search_2, re_match, re_match_2): Arguments that
9147 specify buffer/string position and length are now ssize_t and
9148 size_t. Return type is regoff_t.
9149
9150 2011-04-16 Ben Key <bkey76@gmail.com>
9151
9152 * nsfont.m: Fixed bugs in ns_get_family and
9153 ns_descriptor_to_entity that were caused by using free to
9154 deallocate memory blocks that were allocated by xmalloc (via
9155 xstrdup). This caused Emacs to crash when compiled with
9156 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
9157 --enable-checking=xmallocoverrun). xfree is now used to
9158 deallocate these memory blocks.
9159
9160 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
9161
9162 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
9163
9164 emacs_write: Accept and return EMACS_INT for sizes.
9165 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
9166 et seq.
9167 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
9168 Accept and return EMACS_INT.
9169 (emacs_gnutls_write): Return the number of bytes written on
9170 partial writes.
9171 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
9172 (emacs_read, emacs_write): Remove check for negative size, as the
9173 Emacs source code has been audited now.
9174 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
9175 (emacs_read, emacs_write): Use it.
9176 * process.c (send_process): Adjust to the new signatures of
9177 emacs_write and emacs_gnutls_write. Do not attempt to store
9178 a byte offset into an 'int'; it might overflow.
9179 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
9180
9181 * sound.c: Don't assume sizes fit in 'int'.
9182 (struct sound_device.period_size, alsa_period_size):
9183 Return EMACS_INT, not int.
9184 (struct sound_device.write, vox_write, alsa_write):
9185 Accept EMACS_INT, not int.
9186 (wav_play, au_play): Use EMACS_INT to store sizes and to
9187 record read return values.
9188
9189 2011-04-15 Ben Key <bkey76@gmail.com>
9190
9191 * keyboard.c (Qundefined): Don't declare static since it is used
9192 in nsfns.m.
9193 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
9194 static since they are used in nsfont.m.
9195
9196 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
9197
9198 * process.c (Qprocessp): Don't declare static.
9199 * lisp.h (Qprocessp): Declare again.
9200
9201 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
9202
9203 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
9204
9205 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
9206
9207 Improve C-level modularity by making more things 'static'.
9208
9209 Don't publish debugger-only interfaces to other modules.
9210 * lisp.h (safe_debug_print, debug_output_compilation_hack):
9211 (verify_bytepos, count_markers): Move decls to the only modules
9212 that need them.
9213 * region-cache.h (pp_cache): Likewise.
9214 * window.h (check_all_windows): Likewise.
9215 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
9216
9217 * sysdep.c (croak): Now static, if
9218 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
9219 * syssignal.h (croak): Declare only if not static.
9220
9221 * alloc.c (refill_memory_reserve): Now static if
9222 !defined REL_ALLOC || defined SYSTEM_MALLOC.
9223 * lisp.h (refill_memory_reserve): Declare only if not static.
9224
9225 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
9226 Define only if USE_LUCID.
9227
9228 * xrdb.c (x_customization_string, x_rm_string): Now static.
9229
9230 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
9231 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
9232
9233 * xdisp.c (draw_row_with_mouse_face): Now static.
9234 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
9235
9236 * window.h (check_all_windows): Mark externally visible.
9237
9238 * window.c (window_deletion_count): Now static.
9239
9240 * undo.c: Make symbols static if they're not exported.
9241 (last_undo_buffer, last_boundary_position, pending_boundary):
9242 Now static.
9243
9244 * textprop.c (interval_insert_behind_hooks): Now static.
9245 (interval_insert_in_front_hooks): Likewise.
9246
9247 * term.c: Make symbols static if they're not exported.
9248 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
9249 (max_frame_lines, tty_set_terminal_modes):
9250 (tty_reset_terminal_modes, tty_turn_off_highlight):
9251 (get_tty_terminal): Now static.
9252 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
9253 * termhooks.h (term_mouse_moveto): Do not declare if
9254 HAVE_WINDOW_SYSTEM.
9255 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
9256 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
9257
9258 * sysdep.c: Make symbols static if they're not exported.
9259 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
9260 Now static.
9261 (sigprocmask_set, full_mask): Remove; unused.
9262 (wait_debugging): Mark as visible.
9263 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
9264 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
9265
9266 * syntax.c (syntax_temp): Define only if !__GNUC__.
9267
9268 * sound.c (current_sound_device, current_sound): Now static.
9269
9270 * search.c (searchbufs, searchbuf_head): Now static.
9271
9272 * scroll.c (scroll_cost): Remove; unused.
9273 * dispextern.h (scroll_cost): Remove decl.
9274
9275 * region-cache.h (pp_cache): Mark as externally visible.
9276
9277 * process.c: Make symbols static if they're not exported.
9278 (process_tick, update_tick, create_process, chan_process):
9279 (Vprocess_alist, proc_buffered_char, datagram_access):
9280 (fd_callback_data, send_process_frame, process_sent_to): Now static.
9281 (deactivate_process): Mark defn as static, as well as decl.
9282 * lisp.h (create_process): Remove decl.
9283 * process.h (chan_process, Vprocess_alist): Remove decls.
9284
9285 * print.c: Make symbols static if they're not exported.
9286 (print_depth, new_backquote_output, being_printed, print_buffer):
9287 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
9288 (print_interval, print_number_index, initial_stderr_stream):
9289 Now static.
9290 * lisp.h (Fprinc): Remove decl.
9291 (debug_output_compilation_hack): Mark as externally visible.
9292
9293 * sysdep.c (croak): Move decl from here to syssignal.h.
9294 * syssignal.h (croak): Put it here, so the API can be checked when
9295 'croak' is called from dissociate_if_controlling_tty.
9296
9297 * minibuf.c: Make symbols static if they're not exported.
9298 (minibuf_save_list, choose_minibuf_frame): Now static.
9299 * lisp.h (choose_minibuf_frame): Remove decl.
9300
9301 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
9302
9303 * lread.c: Make symbols static if they're not exported.
9304 (read_objects, initial_obarray, oblookup_last_bucket_number):
9305 Now static.
9306 (make_symbol): Remove; unused.
9307 * lisp.h (initial_obarray, make_symbol): Remove decls.
9308
9309 * keyboard.c: Make symbols static if they're not exported.
9310 (single_kboard, recent_keys_index, total_keys, recent_keys):
9311 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
9312 (this_single_command_key_start, echoing, last_auto_save):
9313 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
9314 (command_loop, echo_now, keyboard_init_hook, help_char_p):
9315 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
9316 (Vlispy_mouse_stem, double_click_count):
9317 Now static.
9318 (force_auto_save_soon): Define only if SIGDANGER.
9319 (ignore_mouse_drag_p): Now static if
9320 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
9321 (print_help): Remove; unused.
9322 (stop_character, last_timer_event): Mark as externally visible.
9323 * keyboard.h (ignore_mouse_drag_p): Declare only if
9324 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
9325 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
9326 * lisp.h (echoing): Remove decl.
9327 (force_auto_save_soon): Declare only if SIGDANGER.
9328 * xdisp.c (redisplay_window): Simplify code, to make it more
9329 obvious that ignore_mouse_drag_p is not accessed if !defined
9330 USE_GTK && !defined HAVE_NS.
9331
9332 * intervals.c: Make symbols static if they're not exported.
9333 (merge_properties_sticky, merge_interval_right, delete_interval):
9334 Now static.
9335 * intervals.h (merge_interval_right, delete_interval): Remove decls.
9336
9337 * insdel.c: Make symbols static if they're not exported.
9338 However, leave prepare_to_modify_buffer alone. It's never
9339 called from outside this function, but that appears to be a bug.
9340 (combine_after_change_list, combine_after_change_buffer):
9341 (adjust_after_replace, signal_before_change): Now static.
9342 (adjust_after_replace_noundo): Remove; unused.
9343 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
9344 (signal_before_change): Remove decls.
9345
9346 * indent.c (val_compute_motion, val_vmotion): Now static.
9347
9348 * image.c: Make symbols static if they're not exported.
9349 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
9350 if USE_GTK.
9351 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
9352 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
9353
9354 * fringe.c (standard_bitmaps): Now static.
9355 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
9356
9357 * frame.c: Make symbols static if they're not exported.
9358 (x_report_frame_params, make_terminal_frame): Now static.
9359 (get_frame_param): Now static, unless HAVE_NS.
9360 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
9361 (x_get_resource_string): Remove; not used.
9362 * frame.h (make_terminal_frame, x_report_frame_params):
9363 (x_get_resource_string); Remove decls.
9364 (x_fullscreen_adjust): Declare only if WINDOWSNT.
9365 * lisp.h (get_frame_param): Declare only if HAVE_NS.
9366
9367 * font.c, fontset.c: Make symbols static if they're not exported.
9368 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
9369 (FACE_SUITABLE_FOR_CHAR_P): Use it.
9370 * font.c (font_close_object): Now static.
9371 * font.h (font_close_object): Remove.
9372 * fontset.c (FONTSET_OBJLIST): Remove.
9373 (free_realized_fontset) #if-0 the body, which does nothing.
9374 (face_suitable_for_char_p): #if-0, as it's never called.
9375 * fontset.h (face_suitable_for_char_p): Remove decl.
9376 * xfaces.c (face_at_string_position):
9377 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
9378 since 0 is always ASCII.
9379
9380 * fns.c (weak_hash_tables): Now static.
9381
9382 * fileio.c: Make symbols static if they're not exported.
9383 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
9384 (Vwrite_region_annotation_buffers): Now static.
9385
9386 * eval.c: Make symbols static if they're not exported.
9387 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
9388 * lisp.h (backtrace_list): Remove decl.
9389
9390 * emacs.c: Make symbols static if they're not exported.
9391 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
9392 (fatal_error_code, fatal_error_signal_hook, standard_args):
9393 Now static.
9394 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
9395 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
9396 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
9397 * lisp.h (fatal_error_signal_hook): Remove decl.
9398 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
9399
9400 * editfns.c: Move a (normally-unused) function to its only use.
9401 * editfns.c, lisp.h (get_operating_system_release): Remove.
9402 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
9403 worth the hassle of breaking this out.
9404
9405 * xterm.c: Make symbols static if they're not exported.
9406 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
9407 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
9408 (x_destroy_window, x_delete_display):
9409 Now static.
9410 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
9411 (x_mouse_leave): Remove; unused.
9412 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
9413 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
9414 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
9415 Remove decls.
9416 (x_mouse_leave): Declare only if WINDOWSNT.
9417 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
9418 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
9419 USE_X_TOOLKIT.
9420
9421 * ftxfont.c: Make symbols static if they're not exported.
9422 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
9423 HAVE_FREETYPE.
9424 * font.h (ftxfont_driver): Likewise.
9425
9426 * xfns.c: Make symbols static if they're not exported.
9427 (x_last_font_name, x_display_info_for_name):
9428 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
9429 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
9430 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
9431 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
9432 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
9433 (last_show_tip_args): Now static.
9434 (xic_defaut_fontset, xic_create_fontsetname): Define only if
9435 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
9436 (x_screen_planes): Remove; unused.
9437 * dispextern.h (x_screen_planes): Remove decl.
9438
9439 * dispnew.c: Make symbols static if they're not exported.
9440 * dispextern.h (redraw_garbaged_frames, scrolling):
9441 (increment_row_positions): Remove.
9442 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
9443 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
9444 Now static.
9445 (redraw_garbaged_frames): Remove; unused.
9446
9447 * xfaces.c: Make symbols static if they're not exported.
9448 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
9449 Remove decls.
9450 * xterm.h (defined_color): Remove decls.
9451 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
9452 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
9453 (menu_face_changed_default, defined_color, free_realized_face):
9454 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
9455 (ascii_face_of_lisp_face): Remove; unused.
9456
9457 * xdisp.c: Make symbols static if they're not exported.
9458 * dispextern.h (scratch_glyph_row, window_box_edges):
9459 (glyph_to_pixel_coords, set_cursor_from_row):
9460 (get_next_display_element, set_iterator_to_next):
9461 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
9462 (show_mouse_face): Remove decls
9463 * frame.h (message_buf_print): Likewise.
9464 * lisp.h (pop_message, set_message, check_point_in_composition):
9465 Likewise.
9466 * xterm.h (set_vertical_scroll_bar): Likewise.
9467 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
9468 (message_buf_print, scratch_glyph_row, displayed_buffer):
9469 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
9470 (get_next_display_element, show_mouse_face, window_box_edges):
9471 (frame_to_window_pixel_xy, check_point_in_composition):
9472 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
9473 (glyph_to_pixel_coords): Remove; unused.
9474
9475 * dired.c (file_name_completion): Now static.
9476
9477 * dbusbind.c (xd_in_read_queued_messages): Now static.
9478
9479 * lisp.h (circular_list_error, FOREACH): Remove; unused.
9480 * data.c (circular_list_error): Remove.
9481
9482 * commands.h (last_point_position, last_point_position_buffer):
9483 (last_point_position_window): Remove decls.
9484 * keyboard.c: Make these variables static.
9485
9486 * coding.h (coding, code_convert_region, encode_coding_gap):
9487 Remove decls.
9488 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
9489 (iso_code_class, detect_coding, code_convert_region): Now static.
9490 (encode_coding_gap): Remove; unused.
9491
9492 * chartab.c (chartab_chars, chartab_bits): Now static.
9493
9494 * charset.h (charset_iso_8859_1): Remove decl.
9495 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
9496 Now static.
9497
9498 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
9499 * ccl.c (Vccl_program_table): Now static.
9500 (check_ccl_update): Remove; unused.
9501
9502 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
9503 * category.h: ... from here.
9504 * category.c (check_category_table, set_category_set): Now static.
9505
9506 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
9507 * lisp.h: Remove these decls.
9508
9509 * buffer.c (buffer_count): Remove unused var.
9510
9511 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
9512 so that it's not optimized away.
9513 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
9514 * dispextern.h (bidi_dump_cached_states): Remove, since it's
9515 exported only to the debugger.
9516
9517 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
9518 * atimer.h (run_all_atimers): Remove; not exported.
9519
9520 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
9521 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
9522 was inaccessible from Lisp.
9523 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
9524 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
9525
9526 alloc.c: Import and export fewer symbols, and remove unused items.
9527 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
9528 is defined.
9529 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
9530 it's not optimized away by whole-program optimization.
9531 (message_enable_multibyte, free_misc): Remove.
9532 (catchlist, handlerlist, mark_backtrace):
9533 Declare only if BYTE_MARK_STACK.
9534 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
9535 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
9536 (message_enable_multibyte): Remove decl.
9537 (free_misc, interval_free_list, float_block, float_block_index):
9538 (n_float_blocks, float_free_list, cons_block, cons_block_index):
9539 (cons_free_list, last_marked_index):
9540 Now static.
9541 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
9542 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
9543 (mark_backtrace): Define only if BYTE_MARK_STACK.
9544 * xdisp.c (message_enable_multibyte): Now static.
9545
9546 Declare Lisp_Object Q* variables to be 'static' if not exported.
9547 This makes it easier for human readers (and static analyzers)
9548 to see whether these variables are used from other modules.
9549 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
9550 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
9551 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
9552 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
9553 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
9554 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
9555 * xmenu.c, xselect.c:
9556 Declare Q* vars static if they are not used in other modules.
9557 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
9558 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
9559 Remove decls of unexported vars.
9560 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
9561
9562 * lisp.h (DEFINE_FUNC): Make sname 'static'.
9563
9564 Make Emacs functions such as Fatom 'static' by default.
9565 This makes it easier for human readers (and static analyzers)
9566 to see whether these functions can be called from other modules.
9567 DEFUN now defines a static function. To make the function external
9568 so that it can be used in other C modules, use the new macro DEFUE.
9569 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
9570 (Finit_image_library):
9571 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
9572 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
9573 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
9574 Remove decls, since these functions are now static.
9575 (Funintern, Fget_internal_run_time): New decls, since these functions
9576 were already external.
9577
9578 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
9579 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
9580 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
9581 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
9582 * keyboard.c, keymap.c, lread.c:
9583 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
9584 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
9585 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
9586 Mark functions with DEFUE instead of DEFUN,
9587 if they are used in other modules.
9588 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
9589 decls for now-static functions.
9590 * buffer.h (Fdelete_overlay): Remove decl.
9591 * callproc.c (Fgetenv_internal): Mark as internal.
9592 * composite.c (Fremove_list_of_text_properties): Remove decl.
9593 (Fcomposition_get_gstring): New forward static decl.
9594 * composite.h (Fcomposite_get_gstring): Remove decl.
9595 * dired.c (Ffile_attributes): New forward static decl.
9596 * doc.c (Fdocumntation_property): New forward static decl.
9597 * eval.c (Ffetch_bytecode): New forward static decl.
9598 (Funintern): Remove extern decl; now in .h file where it belongs.
9599 * fileio.c (Fmake_symbolic_link): New forward static decl.
9600 * image.c (Finit_image_library): New forward static decl.
9601 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
9602 * intervals.h (Fprevious_property_change):
9603 (Fremove_list_of_text_properties): Remove decls.
9604 * keyboard.c (Fthis_command_keys): Remove decl.
9605 (Fcommand_execute): New forward static decl.
9606 * keymap.c (Flookup_key): New forward static decl.
9607 (Fcopy_keymap): Now static.
9608 * keymap.h (Flookup_key): Remove decl.
9609 * process.c (Fget_process): New forward static decl.
9610 (Fprocess_datagram_address): Mark as internal.
9611 * syntax.c (Fsyntax_table_p): New forward static decl.
9612 (skip_chars): Remove duplicate decl.
9613 * textprop.c (Fprevious_property_change): New forward static decl.
9614 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
9615 Now internal.
9616 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
9617 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
9618
9619 * editfns.c (Fformat): Remove unreachable code.
9620
9621 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
9622
9623 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
9624 change. (Bug#8496)
9625
9626 2011-04-13 Eli Zaretskii <eliz@gnu.org>
9627
9628 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
9629 when at ZV. (Bug#8487)
9630
9631 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
9632
9633 * charset.c (Fclear_charset_maps): Use xfree instead of free.
9634 (Bug#8437)
9635 * keyboard.c (parse_tool_bar_item): Likewise.
9636 * sound.c (sound_cleanup, alsa_close): Likewise.
9637 * termcap.c (tgetent): Likewise.
9638 * xfns.c (x_default_font_parameter): Likewise.
9639 * xsettings.c (read_and_apply_settings): Likewise.
9640
9641 * alloc.c (overrun_check_malloc, overrun_check_realloc)
9642 (overrun_check_free): Protoize.
9643
9644 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
9645
9646 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
9647 since callers should never pass a negative size.
9648 Change the signature to match that of plain 'read' and 'write'; see
9649 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
9650 * lisp.h: Update prototypes of emacs_write and emacs_read.
9651
9652 2011-04-11 Eli Zaretskii <eliz@gnu.org>
9653
9654 * xdisp.c (redisplay_window): Don't try to determine the character
9655 position of the scroll margin if the window start point w->startp
9656 is outside the buffer's accessible region. (Bug#8468)
9657
9658 2011-04-10 Eli Zaretskii <eliz@gnu.org>
9659
9660 Fix write-region and its subroutines for buffers > 2GB.
9661 * fileio.c (a_write, e_write): Modify declaration of arguments and
9662 local variables to support buffers larger than 2GB.
9663 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
9664
9665 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
9666 argument, local variables, and return value.
9667
9668 * lisp.h: Update prototypes of emacs_write and emacs_read.
9669
9670 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
9671
9672 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
9673
9674 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
9675
9676 Fix more problems found by GCC 4.6.0's static checks.
9677
9678 * xdisp.c (vmessage): Use a better test for character truncation.
9679
9680 * charset.c (load_charset_map): <, not <=, for optimization,
9681 and to avoid potential problems with integer overflow.
9682 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
9683 * casetab.c (set_identity, shuffle): Likewise.
9684 * editfns.c (Fformat): Likewise.
9685 * syntax.c (skip_chars): Likewise.
9686
9687 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
9688 This also lets GCC 4.6.0 generate slightly better loop code.
9689
9690 * callint.c (Fcall_interactively): <, not <=, for optimization.
9691 (Fcall_interactively): Count the number of arguments produced,
9692 not the number of arguments given. This is simpler and lets GCC
9693 4.6.0 generate slightly better code.
9694
9695 * ftfont.c: Distingish more carefully between FcChar8 and char.
9696 The previous code passed unsigned char * to a functions like
9697 strlen and xstrcasecmp that expect char *, which does not
9698 conform to the C standard.
9699 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
9700 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9701 char * when the C standard requires it.
9702
9703 * keyboard.c (read_char): Remove unused var.
9704
9705 * eval.c: Port to Windows vsnprintf (Bug#8435).
9706 Include <limits.h>.
9707 (SIZE_MAX): Define if the headers do not.
9708 (verror): Do not give up if vsnprintf returns a negative count.
9709 Instead, grow the buffer. This ports to Windows vsnprintf, which
9710 does not conform to C99. Problem reported by Eli Zaretskii.
9711 Also, simplify the allocation scheme, by avoiding the need for
9712 calling realloc, and removing the ALLOCATED variable.
9713
9714 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
9715
9716 Remove invocations of doprnt, as Emacs now uses vsnprintf.
9717 But keep the doprint source code for now, as we might revamp it
9718 and use it again (Bug#8435).
9719 * lisp.h (doprnt): Remove.
9720 * Makefile.in (base_obj): Remove doprnt.o.
9721 * deps.mk (doprnt.o): Remove.
9722
9723 error: Print 32- and 64-bit integers portably (Bug#8435).
9724 Without this change, on typical 64-bit hosts error ("...%d...", N)
9725 was used to print both 32- and 64-bit integers N, which relied on
9726 undefined behavior.
9727 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
9728 * lisp.h (error, verror): Mark as printf-like functions.
9729 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
9730 Report overflow in size calculations when allocating printf buffer.
9731 Do not truncate output string at its first null byte.
9732 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
9733 Truncate the output at a character boundary, since vsnprintf does not
9734 do that.
9735 * charset.c (check_iso_charset_parameter): Convert internal
9736 character to string before calling 'error', since %c now has the
9737 printf meaning.
9738 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
9739 overflow when computing char to be passed to 'error'. Do not
9740 pass Lisp_Object to 'error'; pass the integer instead.
9741 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
9742 formatted with plain %d.
9743
9744 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
9745
9746 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
9747
9748 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
9749
9750 * xterm.c (x_catch_errors): Remove duplicate declaration.
9751
9752 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
9753
9754 * xdisp.c, lisp.h (message_nolog): Remove; unused.
9755
9756 2011-04-10 Jim Meyering <meyering@redhat.com>
9757
9758 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
9759 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
9760 return ssize_t not "int", and use size_t as the buffer length.
9761 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
9762 * gnutls.h: Update declarations.
9763 * process.c (read_process_output): Use ssize_t, to match.
9764 (send_process): Likewise.
9765
9766 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9767
9768 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
9769
9770 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9771
9772 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
9773 Use unsigned char, to match FcChar8 type definition.
9774
9775 * xterm.c (handle_one_xevent):
9776 * xmenu.c (create_and_show_popup_menu):
9777 * xselect.c (x_decline_selection_request)
9778 (x_reply_selection_request): Avoid type-punned deref of X events.
9779
9780 2011-04-09 Eli Zaretskii <eliz@gnu.org>
9781
9782 Fix some uses of `int' instead of EMACS_INT.
9783 * search.c (string_match_1, fast_string_match)
9784 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
9785 (scan_buffer, find_next_newline_no_quit)
9786 (find_before_next_newline, search_command, Freplace_match)
9787 (Fmatch_data): Make some `int' variables be EMACS_INT.
9788
9789 * xdisp.c (display_count_lines): 3rd argument and return value now
9790 EMACS_INT. All callers changed.
9791 (pint2hrstr): Last argument is now EMACS_INT.
9792
9793 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
9794 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9795 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
9796 (decode_coding_utf_16, decode_coding_emacs_mule)
9797 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
9798 (decode_coding_ccl, decode_coding_charset)
9799 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
9800 (decode_coding_iso_2022, decode_coding_emacs_mule)
9801 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
9802 <char_offset, last_offset>: Declare EMACS_INT.
9803 (encode_coding_utf_8, encode_coding_utf_16)
9804 (encode_coding_emacs_mule, encode_invocation_designation)
9805 (encode_designation_at_bol, encode_coding_iso_2022)
9806 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
9807 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
9808 Declare EMACS_INT.
9809 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
9810 (encode_invocation_designation): Last argument P_NCHARS is now
9811 EMACS_INT.
9812 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
9813 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
9814
9815 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
9816 All users changed.
9817
9818 * ccl.c (Fccl_execute_on_string): Declare some variables
9819 EMACS_INT.
9820
9821 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
9822
9823 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
9824
9825 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
9826
9827 * process.c (Fformat_network_address): Doc fix.
9828
9829 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
9830
9831 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
9832
9833 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
9834
9835 * keyboard.c (read_char): Call Lisp function help-form-show,
9836 instead of using internal_with_output_to_temp_buffer.
9837 (Qhelp_form_show): New var.
9838 (syms_of_keyboard): Use DEFSYM macro.
9839
9840 * print.c (internal_with_output_to_temp_buffer): Function deleted.
9841
9842 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
9843
9844 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
9845
9846 * process.c (Flist_processes): Remove to Lisp.
9847 (list_processes_1): Delete.
9848
9849 2011-04-06 Eli Zaretskii <eliz@gnu.org>
9850
9851 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9852
9853 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9854
9855 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
9856
9857 Fix more problems found by GCC 4.6.0's static checks.
9858
9859 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
9860
9861 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
9862
9863 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
9864
9865 * xdisp.c (vmessage): Mark as a printf-like function.
9866
9867 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
9868
9869 * sound.c (sound_warning): Don't crash if arg contains a printf format.
9870
9871 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
9872 printf-like functions.
9873 (tiff_load): Add casts to remove these marks before passing them
9874 to system-supplied API.
9875
9876 * eval.c (Fsignal): Remove excess argument to 'fatal'.
9877
9878 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
9879 This avoids several warnings with gcc -Wstrict-overflow.
9880 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
9881 directly, rather than having caller test rule sign. This avoids
9882 some unnecessary tests.
9883 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
9884 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
9885 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
9886
9887 * xfont.c (xfont_text_extents): Remove var that was set but not used.
9888 (xfont_open): Avoid unnecessary tests.
9889
9890 * composite.c (composition_gstring_put_cache): Use unsigned integer.
9891
9892 * composite.h, composite.c (composition_gstring_put_cache):
9893 Use EMACS_INT, not int, for length.
9894
9895 * composite.h (COMPOSITION_DECODE_REFS): New macro,
9896 breaking out part of COMPOSITION_DECODE_RULE.
9897 (COMPOSITION_DECODE_RULE): Use it.
9898 * composite.c (get_composition_id): Remove unused local vars,
9899 by using the new macro.
9900
9901 * textprop.c (set_text_properties_1): Change while to do-while,
9902 since the condition is always true at first.
9903
9904 * intervals.c (graft_intervals_into_buffer): Mark var as used.
9905 (interval_deletion_adjustment): Return unsigned value.
9906 All uses changed.
9907
9908 * process.c (list_processes_1, create_pty, read_process_output):
9909 (exec_sentinel): Remove vars that were set but not used.
9910 (create_pty): Remove unnecessary "volatile"s.
9911 (Fnetwork_interface_info): Avoid possibility of int overflow.
9912 (read_process_output): Do adaptive read buffering even if carryover.
9913 (read_process_output): Simplify nbytes computation if buffered.
9914
9915 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
9916
9917 * syntax.c (scan_words): Remove var that was set but not used.
9918 (update_syntax_table): Use unsigned instead of int.
9919
9920 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
9921 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
9922 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
9923
9924 * print.c (print_error_message): Avoid int overflow.
9925
9926 * font.c (font_list_entities): Redo for clarity,
9927 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9928
9929 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
9930 (font_score): Avoid potential overflow in diff calculation.
9931
9932 * fns.c (substring_both): Remove var that is set but not used.
9933 (sxhash): Redo loop for clarity and to avoid wraparound warning.
9934
9935 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9936
9937 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9938 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9939 can always succeed if overflow has undefined behavior.
9940
9941 * search.c (boyer_moore, wordify): Remove vars set but not used.
9942 (wordify): Omit three unnecessary tests.
9943
9944 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9945 All callers changed. This avoids the need for an unused var.
9946
9947 * casefiddle.c (casify_region): Remove var that is set but not used.
9948
9949 * dired.c (file_name_completion): Remove var that is set but not used.
9950
9951 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9952
9953 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
9954 (Finsert_file_contents): Remove unnecessary code checking fd.
9955
9956 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9957 Check for integer overflow on size calculations.
9958
9959 * buffer.c (Fprevious_overlay_change): Remove var that is set
9960 but not used.
9961
9962 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9963 Remove vars that are set but not used.
9964 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
9965 (timer_check_2): Mark vars as initialized.
9966
9967 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
9968
9969 * image.c (lookup_image): Remove var that is set but not used.
9970 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
9971
9972 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
9973 that are set but not used.
9974
9975 * xfns.c (make_invisible_cursor): Don't return garbage
9976 if XCreateBitmapFromData fails (Bug#8410).
9977
9978 * xselect.c (x_get_local_selection, x_handle_property_notify):
9979 Remove vars that are set but not used.
9980
9981 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
9982 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
9983
9984 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
9985 Remove var that is set but not used.
9986 (scroll_bar_windows_size): Now size_t, not int.
9987 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
9988 Check for overflow.
9989
9990 * xfaces.c (realize_named_face): Remove vars that are set but not used.
9991 (map_tty_color) [!defined MSDOS]: Likewise.
9992
9993 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
9994
9995 * coding.c: Remove vars that are set but not used.
9996 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
9997 All callers changed.
9998 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
9999 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
10000 (decode_coding_charset): Remove vars that are set but not used.
10001
10002 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
10003 that is set but not used.
10004
10005 * print.c (print_object): Remove var that is set but not used.
10006
10007 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
10008 The gnulib version avoids calling malloc in the usual case,
10009 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
10010 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
10011 * filelock.c (current_lock_owner): Likewise.
10012 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
10013 * sysdep.c: Include allocator.h, careadlinkat.h.
10014 (emacs_no_realloc_allocator): New static constant.
10015 (emacs_readlink): New function.
10016 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
10017 ../lib/careadlinkat.h.
10018
10019 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
10020
10021 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
10022 first non-nil return value).
10023
10024 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
10025
10026 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
10027 if not defined (Bug#8403).
10028
10029 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
10030
10031 * xdisp.c (display_count_lines): Remove parameter `start',
10032 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10033 (get_char_face_and_encoding): Remove parameter `multibyte_p',
10034 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10035 (fill_stretch_glyph_string): Remove parameters `row' and `area',
10036 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
10037 and thereabouts. All callers changed.
10038 (get_per_char_metric): Remove parameter `f', unused since
10039 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10040
10041 2011-04-02 Jim Meyering <meyering@redhat.com>
10042
10043 do not dereference NULL upon failed strdup
10044 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
10045 (ns_get_family): Likewise.
10046
10047 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
10048
10049 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
10050
10051 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
10052
10053 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
10054 later (Bug#8403).
10055
10056 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
10057
10058 Add lexical binding.
10059
10060 * window.c (Ftemp_output_buffer_show): New fun.
10061 (Fsave_window_excursion):
10062 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
10063
10064 * lread.c (lisp_file_lexically_bound_p): New function.
10065 (Fload): Bind Qlexical_binding.
10066 (readevalloop): Remove `evalfun' arg.
10067 Bind Qinternal_interpreter_environment.
10068 (Feval_buffer): Bind Qlexical_binding.
10069 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
10070 Mark as dynamic.
10071 (syms_of_lread): Declare `lexical-binding'.
10072
10073 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
10074
10075 * keyboard.c (eval_dyn): New fun.
10076 (menu_item_eval_property): Use it.
10077
10078 * image.c (parse_image_spec): Use Ffunctionp.
10079
10080 * fns.c (concat, mapcar1): Accept byte-code-functions.
10081
10082 * eval.c (Fsetq): Handle lexical vars.
10083 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
10084 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
10085 (FletX, Flet): Obey lexical binding.
10086 (Fcommandp): Handle closures.
10087 (Feval): New `lexical' arg.
10088 (eval_sub): New function extracted from Feval. Use it almost
10089 everywhere where Feval was used. Look up vars in lexical env.
10090 Handle closures.
10091 (Ffunctionp): Move from subr.el.
10092 (Ffuncall): Handle closures.
10093 (apply_lambda): Remove `eval_flags'.
10094 (funcall_lambda): Handle closures and new byte-code-functions.
10095 (Fspecial_variable_p): New function.
10096 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
10097 but without exporting it to Lisp.
10098
10099 * doc.c (Fdocumentation, store_function_docstring):
10100 * data.c (Finteractive_form): Handle closures.
10101
10102 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
10103 interactive spec.
10104
10105 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
10106 New byte-codes.
10107 (exec_byte_code): New function extracted from Fbyte_code to handle new
10108 calling convention for byte-code-functions. Add new byte-codes.
10109
10110 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
10111
10112 * alloc.c (Fmake_symbol): Init new `declared_special' field.
10113
10114 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10115
10116 * xdisp.c (redisplay_internal): Fix prototype.
10117
10118 2011-03-31 Eli Zaretskii <eliz@gnu.org>
10119
10120 * xdisp.c (SCROLL_LIMIT): New macro.
10121 (try_scrolling): Use it when setting scroll_limit.
10122 Limit scrolling to 100 screen lines.
10123 (redisplay_window): Even when falling back on "recentering",
10124 position point in the window according to scroll-conservatively,
10125 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
10126
10127 (try_scrolling): When point is above the window, allow searching
10128 as far as scroll_max, or one screenful, to compute vertical
10129 distance from PT to the scroll margin position. This prevents
10130 try_scrolling from unnecessarily failing when
10131 scroll-conservatively is set to a value slightly larger than the
10132 window height. Clean up the case of PT below the margin at bottom
10133 of window: scroll_max can no longer be INT_MAX. When aggressive
10134 scrolling is in use, don't let point enter the opposite scroll
10135 margin as result of the scroll.
10136 (syms_of_xdisp) <scroll-conservatively>: Document the
10137 threshold of 100 lines for never-recentering scrolling.
10138
10139 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10140
10141 * dispextern.h (move_it_by_lines):
10142 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
10143 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
10144 (message_log_check_duplicate): Remove parameters `prev_bol' and
10145 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10146 (redisplay_internal): Remove parameter `preserve_echo_area',
10147 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
10148
10149 * indent.c (Fvertical_motion):
10150 * window.c (window_scroll_pixel_based, Frecenter):
10151 Don't pass `need_y_p' to `move_it_by_lines'.
10152
10153 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
10154
10155 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
10156 steal a few bits to be more compact.
10157 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
10158 Remove unneeded casts.
10159
10160 * bytecode.c (Fbyte_code): CAR and CDR can GC.
10161
10162 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
10163
10164 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
10165 binding" message (bug#7967).
10166
10167 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
10168
10169 Fix more problems found by GCC 4.6.0's static checks.
10170
10171 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
10172 Remove unused local var.
10173
10174 * editfns.c (Fmessage_box): Remove unused local var.
10175
10176 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
10177 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10178 Omit unused local vars.
10179 * window.c (shrink_windows): Omit unused local var.
10180 * menu.c (digest_single_submenu): Omit unused local var.
10181 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
10182 Omit unused local var.
10183
10184 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
10185 Don't assume string length fits in int.
10186 (keyremap_step, read_key_sequence): Use size_t for sizes.
10187 (read_key_sequence): Don't check last_real_key_start redundantly.
10188
10189 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
10190 instead of alloca (Bug#8344).
10191
10192 * eval.c (Fbacktrace): Don't assume nargs fits in int.
10193 (Fbacktrace_frame): Don't assume nframes fits in int.
10194
10195 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
10196
10197 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
10198 concerns.
10199
10200 * term.c (produce_glyphless_glyph): Remove unnecessary test.
10201
10202 * cm.c (calccost): Turn while-do into do-while, for clarity.
10203
10204 * keyboard.c (syms_of_keyboard): Use the same style as later
10205 in this function when indexing through an array. This also
10206 works around GCC bug 48267.
10207
10208 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
10209
10210 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
10211
10212 * chartab.c (sub_char_table_ref_and_range): Redo for slight
10213 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
10214
10215 * keyboard.c, keyboard.h (num_input_events): Now size_t.
10216 This avoids undefined behavior on integer overflow, and is a bit
10217 more convenient anyway since it is compared to a size_t variable.
10218
10219 Variadic C functions now count arguments with size_t, not int.
10220 This avoids an unnecessary limitation on 64-bit machines, which
10221 caused (substring ...) to crash on large vectors (Bug#8344).
10222 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
10223 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
10224 All variadic functions and their callers changed accordingly.
10225 (struct gcpro.nvars): Now size_t, not int. All uses changed.
10226 * data.c (arith_driver, float_arith_driver): Likewise.
10227 * editfns.c (general_insert_function): Likewise.
10228 * eval.c (struct backtrace.nargs, interactive_p)
10229 (internal_condition_case_n, run_hook_with_args, apply_lambda)
10230 (funcall_lambda, mark_backtrace): Likewise.
10231 * fns.c (concat): Likewise.
10232 * frame.c (x_set_frame_parameters): Likewise.
10233 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
10234 0 if not found, not -1. All callers changed.
10235
10236 * alloc.c (garbage_collect): Don't assume stack size fits in int.
10237 (stack_copy_size): Now size_t, not int.
10238 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
10239
10240 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
10241
10242 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
10243 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10244 All callers changed.
10245
10246 * lisp.h (multibyte_char_to_unibyte):
10247 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
10248 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10249 * character.h (CHAR_TO_BYTE8):
10250 * cmds.c (internal_self_insert):
10251 * editfns.c (general_insert_function):
10252 * keymap.c (push_key_description):
10253 * search.c (Freplace_match):
10254 * xdisp.c (message_dolog, set_message_1): All callers changed.
10255
10256 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10257
10258 * keyboard.c (safe_run_hook_funcall): New function.
10259 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
10260 don't set the hook to nil, but remove the offending function instead.
10261 (Qcommand_hook_internal): Remove, unused.
10262 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
10263 Vcommand_hook_internal.
10264
10265 * eval.c (enum run_hooks_condition): Remove.
10266 (funcall_nil, funcall_not): New functions.
10267 (run_hook_with_args): Call each function through a `funcall' argument.
10268 Remove `cond' argument, now redundant.
10269 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
10270 (Frun_hook_with_args_until_failure): Adjust accordingly.
10271 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
10272
10273 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
10274
10275 * dispextern.h (string_buffer_position): Remove declaration.
10276
10277 * print.c (strout): Remove parameter `multibyte', unused since
10278 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
10279
10280 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
10281 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
10282 All callers changed.
10283
10284 * w32.c (_wsa_errlist): Use braces for struct initializers.
10285
10286 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
10287 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
10288 All callers changed.
10289 (string_buffer_position): Likewise. Also, make static (it's never
10290 used outside xdisp.c).
10291 (cursor_row_p): Remove parameter `w', unused since
10292 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
10293 (decode_mode_spec): Remove parameter `precision', introduced during
10294 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
10295 All callers changed.
10296
10297 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10298
10299 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
10300
10301 2011-03-27 Anders Lindgren <andlind@gmail.com>
10302
10303 * nsterm.m (ns_menu_bar_is_hidden): New variable.
10304 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
10305 (ns_update_auto_hide_menu_bar): New functions.
10306 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
10307 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
10308 ns_constrain_all_frames.
10309 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
10310 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
10311
10312 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10313
10314 * nsmenu.m (runDialogAt): Remove argument to timer_check.
10315
10316 2011-03-27 Glenn Morris <rgm@gnu.org>
10317
10318 * syssignal.h: Replace RETSIGTYPE with void.
10319 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
10320 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
10321 Replace SIGTYPE with void everywhere.
10322 * s/usg5-4-common.h (SIGTYPE): Remove definition.
10323 * s/template.h (SIGTYPE): Remove commented out definition.
10324
10325 2011-03-26 Eli Zaretskii <eliz@gnu.org>
10326
10327 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
10328 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
10329
10330 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
10331
10332 * w32.c (read_unc_volume): Use parameter `henum', instead of
10333 global variable `wget_enum_handle'.
10334
10335 * keymap.c (describe_vector): Remove parameters `indices' and
10336 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
10337 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
10338
10339 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
10340
10341 * keyboard.c (timer_check): Remove parameter `do_it_now',
10342 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
10343 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
10344 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
10345
10346 * keyboard.c (read_char):
10347 * w32menu.c (w32_menu_display_help):
10348 * xmenu.c (show_help_event, menu_help_callback):
10349 Adjust calls to `show_help_echo'.
10350
10351 * gtkutil.c (xg_maybe_add_timer):
10352 * keyboard.c (readable_events):
10353 * process.c (wait_reading_process_output):
10354 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
10355
10356 * insdel.c (adjust_markers_gap_motion):
10357 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
10358 (gap_left, gap_right): Don't call it.
10359
10360 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
10361
10362 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
10363 incurred during fontification.
10364
10365 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
10366
10367 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
10368 (DEFVAR_PER_BUFFER): Don't pass it.
10369
10370 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
10371 (scrolling_window): Don't pass it.
10372
10373 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
10374
10375 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
10376
10377 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
10378 and `suffix'.
10379 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
10380 of variables specific to SELinux and computation of `encoded_absname'.
10381
10382 * image.c (XPutPixel): Remove unused variable `height'.
10383
10384 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
10385
10386 * unexw32.c (get_section_info): Remove unused variable `section'.
10387
10388 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
10389 (system_process_attributes): Remove unused variable `sess'.
10390 (sys_read): Remove unused variable `err'.
10391
10392 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
10393 (w32_wnd_proc): Remove unused variable `isdead'.
10394 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
10395 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
10396 (x_create_tip_frame): Remove unused variable `tem'.
10397
10398 * w32inevt.c (w32_console_read_socket):
10399 Remove unused variable `no_events'.
10400
10401 * w32term.c (x_draw_composite_glyph_string_foreground):
10402 Remove unused variable `width'.
10403
10404 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
10405
10406 * w32term.c (x_set_glyph_string_clipping):
10407 Don't pass uninitialized region to CombineRgn.
10408
10409 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
10410
10411 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
10412 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
10413 (Fx_close_connection): Remove unused variable `i'.
10414
10415 * w32font.c (w32font_draw): Return number of glyphs.
10416 (w32font_open_internal): Remove unused variable `i'.
10417 (w32font_driver): Add missing initializer.
10418
10419 * w32menu.c (utf8to16): Remove unused variable `utf16'.
10420 (fill_in_menu): Remove unused variable `items_added'.
10421
10422 * w32term.c (last_mouse_press_frame): Remove static global variable.
10423 (w32_clip_to_row): Remove unused variable `f'.
10424 (x_delete_terminal): Remove unused variable `i'.
10425
10426 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
10427 (NOTHING): Remove unused static global variable.
10428 (uniscribe_check_otf): Remove unused variable `table'.
10429 (uniscribe_font_driver): Add missing initializers.
10430
10431 2011-03-23 Julien Danjou <julien@danjou.info>
10432
10433 * term.c (Fsuspend_tty, Fresume_tty):
10434 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
10435 * window.c (temp_output_buffer_show):
10436 * insdel.c (signal_before_change):
10437 * frame.c (Fhandle_switch_frame):
10438 * fileio.c (Fdo_auto_save):
10439 * emacs.c (Fkill_emacs):
10440 * editfns.c (save_excursion_restore):
10441 * cmds.c (internal_self_insert):
10442 * callint.c (Fcall_interactively):
10443 * buffer.c (Fkill_all_local_variables):
10444 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
10445 Use Frun_hooks.
10446 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
10447 unconditionally since it does the check itself.
10448
10449 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
10450
10451 Fix more problems found by GCC 4.5.2's static checks.
10452
10453 * coding.c (encode_coding_raw_text): Avoid unnecessary test
10454 the first time through the loop, since we know p0 < p1 then.
10455 This also avoids a gcc -Wstrict-overflow warning.
10456
10457 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
10458 leading to a memory leak, possible in functions like
10459 load_charset_map_from_file that can allocate an unbounded number
10460 of objects (Bug#8318).
10461
10462 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
10463 that could (at least in theory) be that large.
10464
10465 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
10466 This is less likely to overflow, and avoids undefined behavior if
10467 overflow does occur. All callers changed. Use strtoul to scan
10468 for the unsigned long integer.
10469 (pint2hrstr): Simplify and tune code slightly.
10470 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
10471
10472 * scroll.c (do_scrolling): Work around GCC bug 48228.
10473 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
10474
10475 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
10476 This also avoids a warning with gcc -Wstrict-overflow.
10477 (validate_x_resource_name): Simplify count usage.
10478 This also avoids a warning with gcc -Wstrict-overflow.
10479
10480 * fileio.c (Fcopy_file): Report error if fchown or fchmod
10481 fail (Bug#8306).
10482
10483 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
10484
10485 * process.c (Fmake_network_process): Use socklen_t, not int,
10486 where POSIX says socklen_t is required in portable programs.
10487 This fixes a porting bug on hosts like 64-bit HP-UX, where
10488 socklen_t is wider than int (Bug#8277).
10489 (Fmake_network_process, server_accept_connection):
10490 (wait_reading_process_output, read_process_output):
10491 Likewise.
10492
10493 * process.c: Rename or move locals to avoid shadowing.
10494 (list_processes_1, Fmake_network_process):
10495 (read_process_output_error_handler, exec_sentinel_error_handler):
10496 Rename or move locals.
10497 (Fmake_network_process): Define label "retry_connect" only if needed.
10498 (Fnetwork_interface_info): Fix pointer signedness.
10499 (process_send_signal): Add cast to avoid pointer signedness problem.
10500 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
10501 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
10502
10503 Make tparam.h and terminfo.c consistent.
10504 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
10505 Include tparam.h instead, since it declares them.
10506 * cm.h (PC): Remove extern decl; tparam.h now does this.
10507 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
10508 * terminfo.c: Include tparam.h, to check interfaces.
10509 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
10510 (tparam): Adjust signature to match interface in tparam.h;
10511 this removes some undefined behavior. Check that outstring and len
10512 are zero, which they always are with Emacs.
10513 * tparam.h (PC, BC, UP): New extern decls.
10514
10515 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
10516 (xftfont_open): Rename locals to avoid shadowing.
10517
10518 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
10519 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
10520 (OTF_TAG_SYM): Omit macro if not needed.
10521 (ftfont_list): Remove unused local.
10522 (get_adstyle_property, ftfont_pattern_entity):
10523 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
10524 Rename locals to avoid shadowing.
10525
10526 * xfont.c (xfont_list_family): Mark var as initialized.
10527
10528 * xml.c (make_dom): Now static.
10529
10530 * composite.c (composition_compute_stop_pos): Rename local to
10531 avoid shadowing.
10532 (composition_reseat_it): Remove unused locals.
10533 (find_automatic_composition, composition_adjust_point): Likewise.
10534 (composition_update_it): Mark var as initialized.
10535 (find_automatic_composition): Mark vars as initialized,
10536 with a FIXME (Bug#8290).
10537
10538 character.h: Rename locals to avoid shadowing.
10539 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
10540 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
10541 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
10542 (BUF_DEC_POS): Be more systematic about renaming local temporaries
10543 to avoid shadowing.
10544
10545 * textprop.c (property_change_between_p): Remove; unused.
10546
10547 * intervals.c (interval_start_pos): Now static.
10548
10549 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
10550
10551 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
10552 Rename locals to avoid shadowing.
10553
10554 * sound.c (wav_play, au_play, Fplay_sound_internal):
10555 Fix pointer signedness.
10556 (alsa_choose_format): Remove unused local var.
10557 (wav_play): Initialize a variable to 0, to prevent undefined
10558 behavior (Bug#8278).
10559
10560 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
10561
10562 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
10563
10564 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
10565 clobbering (Bug#8298).
10566 * sysdep.c (sys_subshell): Likewise.
10567 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
10568
10569 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
10570 This should get cleaned up, so that child_setup has the
10571 same signature on all platforms.
10572
10573 * callproc.c (call_process_cleanup): Now static.
10574 (relocate_fd): Rename locals to avoid shadowing.
10575
10576 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
10577
10578 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
10579 not to be necessary, and produces flickering.
10580
10581 2011-03-20 Glenn Morris <rgm@gnu.org>
10582
10583 * config.in: Remove file.
10584
10585 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
10586
10587 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
10588 are now in src/globals.h.
10589 (syms_of_minibuf): Remove spurious & from previous change.
10590
10591 2011-03-20 Leo Liu <sdl.web@gmail.com>
10592
10593 * minibuf.c (completing-read-function): New variable.
10594 (completing-read-default): Rename from completing-read.
10595 (completing-read): Call completing-read-function.
10596
10597 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
10598
10599 * xfaces.c (Fx_load_color_file):
10600 Read color file from absolute filename (bug#8250).
10601
10602 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
10603
10604 * makefile.w32-in: Update dependencies.
10605
10606 2011-03-17 Eli Zaretskii <eliz@gnu.org>
10607
10608 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
10609
10610 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
10611
10612 Fix more problems found by GCC 4.5.2's static checks.
10613
10614 * process.c (make_serial_process_unwind, send_process_trap):
10615 (sigchld_handler): Now static.
10616
10617 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
10618 That way, the code declares only the vars that it needs.
10619 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
10620 * s/cygwin.h (PTY_ITERATION): Likewise.
10621 * s/darwin.h (PTY_ITERATION): Likewise.
10622 * s/gnu-linux.h (PTY_ITERATION): Likewise.
10623
10624 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
10625 * process.c (allocate_pty): Don't declare stb unless it's needed.
10626
10627 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
10628 (CONSTANTLIM): Remove; unused.
10629 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
10630 Define only if needed.
10631
10632 * unexelf.c (unexec): Name an expression,
10633 to avoid gcc -Wbad-function-cast warning.
10634 Use a different way to cause a compilation error if anyone uses
10635 n rather than nn, a way that does not involve shadowing.
10636 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
10637
10638 * deps.mk (unexalpha.o): Remove; unused.
10639
10640 New file unexec.h, the (simple) interface for unexec (Bug#8267).
10641 * unexec.h: New file.
10642 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
10643 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
10644 Depend on unexec.h.
10645 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
10646 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
10647 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
10648 Change as necessary to match prototype in unexec.h.
10649
10650 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
10651 shadowing.
10652 (back_comment, skip_chars): Mark vars as initialized.
10653
10654 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
10655 Rename locals to avoid shadowing.
10656
10657 * lread.c (read1): Rewrite so as not to use empty "else".
10658 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
10659
10660 * print.c (Fredirect_debugging_output): Fix pointer signedess.
10661
10662 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
10663 warning when compiling print.c.
10664
10665 * font.c (font_unparse_fcname): Abort in an "impossible" situation
10666 instead of using an uninitialized var.
10667 (font_sort_entities): Mark var as initialized.
10668
10669 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
10670
10671 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
10672 pointers to constants.
10673 (font_parse_fcname): Remove unused vars.
10674 (font_delete_unmatched): Now static.
10675 (font_get_spec): Remove; unused.
10676 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
10677 (font_update_drivers, Ffont_get_glyphs, font_add_log):
10678 Rename or move locals to avoid shadowing.
10679
10680 * fns.c (require_nesting_list, require_unwind): Now static.
10681 (Ffillarray): Rename locals to avoid shadowing.
10682
10683 * floatfns.c (domain_error2): Define only if needed.
10684 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
10685
10686 * alloc.c (mark_backtrace): Move decl from here ...
10687 * lisp.h: ... to here, so that it can be checked.
10688
10689 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
10690 (Fdefvar): Rewrite so as not to use empty "else".
10691 (lisp_indirect_variable): Name an expression,
10692 to avoid gcc -Wbad-function-cast warning.
10693 (Fdefvar): Rename locals to avoid shadowing.
10694
10695 * callint.c (quotify_arg, quotify_args): Now static.
10696 (Fcall_interactively): Rename locals to avoid shadowing.
10697 Use const pointer when appropriate.
10698
10699 * lisp.h (get_system_name, get_operating_system_release):
10700 Move decls here, to check interfaces.
10701 * process.c (get_operating_system_release): Move decl to lisp.h.
10702 * xrdb.c (get_system_name): Likewise.
10703 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
10704 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
10705 some of which prompt warnings from gcc -Wbad-function-cast.
10706 (Fformat_time_string, Fencode_time, Finsert_char):
10707 (Ftranslate_region_internal, Fformat):
10708 Rename or remove local vars to avoid shadowing.
10709 (Ftranslate_region_internal): Mark var as initialized.
10710
10711 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
10712 avoid shadowing.
10713
10714 * lisp.h (eassert): Check that the argument compiles, even if
10715 ENABLE_CHECKING is not defined.
10716
10717 * data.c (Findirect_variable): Name an expression, to avoid
10718 gcc -Wbad-function-cast warning.
10719 (default_value, arithcompare, arith_driver, arith_error): Now static.
10720 (store_symval_forwarding): Rename local to avoid shadowing.
10721 (Fmake_variable_buffer_local, Fmake_local_variable):
10722 Mark variables as initialized.
10723 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
10724
10725 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
10726 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
10727 Rename locals to avoid shadowing.
10728 (mark_stack): Move local variables into the #ifdef region where
10729 they're used.
10730 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
10731 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
10732 needed otherwise.
10733 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
10734 (GC_STRING_CHARS): Remove; not used.
10735 (Fmemory_limit): Cast sbrk's returned value to char *.
10736
10737 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
10738 avoids undefined behavior in theory.
10739
10740 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
10741
10742 Use functions, not macros, for up- and down-casing (Bug#8254).
10743 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10744 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
10745 to use the following functions instead of these macros.
10746 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
10747 EMACS_INT, since callers assume the returned value fits in int.
10748 (upcase1): Likewise, for UPCASE_TABLE.
10749 (uppercasep, lowercasep, upcase): New static inline functions.
10750 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
10751 the race-condition problem in the old DOWNCASE.
10752
10753 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
10754 Rename locals to avoid shadowing.
10755 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
10756 (regex_compile, re_search_2, re_match_2_internal):
10757 Remove unused local vars.
10758 (FREE_VAR): Rewrite so as not to use empty "else",
10759 which gcc can warn about.
10760 (regex_compile, re_match_2_internal): Mark locals as initialized.
10761 (RETALLOC_IF): Define only if needed.
10762 (WORDCHAR_P): Likewise. This one is never needed, but is used
10763 only in a comment talking about a compiler bug, so put inside
10764 the #if 0 of that comment.
10765 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
10766 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
10767 Remove; unused.
10768
10769 * search.c (boyer_moore): Rename locals to avoid shadowing.
10770 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
10771 (PREV_CHAR_BOUNDARY): Likewise.
10772
10773 * search.c (simple_search): Remove unused var.
10774
10775 * dired.c (compile_pattern): Move decl from here ...
10776 * lisp.h: ... to here, so that it can be checked.
10777 (struct re_registers): New forward decl.
10778
10779 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
10780
10781 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
10782 All uses changed.
10783 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
10784 Rename locals to avoid shadowing.
10785 (Fvertical_motion): Mark locals as initialized.
10786
10787 * casefiddle.c (casify_object, casify_region): Now static.
10788 (casify_region): Mark local as initialized.
10789
10790 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
10791
10792 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
10793 New macros, so that the caller can use some names other than
10794 gcpro1, gcpro2, etc.
10795 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
10796 of the new macros.
10797 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
10798 argument, for consistency with GCPRO2_VAR, etc: it is now the
10799 prefix of the variable, not the variable itself. All uses
10800 changed.
10801 * dired.c (directory_files_internal, file_name_completion):
10802 Rename locals to avoid shadowing.
10803
10804 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
10805 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
10806 dired.c's scmp function, had undefined behavior.
10807 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10808 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
10809 * buffer.h: ... to here, because these macros use current_buffer,
10810 and the new implementation with inline functions needs to have
10811 current_buffer in scope now, rather than later when the macros
10812 are used.
10813 (downcase, upcase1): New static inline functions.
10814 (DOWNCASE, UPCASE1): Reimplement using these functions.
10815 This avoids undefined behavior in expressions like
10816 DOWNCASE (x) == DOWNCASE (y), which previously suffered
10817 from race conditions in accessing the global variables
10818 case_temp1 and case_temp2.
10819 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
10820 * lisp.h (case_temp1, case_temp2): Remove their decls.
10821 * character.h (ASCII_CHAR_P): Move from here ...
10822 * lisp.h: ... to here, so that the inline functions mentioned
10823 above can use them.
10824
10825 * dired.c (directory_files_internal_unwind): Now static.
10826
10827 * fileio.c (file_name_as_directory, directory_file_name):
10828 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
10829 Now static.
10830 (file_name_as_directory): Use const pointers when appropriate.
10831 (Fexpand_file_name): Likewise. In particular, newdir might
10832 point at constant storage, so make it a const pointer.
10833 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
10834 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
10835 signedness issues.
10836 (Fset_file_times, Finsert_file_contents, auto_save_error):
10837 Rename locals to avoid shadowing.
10838
10839 * minibuf.c (choose_minibuf_frame_1): Now static.
10840 (Ftry_completion, Fall_completions): Rename or remove locals
10841 to avoid shadowing.
10842
10843 * marker.c (bytepos_to_charpos): Remove; unused.
10844
10845 * lisp.h (verify_bytepos, count_markers): New decls,
10846 so that gcc does not warn that these functions aren't declared.
10847
10848 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10849 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
10850 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
10851 (copy_text): Remove unused local var.
10852
10853 * filelock.c (within_one_second): Now static.
10854 (lock_file_1): Rename local to avoid shadowing.
10855
10856 * buffer.c (fix_overlays_before): Mark locals as initialized.
10857 (fix_start_end_in_overlays): Likewise. This function should be
10858 simplified by using pointers-to-pointers, but that's a different
10859 matter.
10860 (switch_to_buffer_1): Now static.
10861 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
10862 (report_overlay_modification): Rename locals to avoid shadowing.
10863
10864 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
10865 Fix pointer signedness issue.
10866 (sys_subshell): Mark local as volatile if checking for lint,
10867 to suppress a gcc -Wclobbered warning that does not seem to be right.
10868 (MAXPATHLEN): Define only if needed.
10869
10870 * process.c (serial_open, serial_configure): Move decls from here ...
10871 * systty.h: ... to here, so that they can be checked.
10872
10873 * fns.c (get_random, seed_random): Move extern decls from here ...
10874 * lisp.h: ... to here, so that they can be checked.
10875
10876 * sysdep.c (reset_io): Now static.
10877 (wait_for_termination_signal): Remove; unused.
10878
10879 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
10880 (copy_keymap_item, append_key, push_text_char_description):
10881 Now static.
10882 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
10883 (DENSE_TABLE_SIZE): Remove; unused.
10884 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
10885 (describe_map_tree):
10886 Rename locals to avoid shadowing.
10887
10888 * keyboard.c: Declare functions static if they are not used elsewhere.
10889 (echo_char, echo_dash, cmd_error, top_level_2):
10890 (poll_for_input, handle_async_input): Now static.
10891 (read_char, kbd_buffer_get_event, make_lispy_position):
10892 (make_lispy_event, make_lispy_movement, apply_modifiers):
10893 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
10894 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
10895 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
10896 (read_key_sequence, read_char): Mark locals as initialized.
10897 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
10898
10899 * keyboard.h (make_ctrl_char): New decl.
10900 (mark_kboards): Move decl here ...
10901 * alloc.c (mark_kboards): ... from here.
10902
10903 * lisp.h (force_auto_save_soon): New decl.
10904
10905 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
10906 (DEFINE_DUMMY_FUNCTION): New macro.
10907 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
10908 Use it.
10909 (main): Add casts to avoid warnings
10910 if GCC considers string literals to be constants.
10911
10912 * lisp.h (fatal_error_signal): Add decl, since it's exported.
10913
10914 * dbusbind.c: Pointer signedness fixes.
10915 (xd_signature, xd_append_arg, xd_initialize):
10916 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10917 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10918 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
10919 (Fdbus_register_signal): Use SSDATA when the context wants char *.
10920
10921 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10922 if GCC considers string literals to be constants.
10923 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
10924
10925 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10926
10927 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10928 (print_preprocess, print_object): New macro to fix last change.
10929
10930 * print.c (print_preprocess): Don't forget font objects.
10931
10932 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
10933
10934 * emacs.c (USAGE3): Doc fixes.
10935
10936 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10937
10938 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10939 structure.
10940
10941 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
10942
10943 * lisp.h (VWindow_system, Qfile_name_history):
10944 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10945 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10946 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10947
10948 * w32select.c: Don't #include "keyboard.h".
10949 (run_protected): Add extern declaration for waiting_for_input.
10950
10951 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10952 * w32console.c (detect_input_pending, read_input_pending)
10953 (encode_terminal_code):
10954 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10955 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10956 (w32_system_caret_y, Qfile_name_history):
10957 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10958 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10959 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10960 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10961 * w32proc.c (Qlocal, report_file_error):
10962 * w32term.c (Vwindow_system, updating_frame):
10963 * w32uniscribe.c (initialized, uniscribe_font_driver):
10964 Remove unneeded extern declarations.
10965
10966 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
10967
10968 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
10969
10970 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
10971
10972 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
10973 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
10974 These macros can no longer be used for assignment.
10975
10976 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10977 Assign struct members directly, instead of using BUF_BEGV etc.
10978 (record_buffer_markers, fetch_buffer_markers): New functions for
10979 recording and fetching special buffer markers.
10980 (set_buffer_internal_1, set_buffer_temp): Use them.
10981
10982 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
10983
10984 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
10985
10986 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
10987 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
10988
10989 * xdisp.c (hscroll_window_tree):
10990 (reconsider_clip_changes): Use PT instead of BUF_PT.
10991
10992 2011-03-13 Eli Zaretskii <eliz@gnu.org>
10993
10994 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
10995 $(EMACS_ROOT)/lib/intprops.h.
10996
10997 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
10998
10999 Fix more problems found by GCC 4.5.2's static checks.
11000
11001 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
11002 to unsigned char * to avoid compiler diagnostic.
11003 (xg_free_frame_widgets): Make it clear that a local variable is
11004 needed only if USE_GTK_TOOLTIP.
11005 (gdk_window_get_screen): Make it clear that this macro is needed
11006 only if USE_GTK_TOOLTIP.
11007 (int_gtk_range_get_value): New function, which avoids a diagnostic
11008 from gcc -Wbad-function-cast.
11009 (xg_set_toolkit_scroll_bar_thumb): Use it.
11010 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
11011 diagnostic from gcc -Wbad-function-cast.
11012 (get_utf8_string, xg_get_file_with_chooser):
11013 Rename locals to avoid shadowing.
11014 (create_dialog): Move locals to avoid shadowing.
11015
11016 * xgselect.c (xg_select): Remove unused var.
11017
11018 * image.c (four_corners_best): Mark locals as initialized.
11019 (gif_load): Initialize transparent_p to zero (Bug#8238).
11020 Mark another local as initialized.
11021 (my_png_error, my_error_exit): Mark with NO_RETURN.
11022
11023 * image.c (clear_image_cache): Now static.
11024 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
11025 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
11026 (x_edge_detection): Remove unnecessary cast that
11027 gcc -Wbad-function-cast diagnoses.
11028 (gif_load): Fix pointer signedness.
11029 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
11030 (jpeg_load, gif_load): Rename locals to avoid shadowing.
11031
11032 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
11033
11034 Improve quality of tests for time stamp overflow.
11035 For example, without this patch (encode-time 0 0 0 1 1
11036 1152921504606846976) returns the obviously-bogus value (-948597
11037 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
11038 reports time overflow. See
11039 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
11040 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
11041 * editfns.c: Include limits.h and intprops.h.
11042 (TIME_T_MIN, TIME_T_MAX): New macros.
11043 (time_overflow): Move earlier, to before first use.
11044 (hi_time, lo_time): New functions, for an accurate test for
11045 out-of-range times.
11046 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
11047 (Fget_internal_run_time): Don't assume time_t fits in int.
11048 (make_time): Use list2 instead of Fcons twice.
11049 (Fdecode_time): More accurate test for out-of-range times.
11050 (check_tm_member): New function.
11051 (Fencode_time): Use it, to test for out-of-range times.
11052 (lisp_time_argument): Don't rely on undefined left-shift and
11053 right-shift behavior when checking for time stamp overflow.
11054
11055 * editfns.c (time_overflow): New function, refactoring common code.
11056 (Fformat_time_string, Fdecode_time, Fencode_time):
11057 (Fcurrent_time_string): Use it.
11058
11059 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
11060 * dired.c (make_time): Move to ...
11061 * editfns.c (make_time): ... here.
11062 * systime.h: Note the move.
11063
11064 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11065
11066 * fringe.c (update_window_fringes): Remove unused variables.
11067
11068 * unexmacosx.c (copy_data_segment): Also copy __got section.
11069 (Bug#8223)
11070
11071 2011-03-12 Eli Zaretskii <eliz@gnu.org>
11072
11073 * termcap.c [MSDOS]: Include "msdos.h".
11074 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
11075 Constify `char *' arguments and their references according to
11076 prototypes in tparam.h.
11077
11078 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
11079
11080 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
11081 Adapt all references accordingly.
11082
11083 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
11084
11085 2011-03-11 Tom Tromey <tromey@redhat.com>
11086
11087 * buffer.c (syms_of_buffer): Remove obsolete comment.
11088
11089 2011-03-11 Eli Zaretskii <eliz@gnu.org>
11090
11091 * termhooks.h (encode_terminal_code): Declare prototype.
11092
11093 * msdos.c (encode_terminal_code): Don't declare prototype.
11094
11095 * term.c (encode_terminal_code): Now external again, used by
11096 w32console.c and msdos.c.
11097
11098 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
11099 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
11100
11101 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
11102
11103 Fix some minor problems found by GCC 4.5.2's static checks.
11104
11105 * fringe.c (update_window_fringes): Mark locals as initialized
11106 (Bug#8227).
11107 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
11108
11109 * alloc.c (mark_fringe_data): Move decl from here ...
11110 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
11111 to check its interface.
11112 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
11113
11114 * fontset.c (free_realized_fontset): Now static.
11115 (Fset_fontset_font): Rename local to avoid shadowing.
11116 (fontset_font): Mark local as initialized.
11117 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
11118
11119 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
11120
11121 * xselect.c (x_disown_buffer_selections): Remove; not used.
11122 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
11123 (x_own_selection, Fx_disown_selection_internal): Rename locals
11124 to avoid shadowing.
11125 (x_handle_dnd_message): Remove local to avoid shadowing.
11126
11127 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
11128 so that the caller can use some name other than gcpro1.
11129 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
11130 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11131 (Fx_backspace_delete_keys_p):
11132 Use them to avoid shadowing, and rename vars to avoid shadowing.
11133 (x_decode_color, x_set_name, x_window): Now static.
11134 (Fx_create_frame): Add braces to silence GCC warning.
11135 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
11136 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
11137 Remove unused locals.
11138 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11139 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
11140 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
11141 macros.
11142
11143 * xterm.h (x_mouse_leave): New decl.
11144
11145 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
11146 Remove unused functions.
11147 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
11148 (x_calc_absolute_position): Now static.
11149 (XTread_socket): Don't define label "out" unless it's used.
11150 Don't declare local "event" unless it's used.
11151 (x_iconify_frame, x_free_frame_resources): Don't declare locals
11152 unless they are used.
11153 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
11154 (x_fatal_error_signal): Remove; not used.
11155 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
11156 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
11157 (x_error_catcher, x_connection_closed, x_error_handler):
11158 (x_error_quitter, xembed_send_message, x_iconify_frame):
11159 (my_log_handler): Rename locals to avoid shadowing.
11160 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
11161 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
11162
11163 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
11164 Rename or move locals to avoid shadowing.
11165 (tty_defined_color, merge_face_heights): Now static.
11166 (free_realized_faces_for_fontset): Remove; not used.
11167 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
11168 does not deduce is never used uninitialized.
11169 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
11170 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
11171
11172 * terminal.c (store_terminal_param): Now static.
11173
11174 * xmenu.c (menu_highlight_callback): Now static.
11175 (set_frame_menubar): Remove unused local.
11176 (xmenu_show): Rename parameter to avoid shadowing.
11177 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
11178 since they might point to immutable storage.
11179 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
11180 since it's unused otherwise.
11181
11182 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
11183 Add a FIXME, since the code still doesn't look right. (Bug#8215)
11184 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
11185 avoids a gcc -Wuninitialized diagnostic.
11186 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
11187 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
11188 does not deduce are never used uninitialized.
11189
11190 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
11191
11192 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
11193 * window.c (window_loop, size_window):
11194 (run_window_configuration_change_hook, enlarge_window): Likewise.
11195
11196 * window.c (display_buffer): Now static.
11197 (size_window): Mark variables that gcc -Wuninitialized
11198 does not deduce are never used uninitialized.
11199 * window.h (check_all_windows): New decl, to forestall
11200 gcc -Wmissing-prototypes diagnostic.
11201 * dispextern.h (bidi_dump_cached_states): Likewise.
11202
11203 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
11204 shadowing.
11205 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
11206 Include <limits.h>.
11207 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
11208 and to avoid gcc -Wuninitialized warning.
11209 (load_charset_map): Mark variables that gcc -Wuninitialized
11210 does not deduce are never used uninitialized.
11211 (load_charset): Abort instead of using uninitialized var (Bug#8229).
11212
11213 * coding.c (coding_set_source, coding_set_destination):
11214 Use "else { /* comment */ }" rather than "else /* comment */;"
11215 for clarity, and to avoid gcc -Wempty-body warning.
11216 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
11217 a block, when the outer 'i' will do.
11218 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
11219 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
11220 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
11221 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
11222 (Fdecode_sjis_char, Fdefine_coding_system_internal):
11223 Rename locals to avoid shadowing.
11224 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
11225 * coding.c (emacs_mule_char, encode_invocation_designation):
11226 Now static, since they're not used elsewhere.
11227 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
11228 (decode_coding_object, encode_coding_object, detect_coding_system):
11229 (decode_coding_emacs_mule): Mark variables that gcc
11230 -Wuninitialized does not deduce are never used uninitialized.
11231 (detect_coding_iso_2022): Initialize a local variable that might
11232 be used uninitialized. Leave a FIXME because it's not clear that
11233 this initialization is needed. (Bug#8211)
11234 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
11235 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
11236 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
11237 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
11238 Remove unused macros.
11239
11240 * category.c (hash_get_category_set): Remove unused local var.
11241 (copy_category_table): Now static, since it's not used elsewhere.
11242 * character.c (string_count_byte8): Likewise.
11243
11244 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
11245 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
11246
11247 * chartab.c (copy_sub_char_table): Now static, since it's not used
11248 elsewhere.
11249 (sub_char_table_ref_and_range, char_table_ref_and_range):
11250 Rename locals to avoid shadowing.
11251 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
11252
11253 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
11254 (BIDI_BOB): Remove unused macro.
11255
11256 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
11257 deduce are never used uninitialized.
11258 * term.c (encode_terminal_code): Likewise.
11259
11260 * term.c (encode_terminal_code): Now static. Remove unused local.
11261
11262 * tparam.h: New file.
11263 * term.c, tparam.h: Include it.
11264 * deps.mk (term.o, tparam.o): Depend on tparam.h.
11265 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
11266 Move these decls to tparam.h, and make them agree with what
11267 is actually in tparam.c. The previous trick of using incompatible
11268 decls in different modules does not conform to the C standard.
11269 All callers of tparam changed to use tparam's actual API.
11270 * tparam.c (tparam1, tparam, tgoto):
11271 Use const pointers where appropriate.
11272
11273 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
11274 * cm.h (struct cm): Likewise.
11275 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
11276 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
11277 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
11278 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
11279 (turn_on_face, init_tty): Likewise.
11280 * termchar.h (struct tty_display_info): Likewise.
11281
11282 * term.c (term_mouse_position): Rename local to avoid shadowing.
11283
11284 * alloc.c (mark_ttys): Move decl from here ...
11285 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
11286
11287 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
11288
11289 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
11290
11291 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
11292
11293 * search.c (compile_pattern_1): Remove argument regp, unused since
11294 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
11295 (compile_pattern): Don't pass it.
11296
11297 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
11298
11299 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
11300 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
11301 for ! HAVE_GTK3.
11302 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
11303
11304 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
11305
11306 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
11307 gdk_window_get_screen, gdk_window_get_geometry,
11308 gdk_x11_window_lookup_for_display and GDK_KEY_g.
11309 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
11310 (xg_get_pixbuf_from_pixmap): New function.
11311 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
11312 to Pixmap, take frame as parameter, remove GdkColormap parameter.
11313 Call xg_get_pixbuf_from_pixmap instead of
11314 gdk_pixbuf_get_from_drawable.
11315 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
11316 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
11317 (xg_check_special_colors): Use GtkStyleContext and its functions
11318 for HAVE_GTK3.
11319 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
11320 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
11321 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
11322 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
11323 Call gtk_widget_get_preferred_size.
11324 (xg_frame_resized): gdk_window_get_geometry only takes 5
11325 parameters.
11326 (xg_win_to_widget, xg_event_is_for_menubar):
11327 Call gdk_x11_window_lookup_for_display.
11328 (xg_set_widget_bg): New function.
11329 (delete_cb): New function.
11330 (xg_create_frame_widgets): Connect delete-event to delete_cb.
11331 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
11332 (xg_set_background_color): Call xg_set_widget_bg.
11333 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
11334 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
11335 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
11336 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
11337 if ! HAVE_GTK3.
11338 (update_frame_tool_bar): Call gtk_widget_hide.
11339 (xg_initialize): Use GDK_KEY_g.
11340
11341 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
11342 if ! HAVE_GTK3
11343 (x_session_initialize): Call gdk_x11_set_sm_client_id.
11344
11345 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
11346 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
11347 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
11348
11349 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
11350
11351 * w32xfns.c (select_palette): Check success of RealizePalette against
11352 GDI_ERROR, not zero.
11353
11354 See ChangeLog.11 for earlier changes.
11355
11356 ;; Local Variables:
11357 ;; coding: utf-8
11358 ;; End:
11359
11360 Copyright (C) 2011-2012 Free Software Foundation, Inc.
11361
11362 This file is part of GNU Emacs.
11363
11364 GNU Emacs is free software: you can redistribute it and/or modify
11365 it under the terms of the GNU General Public License as published by
11366 the Free Software Foundation, either version 3 of the License, or
11367 (at your option) any later version.
11368
11369 GNU Emacs is distributed in the hope that it will be useful,
11370 but WITHOUT ANY WARRANTY; without even the implied warranty of
11371 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11372 GNU General Public License for more details.
11373
11374 You should have received a copy of the GNU General Public License
11375 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.