(rst-mode-map): Fix meaning of C-M-a / C-M-e.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
a2821611
AS
12012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2
3 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4 cons_block.
5
5fceba1d
PE
62012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7
8 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9
c98ff5dd
DA
102012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11
12 For a 'struct window', replace some Lisp_Object fields to
13 bitfields where appropriate, remove unused fields.
14 * window.h (struct window): Remove unused 'last_mark_x' and
15 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
16 change it's type from Lisp_Object to bitfield.
17 Change type of 'force_start', 'optional_new_start',
18 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
19 fields from Lisp_Object to bitfield. Adjust users accordingly.
20
ca34e0be
PE
212012-05-31 Paul Eggert <eggert@cs.ucla.edu>
22
23 Pacify gcc -Wdouble-precision when using Xaw.
24 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
25 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
26 Use 'float' consistently, rather than 'float' in most places
27 and 'double' in a couple of places.
28
efc00ab1 292012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
30
31 * xdisp.c (handle_stop): Detect whether we have overlay strings
32 loaded by testing it->current.overlay_string_index to be
33 non-negative, instead of checking whether n_overlay_strings is
34 positive. (Bug#11587)
35
efc00ab1 362012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
37
38 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
39
40 * doc.c (Fsubstitute_command_keys): Doc fix.
41
efc00ab1 422012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
43
44 * search.c (search_buffer): Remove calls to
45 r_alloc_inhibit_buffer_relocation, as it is now called by
46 maybe_unify_char, which was the cause of relocation of buffer text
47 in bug#11519.
48
efc00ab1 492012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
50
51 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
52 for the duration of call to load_charset, to avoid problems with
53 callers of maybe_unify_char that access buffer text through C
54 pointers.
55
56 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
57 decrement the inhibition flag, instead of just setting or
58 resetting it.
59
ba93a187
PE
602012-05-31 Paul Eggert <eggert@cs.ucla.edu>
61
62 Remove obsolete '#define static' cruft.
63 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
64 This #undef was "temporary" in 2000; it is no longer needed
65 now that '#define static' has gone away.
66 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
67 (gray_bitmap_bits): Remove; no longer needed.
68 All uses replaced with definiens.
69 * xterm.c: Include "bitmaps/gray.xbm".
70
9e4bf381
PE
712012-05-30 Paul Eggert <eggert@cs.ucla.edu>
72
73 Clean up __executable_start, monstartup when --enable-profiling.
74 The following changes affect the code only when profiling.
75 * dispnew.c (__executable_start): Rename from safe_bcopy.
76 Define only on platforms that need it.
77 * emacs.c: Include <sys/gmon.h> when profiling.
78 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
79 (__executable_start): Remove decl, since lisp.h does it now.
80 (safe_bcopy): Remove decl; no longer has that name.
81 (main): Coalesce #if into single bit of code, for simplicity.
82 Cast pointers to uintptr_t, since standard libraries want integers
83 and not pointers.
84 * lisp.h (__executable_start): New decl.
85
32d72c2f
GM
862012-05-31 Glenn Morris <rgm@gnu.org>
87
88 * image.c (Fimagemagick_types): Doc fix.
89
baac5bc7
JM
902012-05-30 Jim Meyering <meyering@redhat.com>
91
92 * callproc.c (Fcall_process_region): Include directory component
93 in mkstemp error message (Bug#11586).
94
72cb32cf
PE
952012-05-30 Paul Eggert <eggert@cs.ucla.edu>
96
97 * alloc.c, lisp.h (make_pure_vector): Now static.
98
61b108cc
SM
992012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
100
101 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
102 Move to byte-run.el.
103 (Fautoload): Do the hash-doc more carefully.
104 * data.c (Fdefalias): Purify definition, except for keymaps.
105 (Qdefun): Move from eval.c.
106 * lisp.h (Qdefun): Remove.
107 * lread.c (read1): Tiny simplification.
108
471fe23d
TN
1092012-05-29 Troels Nielsen <bn.troels@gmail.com>
110
934f3f58 111 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
112 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
113 Bug#9642, but explicitly check that the buffer the overlay would
114 be moved to is live and rearrange lines to make sure that errors
115 will not put the overlay in an inconsistent state.
116 (Fdelete_overlay): Cosmetics.
117
85d0efd1
EZ
1182012-05-28 Eli Zaretskii <eliz@gnu.org>
119
120 * w32term.c (my_bring_window_to_top): New function.
121 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
122 could be different from the original one.
123 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
124 (Bug#11513)
125
126 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
127 by calling BringWindowToTop.
128
129 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
130 (WM_EMACS_END): Increase by one.
131
da92a98c
PE
1322012-05-28 Paul Eggert <eggert@cs.ucla.edu>
133
134 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
135 This avoids undefined behavior that might cause the eassert
136 to not catch an out-of-range value.
137
74d1f848
JB
1382012-05-28 Juanma Barranquero <lekktu@gmail.com>
139
140 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
141 Update dependencies.
142
9e1a06fc
EZ
1432012-05-27 Eli Zaretskii <eliz@gnu.org>
144
145 * bidi.c (bidi_mirror_char): Fix last change.
146
f3dd7312
AS
1472012-05-27 Andreas Schwab <schwab@linux-m68k.org>
148
149 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
150 when referring to sectname field in printf format.
151
81899c91
PE
1522012-05-27 Paul Eggert <eggert@cs.ucla.edu>
153
57b81a9f
PE
154 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
155 Only r_alloc_inhibit_buffer_relocation needed to be added;
156 the others were already declared.
157
81899c91
PE
158 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
159 before checking whether it's out of range. Put the check inside
160 eassert. See
161 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
162
33017faf 1632012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
164
165 * callproc.c (Fcall_process): Restore a line that was accidentally
166 commented out in the 2011-02-13 change (bug#11547).
167
33017faf 1682012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
169
170 * lisp.h [REL_ALLOC]: Add prototypes for external functions
171 defined on ralloc.c.
172
173 * buffer.c [REL_ALLOC]: Remove prototypes of
174 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
175 they are now on lisp.h.
176
177 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
178
179 * search.c (search_buffer): Use it to inhibit relocation of buffer
180 text while re_search_2 is doing its job, because re_search_2 is
181 passed C pointers to buffer text. (Bug#11519)
182
23415acf
EZ
183 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
184 Update value to 24.
185
44e27368
EZ
186 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
187 state after an additional call to move_it_in_display_line_to, keep
188 the values of it->max_ascent and it->max_descent found for the
189 entire line.
190 (pos_visible_p): Revert the comparison against bottom_y to what it
191 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
192 (Bug#11464)
193
c1892f11
PE
1942012-05-26 Paul Eggert <eggert@cs.ucla.edu>
195
196 Fix coding-related core dumps with gcc -ftrapv.
197 The code was computing A - B, where A and B are pointers, and B is
198 random garbage. This can lead to core dumps on platforms that
199 have special pointer registers, and it also leads to core dumps on
200 x86-64 when compiled with gcc -ftrapv. The fix is to compute
201 A - B only when B is initialized properly.
202 * coding.c (coding_set_source, coding_set_destination): Return void.
203 (coding_change_source, coding_change_destinations): New functions,
204 with the old behaviors of coding_set_source and coding_set_destination.
205 All callers that need an offset changed to use these new functions.
206
eb7afdad
GM
2072012-05-26 Glenn Morris <rgm@gnu.org>
208
209 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
210
f12fdf02
EZ
2112012-05-26 Eli Zaretskii <eliz@gnu.org>
212
53a63be6 213 Extend mouse support on W32 text-mode console.
61b108cc
SM
214 * xdisp.c (draw_row_with_mouse_face):
215 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 216
eb3f6f01 217 * w32console.c: Include window.h.
61b108cc
SM
218 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
219 New functions.
eb3f6f01
EZ
220 (initialize_w32_display): Initialize mouse-highlight data.
221
53a63be6
EZ
222 * w32inevt.c: Include termchar.h and window.h.
223 (do_mouse_event): Support mouse-autoselect-window. When the mouse
224 moves, call note_mouse_highlight. If help_echo changed, call
225 gen_help_event to produce help-echo message in the echo area.
226 Call clear_mouse_face if mouse_face_hidden is set in the mouse
227 highlight info.
228
4cfd81f6
PE
2292012-05-26 Paul Eggert <eggert@cs.ucla.edu>
230
231 * lread.c (read1): Simplify slightly to avoid an overflow warning
232 with GCC 4.7.0 on x86-64.
233
4446092a
EZ
2342012-05-26 Eli Zaretskii <eliz@gnu.org>
235
236 * bidi.c (bidi_mirror_char): Revert last change: an int is
237 definitely wide enough here.
238
42b2a986 2392012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 240
42b2a986 241 Fix integer width and related bugs (Bug#9874).
eb106a49 242 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
243 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
244 (string_bytes, check_sblock, allocate_string_data):
245 (compact_small_strings, Fmake_bool_vector, make_string)
246 (make_unibyte_string, make_multibyte_string)
247 (make_string_from_bytes, make_specified_string)
248 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
249 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
250 (mark_vectorlike):
251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
252 (allocate_pseudovector):
253 Use int, not EMACS_INT, where int is wide enough.
254 (inhibit_garbage_collection, Fgarbage_collect):
255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
256 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
257 int might not be wide enough.
258 (bidi_cache_search, bidi_cache_find, bidi_init_it)
259 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
260 (bidi_at_paragraph_end, bidi_find_paragraph_start)
261 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
262 (bidi_level_of_next_char, bidi_move_to_visually_next):
263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
264 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
265 (Fkill_buffer, Fset_buffer_major_mode)
266 (advance_to_char_boundary, Fbuffer_swap_text)
267 (Fset_buffer_multibyte, overlays_at, overlays_in)
268 (overlay_touches_p, struct sortvec, record_overlay_string)
269 (overlay_strings, recenter_overlay_lists)
270 (adjust_overlays_for_insert, adjust_overlays_for_delete)
271 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
272 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
273 (Foverlay_recenter, last_overlay_modification_hooks_used)
274 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
276 (validate_region): Omit unnecessary test for b <= e,
277 since that's guaranteed by the previous test.
d311d28c
PE
278 (adjust_overlays_for_delete): Avoid pos + length overflow.
279 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
280 (report_overlay_modification):
281 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
282 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
283 Omit pointer cast, which isn't needed anyway, and doesn't work
284 after the EMACS_INT -> ptrdiff_t change.
02481186 285 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
286 * buffer.h: Adjust decls to match defn changes elsewhere.
287 (struct buffer_text, struct buffer):
288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
289 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
290 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
291 not int, to avoid needless 32-bit limit on 64-bit hosts.
292 (exec_byte_code): Use tighter memory-full test, one that checks
293 for alloca overflow. Don't compute the address of the object just
294 before an array, as that's not portable. Use EMACS_INT, not
295 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
296 * callint.c (Fcall_interactively):
297 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
298 * callproc.c (call_process_kill, Fcall_process):
299 Don't assume pid_t fits into an Emacs fixnum.
300 (call_process_cleanup, Fcall_process, child_setup):
301 Don't assume pid_t fits into int.
302 (call_process_cleanup, Fcall_process, delete_temp_file)
303 (Fcall_process_region):
304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
305 (Fcall_process): Simplify handling of volatile integers.
306 Use int, not EMACS_INT, where int will do.
307 * casefiddle.c (casify_object, casify_region, operate_on_word)
308 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
309 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
310 (casify_object): Avoid integer overflow when overallocating buffer.
311 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 312 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
313 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
314 * category.h (CATEGORYP): Don't assume arg is nonnegative.
315 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
316 integers are now checked earlier. All uses replaced with XINT.
317 (ccl_driver):
318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
319 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
320 (ccl_driver, Fregister_code_conversion_map):
321 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
322 (resolve_symbol_ccl_program): Check that vector header is in range.
323 Always copy the vector, so that we can check its contents reliably
324 now rather than having to recheck each instruction as it's being
325 executed. Check that vector words fit in 'int'.
326 (ccl_get_compiled_code, Fregister_ccl_program)
327 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
328 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
329 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
330 contents are in range.
331 (Fccl_execute_on_string): Check that status is in range.
332 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
333 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
334 Accept and return EMACS_INT, not int, because callers can pass values
335 out of 'int' range.
336 (c_string_width, strwidth, lisp_string_width, chars_in_text)
337 (multibyte_chars_in_text, parse_str_as_multibyte)
338 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
339 (str_as_unibyte, str_to_unibyte, string_count_byte8)
340 (string_escape_byte8, Fget_byte):
341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 342 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
343 avoid mishandling large integers.
344 * character.h: Adjust decls to match defn changes elsewhere.
345 * charset.c (load_charset_map_from_file, find_charsets_in_text)
346 (Ffind_charset_region):
347 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
348 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
349 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 350 Don't assume fixnum fits in int.
d311d28c
PE
351 (load_charset_map_from_vector, Fmap_charset_chars):
352 Remove now-unnecessary CHECK_NATNUMs.
353 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
354 Don't rely on undefined behavior with signed left shift overflow.
355 Don't assume unsigned int fits into fixnum, or that fixnum fits
356 into unsigned int. Don't require max_code to be a valid fixnum;
357 that's not true for gb10830 4-byte on a 32-bit host. Allow
358 invalid_code to be a cons, for the same reason. Require code_offset
359 to be a character. Avoid int overflow if max_char is close
360 to INT_MAX.
361 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
362 this is intended anyway and avoids some undefined behavior.
363 (load_charset_map): Pass unsigned, not int, as 2nd arg of
364 INDEX_TO_CODE_POINT, as that's what it expects.
365 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
366 * charset.h (DECODE_CHAR): Return int, not unsigned;
367 this is what was intended anyway, and it avoids undefined behavior.
368 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
369 integer-overflow issues.
370 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
371 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
372 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
373 * chartab.c (Fmake_char_table, Fset_char_table_range)
374 (uniprop_get_decoder, uniprop_get_encoder):
375 Don't assume fixnum fits in int.
376 * cmds.c (move_point): New function, that does the gist of
377 Fforward_char and Fbackward_char, but does so while checking
378 for integer overflow more accurately.
c96e5d6a 379 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
380 (Fforward_line, Fend_of_line, internal_self_insert)
381 (internal_self_insert):
382 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
383 Fix a FIXME, by checking for integer overflow when calculating
384 target_clm and actual_clm.
385 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 386 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
387 (ASSURE_DESTINATION, coding_alloc_by_realloc)
388 (coding_alloc_by_making_gap, alloc_destination)
389 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
390 (encode_coding_utf_16, detect_coding_emacs_mule)
391 (decode_coding_emacs_mule, encode_coding_emacs_mule)
392 (detect_coding_iso_2022, decode_coding_iso_2022)
393 (encode_invocation_designation, encode_designation_at_bol)
394 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
395 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
396 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
397 (encode_coding_ccl, encode_coding_raw_text)
398 (detect_coding_charset, decode_coding_charset)
399 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
400 (produce_composition, produce_charset, produce_annotation)
401 (decode_coding, handle_composition_annotation)
402 (handle_charset_annotation, consume_chars, decode_coding_gap)
403 (decode_coding_object, encode_coding_object, detect_coding_system)
404 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
405 (code_convert_region, code_convert_string)
8f50130c
PE
406 (Fdefine_coding_system_internal)
407 (coding_set_source, coding_set_destination):
d311d28c
PE
408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
409 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
410 (Fdefine_coding_system_internal):
411 Don't assume fixnums fit in int.
412 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 413 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
414 (Funencodable_char_position, Fcheck_coding_systems_region)
415 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 417 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 418 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 419 Don't access memory outside of the args array.
d311d28c 420 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
421 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
422 result of ENCODE_CHAR.
d311d28c
PE
423 * coding.h: Adjust decls to match defn changes elsewhere.
424 (struct coding_system):
425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
426 * composite.c (get_composition_id, find_composition)
427 (run_composition_function, update_compositions)
428 (compose_text, composition_gstring_put_cache)
429 (composition_gstring_p, composition_gstring_width)
430 (fill_gstring_header, fill_gstring_body, autocmp_chars)
431 (composition_compute_stop_pos, composition_reseat_it)
432 (composition_update_it, struct position_record)
433 (find_automatic_composition, composition_adjust_point)
434 (Fcomposition_get_gstring, Ffind_composition_internal):
435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
436 (update_compositions):
437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
438 * composite.h: Adjust decls to match defn changes elsewhere.
439 (struct composition):
440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
441 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
442 Do not attempt to compute the address of the object just before a
443 buffer; this is not portable.
444 (Faref, Faset):
445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
446 (Faset): Use int, not EMACS_INT, where int is wide enough.
447 (Fstring_to_number): Don't assume fixnums fit in int.
448 (Frem): Don't assume arg is nonnegative.
449 * dbusbind.c (xd_append_arg): Check for integers out of range.
450 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 451 (extract_signed, extract_unsigned): New functions.
243e0530
PE
452 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
453 (xd_get_connection_references): Return ptrdiff_t, not int.
454 All uses changed.
455 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
456 (xd_read_message_1):
457 Use int, not unsigned, where the dbus API uses int.
458 (Fdbus_message_internal): Don't overflow mtype.
459 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
460 * dired.c (directory_files_internal, file_name_completion, scmp)
461 (file_name_completion_stat):
462 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
463 (file_name_completion): Don't overflow matchcount.
464 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
465 * dispextern.h: Adjust decls to match defn changes elsewhere.
466 (struct text_pos, struct glyph, struct bidi_saved_info)
467 (struct bidi_string_data, struct bidi_it, struct composition_it)
468 (struct it):
469 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
470 (struct display_pos, struct composition_it, struct it):
471 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
472 * dispnew.c (increment_matrix_positions)
473 (increment_row_positions, mode_line_string)
474 (marginal_area_string):
475 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 476 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
478 (duration_to_sec_usec): New function, to check for overflow better.
479 (Fsleep_for, sit_for): Use it.
480 * doc.c (get_doc_string, store_function_docstring):
481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
482 (get_doc_string, Fsnarf_documentation):
483 Use int, not EMACS_INT, where int is wide enough.
484 (get_doc_string):
485 Use SAFE_ALLOCA, not alloca.
486 Check for overflow when converting EMACS_INT to off_t.
487 * doprnt.c (doprnt):
488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
489 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
490 Don't assume uid_t fits into fixnum.
491 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
492 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
493 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
494 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
495 (general_insert_function)
496 (Finsert_char, make_buffer_string, make_buffer_string_both)
497 (update_buffer_properties, Fbuffer_substring)
498 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
499 (Fsubst_char_in_region, check_translation)
500 (Ftranslate_region_internal, save_restriction_restore, Fformat)
501 (transpose_markers, Ftranspose_regions):
502 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
503 (clip_to_bounds): Move to lisp.h as an inline function).
504 (Fconstrain_to_field): Don't assume integers are nonnegative.
505 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
506 (Fsubst_char_in_region, Fsave_restriction):
507 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
508 (Femacs_pid): Don't assume pid_t fits into fixnum.
509 (lo_time): Use int, not EMACS_INT, when int suffices.
510 (lisp_time_argument): Check for usec out of range.
511 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
512 (Fuser_login_name, Fuser_full_name): Signal an error
513 if a uid argument is out of range, rather than relying on
514 undefined behavior.
c8d5c857
PE
515 (Fformat_time_string): Remove now-unnecessary check.
516 lisp_time_argument checks for out-of-range usec now.
243e0530 517 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
518 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
519 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
520 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
521 (init_cmdargs, Fdump_emacs):
522 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
523 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
524 the bottom (typically) 32 bits of the fixnum.
525 * eval.c (specpdl_size, call_debugger):
526 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
527 (when_entered_debugger, Fbacktrace_debug):
528 Don't assume fixnum can fit in int.
529 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
530 the object just before a buffer; this is not portable.
531 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
532 (grow_specpdl, unbind_to):
533 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
534 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
535 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 536 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
537 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
538 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
540 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
541 (a_write, e_write):
542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
543 (Fcopy_file, non_regular_nbytes, read_non_regular)
544 (Finsert_file_contents):
545 Use int, not EMACS_INT, where int is wide enough.
546 (READ_BUF_SIZE): Verify that it fits in int.
547 (Finsert_file_contents): Check that counts are in proper range,
548 rather than assuming fixnums fit into ptrdiff_t etc.
549 Don't assume fixnums fit into int.
125b3835 550 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
551 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
552 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
553 (string_char_to_byte, string_byte_to_char)
554 (string_make_multibyte, string_to_multibyte)
555 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
556 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
557 (substring_both, Fdelete, internal_equal, Ffillarray)
558 (Fclear_string, mapcar1)
559 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
560 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
561 (larger_vector, make_hash_table, maybe_resize_hash_table)
562 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
563 (Fmaphash, secure_hash):
564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
565 (concat): Check for string index and length overflow.
566 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
567 (Frequire):
568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
569 (larger_vector): New API (vec, incr_min, size_max) replaces old
570 one (vec, new_size, init). This catches size overflow.
571 INIT was removed because it was always Qnil.
572 All callers changed.
573 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
574 the upper bound on a hash table index size.
575 (make_hash_table, maybe_resize_hash_table): Use it.
576 (secure_hash): Computer start_byte and end_byte only after
577 they're known to be in ptrdiff_t range.
578 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
579 (Ffont_get_glyphs, Ffont_at):
580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
581 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
582 (Flist_fonts, Fopen_font):
583 Don't assume fixnum can fit in int.
584 (check_gstring): Don't assume index can fit in int.
585 (font_match_p): Check that fixnum is a character, not a nonnegative
586 fixnum, since the later code needs to stuff it into an int.
587 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
588 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
589 conversion overflow issues.
590 (Fopen_font): Check for integer out of range.
591 (Ffont_get_glyphs): Don't assume index can fit in int.
592 * font.h: Adjust decls to match defn changes elsewhere.
593 * fontset.c (reorder_font_vector): Redo score calculation to avoid
594 integer overflow.
595 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
596 printmax_t, where ptrdiff_t is wide enough.
597 (Finternal_char_font):
598 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
599 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
600 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
601 (Fset_frame_position, x_set_frame_parameters)
602 (x_set_line_spacing, x_set_border_width)
603 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
604 Check that fixnums are in proper range for system types.
605 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
607 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
608 Use SAFE_ALLOCA_LISP, not alloca.
609 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
610 intptr_t is wide enough.
611 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
612 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
613 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
614 Check for fixnum out of range.
615 * ftfont.c (ftfont_list): Don't assume index fits in int.
616 Check that fixnums are in proper range for system types.
617 (ftfont_shape_by_flt):
618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
619 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
620 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
621 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
622 Check that fixnums are in proper range for system types.
623 * gnutls.h: Adjust decls to match defn changes elsewhere.
624 * gtkutil.c (xg_dialog_run):
625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
626 (update_frame_tool_bar):
627 Check that fixnums are in proper range for system types.
628 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 629 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
630 * indent.c (last_known_column, last_known_column_point):
631 (current_column_bol_cache):
632 (skip_invisible, current_column, check_display_width):
633 (check_display_width, scan_for_column, current_column_1)
634 (Findent_to, Fcurrent_indentation, position_indentation)
635 (indented_beyond_p, Fmove_to_column, compute_motion):
636 (Fcompute_motion, Fvertical_motion):
637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
638 (last_known_column_modified): Use EMACS_INT, not int.
639 (check_display_width):
640 (Fcompute_motion):
641 Check that fixnums and floats are in proper range for system types.
642 (compute_motion): Don't assume index or fixnum fits in int.
643 (compute_motion, Fcompute_motion):
644 Use int, not EMACS_INT, when it is wide enough.
645 (vmotion): Omit local var start_hpos that is always 0; that way
646 we don't need to worry about overflow in expressions involving it.
647 * indent.h: Adjust decls to match defn changes elsewhere.
648 (struct position):
649 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
650 Use int, not EMACS_INT, where int is wide enough.
651 Remove unused members ovstring_chars_done and tab_offset;
652 all uses removed.
653 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
654 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
655 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
656 (make_gap, copy_text, insert, insert_and_inherit)
657 (insert_before_markers, insert_before_markers_and_inherit)
658 (insert_1, count_combining_before, count_combining_after)
659 (insert_1_both, insert_from_string)
660 (insert_from_string_before_markers, insert_from_string_1)
661 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
662 (adjust_after_replace, adjust_after_insert, replace_range)
663 (replace_range_2, del_range, del_range_1, del_range_byte)
664 (del_range_both, del_range_2, modify_region)
665 (prepare_to_modify_buffer, signal_before_change)
666 (signal_after_change, Fcombine_after_change_execute):
667 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
668 * intervals.c (traverse_intervals, rotate_right, rotate_left)
669 (balance_an_interval, split_interval_right, split_interval_left)
670 (find_interval, next_interval, update_interval)
671 (adjust_intervals_for_insertion, delete_node, delete_interval)
672 (interval_deletion_adjustment, adjust_intervals_for_deletion)
673 (static_offset_intervals, offset_intervals)
674 (merge_interval_right, merge_interval_left, make_new_interval)
675 (graft_intervals_into_buffer, temp_set_point_both)
676 (temp_set_point, set_point, adjust_for_invis_intang)
677 (set_point_both, move_if_not_intangible, get_property_and_range)
678 (get_local_map, copy_intervals, copy_intervals_to_string)
679 (compare_string_intervals, set_intervals_multibyte_1):
680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
681 * intervals.h: Adjust decls to match defn changes elsewhere.
682 (struct interval):
683 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
684 * keyboard.c (this_command_key_count, this_single_command_key_start)
685 (before_command_key_count, before_command_echo_length, echo_now)
686 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
687 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
688 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
689 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
691 (last_non_minibuf_size, last_point_position, echo_truncate)
692 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
693 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
694 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
695 (stuff_buffered_input):
696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
697 (last_auto_save, command_loop_1, read_char):
698 Use EMACS_INT, not int, to avoid integer overflow.
699 (record_char): Avoid overflow in total_keys computation.
700 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
701 * keyboard.h: Adjust decls to match defn changes elsewhere.
702 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
703 (Fkey_description, Fdescribe_vector, Flookup_key):
704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
705 (click_position): New function, to check that positions are in range.
706 (Fcurrent_active_maps):
707 (describe_command):
708 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
709 (Faccessible_keymaps, Fkey_description):
710 (preferred_sequence_p):
711 Don't assume fixnum can fit into int.
712 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
713 Check for integer overflow in size calculations.
714 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
715 avoid mishandling large integers.
716 * lisp.h: Adjust decls to match defn changes elsewhere.
717 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
718 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
719 (struct Lisp_Marker):
720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
721 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
722 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
723 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
724 All callers changed.
725 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
726 Assume the arg has valid form, since it always does.
727 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
728 unsigned integer system type.
729 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
730 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
732 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
733 (duration_to_sec_usec): New decl.
734 * lread.c (read_from_string_index, read_from_string_index_byte)
735 (read_from_string_limit, readchar, unreadchar, openp)
736 (read_internal_start, read1, oblookup):
737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
738 (Fload, readevalloop, Feval_buffer, Feval_region):
739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
740 (openp): Check for out-of-range argument to 'access'.
741 (read1): Use int, not EMACS_INT, where int is wide enough.
742 Don't assume fixnum fits into int.
6efdadfd 743 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
744 (read_filtered_event): Use duration_to_sec_usec
745 to do proper overflow checking on durations.
d311d28c
PE
746 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
747 in size calculation.
748 (Fexecute_kbd_macro):
749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
750 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
751 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
752 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
753 (set_marker_both, set_marker_restricted_both, marker_position)
754 (marker_byte_position, Fbuffer_has_markers_at):
755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
756 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 757 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
758 It now merely ensures that the menu is large enough, without
759 necessarily growing it, as this avoids some integer overflow issues.
760 All callers changed.
761 (keymap_panes, parse_single_submenu, Fx_popup_menu):
762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
763 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
764 Use SAFE_ALLOCA_LISP, not alloca.
765 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
766 to EMACS_INT. Check that fixnums are in proper range for system types.
767 * minibuf.c (minibuf_prompt_width, string_to_object)
768 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
769 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
771 (get_minibuffer, read_minibuf_unwind):
772 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
773 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
774 this simplifies overflow checking. All callers changed.
775 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
776 (Ftest_completion):
777 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
778 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
779 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
780 Check that fixnums are in proper range for system types.
781 (Fx_create_frame, Fx_show_tip):
782 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
783 * nsfont.m (ns_findfonts, nsfont_list_family):
784 Don't assume fixnum fits in long.
785 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
787 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
788 wide enough.
17fdb222 789 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
791 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
792 (PRINTDECLARE, PRINTPREPARE):
793 (strout, print_string):
794 (print, print_preprocess, print_check_string_charset_prop)
795 (print_object):
796 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
797 (PRINTDECLARE):
798 (temp_output_buffer_setup, Fprin1_to_string, print_object):
799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
800 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 801 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 802 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
803 (print_error_message): Use SAFE_ALLOCA, not alloca.
804 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
805 (print_depth, new_backquote_output, print_number_index):
806 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
807 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
808 (Fset_process_window_size, Fformat_network_address)
809 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 810 (sigchld_handler):
d311d28c 811 Check that fixnums are in proper range for system types.
d44287d4 812 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
813 Check for process-ids out of pid_t range rather than relying on
814 undefined behavior.
e4d81efc 815 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
816 (Fformat_network_address, read_process_output, send_process)
817 (Fprocess_send_region, status_notify):
818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
819 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
820 (wait_reading_process_output, read_process_output, exec_sentinel):
821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
822 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
823 (Faccept_process_output): Use duration_to_sec_usec to do proper
824 overflow checking on durations.
dde14581
PE
825 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
826 Don't assume pid_t fits in int.
02481186
PE
827 * process.h (struct Lisp_Process): Members tick and update_tick
828 are now of type EMACS_INT, not int.
b62b53e8
PE
829 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
830 configured --with-wide-int.
d311d28c
PE
831 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
832 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
833 * search.c (looking_at_1, string_match_1):
834 (fast_string_match, fast_c_string_match_ignore_case)
835 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
836 (scan_newline, find_before_next_newline, search_command)
837 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
838 (set_search_regs, wordify):
839 (Freplace_match):
840 (Fmatch_data):
841 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
842 (string_match_1, search_buffer, set_search_regs):
843 (Fmatch_data):
844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
845 (wordify): Check for overflow in size calculation.
846 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
847 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
848 Check that fixnums are in proper range for system types.
849 * sound.c (struct sound_device)
850 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
852 (Fplay_sound_internal):
853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 854 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
855 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
856 (Fparse_partial_sexp):
857 Don't assume fixnums can fit in int.
858 (struct lisp_parse_state, find_start_pos, find_start_value)
859 (find_start_value_byte, find_start_begv)
860 (update_syntax_table, char_quoted, dec_bytepos)
861 (find_defun_start, prev_char_comend_first, back_comment):
862 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
863 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
865 (Finternal_describe_syntax_value): Check that match_lisp is a
866 character, not an integer, since the code stuffs it into int.
867 (scan_words, scan_sexps_forward):
868 Check that fixnums are in proper range for system types.
869 (Fforward_word):
870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
871 (scan_sexps_forward):
872 Use CHARACTERP, not INTEGERP, since the value must fit into int.
873 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
874 * syntax.h: Adjust decls to match defn changes elsewhere.
875 (struct gl_state_s):
876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
877 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
878 MOST_POSITIVE_FIXNUM.
d311d28c
PE
879 * sysdep.c (wait_for_termination_1, wait_for_termination)
880 (interruptible_wait_for_termination, mkdir):
881 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
882 (emacs_read, emacs_write):
883 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
884 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
885 and double all fit in int.
d311d28c
PE
886 * term.c (set_tty_color_mode):
887 Check that fixnums are in proper range for system types.
888 * termhooks.h (struct input_event):
889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
890 * textprop.c (validate_interval_range, interval_of)
891 (Fadd_text_properties, set_text_properties_1)
892 (Fremove_text_properties, Fremove_list_of_text_properties)
893 (Ftext_property_any, Ftext_property_not_all)
894 (copy_text_properties, text_property_list, extend_property_ranges)
895 (verify_interval_modification):
896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
897 (Fnext_single_char_property_change)
898 (Fprevious_single_char_property_change):
899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
900 (copy_text_properties):
901 Check for integer overflow in index calculation.
d311d28c
PE
902 * undo.c (last_boundary_position, record_point, record_insert)
903 (record_delete, record_marker_adjustment, record_change)
904 (record_property_change):
905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
906 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
908 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
909 (Fx_hide_tip, Fx_file_dialog):
910 * w32menu.c (set_frame_menubar):
911 Use ptrdiff_t, not int, for consistency with rest of code.
912 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
913 (select_window, Fdelete_other_windows_internal)
914 (window_scroll_pixel_based, window_scroll_line_based)
915 (Frecenter, Fset_window_configuration):
916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
917 (Fset_window_hscroll, run_window_configuration_change_hook)
918 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 919 (Fscroll_other_window, Frecenter):
d311d28c
PE
920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
921 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
922 Don't assume fixnum fits in int.
923 (Fset_window_scroll_bars):
924 Check that fixnums are in proper range for system types.
925 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
926 (string_pos, c_string_pos, number_of_chars, init_iterator)
927 (in_ellipses_for_invisible_text_p, init_from_display_pos)
928 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
929 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
930 (face_before_or_after_it_pos, handle_invisible_prop)
931 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
932 (display_prop_intangible_p, string_buffer_position_lim)
933 (string_buffer_position, handle_composition_prop, load_overlay_strings)
934 (get_overlay_strings_1, get_overlay_strings)
935 (iterate_out_of_display_property, forward_to_next_line_start)
936 (back_to_previous_visible_line_start, reseat, reseat_to_string)
937 (get_next_display_element, set_iterator_to_next)
938 (get_visually_first_element, compute_stop_pos_backwards)
939 (handle_stop_backwards, next_element_from_buffer)
940 (move_it_in_display_line_to, move_it_in_display_line)
941 (move_it_to, move_it_vertically_backward, move_it_by_lines)
942 (add_to_log, message_dolog, message_log_check_duplicate)
943 (message2, message2_nolog, message3, message3_nolog
944 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
945 (current_message_1, truncate_echo_area, truncate_message_1)
946 (set_message, set_message_1, store_mode_line_noprop)
947 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
948 (text_outside_line_unchanged_p, check_point_in_composition)
949 (reconsider_clip_changes)
950 (redisplay_internal, set_cursor_from_row, try_scrolling)
951 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
952 (redisplay_window, find_last_unchanged_at_beg_row)
953 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
954 (trailing_whitespace_p, find_row_edges, display_line)
955 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
956 (display_mode_element, store_mode_line_string)
957 (pint2str, pint2hrstr, decode_mode_spec)
958 (display_count_lines, display_string, draw_glyphs)
959 (x_produce_glyphs, x_insert_glyphs)
960 (rows_from_pos_range, mouse_face_from_buffer_pos)
961 (fast_find_string_pos, mouse_face_from_string_pos)
962 (note_mode_line_or_margin_highlight, note_mouse_highlight):
963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
964 (safe_call, init_from_display_pos, handle_fontified_prop)
965 (handle_single_display_spec, load_overlay_strings)
966 (with_echo_area_buffer, setup_echo_area_for_printing)
967 (display_echo_area, echo_area_display)
968 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
969 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
970 (redisplay_window, dump_glyph_row, display_mode_line)
971 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 972 (handle_display_spec, display_prop_string_p):
d311d28c
PE
973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
974 (handle_single_display_spec, build_desired_tool_bar_string)
975 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
976 (get_specified_cursor_type):
977 Check that fixnums are in proper range for system types.
978 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
979 (Flookup_image_map):
980 Don't assume fixnums fit in int.
981 (compare_overlay_entries):
982 Avoid mishandling comparisons due to subtraction overflow.
983 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
984 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
985 (handle_tool_bar_click):
986 Use int, not unsigned, since we prefer signed and the signedness
987 doesn't matter here.
988 (get_next_display_element, next_element_from_display_vector):
989 Use int, not EMACS_INT, when int is wide enough.
990 (start_hourglass): Use duration_to_sec_usec to do proper
991 overflow checking on durations.
992 * xfaces.c (Fbitmap_spec_p):
993 Check that fixnums are in proper range for system types.
994 (compare_fonts_by_sort_order):
995 Avoid mishandling comparisons due to subtraction overflow.
996 (Fx_family_fonts, realize_basic_faces):
997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
998 (Fx_family_fonts):
999 Don't assume fixnum fits in int.
1000 Use SAFE_ALLOCA_LISP, not alloca.
1001 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
1002 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
1003 (face_at_buffer_position, face_for_overlay_string)
1004 (face_at_string_position):
1005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1006 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
1007 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
1008 (Fx_show_tip):
1009 Check that fixnums are in proper range for system types.
1010 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1011 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
1012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1013 (Fx_change_window_property): Don't assume fixnums fit in int.
1014 * xfont.c (xfont_chars_supported):
1015 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1016 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
1017 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
1018 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1019 * xml.c (parse_region):
1020 * xrdb.c (magic_file_p):
1021 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1022 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
1023 (x_get_local_selection, x_reply_selection_request)
1024 (x_handle_selection_request, wait_for_property_change):
1025 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1026 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
1027 short is wide enough.
1028 (x_send_client_event): Don't assume fixnum fits in int.
1029 * xterm.c (x_x_to_emacs_modifiers):
1030 Don't assume EMACS_INT overflows nicely into int.
1031 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
1032 may come from Lisp.
1033 (handle_one_xevent): NATNUMP can eval its arg twice.
1034 (x_connection_closed):
1035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1036 * xterm.h: Adjust decls to match defn changes elsewhere.
1037 (struct scroll_bar): Use struct vectorlike_header
1038 rather than rolling our own approximation.
1039 (SCROLL_BAR_VEC_SIZE): Remove; not used.
1040
c6574eb5
GM
10412012-05-25 Glenn Morris <rgm@gnu.org>
1042
1043 * lisp.mk (lisp): Update for more files being compiled now.
1044
e8d32c7e
SM
10452012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
1046
48def666
SM
1047 * lread.c: Remove `read_pure' which makes no difference.
1048 (read_pure): Remove var.
1049 (unreadpure): Remove function.
1050 (readevalloop): Don't call read_list with -1 flag.
1051 (read1, read_vector): Don't test read_pure any more.
1052 (read_list): Simplify.
1053
e8d32c7e
SM
1054 * fileio.c, character.h: Minor style tweaks.
1055
4b2addb7
DA
10562012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
1057
1058 * window.h (clip_changed): Remove useless declaration.
1059
584461b2
JB
10602012-05-22 Juanma Barranquero <lekktu@gmail.com>
1061
1062 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
1063 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
1064
34374650
PE
10652012-05-22 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 Remove src/m/*.
1068 This directory predates autoconf and is no longer needed nowadays.
1069 Move its few remaining bits of functionality to where they're needed.
1070 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
1071 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
1072 * m/template.h: Remove.
1073 * Makefile.in (M_FILE): Remove. All uses removed.
1074 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
1075 * lisp.h (USE_LSB_TAG):
1076 * mem-limits.h (EXCEEDS_LISP_PTR):
1077 Use VAL_MAX, not VALBITS, in #if.
1078 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
1079 (EMACS_UINT): Define unconditionally now.
1080 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
1081 (BITS_PER_EMACS_INT): New constants, replacing
1082 what used to be in config.h, but not useful in #if.
1083 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
1084 define them any more.
1085 (VAL_MAX): New macro.
1086 (VALMASK): Use it.
1087 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
1088 BITS_PER_EMACS_INT, in #if.
1089 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1090 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
1091 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
1092 * s/ms-w32.h (DATA_START):
1093 Move here from removed file m/intel386.h.
1094 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
1095 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
1096
261cb4bb
PE
10972012-05-21 Paul Eggert <eggert@cs.ucla.edu>
1098
1099 Assume C89 or later.
1100 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
1101 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
1102 (xrealloc):
1103 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
1104 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
1105 * textprop.c, tparam.c (NULL): Remove.
1106 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
1107 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
1108 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
1109 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
1110 * xterm.c (input_signal_count): Assume volatile works.
1111
ff23cd9f
KB
11122012-05-21 Ken Brown <kbrown@cornell.edu>
1113
1114 * xgselect.c (xg_select): Fix first argument in call to 'select'
1115 (bug#11508).
1116
1b170bc6
KB
11172012-05-20 Ken Brown <kbrown@cornell.edu>
1118
1119 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 1120 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 1121
b2f4d39f
KB
11222012-05-19 Ken Brown <kbrown@cornell.edu>
1123
1124 * xfns.c (x_in_use): Remove `static' qualifier.
1125 * xterm.h (x_in_use): Declare.
1126 * xgselect.c: Include xterm.h.
1127 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
1128 and `display_arg' (bug#9754).
1129
003fdae2
PE
11302012-05-19 Paul Eggert <eggert@cs.ucla.edu>
1131
9232a6d9
PE
1132 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
1133
003fdae2
PE
1134 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
1135 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
1136
784b56e2
EZ
11372012-05-18 Eli Zaretskii <eliz@gnu.org>
1138
1139 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
1140
1141 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
1142 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
1143
1144 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
1145 reference to image_cache->refcount.
1146 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
1147
a0a79cde
JL
11482012-05-17 Juri Linkov <juri@jurta.org>
1149
1150 * search.c (Fword_search_regexp, Fword_search_backward)
1151 (Fword_search_forward, Fword_search_backward_lax)
1152 (Fword_search_forward_lax): Move functions to isearch.el
1153 (bug#10145, bug#11381).
1154
b0572523
PE
11552012-05-16 Paul Eggert <eggert@cs.ucla.edu>
1156
1157 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
1158
9660f5fc
SM
11592012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
1160
1161 * lread.c (init_obarray): Declare Qt and Qnil as special.
1162
4374de83
GM
11632012-05-14 Glenn Morris <rgm@gnu.org>
1164
1165 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 1166 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 1167
dc44c39a
PE
11682012-05-14 Paul Eggert <eggert@cs.ucla.edu>
1169
078c97cb
PE
1170 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
1171
dc44c39a
PE
1172 * unexaix.c: Port to more-recent AIX compilers.
1173 (report_error, report_error_1, make_hdr, copy_sym)
1174 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
1175 Make arguments const char *, not char *, to avoid violations of C
1176 standard and to fix some AIX warnings reported by Gilles Pion.
1177
e18afed7 11782012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
1179
1180 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
1181 already have overlays loaded.
1182 (handle_single_display_spec): Before returning without displaying
1183 fringe bitmap, synchronize the bidi iterator with the main display
1184 iterator, by calling iterate_out_of_display_property.
1185 (iterate_out_of_display_property): Detect buffer iteration by
1186 testing that it->string is a Lisp string.
1187 (get_next_display_element): When the current object is exhausted,
1188 and there's something on it->stack, call set_iterator_to_next to
1189 proceed with what's on the stack, instead of returning zero.
1190 (set_iterator_to_next): If called at the end of a Lisp string,
1191 proceed to consider_string_end without incrementing string
1192 position. Don't increment display vector index past the end of
1193 the display vector. (Bug#11417)
c8fb9dc6
EZ
1194 (pos_visible_p): Don't report a position visible when move_it_to
1195 stopped at the last line of window, which happens to be scanned
1196 backwards by the bidi iteration. (Bug#11464)
ac268e67 1197
e18afed7 11982012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
1199
1200 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
1201 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
1202 are on a TTY, and thus unable to display on the fringes.
1203 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
1204 so we need to signal to the caller that this is a "replacing"
1205 display spec. This fixes display when the spec is invalid or we
1206 are on a TTY.
1207
e18afed7 12082012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
1209
1210 * unexaix.c (make_hdr): Fix typo in prototype.
1211 This bug broke the build on AIX. Problem reported by Gilles Pion.
1212
9d0a235a
MA
12132012-05-14 Michael Albinus <michael.albinus@gmx.de>
1214
1215 * keyboard.c (kbd_buffer_get_event): Read special events also in
1216 batch mode. (Bug#11415)
1217
9e6b06ed
GM
12182012-05-12 Glenn Morris <rgm@gnu.org>
1219
1220 * ns.mk: Update for ns_appbindir no longer having trailing "/".
1221
c1a1d7a3
EZ
12222012-05-12 Eli Zaretskii <eliz@gnu.org>
1223
1224 * lisp.mk (lisp): Add newcomment.elc.
1225
3fe7cdc8
GM
12262012-05-12 Glenn Morris <rgm@gnu.org>
1227
1228 * Makefile.in (MKDIR_P): New, set by configure.
1229 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
1230
53f7d2c0
PE
12312012-05-11 Paul Eggert <eggert@cs.ucla.edu>
1232
1233 Remove unused function hourglass_started.
1234 * dispextern.h (hourglass_started):
1235 * w32fns.c (hourglass_started):
1236 * xdisp.c (hourglass_started): Remove.
1237
75aafb17
JB
12382012-05-10 Juanma Barranquero <lekktu@gmail.com>
1239
1240 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
1241 Update dependencies.
1242
12959e8e
PE
12432012-05-10 Paul Eggert <eggert@cs.ucla.edu>
1244
97107e2e
PE
1245 * xgselect.c (xg_select): Put maxfds+1 into a var.
1246 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
1247
12959e8e
PE
1248 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
1249
836d29b3
DA
12502012-05-10 Dave Abrahams <dave@boostpro.com>
1251
1252 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
1253 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
1254
5cb67954
MA
12552012-05-09 Michael Albinus <michael.albinus@gmx.de>
1256
1257 * dbusbind.c (xd_registered_buses): New internal Lisp object.
1258 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
1259 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
1260 Initialize xd_registered_buses.
1261
3478ec45
PE
12622012-05-09 Paul Eggert <eggert@cs.ucla.edu>
1263
b263a6b0
PE
1264 Untag more efficiently if USE_LSB_TAG.
1265 This is based on a proposal by YAMAMOTO Mitsuharu in
1266 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
1267 For an admittedly artificial (nth 8000 longlist) benchmark on
1268 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
1269 Emacs's overall text size by 1%.
1270 * lisp.h (XUNTAG): New macro.
1271 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
1272 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
1273 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
1274 * eval.c (Fautoload):
1275 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
1276 * frame.h (XFRAME): Use XUNTAG.
1277
3478ec45
PE
1278 Port recent dbusbind.c changes to 32-bit --with-wide-int.
1279 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
1280 Remove unportable assumptions about print widths of types like
1281 dbus_uint32_t.
1282 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
1283 intptr_t when converting between pointer and integer, to avoid GCC
1284 warnings about wrong width.
1285
666b903b 12862012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
1287
1288 * w32proc.c (new_child): Force Windows to reserve only 64KB of
1289 stack for each reader_thread, instead of defaulting to 8MB
1290 determined by the linker. This avoids failures in creating
1291 subprocesses on Windows 7, see the discussion in this thread:
1292 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
1293
b120cc17
JC
12942012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
1295
1296 Fix up display of the *Minibuf-0* buffer in the mini window.
1297 * keyboard.c (read_char): Don't clear the echo area if there's no
1298 message to clear.
1299 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 1300 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 1301
9a4b36f8
MA
13022012-05-07 Michael Albinus <michael.albinus@gmx.de>
1303
1304 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
1305 batch mode.
1306
e5f9458f
CY
13072012-05-06 Chong Yidong <cyd@gnu.org>
1308
1309 * lisp.mk (lisp): Update.
1310
eceeb5fc 13112012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
1312
1313 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
1314
71873e2b
SM
13152012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
1316
1317 * data.c (PUT_ERROR): New macro.
1318 (syms_of_data): Use it. Add new error type `user-error'.
1319 * undo.c (user_error): New function.
1320 (Fprimitive_undo): Use it.
1321 * print.c (print_error_message): Adjust print style for `user-error'.
1322 * keyboard.c (user_error): New function.
1323 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
1324
ab0fa4e4
PE
13252012-05-03 Paul Eggert <eggert@cs.ucla.edu>
1326
1327 Do not limit current-time-string to years 1000..9999.
1328 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
1329 (Fcurrent_time_string): Support any year that is supported by the
1330 underlying localtime representation. Don't use asctime, as it
1331 has undefined behavior for years outside the range -999..9999.
1332
7ed806a7
PE
13332012-05-02 Paul Eggert <eggert@cs.ucla.edu>
1334
1335 Fix race conditions involving setenv, gmtime, localtime, asctime.
1336 Without this fix, interrupts could mess up code that uses these
1337 nonreentrant functions, since setting TZ invalidates existing
1338 tm_zone or tzname values, and since most of these functions return
1339 pointers to static storage.
1340 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
1341 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
1342 Grow the critical sections to include not just invoking
1343 localtime/gmtime, but also accessing these functions' results
1344 including their tm_zone values if any, and any related TZ setting.
1345 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
1346 so that the struct tm is saved in the critical section.
1347 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
1348 motivated by the fact that memory allocation needs to be outside
1349 the critical section.
1350
0c16dfed
DA
13512012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
1352
1353 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
1354 with RESET_INTERVAL.
1355
1356 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1357 Remove duplicated buffer name initialization.
1358
3f83ace8
JM
13592012-05-02 Jim Meyering <jim@meyering.net>
1360
1361 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
1362
c7b8541e
JM
1363 * xfns.c (x_window): Use xstrdup (Bug#11375).
1364
90207a15 13652012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
1366
1367 * xdisp.c (pos_visible_p): If already at a newline from the
1368 display string before the 'while' loop, don't walk back the glyphs
1369 from it3.glyph_row. Solves assertion violation when the display
1370 string begins with a newline (egg.el). (Bug#11367)
1371
b593d6a9
AH
13722012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
1373
1374 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
1375 Move to simple.el.
1376
4737362e
GM
13772012-05-01 Glenn Morris <rgm@gnu.org>
1378
99cf43f9
GM
1379 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
1380 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
1381 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
1382 All were removed before 23.1.
1383
9311dcff
GM
1384 * dispnew.c: Remove HAVE_LIBNCURSES test;
1385 it is always true on relevant platforms.
1386
4d5c6349
GM
1387 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
1388 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
1389
4737362e
GM
1390 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
1391
74dd3a6b
AS
13922012-04-30 Andreas Schwab <schwab@linux-m68k.org>
1393
1394 * .gdbinit (xpr): Remove checks for no longer existing misc types.
1395 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
1396 Remove.
1397
13c379ee
PE
13982012-04-28 Paul Eggert <eggert@cs.ucla.edu>
1399
1400 Do not avoid creating empty evaporating overlays (Bug#9642).
1401 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
1402 That is, do not delete an evaporating overlay if it becomes
1403 empty after its bounds are adjusted to fit within its buffer.
1404 This fix caused other problems, and I'm reverting it until we get
1405 to the bottom of them.
1406
a8e7d6d7 14072012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
1408
1409 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
1410
a8e7d6d7 14112012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
1412
1413 * xdisp.c (pos_visible_p): If the window start position is beyond
1414 ZV, start the display from buffer beginning. Prevents assertion
1415 violation in init_iterator when the minibuffer window is scrolled
1416 via the scroll bar.
1417
1418 * window.c (window_scroll_pixel_based): Likewise.
1419
a8e7d6d7 14202012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
1421
1422 * keymap.c (where_is_internal): Doc fix (Bug#10872).
1423
a8e7d6d7 14242012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
1425
1426 * fileio.c (Fcopy_file, Fset_file_selinux_context):
1427 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
1428
a8e7d6d7 14292012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 1430
b593d6a9
AH
1431 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
1432 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 1433
1c6900d9
EZ
14342012-04-26 Eli Zaretskii <eliz@gnu.org>
1435
4c3fa1d9
EZ
1436 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
1437 display element, check also the underlying string or buffer
1438 character. (Bug#11341)
1439
1c6900d9
EZ
1440 * w32menu.c: Include w32heap.h.
1441 (add_menu_item): If the call to AppendMenuW (via
1442 unicode_append_menu) fails, disable Unicode menus only if we are
1443 running on Windows 9X/Me.
1444
42bf8205
AS
14452012-04-24 Andreas Schwab <schwab@linux-m68k.org>
1446
1447 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
1448 (xgetint): Add missing shift for LSB tags.
1449
b1bac16e
MR
14502012-04-24 Martin Rudalics <rudalics@gmx.at>
1451
1452 * keyboard.c (read_char): Don't wipe echo area for select window
1453 events: These might get delayed via `mouse-autoselect-window'
1454 (Bug#11304).
1455
d69621cc
JB
14562012-04-24 Juanma Barranquero <lekktu@gmail.com>
1457
1458 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
1459 manipulation of :loaded-from data.
1460
02fd101b
JB
14612012-04-23 Juanma Barranquero <lekktu@gmail.com>
1462
1463 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
1464 now a cons (bug#11311).
1465
888bec30
PE
14662012-04-23 Paul Eggert <eggert@cs.ucla.edu>
1467
89a438bd
PE
1468 Do not create empty overlays with the evaporate property (Bug#9642).
1469 * buffer.c (Fmove_overlay): Delete an evaporating overlay
1470 if it becomes empty after its bounds are adjusted to fit within
1471 its buffer. Without this fix, in a nonempty buffer (let ((o
1472 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
1473 yields an empty overlay that has the evaporate property, which is
1474 not supposed to happen.
1475
1068fe4d
PE
1476 Fix minor GTK3 problems found by static checking.
1477 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1478 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1479 (struct _EmacsFixedClass, emacs_fixed_get_type):
1480 Move decls here from emacsgtkfixed.h, since they needn't be public.
1481 (emacs_fixed_get_type): Now static.
1482 (emacs_fixed_class_init): Omit unused local.
1483 (emacs_fixed_child_type): Remove; unused.
1484 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1485 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1486 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
1487 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
1488 (EMACS_FIXED_GET_CLASS): Remove; unused.
1489 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
1490
888bec30
PE
1491 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
1492 Problem reported by Juanma Barranquero for Windows -Wunused-function.
1493
de85e130
PE
14942012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1495
d0baac98 1496 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 1497 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
1498 (__malloc_size_t, __malloc_ptrdiff_t):
1499 Remove. All uses removed, replaced by the definiens if needed,
1500 since we can assume C89 or better now.
1501 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
1502 (protect_malloc_state, align, get_contiguous_space)
1503 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
1504 (malloc_atfork_handler_child, malloc_enable_thread)
1505 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
1506 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
1507 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
1508 (special_realloc, _realloc_internal_nolock, _realloc_internal)
1509 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
1510 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
1511 Define using prototypes, not old style.
1512 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
1513 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
1514 (align): Don't assume that signed integer overflow wraps around.
1515 Omit unused local var.
1516 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
1517 (_free_internal_nolock, memalign, mallochook, reallochook):
1518 Omit no-longer-needed casts.
1519 (valloc): Use getpagesize, not __getpagesize.
1520 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
1521 (struct hdr): The 'magic' member is now size_t, not unsigned long.
1522
de85e130
PE
1523 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
1524
dcbf5805
MA
15252012-04-22 Michael Albinus <michael.albinus@gmx.de>
1526
1527 Move functions from C to Lisp. Make non-blocking method calls
1528 the default. Implement further D-Bus standard interfaces.
1529
1530 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
1531 (QCdbus_request_name_allow_replacement)
1532 (QCdbus_request_name_replace_existing)
1533 (QCdbus_request_name_do_not_queue)
1534 (QCdbus_request_name_reply_primary_owner)
1535 (QCdbus_request_name_reply_in_queue)
1536 (QCdbus_request_name_reply_exists)
1537 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
1538 (QCdbus_registered_serial, QCdbus_registered_method)
1539 (QCdbus_registered_signal): New Lisp objects.
1540 (XD_DEBUG_MESSAGE): Use sizeof.
1541 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
1542 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
1543 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
1544 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
1545 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
1546 (xd_signature, xd_append_arg): Allow float for integer types.
1547 (xd_get_connection_references): New function.
b593d6a9
AH
1548 (xd_get_connection_address): Rename from xd_initialize.
1549 Return cached address.
dcbf5805
MA
1550 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
1551 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
1552 level.
1553 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 1554 Return number of refcounts.
dcbf5805
MA
1555 (Fdbus_get_unique_name): Make stronger parameter check.
1556 (Fdbus_message_internal): New defun.
1557 (Fdbus_call_method, Fdbus_call_method_asynchronously)
1558 (Fdbus_method_return_internal, Fdbus_method_error_internal)
1559 (Fdbus_send_signal, Fdbus_register_service)
1560 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
1561 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
1562 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
1563 (Vdbus_compiled_version, Vdbus_runtime_version)
1564 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
1565 (Vdbus_message_type_method_return, Vdbus_message_type_error)
1566 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
1567 (Vdbus_registered_buses, Vdbus_registered_objects_table):
1568 Adapt docstring.
dcbf5805 1569
52828e02
PE
15702012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1571
da05bc4c
PE
1572 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
1573 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
1574 Do not assume ptrdiff_t is the same width as 'int'.
1575
52828e02
PE
1576 * alloc.c: Handle unusual debugging option combinations.
1577 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
1578 since the two debugging options are incompatible.
1579 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
1580 is defined.
1581 (mem_init, mem_insert, mem_insert_fixup):
1582 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
1583 (NEED_MEM_INSERT): Remove; no longer needed.
1584
f01769f9
LL
15852012-04-22 Leo Liu <sdl.web@gmail.com>
1586
1587 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
1588
5790543d
PE
15892012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1590
1591 * sysdep.c [__FreeBSD__]: Minor cleanups.
1592 (list_system_processes, system_process_attributes) [__FreeBSD__]:
1593 Use Emacs indenting style more consistently. Avoid some casts.
1594 Use 'double' consistently rather than mixing 'float' and 'double'.
1595
b91b7e4d
EW
15962012-04-21 Eduard Wiebe <usenet@pusto.de>
1597
b593d6a9
AH
1598 * sysdep.c (list_system_processes, system_process_attributes):
1599 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 1600
6114eb15
AS
16012012-04-21 Andreas Schwab <schwab@linux-m68k.org>
1602
1603 * lisp.mk (lisp): Update.
1604
2f38dff7
PE
16052012-04-20 Paul Eggert <eggert@cs.ucla.edu>
1606
1607 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
1608 It is never used otherwise.
1609
4ae29f89
SM
16102012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
1611
1612 * print.c (print_preprocess): Only check print_depth if print-circle
1613 is nil.
1614 (print_object): Check for cycles even when print-circle is nil and
1615 print-gensym is t, but only check print_depth if print-circle is nil.
1616
f30d612a
CY
16172012-04-20 Chong Yidong <cyd@gnu.org>
1618
1619 * process.c (wait_reading_process_output): If EIO occurs on a pty,
1620 set the status to "failed" and ensure that sentinel is run.
1621
c07a4c0b 16222012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
1623
1624 * process.c (Fset_process_inherit_coding_system_flag)
1625 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 1626 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 1627
c07a4c0b 16282012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
1629
1630 * xdisp.c (string_buffer_position_lim): Limit starting position to
1631 BEGV.
1632 (set_cursor_from_row): If called for a mode-line or header-line
1633 row, return zero immediately.
1634 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
1635 farther than the first row after the header line, if any.
1636 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
1637 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
1638
c07a4c0b 16392012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 1640
4ae29f89
SM
1641 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
1642 (bug#11238).
ad3a2b41 1643
c07a4c0b 16442012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 16452012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
1646
1647 configure: new option --enable-gcc-warnings (Bug#11207)
1648 * Makefile.in (C_WARNINGS_SWITCH): Remove.
1649 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
1650 (ALL_CFLAGS): Use new macros rather than old.
1651 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
1652 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
1653 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
1654 -Wunused-result, -Wunused-variable. This should go away once
1655 the Emacs and Gnulib regex code is merged.
1656 (xmalloc, xrealloc): Now static.
1657
aba027e8
PE
16582012-04-17 Paul Eggert <eggert@cs.ucla.edu>
1659
1660 * dired.c (Fsystem_groups): Remove unused local.
1661
e5a36063
GM
16622012-04-17 Glenn Morris <rgm@gnu.org>
1663
1664 * dired.c (Fsystem_users): Doc fix.
1665
316411f0
DA
16662012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
1667
1668 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
1669 (syms_of_dired): Add them.
1670
9426aba4
PE
16712012-04-16 Paul Eggert <eggert@cs.ucla.edu>
1672
b62a57be
PE
1673 Fix minor alloc.c problems found by static checking.
1674 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
1675 New extern decls, to avoid calling undeclared functions.
1676 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
1677 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
1678 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
1679 (NEED_MEM_INSERT): New macro.
1680 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 1681 Remove one incorrect comment and fix another.
b62a57be 1682
3539f31f
PE
1683 Fix minor ralloc.c problems found by static checking.
1684 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1685 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
1686 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
1687 (r_alloc_sbrk): Now static.
1688
a041960a
PE
1689 Improve ralloc.c interface checking.
1690 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1691 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
1692 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
1693 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
1694 [REL_ALLOC]: ... to here, to check interface.
1695 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
1696 Remove decls. This fixes an "It stinks!".
1697
9426aba4
PE
1698 * alloc.c (which_symbols): Fix alignment issue / type clash.
1699
d55c12ed
AS
17002012-04-15 Andreas Schwab <schwab@linux-m68k.org>
1701
1702 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
1703 (struct Lisp_Misc_Any): Likewise.
1704 (struct Lisp_Free): Likewise.
1705 * alloc.c (union aligned_Lisp_Symbol): Define.
1706 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
1707 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
1708 (union aligned_Lisp_Misc): Define.
1709 (MARKER_BLOCK_SIZE, struct marker_block): Use union
1710 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 1711 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 1712
b948ce8b
PE
17132012-04-14 Paul Eggert <eggert@cs.ucla.edu>
1714
1715 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
1716 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
1717 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
1718 * s/netbsd.h, s/sol2-6.h:
1719 Remove definition of GC_MARK_STACK, since the default now works.
1720 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
1721 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
1722 no longer the default.
1723 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
1724
35dc09a1 17252012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 1726
35dc09a1
GM
1727 * lread.c (lisp_file_lexically_bound_p):
1728 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 1729
35dc09a1
GM
17302012-04-14 Eli Zaretskii <eliz@gnu.org>
1731
1732 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
1733 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
1734
17352012-04-14 Jan Djärv <jan.h.d@swipnet.se>
1736
1737 * nsterm.m (constrainFrameRect): Always constrain when there is only
1738 one screen (Bug#10962).
1739
bcd86815
KB
17402012-04-13 Ken Brown <kbrown@cornell.edu>
1741
1742 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
1743
c25df26e
RT
17442012-04-13 Reuben Thomas <rrt@sc3d.org>
1745
1746 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
1747
0fc59f1e
DC
17482012-04-11 Daniel Colascione <dancol@dancol.org>
1749
1750 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
1751 against is gone. It's better to use vfork now so that when Cygwin
1752 gains a new, working vfork, we use it automatically (bug#10398).
1753
de8c03dc
SM
17542012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1755
1756 * window.c (save_window_save): Obey window-point-insertion-type.
1757
2f097256
GM
17582012-04-11 Glenn Morris <rgm@gnu.org>
1759
1760 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
1761
453b951e
SM
17622012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1763
1764 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
1765
75f1671a 17662012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
1767
1768 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
1769 (force_quit_count): New var.
1770 (handle_interrupt): Use it.
1771
2a8ce227
JB
17722012-04-10 Juanma Barranquero <lekktu@gmail.com>
1773
1774 * w32.c (w32_delayed_load): Record the full path of the library
1775 being loaded (bug#10424).
1776
935396c0
GM
17772012-04-09 Glenn Morris <rgm@gnu.org>
1778
05920a43
GM
1779 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
1780 not just in the obarray, before snarfing them. (Bug#11036)
1781
935396c0
GM
1782 * Makefile.in ($(leimdir)/leim-list.el):
1783 Pass EMACS rather than BUILT_EMACS.
1784
a18ecafa
TZ
17852012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
1786
1787 * process.c (make_process):
1788 * process.h: Add integer `gnutls_handshakes_tried' member to
1789 process struct.
1790
6bbef4e5
JC
1791 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
1792 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
1793
1794 * gnutls.c (gnutls_log_function2i): Convenience log function.
1795 (emacs_gnutls_read): Use new log functions,
1796 `gnutls_handshakes_tried' process member, and
1797 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
1798 attempts per process (connection).
1799
b4d3bc10
CY
18002012-04-09 Chong Yidong <cyd@gnu.org>
1801
1802 * eval.c (Fuser_variable_p, user_variable_p_eh)
1803 (lisp_indirect_variable): Functions deleted.
1804 (Fdefvar): Caller changed.
1805
1806 * callint.c (Finteractive, Fcall_interactively):
1807 * minibuf.c (Fread_variable): Callers changed.
1808
70f4d973
EZ
18092012-04-09 Eli Zaretskii <eliz@gnu.org>
1810
1811 * xdisp.c (set_cursor_from_row): If the display string appears in
1812 the buffer at position that is closer to point than the position
1813 after the display string, display the cursor on the first glyph of
1814 the display string. Fixes cursor display when a 'display' text
1815 property immediately follows invisible text. (Bug#11094)
1816
cb3c2e3e
PE
18172012-04-09 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 composite.c: use 'double' consistently
1820 * composite.c (get_composition_id): Use 'double' consistently
1821 instead of converting 'float' to 'double' and vice versa; this is
1822 easier to understand and avoids a GCC warning.
1823
fd06db5d
GM
18242012-04-09 Glenn Morris <rgm@gnu.org>
1825
50fe702a
GM
1826 * Makefile.in: Generate leim-list with bootstrap-emacs, in
1827 preparation for dumping it with emacs. (Bug#4789)
1828 (leimdir): New variable.
1829 ($(leimdir)/leim-list.el): New rule.
1830 (emacs$(EXEEXT)): Depend on leim-list.el.
1831
fd06db5d
GM
1832 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
1833 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
1834 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
1835
55c131ee
AS
18362012-04-08 Andreas Schwab <schwab@linux-m68k.org>
1837
1838 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
1839 proper alignment.
1840
9209588f
JB
18412012-04-07 Juanma Barranquero <lekktu@gmail.com>
1842
1843 * xml.c (init_libxml2_functions) [WINDOWSNT]:
1844 Remove unused local variable.
1845
e3fb2efb
PE
18462012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
1849 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
1850 (mark_memory): Mark Lisp_Objects only if pointers might hide in
1851 objects, as mark_maybe_pointer will catch them otherwise.
1852 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
1853 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
1854
b5385551
PE
18552012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 Fix typo that broke non-Windows builds.
1858 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
1859
9078ead6
EZ
18602012-04-07 Eli Zaretskii <eliz@gnu.org>
1861
1862 Support building on MS-Windows with libxml2.
1863
1864 * makefile.w32-in (OBJ2): Add xml.$(O).
1865 (GLOBAL_SOURCES): Add xml.c.
1866 ($(BLD)/xml.$(O)): New dependency list.
1867
1868 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
1869 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
1870 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
1871 [!WINDOWSNT]: New macros.
1872 (init_libxml2_functions, libxml2_loaded_p): New functions.
1873 (parse_region): Call fn_xmlCheckVersion instead of using the macro
1874 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
1875 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
1876 Calls xmlCleanupParser only if libxml2 was loaded (or statically
1877 linked in).
6bbef4e5
JC
1878 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
1879 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
1880 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
1881
1882 * emacs.c: Don't include libxml/parser.h.
1883 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
1884 xmlCleanupParser directly.
1885
1886 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
1887
3811fdf3
EZ
18882012-04-07 Eli Zaretskii <eliz@gnu.org>
1889
1890 * indent.c (Fvertical_motion): If there is a display string at
1891 point, use it.vpos to compute how many lines to backtrack after
1892 move_it_to point. (Bug#11133)
1893
2f8e16b2
EZ
18942012-04-06 Eli Zaretskii <eliz@gnu.org>
1895
1896 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
1897 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
1898 about subtle differences between FETCH_CHAR* and STRING_CHAR*
1899 macros related to unification of CJK characters. For the details,
1900 see the discussion following the message here:
1901 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
1902
3d439cd1
CY
19032012-04-04 Chong Yidong <cyd@gnu.org>
1904
1905 * keyboard.c (Vdelayed_warnings_list): Doc fix.
1906
8bc53d00
EZ
19072012-04-01 Eli Zaretskii <eliz@gnu.org>
1908
1909 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
1910 instead of alloca. (Bug#11138)
1911
3b0512a3
AS
19122012-04-01 Andreas Schwab <schwab@linux-m68k.org>
1913
1914 * w32menu.c (is_simple_dialog): Properly check lisp types.
1915 (Bug#11141)
1916
8427ddd2
EZ
19172012-03-31 Eli Zaretskii <eliz@gnu.org>
1918
979022ef
EZ
1919 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
1920 position we get to after a call to move_it_to fails the
1921 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
1922 only if we wind up in a string from display property. (Bug#11063)
1923
a6b1c7cc
EZ
1924 * window.c (Fdelete_other_windows_internal): Invalidate the row
1925 and column information about mouse highlight, so that redisplay
1926 restores it after reallocating the glyph matrices. (Bug#7464)
1927
8427ddd2
EZ
1928 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
1929 string comes from a `display' text property, use the buffer
1930 position of that property as if we actually saw that position in
1931 the row's glyphs.
697ba24b
EZ
1932 (move_it_by_lines): Remove the assertion that
1933 "it->current_x == 0 && it->hpos == 0" which can be legitimately
1934 violated when there's a before-string at the beginning of a line.
1935 (Bug#11063)
8427ddd2 1936
65a0a738
EZ
19372012-03-30 Eli Zaretskii <eliz@gnu.org>
1938
1939 * xdisp.c (append_space_for_newline): If the default face was
1940 remapped, use the remapped face for the appended newline.
1941 (extend_face_to_end_of_line): Use the remapped default face for
1942 extending the face to the end of the line.
1943 (display_line): Call extend_face_to_end_of_line when the default
1944 face was remapped. (Bug#11068)
1945
581355cc
EZ
19462012-03-29 Eli Zaretskii <eliz@gnu.org>
1947
1948 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
1949
e8fc049f
SM
19502012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1951
1952 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
1953
4fb9a543
GM
19542012-03-27 Glenn Morris <rgm@gnu.org>
1955
1956 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
1957 Doc fixes.
1958
679910f1
KH
19592012-03-26 Kenichi Handa <handa@m17n.org>
1960
1961 * dispextern.h (struct glyph): Fix previous change. Change the
1962 bit length of glyphless.ch to 25 (Bug#11082).
1963
90d49b7f
CY
19642012-03-26 Chong Yidong <cyd@gnu.org>
1965
1966 * keyboard.c (Vselection_inhibit_update_commands): New variable.
1967 (command_loop_1): Use it; inhibit selection update for
1968 handle-select-window too (Bug#8996).
1969
f514f6f0
FP
19702012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
1971
e8fc049f 1972 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 1973
bf43fa51
KH
19742012-03-25 Kenichi Handa <handa@m17n.org>
1975
1976 * dispextern.h (struct glyph): Change the bit length of
1977 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
1978
8a0c01dd
EZ
19792012-03-24 Eli Zaretskii <eliz@gnu.org>
1980
1981 * s/ms-w32.h (tzname): Include time.h before redirecting to
1982 _tzname. Fixes the MSVC build. (Bug#9960)
1983
7d1c3a76
AS
19842012-03-24 Andreas Schwab <schwab@linux-m68k.org>
1985
8ed79523
AS
1986 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1987 characters.
1988
7d1c3a76
AS
1989 * xterm.c (XTread_socket): Only modify handling_signal if
1990 !SYNC_INPUT. (Bug#11080)
1991
e99a9b8b
EZ
19922012-03-23 Eli Zaretskii <eliz@gnu.org>
1993
1994 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1995 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1996 when fetching a multibyte character consumes more bytes than
1997 CHAR_BYTES returns, due to unification of CJK characters in
1998 string_char. (Bug#11073)
1999
5063c0e1
TN
20002012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
2001
2002 * process.c (wait_reading_process_output): Handle pty disconnect
2003 by refraining from sending oneself a SIGCHLD (bug#10933).
2004
9f851fbd
CY
20052012-03-22 Chong Yidong <cyd@gnu.org>
2006
2007 * dispextern.h (struct it): New member string_from_prefix_prop_p.
2008
5063c0e1 2009 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
2010 Mark string as coming from a prefix property.
2011 (handle_face_prop): Use default face for prefix strings (Bug#4281).
2012 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
2013
fb5b8aca
CY
20142012-03-21 Chong Yidong <cyd@gnu.org>
2015
2016 * xfaces.c (Vface_remapping_alist): Doc fix.
2017
62356a1b
EZ
20182012-03-20 Eli Zaretskii <eliz@gnu.org>
2019
2020 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
2021 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
2022 Doc fixes.
62356a1b 2023
025de85b
CY
20242012-03-20 Chong Yidong <cyd@gnu.org>
2025
2026 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
2027 to reflect default non-nil value of redisplay-dont-pause.
2028
4827f94e
KH
20292012-03-19 Kenichi Handa <handa@m17n.org>
2030
2031 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
2032 it fit in a valid range (Bug#11003).
2033
e50a24a2
EZ
20342012-03-18 Eli Zaretskii <eliz@gnu.org>
2035
2036 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
2037 that is not from display property, accept the row as a "cursor
2038 row" if one of the string's character has a non-nil `cursor'
2039 property. Fixes cursor positioning when there are newlines in
2040 overlay strings, e.g. in icomplete.el. (Bug#11035)
2041
9af5ed87
PE
20422012-03-12 Paul Eggert <eggert@cs.ucla.edu>
2043
2044 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
2045
d1f55f16
CY
20462012-03-12 Chong Yidong <cyd@gnu.org>
2047
2048 * eval.c (inhibit_lisp_code): Rename from
2049 inhibit_window_configuration_change_hook; move from window.c.
2050
2051 * xfns.c (unwind_create_frame_1, Fx_create_frame):
2052 * window.c (run_window_configuration_change_hook)
2053 (syms_of_window): Callers changed.
2054
66c5eebd
CY
20552012-03-11 Chong Yidong <cyd@gnu.org>
2056
413df973
CY
2057 * keymap.c (Fkey_description): Doc fix (Bug#9700).
2058
66c5eebd
CY
2059 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
2060
1de11f56
CY
20612012-03-10 Chong Yidong <cyd@gnu.org>
2062
2063 * frame.c (other_visible_frames): Don't assume the selected frame
2064 is visible (Bug#10955).
2065
cae07000
SM
20662012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
2067
2068 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
2069
89c94350
JD
20702012-03-08 Jan Djärv <jan.h.d@swipnet.se>
2071
2072 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
2073 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
2074 zero (Bug#10954).
2075
999dd333
GM
20762012-03-03 Glenn Morris <rgm@gnu.org>
2077
01a6dcc8 2078 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 2079
de0100f2
EZ
20802012-03-02 Eli Zaretskii <eliz@gnu.org>
2081
2082 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
2083 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
2084 (redisplay_window, next_element_from_string): Fix typos in
2085 comments.
3e441275
EZ
2086 (redisplay_window): Pass to move_it_vertically the margin in
2087 pixels, not in screen lines.
de0100f2 2088
96a72ee9
GM
20892012-03-02 Glenn Morris <rgm@gnu.org>
2090
2091 * buffer.c (buffer-list-update-hook): Doc fix.
2092
312508d7
EZ
20932012-02-29 Eli Zaretskii <eliz@gnu.org>
2094
2095 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
2096 push_it before setting up the iterator for the first overlay
2097 string, even if we have an empty string loaded.
2098 (next_overlay_string): If there's an empty string on the iterator
2099 stack, pop the stack. (Bug#10903)
2100
27f3c637
PE
21012012-02-25 Paul Eggert <eggert@cs.ucla.edu>
2102
2103 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
2104 Suggested by Stefan Monnier in
2105 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
2106 * alloc.c (widen_to_Lisp_Object): New static function.
2107 (mark_memory): Also mark Lisp_Objects by fetching pointer words
2108 and widening them to Lisp_Objects. This would work even if
2109 USE_LSB_TAG is defined and wide integers are used, which might
2110 happen in a future version of Emacs.
2111
3c9dfce6
CY
21122012-02-25 Chong Yidong <cyd@gnu.org>
2113
fa74b241
CY
2114 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
2115 Doc fix.
2116
3c9dfce6
CY
2117 * xselect.c (Fx_selection_exists_p): Doc fix.
2118 (x_clipboard_manager_save_all): Print an informative message
2119 before saving to clipboard manager.
2120
9486df08
CY
21212012-02-24 Chong Yidong <cyd@gnu.org>
2122
2123 * keyboard.c (process_special_events): Handle all X selection
2124 requests in kbd_buffer, not just the next one (Bug#8869).
2125
f01d3321
CY
21262012-02-23 Chong Yidong <cyd@gnu.org>
2127
2128 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
2129 call when setting menu-bar-lines and tool-bar-lines parameters.
2130 (unwind_create_frame_1): New helper function.
2131
2132 * window.c (inhibit_window_configuration_change_hook): New var.
2133 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 2134 (syms_of_window): Initialize it.
f01d3321 2135
86b847b6
CY
21362012-02-22 Chong Yidong <cyd@gnu.org>
2137
2138 * xterm.c (x_draw_image_relief): Add missing type check for
2139 Vtool_bar_button_margin (Bug#10743).
2140
a59225b1
CY
21412012-02-21 Chong Yidong <cyd@gnu.org>
2142
2143 * fileio.c (Vfile_name_handler_alist): Doc fix.
2144
2145 * buffer.c (Fget_file_buffer): Protect against invalid file
2146 handler return value.
2147
310f5bd4
PE
21482012-02-20 Paul Eggert <eggert@cs.ucla.edu>
2149
cb3a28cc
PE
2150 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
2151 when computing $valmask.
2152
310f5bd4
PE
2153 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
2154 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
2155 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
2156 It's useless in that case, and it can cause problems on hosts
2157 that allocate halves of EMACS_INT values separately.
2158 Reported by Dan Horák. Diagnosed by Andreas Schwab in
2159 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
2160 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
2161 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
2162 it avoids undefined behavior on hosts where shifting right by more
2163 than the word width has undefined behavior.
2164
2375c96a
CY
21652012-02-19 Chong Yidong <cyd@gnu.org>
2166
2167 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
2168 (Funhandled_file_name_directory, Ffile_name_as_directory)
2169 (Fdirectory_file_name, Fexpand_file_name)
2170 (Fsubstitute_in_file_name): Protect against invalid file handler
2171 return values (Bug#10845).
2172
3eb49e71
EZ
21732012-02-18 Eli Zaretskii <eliz@gnu.org>
2174
2175 * .gdbinit (pitx): Fix incorrect references to fields of the
2176 iterator stack.
2177
7b926f3f
CY
21782012-02-17 Chong Yidong <cyd@gnu.org>
2179
2180 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
2181
11273115
PE
21822012-02-15 Paul Eggert <eggert@cs.ucla.edu>
2183
2184 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
2185 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
2186
c3a70e2b
CY
21872012-02-15 Chong Yidong <cyd@gnu.org>
2188
2189 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
2190 marked as special. Also, starting docstrings with * is obsolete.
2191
0ca43699
AS
21922012-02-13 Andreas Schwab <schwab@linux-m68k.org>
2193
2194 * gnutls.c (emacs_gnutls_write): Fix last change.
2195
2e8f3c56
LI
21962012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2197
2198 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
2199 send_process.
2200
af70074f
SM
22012012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2202
2203 * keymap.c (Fsingle_key_description): Handle char ranges.
2204
95986d52
CY
22052012-02-12 Chong Yidong <cyd@gnu.org>
2206
afd83bd1
CY
2207 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
2208 as that creates a dangerous corner case.
2209
95986d52
CY
2210 * window.c (Fdelete_window_internal): Invalidate the mouse
2211 highlight (Bug#9904).
2212
bd7da63e
GM
22132012-02-12 Glenn Morris <rgm@gnu.org>
2214
2215 * xselect.c (Fx_own_selection_internal)
2216 (Fx_get_selection_internal, Fx_disown_selection_internal)
2217 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
2218 * nsselect.m (Fx_own_selection_internal)
2219 (Fx_disown_selection_internal, Fx_selection_exists_p)
2220 (Fx_selection_owner_p, Fx_get_selection_internal):
2221 Sync docs and argument specs with the xselect.c versions.
2222
77abcbc2
LI
22232012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
2224
2225 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
2226
90b671e2
EZ
22272012-02-11 Eli Zaretskii <eliz@gnu.org>
2228
1c0ca0b7
EZ
2229 * w32select.c (Fx_selection_exists_p): Sync doc string and
2230 argument list with xselect.c. (Bug#10783)
2231
2232 * w16select.c (Fx_selection_exists_p): Sync doc string and
2233 argument list with xselect.c. (Bug#10783)
90b671e2 2234
49241268
GM
22352012-02-10 Glenn Morris <rgm@gnu.org>
2236
2237 * fns.c (Fsecure_hash): Doc fix.
2238
f998bbe7 22392012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
2240
2241 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
2242
0992bd9c
CY
22432012-02-07 Chong Yidong <cyd@gnu.org>
2244
2245 * buffer.c (Fbuffer_local_variables)
2246 (buffer_lisp_local_variables): Handle unbound vars correctly;
2247 don't let Qunbound leak into Lisp.
2248
af008560
GM
22492012-02-07 Glenn Morris <rgm@gnu.org>
2250
dd605cc4
GM
2251 * image.c (Fimagemagick_types): Doc fix.
2252
af008560
GM
2253 * image.c (imagemagick-render-type): Change it from a lisp object
2254 to an integer. Move the doc here from the lisp manual.
2255 Treat all values not equal to 0 the same.
2256
1449fa1d
CY
22572012-02-06 Chong Yidong <cyd@gnu.org>
2258
2259 * doc.c (store_function_docstring): Avoid applying docstring of
2260 alias to base function (Bug#2603).
2261
3723ec07
AS
22622012-02-04 Andreas Schwab <schwab@linux-m68k.org>
2263
2264 * .gdbinit (pp1, pv1): Remove redundant defines.
2265 (pr): Use pp.
2266
79c1cc1e
CY
22672012-02-04 Chong Yidong <cyd@gnu.org>
2268
2269 * nsterm.m: Declare a global (Bug#10694).
2270
d7f29f8e
EZ
22712012-02-04 Eli Zaretskii <eliz@gnu.org>
2272
cae07000
SM
2273 * w32.c (get_emacs_configuration_options):
2274 Include --enable-checking, if specified, in the return value.
d7f29f8e 2275
3b95a6f9
MR
22762012-02-04 Martin Rudalics <rudalics@gmx.at>
2277
2278 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
2279 after rounding frame sizes. (Bug#9723)
2280
d6fa96a6
EZ
22812012-02-04 Eli Zaretskii <eliz@gnu.org>
2282
2283 * keyboard.c (adjust_point_for_property): Don't position point
2284 before BEGV. (Bug#10696)
2285
df0b2940
PE
22862012-02-03 Paul Eggert <eggert@cs.ucla.edu>
2287
2288 Handle overflow when computing char display width (Bug#9496).
2289 * character.c (char_width): Return EMACS_INT, not int.
2290 (char_width, c_string_width): Check for overflow when
2291 computing the width; this is possible now that individual
2292 characters can have unbounded width. Problem introduced
2293 by merge from Emacs 23 on 2012-01-19.
2294
6bee44d6
MA
22952012-02-02 Michael Albinus <michael.albinus@gmx.de>
2296
2297 * dbusbind.c (Fdbus_register_method): Mention the return value
2298 :ignore in the docstring.
2299
44f92739
GM
23002012-02-02 Glenn Morris <rgm@gnu.org>
2301
1b9f60cc
GM
2302 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
2303
44f92739
GM
2304 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2305 Unconditionally set to t. (Bug#10673)
2306 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2307 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2308 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
2309
c5d3843c
KH
23102012-02-02 Kenichi Handa <handa@m17n.org>
2311
2312 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
2313 0, do not call append_composite_glyph.
2314
159462d4 23152012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
2316
2317 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
2318 NULL (Bug#6988).
2319 (x_produce_glyphs): If the component of a composition is a null
2320 string, set it->pixel_width to 1 to avoid zero-width glyph.
2321
78cef877
EZ
23222012-02-01 Eli Zaretskii <eliz@gnu.org>
2323
2324 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
2325 first 2 arguments are identical. This makes inserting large
2326 output from a subprocess an order of magnitude faster on
2327 MS-Windows, where all sbrk'ed memory is always contiguous.
2328
97897668
GM
23292012-01-31 Glenn Morris <rgm@gnu.org>
2330
2331 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 2332 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
2333 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
2334
31fd3586
GM
23352012-01-29 Glenn Morris <rgm@gnu.org>
2336
2337 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
2338
0e24a8b2
CY
23392012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
2340
2341 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
2342
cc0adcb0
CY
23432012-01-28 Chong Yidong <cyd@gnu.org>
2344
2345 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
2346
acc28cb9
CY
23472012-01-26 Chong Yidong <cyd@gnu.org>
2348
9c69cfb7
CY
2349 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
2350
acc28cb9
CY
2351 * search.c (Fsearch_forward, Fsearch_backward): Document negative
2352 repeat counts (Bug#10507).
2353
48da7392
GM
23542012-01-26 Glenn Morris <rgm@gnu.org>
2355
2356 * lread.c (syms_of_lread): Doc fix.
2357
14af5f7f
CY
23582012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
2359
2360 * coding.c (encode_designation_at_bol): Change return value to
2361 EMACS_INT.
2362
0b21c100
CY
23632012-01-25 Chong Yidong <cyd@gnu.org>
2364
2365 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
2366
3c2907f7
CY
23672012-01-21 Chong Yidong <cyd@gnu.org>
2368
2369 * floatfns.c (Fcopysign): Make the second argument non-optional,
2370 since nil is not allowed anyway.
2371
959ad23f
AS
23722012-01-21 Andreas Schwab <schwab@linux-m68k.org>
2373
2374 * process.c (read_process_output): Use p instead of XPROCESS (proc).
2375 (send_process): Likewise.
2376
34a02f46
MR
23772012-01-19 Martin Rudalics <rudalics@gmx.at>
2378
2379 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
2380 (Vwindow_persistent_parameters): Do not use Qstate.
2381 Rewrite doc-strings.
34a02f46 2382
1259009a 23832012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
2384
2385 * character.c (char_width): New function.
70d4fdf6
GM
2386 (Fchar_width, c_string_width, lisp_string_width):
2387 Use char_width (Bug#9496).
25ed9e61 2388
6a6ee00d
MR
23892012-01-16 Martin Rudalics <rudalics@gmx.at>
2390
2391 * window.c (Vwindow_persistent_parameters): New variable.
2392 (Fset_window_configuration, save_window_save): Handle persistent
2393 window parameters.
2394
c85efaf7
EZ
23952012-01-14 Eli Zaretskii <eliz@gnu.org>
2396
2397 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
2398 thrashing the stack of the thread. (Bug#9087)
2399
5944709e
PE
24002012-01-12 Paul Eggert <eggert@cs.ucla.edu>
2401
2402 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
2403
e71f5d99
EZ
24042012-01-11 Eli Zaretskii <eliz@gnu.org>
2405
2406 * xdisp.c (rows_from_pos_range): Handle the case where the
2407 highlight ends on a newline. (Bug#10464)
2408 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
2409 he end column for display of highlight that ends on a newline
2410 before a R2L line.
2411
ce316182
GM
24122012-01-11 Glenn Morris <rgm@gnu.org>
2413
2414 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
2415 from load-path also when installation-directory is nil. (Bug#10208)
2416
5b43da69
GM
24172012-01-10 Glenn Morris <rgm@gnu.org>
2418
74cc8ff9
GM
2419 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
2420
7d8d6e4e
GM
2421 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
2422 Update template values to be closer to their typical values these days.
5b43da69 2423
a0db8d43
EZ
24242012-01-09 Eli Zaretskii <eliz@gnu.org>
2425
2426 * xdisp.c (rows_from_pos_range): Accept additional argument
2427 DISP_STRING, and accept any glyph in a row whose object is that
2428 string as eligible for mouse highlight. Fixes mouse highlight of
2429 display strings from overlays. (Bug#10464)
2430
9a0115ab 24312012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 2432
b9110d6a 2433 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
2434 * fileio.c (auto_saving_dir_umask): New static var.
2435 (Fmake_directory_internal): Use it.
2436 (do_auto_save_make_dir): Set it, instead of invoking chmod after
2437 creating the directory. The old code temporarily assigns
2438 too-generous permissions to the directory.
2439 (do_auto_save_eh): Clear it.
b9110d6a 2440 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
2441 that the var is always cleared.
2442
6c1bd3f3
EZ
24432012-01-07 Eli Zaretskii <eliz@gnu.org>
2444
2445 * search.c (scan_buffer): Pass character positions to
2446 know_region_cache, not byte positions. (Bug#6540)
2447
069d2b50
L
24482012-01-07 LynX <_LynX@bk.ru> (tiny change)
2449
2450 * w32.c (sys_rename): Report EXDEV when rename of a directory
2451 fails because the target is on another logical disk. (Bug#10284)
2452
75bf0d33
DB
24532012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
2454
2455 * xterm.c (x_embed_request_focus): New function.
2456
2457 * xterm.h: Add prototype.
2458
2459 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
2460
1c6e5a32
GM
24612012-01-05 Glenn Morris <rgm@gnu.org>
2462
2463 * emacs.c (emacs_copyright): Update short copyright year to 2012.
2464
651e947e
EZ
24652012-01-01 Eli Zaretskii <eliz@gnu.org>
2466
2467 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
2468 Load gnutls_transport_set_lowat only if GnuTLS version is below
2469 2.11.1.
2470 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
2471 GnuTLS versions below 2.11.1.
2472
3778cdd8
AL
24732011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
2474
2475 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
2476 to the doc string advising against its use for altering the way
2477 windows are scrolled.
2478
0e5317f7
KH
24792011-12-28 Kenichi Handa <handa@m17n.org>
2480
2481 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
2482 coding-system ASCII compatible only when it does not produce BOM
2483 on encoding (Bug#10383).
2484
93d5ca1f
JD
24852011-12-26 Jan Djärv <jan.h.d@swipnet.se>
2486
2487 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
2488 can scroll.
2489 (create_and_show_popup_menu): Always use menu_position_func for
2490 Gtk3 (Bug#10361).
2491
ca22b785
AS
24922011-12-24 Andreas Schwab <schwab@linux-m68k.org>
2493
2494 * callint.c (Fcall_interactively): Don't truncate prompt string.
2495
d048e1e6
EZ
24962011-12-23 Eli Zaretskii <eliz@gnu.org>
2497
2498 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
2499 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 2500 resumed from there (after widening). (Bug#10360)
d048e1e6 2501
5ccaba1f
JD
25022011-12-22 Jan Djärv <jan.h.d@swipnet.se>
2503
2504 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
2505
204ee57f
JD
25062011-12-21 Jan Djärv <jan.h.d@swipnet.se>
2507
b81d40f0
JB
2508 * nsterm.m (x_free_frame_resources):
2509 Release f->output_data.ns->miniimage.
204ee57f
JD
2510 (ns_index_color): Fix indentation. Do not retain
2511 color_table->colors[i].
2512
2513 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
2514 before returning.
2515
2516 * nsfns.m (x_set_background_color): Assign return value from
2517 ns_index_color to face-background instead of NSColor*.
2518 (ns_implicitly_set_icon_type): Fix indentation.
2519 Change assignment in for loop to comparison.
2520
2521 * emacs.c (ns_pool): New variable.
2522 (main): Assign ns_pool.
2523 (Fkill_emacs): Call ns_release_autorelease_pool.
2524
2525 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
2526 autorelease fdesc, release fdAttrs and tdict.
2527 (ns_get_covering_families): Release charset.
2528 (ns_findfonts): Release NSFontDescriptor created with new.
2529 (ns_uni_to_glyphs): Fix indentation.
2530 (setString): Release attrStr before assigning new value.
2531
c803b2b7
JD
25322011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2533
678f4426
JD
2534 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
2535 and NS_IMPL_COCOA.
2536 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
2537 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
2538
cd394be1 25392011-12-18 David Reitter <reitter@cmu.edu>
678f4426 2540
5fecd5fc
JD
2541 * nsterm.m (ns_term_init): Subscribe for notifications
2542 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
2543 to method trackingNotification in EmacsMenu.
2544
2545 * nsmenu.m (trackingMenu): New variable.
3771cb17 2546 (trackingNotification): New method (from Aquamacs).
5fecd5fc 2547 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 2548 from Aquamacs (Bug#7030).
678f4426
JD
2549
25502011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 2551
c803b2b7
JD
2552 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
2553 (symbol_to_nsstring): Fix indentation.
2554 (ns_symbol_to_pb): New function.
cae07000
SM
2555 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
2556 (Fns_rotate_cut_buffers_internal): Remove.
2557 (Fns_store_selection_internal): Rename from
c803b2b7
JD
2558 Fns_store_cut_buffer_internal.
2559 (ns_get_foreign_selection, Fx_own_selection_internal)
2560 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
2561 (Fns_get_selection_internal, Fns_store_selection_internal):
2562 Use ns_symbol_to_pb and check if return value is nil.
2563 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
2564 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
2565 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
2566 renamed to Sns_store_selection_internal.
2567 (ns_handle_selection_request): Move code to Fx_own_selection_internal
2568 and remove this function.
2569 (ns_handle_selection_clear): Remove, never used.
2570 (Fx_own_selection_internal): Move code from ns_handle_selection_request
2571 here.
2572
e1b01a3a
KB
25732011-12-17 Ken Brown <kbrown@cornell.edu>
2574
2575 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
2576 GID is unknown (Bug#10257).
2577
2adb6e85
PE
25782011-12-17 Paul Eggert <eggert@cs.ucla.edu>
2579
2580 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
2581 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
2582 which caused a build failure on GNU/Linux IA-64. This problem was
2583 introduced by my 2011-10-07 patch.
2584
d1d7b339
JL
25852011-12-15 Juri Linkov <juri@jurta.org>
2586
2587 * image.c (imagemagick_error): New function. (Bug#10112)
2588 (imagemagick_load_image): Comment out `MagickSetResolution' call.
2589 Use `imagemagick_error' where ImageMagick functions return
2590 `MagickFalse'.
2591 (Fimagemagick_types): Add `Fnreverse' to return the list in the
2592 proper order.
2593
100d5755
KH
25942011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2595
2596 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
2597 fill background (Bug#8992).
2598
454592a6
MR
25992011-12-13 Martin Rudalics <rudalics@gmx.at>
2600
2601 * window.c (Vwindow_combination_resize)
2602 (Vwindow_combination_limit): Use t instead of non-nil in
2603 doc-strings.
61d4b438
MR
2604 (Vrecenter_redisplay): Add first sentence of doc-string on
2605 separate line.
53524d93 2606 (Frecenter): Fix doc-string typo.
454592a6 2607
3633e3aa
KH
26082011-12-11 Kenichi Handa <handa@m17n.org>
2609
2610 * coding.c (Funencodable_char_position): Pay attention to the
2611 buffer text relocation (Bug#9389).
2612
7b9d523a 26132011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 2614
7b9d523a
JD
2615 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
2616 gtk_init (Bug#10100).
2617
b73189c6
EZ
26182011-12-10 Eli Zaretskii <eliz@gnu.org>
2619
2620 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
2621 IT->string is nil. (Bug#10263)
2622
f7dfe5d6
JD
26232011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2624
83faebb4
JD
2625 * nsterm.h (x_free_frame_resources): Declare.
2626
f7dfe5d6
JD
2627 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
2628 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
2629
2630 * nsterm.h (ns_get_defaults_value): Declare.
2631
2632 * nsterm.m (ns_default): Call ns_get_defaults_value.
2633
7cd4e72c
EZ
26342011-12-09 Eli Zaretskii <eliz@gnu.org>
2635
2636 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
2637 (Bug#10170)
2638
b34d7317
YM
26392011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2640
2641 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
2642 that where the value of an _OBJC_* symbol points to is in the .bss
2643 section (Bug#10240).
2644
76470ad1
KH
26452011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2646
2647 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 2648 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 2649
745fff94
KH
26502011-12-08 Kenichi Handa <handa@m17n.org>
2651
2652 * ftfont.c (get_adstyle_property): Fix previous change
2653 (Bug#10233).
2654
6e44397c
JB
26552011-12-07 Juanma Barranquero <lekktu@gmail.com>
2656
2657 * w32.c (init_environment): If no_site_lisp, remove site-lisp
2658 dirs from the default value of EMACSLOADPATH (bug#10208).
2659
7efa6272
GM
26602011-12-07 Glenn Morris <rgm@gnu.org>
2661
2662 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
2663 installation and source directories as well. (Bug#10208)
2664
f6fc4d87
CY
26652011-12-06 Chong Yidong <cyd@gnu.org>
2666
2667 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
2668
2bf26180
GM
26692011-12-06 Glenn Morris <rgm@gnu.org>
2670
2671 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
2672 as an error, not just -1. (Bug#10217)
2673
3a6ad4f0
CY
26742011-12-05 Chong Yidong <cyd@gnu.org>
2675
2676 * keyboard.c (process_special_events): New function.
2677 (swallow_events, Finput_pending_p): Use it (Bug#10195).
2678
75a3b399
PE
26792011-12-05 Paul Eggert <eggert@cs.ucla.edu>
2680
2681 * coding.c (encode_designation_at_bol): Don't use uninitialized
2682 local variable (Bug#9318).
2683
c3c9e25e
KH
26842011-12-05 Kenichi Handa <handa@m17n.org>
2685
2686 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
2687 return Qnil (Bug#8046, Bug#10193).
2688
5eb05ea3
KH
26892011-12-05 Kenichi Handa <handa@m17n.org>
2690
2691 * coding.c (encode_designation_at_bol): New args charbuf_end and
2692 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
2693 (coding_set_source): Return how many bytes coding->source was
2694 relocated.
2695 (coding_set_destination): Return how many bytes
2696 coding->destination was relocated.
2697 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 2698 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
2699
27002011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2701
2702 * coding.c (CODING_CHAR_CHARSET_P): New macro.
2703 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
2704 macro (Bug#9318).
2705
27062011-12-05 Andreas Schwab <schwab@linux-m68k.org>
2707
2708 The following changes are to fix Bug#9318.
2709
a79703f5 2710 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
2711 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
2712 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 2713 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 2714
7dbda6df
JB
27152011-12-05 Juanma Barranquero <lekktu@gmail.com>
2716
2717 * lisp.h (process_quit_flag): Fix external declaration.
2718
6d5eb5b0
SM
27192011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
2720
2721 Don't macro-inline non-performance-critical code.
2722 * eval.c (process_quit_flag): New function.
2723 * lisp.h (QUIT): Use it.
2724
a0c3fad0
JD
27252011-12-04 Jan Djärv <jan.h.d@swipnet.se>
2726
2727 * nsfns.m (get_geometry_from_preferences): New function.
2728 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
2729
6c07aac2
AS
27302011-12-04 Andreas Schwab <schwab@linux-m68k.org>
2731
2732 * emacs.c (Qkill_emacs): Define.
2733 (syms_of_emacs): Initialize it.
2734 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
2735 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
2736 (quit_throw_to_read_char): Add parameter `from_signal'.
2737 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
2738 * lisp.h (QUIT): Call Fkill_emacs if requested.
2739
c052ead4
JD
27402011-12-03 Jan Djärv <jan.h.d@swipnet.se>
2741
2742 * widget.c (update_wm_hints): Return if wmshell is null.
2743 (widget_update_wm_size_hints): New function.
2744
2745 * widget.h (widget_update_wm_size_hints): Declare.
2746
2747 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
2748 widget_update_wm_size_hints (Bug#10104).
2749
9e49252b
EZ
27502011-12-03 Eli Zaretskii <eliz@gnu.org>
2751
2752 * xdisp.c (handle_invisible_prop): If the invisible text ends just
2753 before a newline, prepare the bidi iterator for consuming the
2754 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 2755 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 2756
02b16839
JL
27572011-12-02 Juri Linkov <juri@jurta.org>
2758
2759 * search.c (Fword_search_regexp): New Lisp function created from
2760 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
2761 (Fword_search_backward, Fword_search_forward)
2762 (Fword_search_backward_lax, Fword_search_forward_lax):
2763 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
2764 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
2765
0068070e
SM
27662011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
2767
2768 * fileio.c (Finsert_file_contents): Move after-change-function call
2769 to before the "handled:" label, since all "goto handled" appear in
2770 cases where the *-change-functions have already been properly called
2771 (bug#10117).
2772
3360a3fc
AS
27732011-12-01 Andreas Schwab <schwab@linux-m68k.org>
2774
2775 * keyboard.c (interrupt_signal): Don't call kill-emacs when
2776 waiting for input. (Bug#10169)
2777
73d6c093
EZ
27782011-11-30 Eli Zaretskii <eliz@gnu.org>
2779
2780 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
2781 verifies glyph row's hash code--we have just reallocated the
2782 glyphs, so their contents can be complete garbage. (Bug#10164)
2783
febe6bea
JB
27842011-11-30 Juanma Barranquero <lekktu@gmail.com>
2785
2786 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
2787
801a4313
EZ
27882011-11-30 Eli Zaretskii <eliz@gnu.org>
2789
2790 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
2791 attributes are tested _before_ calling verify_row_hash, to protect
2792 against GCC re-ordering of the tests. (Bug#10164)
2793
2b56b87e
JD
27942011-11-29 Jan Djärv <jan.h.d@swipnet.se>
2795
2796 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
2797
2798 * xterm.c (handle_one_xevent): Only set async_visible and friends
2799 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 2800 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
2801 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2802
dbf31225
PE
28032011-11-28 Paul Eggert <eggert@cs.ucla.edu>
2804
2805 Remove GCPRO-related macros that exist only to avoid shadowing locals.
2806 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
2807 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
2808 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2809 All uses changed to use GCPRO1 etc.
2810 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
2811 Revert to old implementation (i.e., before 2011-03-11).
2812
1305621b
YM
28132011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2814
2815 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
2816 of scroll runs so as to avoid assigning disabled bogus rows and
2817 unnecessary graphics copy operations.
2818
8c9afb46
EZ
28192011-11-27 Eli Zaretskii <eliz@gnu.org>
2820
2821 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
2822 (snprintf) [_MSC_VER]: Redirect to _snprintf.
2823 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
2824 (malloc, free, realloc, calloc): Redirect to e_* only when
2825 compiling Emacs.
2826
2827 * lisp.h (GCTYPEBITS): Move before first use.
2828 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
2829 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
2830 this macro definition.
2831
2832 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
2833 _MSC_VER.
2834
54e9e3bf
JD
28352011-11-27 Jan Djärv <jan.h.d@swipnet.se>
2836
6d5eb5b0
SM
2837 * gtkutil.c (xg_create_frame_widgets):
2838 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
2839 present with Gtk+ 2.0.
2840
83aca1cb
PE
28412011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2842
2843 * fileio.c (Finsert_file_contents): Undo previous change; see
2844 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2845
5b76caa4
PE
28462011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 Rename locals to avoid shadowing.
2849 * fileio.c (Finsert_file_contents):
2850 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
2851 * process.c (wait_reading_process_output):
2852 Rename inner 'proc' to 'p' to avoid shadowing.
2853 Indent for consistency with usual Emacs style.
2854
8c535114
EZ
28552011-11-25 Eli Zaretskii <eliz@gnu.org>
2856
2857 * xdisp.c (redisplay_window): If cursor row is not fully visible
2858 after recentering, and scroll-conservatively is set to a large
2859 number, scroll window by a few more lines to make the cursor fully
2860 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
2861 (start_display): Don't move to the next line if the display should
2862 start at a newline that is part of a display vector or an overlay
2863 string. (Bug#10119)
8c535114 2864
fa4fdb5c
JL
28652011-11-24 Juri Linkov <juri@jurta.org>
2866
2867 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
2868 after the `MagickPingImage' call. (Bug#10112)
2869
90ec88df
CY
28702011-11-23 Chong Yidong <cyd@gnu.org>
2871
2872 * window.c (Fcoordinates_in_window_p): Accept only live windows.
2873
56e2e794
MR
28742011-11-23 Martin Rudalics <rudalics@gmx.at>
2875
2876 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
2877 making another buffer current. (Bug#10114)
2878
b6e64c41
GM
28792011-11-23 Glenn Morris <rgm@gnu.org>
2880
2881 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
2882
6b21de18
CY
28832011-11-23 Chong Yidong <cyd@gnu.org>
2884
2885 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
2886 using it (Bug#5984).
2887
b12cd789
EZ
28882011-11-22 Eli Zaretskii <eliz@gnu.org>
2889
2890 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
2891 and header-lines, as they don't have one computed for them.
2892 (Bug#10098)
2893
2894 * .gdbinit (prow): Make displayed values more self-explaining.
2895 Add row's hash code.
2896
261b6fd4
LMI
28972011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2898
2899 * process.c (wait_reading_process_output): Fix asynchrounous
2900 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 2901 (wait_reading_process_output): Add comment and URL.
261b6fd4 2902
e7cfd277
JD
29032011-11-21 Jan Djärv <jan.h.d@swipnet.se>
2904
2905 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
2906
a9b9b7f5
CY
29072011-11-21 Chong Yidong <cyd@gnu.org>
2908
2909 * window.c (Fnext_window, Fprevious_window): Doc fix.
2910
b0d15b4f
SM
29112011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2912
2913 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
2914
fe7a3057
JB
29152011-11-20 Juanma Barranquero <lekktu@gmail.com>
2916
2917 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
2918
d2999b1a
MR
29192011-11-20 Martin Rudalics <rudalics@gmx.at>
2920
2921 * window.c (Fset_window_combination_limit): Rename argument
2922 STATUS to LIMIT.
2923 (Vwindow_combination_limit): Remove "status" from doc-string.
2924
d5ff9cd0
AS
29252011-11-20 Andreas Schwab <schwab@linux-m68k.org>
2926
2927 * m/ibms390.h: Remove.
2928 * m/ibms390x.h: Don't include "ibms390.h".
2929
a5bb9bd3
SM
29302011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2931
2932 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
2933 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
2934
cd1181db
JB
29352011-11-20 Juanma Barranquero <lekktu@gmail.com>
2936
2937 * casetab.c (Fset_case_table):
2938 * charset.c (Fcharset_after): Fix typos.
2939
615a3b8d 29402011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 2941
17e845af
PE
2942 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
2943 Otherwise, valgrind does not work on some platforms.
2944 Problem reported by Andreas Schwab in
6a0bf43d
PE
2945 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
2946 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
2947 is set, removing the need for VIRT_ADDRESS_VARIES.
2948 (PURE_P): Use a more-efficient implementation that needs just one
2949 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
2950 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
2951 to 4 (xorl, subq, cmpq, setbe).
2952 * alloc.c (pure): Always extern now, since that's the
2953 VIRT_ADDR_VARIES behavior.
2954 (PURE_POINTER_P): Use a single comparison, not two, for
2955 consistency with the new puresize.h.
2956 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
2957 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
2958 Remove VIRT_ADDR_VARIES no longer needed.
2959
f8fe6f96
EZ
29602011-11-19 Eli Zaretskii <eliz@gnu.org>
2961
2962 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
2963 (erase_phys_cursor, update_window_cursor, show_mouse_face)
2964 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
2965 behave as if the cursor position were at the window margin.
2966
2967 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
2968 and the cursor position is out of bounds, behave as if the cursor
2969 position were at the window margin. (Bug#10075)
2970
df05a53c
CY
29712011-11-18 Chong Yidong <cyd@gnu.org>
2972
2973 * window.c (Fwindow_combination_limit): Make first argument
2974 non-optional, since it is meaningless for live windows like the
2975 selected window.
61ccba97 2976
2071918e
DA
29772011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
2978
2979 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
2980
b50a28de
SM
29812011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2982
2983 * intervals.c: Fix grafting over the whole buffer (bug#10071).
2984 (graft_intervals_into_buffer): Simplify.
2985
015137db
EZ
29862011-11-18 Eli Zaretskii <eliz@gnu.org>
2987
2988 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2989 hash values of the two rows.
2990 (copy_row_except_pointers): Preserve the used[] arrays and the
2991 hash values of the two rows. (Bug#10035)
68c95424 2992 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
2993
2994 * xdisp.c (row_hash): New function, body extracted from
2995 compute_line_metrics.
2996 (compute_line_metrics): Call row_hash, instead of computing the
2997 hash code inline.
2998
2999 * dispnew.c (verify_row_hash): Call row_hash for computing the
3000 hash code of a row, instead of duplicating code from xdisp.c.
3001
3002 * dispextern.h (row_hash): Add prototype.
3003
a2addb04
TH
30042011-11-18 Tassilo Horn <tassilo@member.fsf.org>
3005
3006 * frame.c (delete_frame): Don't delete the terminal when the last
3007 X frame is closed if emacs is built with GTK toolkit.
3008
df85d315
JB
30092011-11-17 Juanma Barranquero <lekktu@gmail.com>
3010
3011 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
3012
a0c2d0ae
MR
30132011-11-17 Martin Rudalics <rudalics@gmx.at>
3014
3015 * window.c (Vwindow_splits): Rename to
3016 Vwindow_combination_resize. Suggested by Juri Linkov.
3017 (Fsplit_window_internal): Use Vwindow_combination_resize instead
3018 of Vwindow_splits.
3019
58179cce
JB
30202011-11-16 Juanma Barranquero <lekktu@gmail.com>
3021
7877f373
JB
3022 * nsfns.m (Fns_font_name):
3023 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 3024
b6f67890
MR
30252011-11-16 Martin Rudalics <rudalics@gmx.at>
3026
3027 * window.h (window): Rename slot "nest" to "combination_limit".
3028 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
3029 (Fset_window_nest): Rename to Fset_window_combination_limit.
3030 (Vwindow_nest): Rename to Vwindow_combination_limit.
3031 (recombine_windows, make_parent_window, make_window)
3032 (Fsplit_window_internal, saved_window)
3033 (Fset_window_configuration, save_window_save): Rename all
3034 occurrences of window_nest to window_combination_limit.
3035
c7015153
JB
30362011-11-15 Juanma Barranquero <lekktu@gmail.com>
3037
3038 * image.c (imagemagick_load_image): Fix typo.
3039
322ad6ec
EZ
30402011-11-14 Eli Zaretskii <eliz@gnu.org>
3041
3042 * xdisp.c (display_line): Move the call to
3043 highlight_trailing_whitespace before the call to
3044 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
3045 faces of all the glyphs to compute ROW's hash value.
3046 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 3047
f067b8ec
JB
30482011-11-14 Juanma Barranquero <lekktu@gmail.com>
3049
3050 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
3051 just return (bug#10044).
3052
1e5b2111
EZ
30532011-11-12 Eli Zaretskii <eliz@gnu.org>
3054
7ef3cbd5
EZ
3055 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
3056 with user-defined heap size. Bump the default size of the temacs
3057 heap to 27MB, to avoid memory warning when running temacs.
3058 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
3059
1e5b2111
EZ
3060 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
3061 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
3062 (verify_row_hash) [XASSERTS]: New function.
3063 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
3064 that the hash value of glyph rows is correct.
1e5b2111 3065
89d61221
MR
30662011-11-12 Martin Rudalics <rudalics@gmx.at>
3067
3068 * window.h (window): Remove splits slot.
3069 * window.c (Fwindow_splits, Fset_window_splits): Remove.
3070 (Fdelete_other_windows_internal, make_parent_window)
3071 (make_window, Fsplit_window_internal, Fdelete_window_internal)
3072 (Fset_window_configuration, save_window_save): Don't deal with
3073 split status of windows.
3074 (saved_window): Remove splits slot.
3075 (Vwindow_splits): Rewrite doc-string.
3076
97f18cc8
JD
30772011-11-11 Jan Djärv <jan.h.d@swipnet.se>
3078
3079 * xfns.c (unwind_create_frame):
3080 * nsfns.m (unwind_create_frame):
3081 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
3082 Vframe_list (Bug#9999).
3083
22a648b4
DA
30842011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
3085
0b381c7e 3086 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 3087
659afede
KH
30882011-11-11 Kenichi Handa <handa@m17n.org>
3089
3090 * callproc.c (Fcall_process): Set the member dst_multibyte of
3091 process_coding.
3092
9ac0394b
KH
30932011-11-11 Johan Bockgård <bojohan@gnu.org>
3094
3095 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
3096 avoid a crash (bug#9496).
3097
2fbdc249
CY
30982011-11-09 Chong Yidong <cyd@gnu.org>
3099
3100 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3101 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
3102
ac6b1f81
PE
31032011-11-08 Paul Eggert <eggert@cs.ucla.edu>
3104
3105 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
3106
09db192c
PE
31072011-11-08 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 Avoid some portability problems by eschewing 'extern inline' functions.
3110 The trivial performance wins aren't worth the portability hassles; see
3111 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
3112 et seq.
3113 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
3114 (window_box_width, window_box_left, window_box_left_offset)
3115 (window_box_right, window_box_right_offset): Undo previous change,
3116 by removing the "extern"s.
3117 * intervals.c (adjust_intervals_for_insertion)
3118 (adjust_intervals_for_deletion): Undo previous change,
3119 making these static again.
3120 (offset_intervals, temp_set_point_both, temp_set_point)
3121 (copy_intervals_to_string): No longer inline.
3122 * xdisp.c (window_text_bottom_y, window_box_width)
3123 (window_box_height, window_box_left_offset)
3124 (window_box_right_offset, window_box_left, window_box_right)
3125 (window_box): No longer inline.
3126
105216ed
CY
31272011-11-08 Chong Yidong <cyd@gnu.org>
3128
3129 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
3130 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
3131 Signal an error if not a live window.
105216ed
CY
3132 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
3133 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
3134
ae9e237f
JB
31352011-11-07 Juanma Barranquero <lekktu@gmail.com>
3136
3137 * lisp.h (syms_of_abbrev): Remove declaration.
3138 Reported by CHENG Gao <chenggao@royau.me>.
3139
c7aa8333
EZ
31402011-11-07 Eli Zaretskii <eliz@gnu.org>
3141
3142 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
3143 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
3144 of temacs in GUI mode.
3145
be7f5545
MR
31462011-11-07 Martin Rudalics <rudalics@gmx.at>
3147
3148 * window.h: Declare delete_all_child_windows instead of
3149 delete_all_subwindows.
3150 * window.c (Fwindow_nest, Fset_window_nest)
3151 (Fset_window_new_total, Fset_window_new_normal)
3152 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
3153 (delete_all_subwindows): Rename to delete_all_child_windows.
3154 (Fdelete_other_windows_internal, Fset_window_configuration):
3155 Call delete_all_child_windows instead of delete_all_subwindows.
3156 * frame.c (delete_frame): Call delete_all_child_windows instead
3157 of delete_all_subwindows.
3158
ca78dc43
PE
31592011-11-07 Paul Eggert <eggert@cs.ucla.edu>
3160
3161 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
3162 This is also needed for porting to any host where GC_MARK_STACK is
3163 not GC_MAKE_GCPROS_NOOPS.
3164 (which_symbols): Use it.
3165
a0241d01
KH
31662011-11-07 Kenichi Handa <handa@m17n.org>
3167
3168 * coding.c (coding_set_destination): Check coding->src_pos only
3169 when coding->src_object is a buffer (bug#9910).
3170
3171 * process.c (send_process): Set the member src_multibyte of coding
3172 to 0 (bug#9911) when sending a unibyte text.
3173
3174 * callproc.c (Fcall_process): Set the member src_multibyte of
3175 process_coding to 0 (bug#9912).
3176
a64bfdfa 31772011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
3178
3179 * xmenu.c (cleanup_widget_value_tree): New function.
3180 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
3181 calling free_menubar_widget_value_tree directly (Bug#9830).
3182
cb41b32a
PE
31832011-11-06 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 Fix some portability problems with 'inline'.
3186 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
3187 (window_box_width, window_box_left, window_box_left_offset)
3188 (window_box_right, window_box_right_offset): Declare extern.
3189 Otherwise, these inline functions do not conform to C99 and
3190 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
3191 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
3192 * intervals.c (adjust_intervals_for_insertion)
3193 (adjust_intervals_for_deletion): Now extern, because otherwise the
3194 extern inline functions 'offset_intervals' couldn't refer to it.
3195 (static_offset_intervals): Remove.
3196 (offset_intervals): Rewrite using the old contents of
3197 static_offset_intervals. The old version didn't conform to C99
3198 because an extern inline function contained a reference to an
3199 identifier with static linkage.
3200
b7041366
AS
32012011-11-06 Andreas Schwab <schwab@linux-m68k.org>
3202
3203 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
3204 GC.
3205
88a37c4d
EZ
32062011-11-06 Eli Zaretskii <eliz@gnu.org>
3207
3208 * xdisp.c (init_iterator, reseat_to_string): Don't set the
3209 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
3210 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
3211 return Qleft_to_right.
3212
49745b39
CY
32132011-11-06 Chong Yidong <cyd@gnu.org>
3214
3215 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
3216 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
3217 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
3218 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
3219 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
3220 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
3221 (Fwindow_vscroll): Doc fix.
3222 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
3223 argument, since it makes no sense to pass a live window and for
3224 consistency with window-child.
3225
1f05cd82
CS
32262011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
3227
3228 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
3229 support MSVC.
3230
22610910
JR
32312011-11-05 Jason Rumney <jasonr@gnu.org>
3232
3233 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
3234 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
3235 fonts (Bug#6029).
3236 (add_font_entity_to_list): Fix logic errors in mixed boolean and
3237 bitwise arithmetic preventing use of unicode-sip and non-truetype
3238 opentype fonts.
3239
a06776b2
EZ
32402011-11-05 Eli Zaretskii <eliz@gnu.org>
3241
3ad924ba
EZ
3242 * s/ms-w32.h (fstat, stat, utime): Move redirections to
3243 "emacs"-only part.
3244
a06776b2
EZ
3245 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
3246 initialization code to keep similarity to xfns.c after changes
3247 from 2011-11-05.
3248
c9e7db78
JD
32492011-11-05 Jan Djärv <jan.h.d@swipnet.se>
3250
a97f8f3f
JD
3251 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
3252 (unwind_create_frame): New function (Bug#9943).
3253 (Fx_create_frame): Restructure code to be more similar to the one in
3254 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
3255 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
3256 Move terminal->reference_count++ just before making the frame official
3257 (Bug#9943).
3258
3259 * nsterm.m (x_free_frame_resources): New function.
3260 (x_destroy_window): Move code to x_free_frame_resources.
3261
c9e7db78 3262 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
3263 (Fx_create_frame, x_create_tip_frame):
3264 Move terminal->reference_count++ just before making the frame
75f1671a 3265 official. Move initialization of image_cache_refcount and
c9e7db78
JD
3266 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
3267
a6fc3b5c
EZ
32682011-11-05 Eli Zaretskii <eliz@gnu.org>
3269
3270 Support MSVC build with newer versions of Visual Studio.
3271 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
3272 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
3273 nt/gmake.defs.
3274
3275 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
3276 which are not supported by MSVC.
3277 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
3278 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
3279 bitfields.
3280 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
3281 types in bitfields.
3282 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
3283
3284 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
3285
58179cce 32862011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
3287
3288 Support MSVC build with newer versions of Visual Studio.
3289 * w32.c: Don't include w32api.h for MSVC.
3290 (init_environment) [_MSC_VER]: Call sys_access, not _access.
3291
3292 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
3293 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
3294 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
3295 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
3296 e_* cousins.
3297 (alloca) [_MSC_VER]: Define to _alloca.
3298
3299 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
3300
3301 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
3302
a58c13ed
EZ
33032011-11-04 Eli Zaretskii <eliz@gnu.org>
3304
3305 * xdisp.c (note_mouse_highlight): If either of
3306 previous/next-single-property-change returns nil, treat that as
3307 the beginning or the end of the buffer. (Bug#9955)
3308
fe0b6370
JD
33092011-11-04 Jan Djärv <jan.h.d@swipnet.se>
3310
a58c13ed 3311 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
3312 label is not null (Bug#9951).
3313 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
3314 may be NULL.
3315
89bd5ee1
EZ
33162011-11-04 Eli Zaretskii <eliz@gnu.org>
3317
3318 * window.c (Fwindow_body_size): Mention in the doc string that the
3319 return value is in frame's canonical units. (Bug#9949)
3320
84c3edb9
EZ
33212011-11-03 Eli Zaretskii <eliz@gnu.org>
3322
4e2fb5c7
EZ
3323 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
3324
84c3edb9 3325 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 3326 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 3327 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 3328
bc17a887
EZ
33292011-11-01 Eli Zaretskii <eliz@gnu.org>
3330
3331 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
3332 Don't stop backward scan on the continuation glyph, even though
3333 its CHARPOS is positive.
6d5eb5b0
SM
3334 (mouse_face_from_buffer_pos, note_mouse_highlight):
3335 Rename cover_string to disp_string.
bc17a887 3336
4ee88440
MR
33372011-11-01 Martin Rudalics <rudalics@gmx.at>
3338
3339 * window.c (temp_output_buffer_show): Don't use
3340 Vtemp_buffer_show_specifiers.
3341 (Vtemp_buffer_show_specifiers): Remove unused variable.
3342
c2ff3c02
EZ
33432011-10-30 Eli Zaretskii <eliz@gnu.org>
3344
3345 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
3346 past the beginning of the current glyph matrix.
3347
58179cce 33482011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
3349
3350 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
3351 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
3352 HAVE_GTK3 (Bug#9869).
b77a6a7f 3353
3b574623
JD
3354 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
3355 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
3356
b77a6a7f
JD
3357 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
3358
3359 * xterm.c: Declare x_handle_net_wm_state to return int.
3360 (handle_one_xevent): Check if we are iconified but don't have
3361 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
3362 (get_current_wm_state): Return non-zero if not hidden,
3363 check for _NET_WM_STATE_HIDDEN (Bug#9893).
3364 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
3365 (x_handle_net_wm_state): Return what get_current_wm_state returns.
3366 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
3367
196e41e4
PE
33682011-10-29 Paul Eggert <eggert@cs.ucla.edu>
3369
3370 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
3371 so that this new function doesn't get optimized away by a
3372 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
3373
021f2e1a
AS
33742011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3375
3376 * frame.h (MOUSE_HL_INFO): Remove excess parens.
3377
8b058d44
EZ
33782011-10-29 Eli Zaretskii <eliz@gnu.org>
3379
3380 Fix the `xbytecode' command.
3381 * .gdbinit (xprintbytestr): New command.
b50a28de 3382 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
3383 (xbytecode): Print the byte-code string as well.
3384
4452fb80
EZ
33852011-10-29 Kim Storm <storm@cua.dk>
3386
8b058d44
EZ
3387 * alloc.c (which_symbols): New function.
3388
21b72067
AS
33892011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3390
3391 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
3392 line. (Bug#9903)
3393
83ed7b5c
GM
33942011-10-29 Glenn Morris <rgm@gnu.org>
3395
3396 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
3397 Not clear what it was for, and it causes various bugs. (Bug#9839)
3398
5a7a728b
EZ
33992011-10-28 Eli Zaretskii <eliz@gnu.org>
3400
3401 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
3402 possible random value that matches one of those tested as
3403 condition to clear the mouse face.
3404
d3d0842f
CY
34052011-10-28 Chong Yidong <cyd@gnu.org>
3406
3407 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
3408
31b39d13
DN
34092011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
3410
3411 * window.c (make_window): Initialize phys_cursor_on_p.
3412
9aba6043
SM
34132011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3414
3415 * lisp.h (struct Lisp_Symbol): Update comments.
3416
c20992f4
JB
34172011-10-28 Juanma Barranquero <lekktu@gmail.com>
3418
3419 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
3420
db4f02f2
EZ
34212011-10-28 Eli Zaretskii <eliz@gnu.org>
3422
3423 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
3424 <oslsachem@gmail.com> for helping to debug this.
3425
3426 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
3427 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
3428 (g_b_init_get_glyph_outline_w): New static variables.
3429 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
3430 (GetGlyphOutlineW_Proc): New typedefs.
3431 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
3432 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
3433 New functions.
3434 (w32font_open_internal, compute_metrics):
3435 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
3436 instead of calling the "wide" APIs directly.
3437
3438 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
3439
3440 * w32.h (syms_of_w32font): Add prototype.
3441
87e68db4
JB
34422011-10-27 Juanma Barranquero <lekktu@gmail.com>
3443
3444 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
3445 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
3446 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
3447 (Fmove_to_window_line): Doc fix.
3448
435c1d67
CY
34492011-10-27 Chong Yidong <cyd@gnu.org>
3450
3451 * process.c (make_process): Set gnutls_state to NULL.
3452
3453 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
3454 non-NULL, regardless of GNUTLS_INITSTAGE.
3455 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
3456 an error. Set process slots as soon as we allocate them.
3457
3458 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
3459
9c6c6f49
CY
34602011-10-27 Chong Yidong <cyd@gnu.org>
3461
9aba6043
SM
3462 * gnutls.c (emacs_gnutls_deinit): New function.
3463 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
3464 (Fgnutls_deinit, Fgnutls_boot): Use it.
3465
3466 * process.c (make_process): Initialize GnuTLS credentials to NULL.
3467 (deactivate_process): Call emacs_gnutls_deinit.
3468
657d08d3
JB
34692011-10-27 Juanma Barranquero <lekktu@gmail.com>
3470
3471 * image.c (x_create_x_image_and_pixmap):
3472 * w32.c (sys_rename, w32_delayed_load):
3473 * w32font.c (fill_in_logfont):
3474 * w32reg.c (x_get_string_resource): Silence compiler warnings.
3475
5430d399
JB
34762011-10-26 Juanma Barranquero <lekktu@gmail.com>
3477
3478 * w32fns.c (w32_default_color_map): New function,
3479 extracted from Fw32_default_color_map.
a7ef684b 3480 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 3481
fe0055fa
PE
34822011-10-25 Paul Eggert <eggert@cs.ucla.edu>
3483
3484 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
3485
e6346438
SM
34862011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
3487
3488 * keyboard.c (test_undefined): New function (bug#9751).
3489 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
3490
e112cc37
ET
34912011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
3492
3493 * sysdep.c (init_sys_modes): Fix the check for the controlling
3494 terminal (Bug#6649).
3495
7b5d6677
EZ
34962011-10-20 Eli Zaretskii <eliz@gnu.org>
3497
3498 * dispextern.h (struct bidi_it): New member next_en_type.
3499
3500 * bidi.c (bidi_line_init): Initialize the next_en_type member.
3501 (bidi_resolve_explicit_1): When next_en_pos is valid for the
3502 current character, check also for next_en_type being WEAK_EN.
3503 (bidi_resolve_weak): Don't enter the expensive loop if the current
3504 position is before next_en_pos. Record the bidi type of the first
3505 non-ET, non-BN character we find, in addition to its position.
3506 (bidi_level_of_next_char): Invalidate next_en_type when
3507 next_en_pos is over-stepped.
3508
7da0b018
PE
35092011-10-20 Paul Eggert <eggert@cs.ucla.edu>
3510
3511 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
3512 * editfns.c: Rewrite current-time-zone so that it invokes
3513 the equivalent of (format-time-string "%Z") to get the time zone name.
3514 This fixes a bug when the time zone name contains characters that
3515 need converting from the system time locale to Emacs internal format.
3516 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
3517 that patch fixed format-time-string to do the conversion, but
3518 I forgot to fix current-time-zone.
3519 (format_time_string): New function, containing most of
3520 what Fformat_time_string used to contain.
3521 (Fformat_time_string): Rewrite in terms of format_time_string.
3522 This doesn't change this function's behavior.
3523 (current-time-zone): Rewrite to use format_time_string.
3524 This fixes the bug reported by Michael Schierl in
3525 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
3526 Jason Rumney's 2007-06-07 change worked around this bug, but
3527 didn't fix it.
3528 * systime.h (tzname, timezone): Remove no-longer-used declarations.
3529
8547b010
EZ
35302011-10-19 Eli Zaretskii <eliz@gnu.org>
3531
3532 * xdisp.c (start_display): If the character at POS is displayed
3533 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
3534 (try_window_reusing_current_matrix): If a line ends in a display
3535 vector or the next line starts in a display vector, continue
3536 redrawing the window even though the character position of
3537 start_row was reached.
8547b010
EZ
3538 (Bug#9771, part 2)
3539
4e948d15
CY
35402011-10-18 Chong Yidong <cyd@gnu.org>
3541
3542 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
3543 with nobreak-char-display too.
3544
4787455f
EZ
35452011-10-18 Eli Zaretskii <eliz@gnu.org>
3546
3547 Fix part 3 of bug#9771.
3548 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
3549 (bidi_resolve_neutral): Don't enter the expensive loop looking for
3550 non-neutral characters if the current character is a paragraph
3551 separator (a.k.a. Newline). This avoids running the same
3552 expensive loop twice, once when we consume the preceding newline
3553 and the other time when the line actually needs to be displayed.
3554 Avoid the loop when we see neutrals on the base embedding level
3555 following a character whose directionality is the same as the
3556 paragraph's. This avoids running the expensive loop when a line
3557 ends in a long sequence of neutrals, like control characters.
3558 Add assertion against STRONG_AL type. Slightly rearrange code
3559 that determines the type of a neutral given the first non-neutral
3560 that follows it.
3561 (bidi_level_of_next_char): Set next_en_pos to zero when
3562 invalidating its info.
3563
2c91f553
EZ
35642011-10-17 Eli Zaretskii <eliz@gnu.org>
3565
3566 * xdisp.c (push_display_prop): Determine whether to record string
3567 or buffer position by IT->string, not by IT->method. Allow
3568 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
3569 (move_it_vertically_backward): Don't look for character position
3570 immediately after the newline when in a continuation line.
3571 (Bug#9771, part 1)
2c91f553 3572
c7b08b0d
MR
35732011-10-15 Martin Rudalics <rudalics@gmx.at>
3574
3575 * window.c (coordinates_in_window): Rewrite and delabelize
3576 vertical border check. (Bug#5357) (Bug#9618)
3577
6b02f655
SM
35782011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
3579
3580 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
3581 errors in XSetWindowBorder (bug#9310).
3582
81d40c92
DA
35832011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
3584
3585 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
3586 avoid crash when xmalloc overrun checking is enabled.
3587
d4172c3b
EZ
35882011-10-13 Eli Zaretskii <eliz@gnu.org>
3589
3590 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
3591 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
3592 cursor motion with <left> and <right> arrow keys.
3593
3594 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
3595 some callers set that themselves.
3596
b00eea75
EZ
35972011-10-12 Eli Zaretskii <eliz@gnu.org>
3598
3599 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
3600 display string and the previous row comes from the same string and
3601 is empty. (Bug#9739) (Bug#9738)
3602
8fe012c4
SM
36032011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3604
3605 * doc.c (get_doc_string): Encode file name (bug#9735).
3606
0074aef2
EZ
36072011-10-12 Eli Zaretskii <eliz@gnu.org>
3608
79beb178
EZ
3609 * bidi.c (bidi_level_of_next_char):
3610 * xdisp.c (get_visually_first_element): Remove old incorrect
3611 comments regarding the Unicode Line Separator character.
3612
0074aef2
EZ
3613 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
3614
6e4b3fbe
DA
36152011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
3616
3617 * alloc.c (Fgc_status): Do not access beyond zombies array
3618 boundary if nzombies > MAX_ZOMBIES.
3619 * alloc.c (dump_zombies): Add missing format specifier.
3620
0324f3af
PE
36212011-10-12 Paul Eggert <eggert@cs.ucla.edu>
3622
b5525cac
PE
3623 * xdisp.c (set_cursor_from_row): Simplify conditionals,
3624 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
3625
0324f3af
PE
3626 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
3627 Some packages use them to denote characters with modifiers.
3628
e9b5f888
AS
36292011-10-11 Andreas Schwab <schwab@linux-m68k.org>
3630
3631 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
3632 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
3633 matching a pp-number. Rename parameter var to var1.
3634
127827c0
SM
36352011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3636
3637 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
3638
c8fd3bd0
GM
36392011-10-08 Glenn Morris <rgm@gnu.org>
3640
3641 * callint.c (Fcall_interactively): Give a more explicit error for the
3642 'c' case with a non-character input. (Bug#8479)
3643
352ec8ff
EZ
36442011-10-08 Eli Zaretskii <eliz@gnu.org>
3645
03669ccb
EZ
3646 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
3647 lines.
7061c986
EZ
3648 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
3649 lines that are hscrolled on the left.
03669ccb 3650
352ec8ff
EZ
3651 * dispnew.c (buffer_posn_from_coords): Account for a possible
3652 presence of header-line. (Bug#4426)
3653
a66cfb1c
SM
36542011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
3655
6b02f655
SM
3656 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
3657 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 3658
7c5ee88e
PE
36592011-10-07 Paul Eggert <eggert@cs.ucla.edu>
3660
3661 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
3662 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
3663 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
3664 this makes Emacs dump core during garbage collection on rare
3665 occasions. sizeof is obviously inferior to offsetof here, so
3666 stick with offsetof.
3667 (GC_POINTER_ALIGNMENT): New macro.
3668 (mark_memory): Omit 3rd (offset) arg; caller changed.
3669 Don't assume EMACS_INT alignment is the same as pointer alignment.
3670
df1bbe5b
SM
36712011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
3672
3673 * keyboard.c (read_key_sequence_remapped): New var.
3674 (read_key_sequence): Compute remapping in the right buffer.
3675 (command_loop_1): Use read_key_sequence's remapping directly.
3676
51553db6
SM
36772011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3678
32c1fffd
SM
3679 * dired.c (file_name_completion): Don't expand file name.
3680 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
3681 before checking file name handler.
3682
51553db6
SM
3683 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
3684 they've been requested explicitly (bug#9591).
3685
b6bd1599 36862011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
3687
3688 * keymap.c (Fsingle_key_description): Use make_specified_string
3689 instead of build_string to build string from push_key_description.
3690 (Bug#5193)
3691
f701dc2a
PE
36922011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3693
4222c55d
PE
3694 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
3695 This fixes a Y2038 bug on 64-bit hosts.
3696 * buffer.c (reset_buffer):
3697 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
3698 (Fclear_buffer_auto_save_failure):
3699 Use 0, not -1, to represent an unset failure time, since time_t
3700 might not be signed.
3701
f701dc2a
PE
3702 Remove dependency on glibc malloc internals.
3703 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3704 Move back here from lisp.h, but with their new implementations.
3705 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3706 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
3707 * charset.c (charset_table_init): New static var.
3708 (syms_of_charset): Use it instead of xmalloc. This removes a
3709 dependency on glibc malloc internals. See Eli Zaretskii's comment in
3710 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
3711 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3712 Move back to alloc.c.
3713 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3714 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
3715
9ceebf39
JD
37162011-09-30 Jan Djärv <jan.h.d@swipnet.se>
3717
3718 * nsterm.m (windowDidResize): Call x_set_window_size only when
3719 ns_in_resize is true. Otherwise set pixelwidth/height and
3720 call change_frame_size (Bug#9628).
3721
cb993c58
PE
37222011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3723
3930c88b
PE
3724 Port --enable-checking=all to Fedora 14 x86-64.
3725 * charset.c (syms_of_charset): Also account for glibc malloc's
3726 internal overhead when calculating the initial malloc maximum.
3727
cb993c58
PE
3728 Port --enable-checking=all to Fedora 14 x86.
3729 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3730 Move to lisp.h.
3731 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
3732 (overrun_check_realloc, overrun_check_free):
3733 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
3734 That way, xmalloc returns a properly-aligned pointer even if
3735 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
3736 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
3737 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
3738 into account when calculating the initial malloc maximum.
3739 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3740 Move here from alloc.c, so that charset.c can use it too.
3741 Properly align; the old code wasn't right for common 32-bit hosts
3742 when configured with --enable-checking=all.
3743 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3744 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
3745
31bed486
EZ
37462011-09-29 Eli Zaretskii <eliz@gnu.org>
3747
04c70788 3748 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
3749 use EDOM.
3750
fbcaa2f3
EZ
37512011-09-28 Eli Zaretskii <eliz@gnu.org>
3752
3753 * xdisp.c (compute_display_string_end): If there's no display
3754 string at CHARPOS, return -1.
3755
3756 * bidi.c (bidi_fetch_char): When compute_display_string_end
3757 returns a negative value, treat the character as a normal
3758 character not covered by a display string. (Bug#9624)
3759
a239d4e9
JB
37602011-09-28 Juanma Barranquero <lekktu@gmail.com>
3761
3762 * lread.c (Fread_from_string): Fix typo in docstring.
3763
88652fd5
EZ
37642011-09-27 Eli Zaretskii <eliz@gnu.org>
3765
3766 * xdisp.c (handle_invisible_prop): If invisible text ends on a
3767 newline, reseat the iterator instead of bidi-iterating there one
3768 character at a time. (Bug#9610)
32c1fffd
SM
3769 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
3770 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 3771
ed497dd4
AS
37722011-09-27 Andreas Schwab <schwab@linux-m68k.org>
3773
3774 * lread.c (readevalloop): Use correct code for NBSP.
3775 (read1): Likewise. (Bug#9608)
3776
b2bf61aa
MA
37772011-09-25 Michael Albinus <michael.albinus@gmx.de>
3778
3779 * dbusbind.c (Fdbus_register_signal): When service is not
3780 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
3781
32bbb17c
GM
37822011-09-25 Glenn Morris <rgm@gnu.org>
3783
3784 * buffer.c (truncate-lines): Doc fix.
3785
94e0933e
CY
37862011-09-24 Chong Yidong <cyd@stupidchicken.com>
3787
3788 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
3789 (Fset_window_next_buffers): Doc fix.
3790
cddde921
GM
37912011-09-24 Glenn Morris <rgm@gnu.org>
3792
3793 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
3794
1260aef1
PE
37952011-09-24 Paul Eggert <eggert@cs.ucla.edu>
3796
25b4bfa0
PE
3797 Fix minor problems found by static checking.
3798 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
3799 * indent.c (Fvertical_motion): Fix == vs = typo.
3800
e3cbd34b
EZ
38012011-09-24 Eli Zaretskii <eliz@gnu.org>
3802
a66cfb1c
SM
3803 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
3804 Default value is now t. Doc fix.
6bf7006f 3805
e3cbd34b 3806 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 3807 logic when moving up, not only when moving down. Fix the
e3cbd34b 3808 confusing name and values of the it_overshoot_expected variable;
32c1fffd 3809 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
3810
3811 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
3812 CHARPOS is covered by a display string which includes newlines.
3813 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
3814 is covered by a display string with embedded newlines.
3815
a3de0cbd
MA
38162011-09-24 Michael Albinus <michael.albinus@gmx.de>
3817
3818 * dbusbind.c (Fdbus_register_signal): Add match rule to
3819 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
3820 (Fdbus_register_method, Vdbus_registered_objects_table):
3821 Fix docstring.
a3de0cbd 3822
b260039d
JM
38232011-09-24 Jim Meyering <meyering@redhat.com>
3824
32c1fffd 3825 do not ignore write error for any output size
b260039d
JM
3826 The previous change was incomplete.
3827 While it makes emacs --batch detect the vast majority of stdout
3828 write failures, errors were still ignored whenever the output size is
3829 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
3830 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
3831 && echo FAIL: ignored write error
3832 FAIL: ignored write error
3833 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
3834 && echo FAIL: ignored write error
3835 FAIL: ignored write error
3836 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
3837
8eca8a7c
AS
38382011-09-23 Andreas Schwab <schwab@linux-m68k.org>
3839
3840 * emacs.c (Fkill_emacs): In noninteractive mode exit
3841 non-successfully if a write error occurred on stdout. (Bug#9574)
3842
3341db62
EZ
38432011-09-21 Eli Zaretskii <eliz@gnu.org>
3844
3845 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
3846 the xassert test.
3847
3848 * dispextern.h (struct it): Update the comment documenting what
3849 can it->OBJECT be.
3850
8c203dbf
EZ
38512011-09-20 Eli Zaretskii <eliz@gnu.org>
3852
3853 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
3854 a display string, extend search for cursor position to end of row.
3855 (find_row_edges): If the row ends in a newline from a display
3856 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
3857 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
3858 (Fcurrent_bidi_paragraph_direction): Fix search for previous
3859 non-empty line. Fixes confusing cursor motion with arrow keys at
3860 the beginning of a line that starts with whitespace.
8c203dbf 3861
a4824228
LMI
38622011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
3863
3864 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
3865 (bug#9493).
3866
33ed493b
CY
38672011-09-18 Chong Yidong <cyd@stupidchicken.com>
3868
3869 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
3870 boolean (Bug#9154).
3871
56cd55c8
EZ
38722011-09-18 Eli Zaretskii <eliz@gnu.org>
3873
3874 * xdisp.c (display_line): Record maximum and minimum buffer
3875 positions even if no glyphs were produced (e.g., by a zero-width
3876 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
3877 buffer positions that will be removed from the glyph row because
3878 they don't fit.
c02dcedf
EZ
3879 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
3880 column is beyond frame width: don't subtract 1 "pixel" when
3881 computing width of the stretch.
3e62b7e0
EZ
3882 (reseat_at_next_visible_line_start): Undo the change made on
3883 2011-09-17 that saved paragraph information and restored it after
3884 the call to `reseat'. (Bug#9545)
56cd55c8 3885
5ed99d36 38862011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
3887
3888 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
3889 and turn window cursor on if cleared (Bug#9415).
3890
5ed99d36 38912011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
3892
3893 * search.c (boyer_moore): Take unibyte characters from pattern
3894 literally. (Bug#9458)
3895
9bade7b2
EZ
38962011-09-18 Eli Zaretskii <eliz@gnu.org>
3897
3898 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
3899
e5e9d610
PE
39002011-09-18 Paul Eggert <eggert@cs.ucla.edu>
3901
87e4427a
PE
3902 Fix minor problem found by static checking.
3903 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
3904 initialized, to pacify gcc -Wuninitialized.
3905
e5e9d610
PE
3906 * fileio.c: Report proper errno when syscall falls.
3907 (Finsert_file_contents): Save and restore errno,
3908 so that report_file_error outputs the correct diagnostic.
3909 (Fwrite_region) [CLASH_DETECTION]: Likewise.
3910
a1674f0b
EZ
39112011-09-18 Eli Zaretskii <eliz@gnu.org>
3912
3913 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
3914
fbfb6dd4
EZ
39152011-09-17 Eli Zaretskii <eliz@gnu.org>
3916
3917 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
3918 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
3919
bb187662
EZ
39202011-09-17 Eli Zaretskii <eliz@gnu.org>
3921
1137e8b8 3922 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 3923 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
3924
3925 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
3926 (bidi_find_paragraph_start): Search back for paragraph beginning
3927 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
3928 (bidi_move_to_visually_next): Only trigger paragraph-related
3929 computations when the last character is a newline or at EOB, not
3930 just any NEUTRAL_B. (Bug#9470)
3931
bb187662
EZ
3932 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
3933 truncated lines if point is covered by a display string. (Bug#9524)
3934
2e621251
PE
39352011-09-16 Paul Eggert <eggert@cs.ucla.edu>
3936
3937 * xselect.c: Relax test for outgoing X longs (Bug#9498).
3938 (cons_to_x_long): New function.
3939 (lisp_data_to_selection_data): Use it. Correct the test for
3940 short-versus-long data; it was negated. Break out of vector
3941 loop, for efficiency, when a long datum is discovered.
3942
91a15bc6
SM
39432011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
3944
3945 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
3946
b41c3a35
EZ
39472011-09-16 Eli Zaretskii <eliz@gnu.org>
3948
3949 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
3950 GCC PR/17406) by declaring this function with external scope.
3951
7812ba2d
PE
39522011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3953
3954 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
3955 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
3956
cf7edc2a
AS
39572011-09-15 Andreas Schwab <schwab@linux-m68k.org>
3958
3959 * editfns.c (Fformat): Correctly handle text properties on "%%".
3960
bd01620e
EZ
39612011-09-15 Eli Zaretskii <eliz@gnu.org>
3962
3963 * xterm.c (x_draw_composite_glyph_string_foreground):
3964 * w32term.c (x_draw_composite_glyph_string_foreground):
3965 * term.c (encode_terminal_code):
3966 * composite.c (composition_update_it, get_composition_id):
3967 * xdisp.c (get_next_display_element)
3968 (fill_composite_glyph_string): Add comments about special meaning
3969 of TAB characters in a composition.
3970
a02719a3
PE
39712011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3972
3973 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
3974 This occurs when processing a multibyte format.
3975 Problem reported by Wolfgang Jenker.
a02719a3 3976
72589a3c
JB
39772011-09-15 Johan Bockgård <bojohan@gnu.org>
3978
3979 * xdisp.c (try_cursor_movement): Only check for exact match if
3980 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
3981
1c14176c
PE
39822011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3983
3984 Remove unused external symbols.
3985 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3986 * xdisp.c (calc_pixel_width_or_height): Now static.
3987 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3988 * indent.c (check_display_width):
3989 * w32term.c: Fix comment to match code.
3990 * xterm.c, xterm.h (x_catching_errors): Remove.
3991
d2eea5b5
PE
39922011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3993
3994 * xselect.c: Use signed conversions more consistently (Bug#9498).
3995 (selection_data_to_lisp_data): Assume incoming selection data are
3996 signed integers, not unsigned. This is to be consistent with
3997 outgoing selection data, which was modified to use signed integers
3998 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3999 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
4000 expects long, not unsigned long.
4001
46888499
EZ
40022011-09-14 Eli Zaretskii <eliz@gnu.org>
4003
4004 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
4005 computation of loop end. Reported by Johan Bockgård
4006 <bojohan@gnu.org>.
4007
ef8ef9fb
CY
40082011-09-13 Chong Yidong <cyd@stupidchicken.com>
4009
4010 * frame.c (Fother_visible_frames_p): Function deleted.
4011
fa819fed
EZ
40122011-09-12 Eli Zaretskii <eliz@gnu.org>
4013
4014 * indent.c (compute_motion): Process display vector front to back
4015 rather than the other way around. (Bug#2496)
4016
2ba8e008
SM
40172011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4018
4019 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
4020
20f53c69
CY
40212011-09-11 Chong Yidong <cyd@stupidchicken.com>
4022
4023 * minibuf.c (Fread_from_minibuffer): Doc fix.
4024
d562d7a4
EZ
40252011-09-11 Eli Zaretskii <eliz@gnu.org>
4026
4027 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
4028 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
4029
1c4d7f3d
LMI
40302011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4031
4032 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
4033 value for non-existent files.
4034
b885bf36
EZ
40352011-09-11 Eli Zaretskii <eliz@gnu.org>
4036
4037 * fileio.c (Finsert_file_contents): If the file cannot be opened,
4038 set its "size" to -1. This will set the modtime_size field of
4039 the corresponding buffer to -1, which is what
4040 verify-visited-file-modtime expects for files that do not exist.
4041 (Bug#9139)
4042
6612f0bf
PE
40432011-09-11 Paul Eggert <eggert@cs.ucla.edu>
4044
4045 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
4046 here ...
4047 * lisp.h: ... from here. push_key_description is no longer
4048 defined in keyboard.c, so its declaration should not be in
4049 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
4050 logically belongs with push_key_description.
4051
dfb3f755
PE
40522011-09-10 Paul Eggert <eggert@cs.ucla.edu>
4053
4054 * buffer.h: Include <sys/types.h> instead of <time.h>.
4055 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
4056 Problem reported by Herbert J. Skuhra.
4057
3134906c
LMI
40582011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
4059
4060 * xml.c (parse_region): Make the parsing work for
4061 non-comment-starting XML files again (bug#9144).
4062
8d903f4e
AS
40632011-09-10 Andreas Schwab <schwab@linux-m68k.org>
4064
4065 * image.c (gif_load): Fix calculation of bottom and right corner.
4066 (Bug#9468)
4067
80ad64f4
EZ
40682011-09-10 Eli Zaretskii <eliz@gnu.org>
4069
4070 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
4071 redisplay in small windows.
4072
208a048d
EZ
40732011-09-09 Eli Zaretskii <eliz@gnu.org>
4074
4075 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
4076
9b1c252e
MR
40772011-09-08 Martin Rudalics <rudalics@gmx.at>
4078
4079 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
4080 Operate on live windows only.
4081
2949f33b
JB
40822011-09-08 Juanma Barranquero <lekktu@gmail.com>
4083
4084 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
4085
e08dcafd
EZ
40862011-09-07 Eli Zaretskii <eliz@gnu.org>
4087
4088 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
4089 only under bidi iteration.
4090
115b96bd
JD
40912011-09-07 Jan Djärv <jan.h.d@swipnet.se>
4092
4093 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
4094
c8199d0f
PE
40952011-09-06 Paul Eggert <eggert@cs.ucla.edu>
4096
4097 isnan: Fix porting problem to Solaris 10 with bundled gcc.
4098 Without this fix, the command to link temacs failed due to an
4099 undefined symbol __builtin_isnan. This is because
4100 /usr/include/iso/math_c99.h #defines isnan(x) to
4101 __builtin_isnan(x), but the bundled gcc, which identifies itself
4102 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
4103 a __builtin_isnan.
4104 * floatfns.c (isnan): #undef, and then #define to a clone of
4105 what's in data.c.
4106 (Fisnan): Always define, since it's always available now.
4107 (syms_of_floatfns): Always define isnan at the Lisp level.
4108
e39b275c 41092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
4110
4111 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
4112
b2db44d9 41132011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 4114
f4af5137 4115 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
4116 The previous code assumed that file offsets (off_t values) fit in
4117 EMACS_INT variables, which is not true on typical 32-bit hosts.
4118 The code messed up by falsely reporting buffer overflow in cases
4119 such as (insert-file-contents "big" nil 1 2) into an empty buffer
4120 when "big" contains more than 2**29 bytes, even though this
4121 inserts just one byte and does not overflow the buffer.
4122 (Finsert_file_contents): Store file offsets as off_t
4123 values, not as EMACS_INT values. Check for overflow when
4124 converting between EMACS_INT and off_t. When checking for
4125 buffer overflow or for overlap, take the offsets into account.
4126 Don't use EMACS_INT for small values where int suffices.
4127 When checking for overlap, fix a typo: ZV was used where
4128 ZV_BYTE was intended.
4129 (Fwrite_region): Don't assume off_t fits into 'long'.
4130 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
4131
ecfc0a49
MA
41322011-09-05 Michael Albinus <michael.albinus@gmx.de>
4133
4134 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
4135
6511acf2 41362011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 4137
0999621a 4138 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
4139
4140 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 4141 (esprintf, exprintf, evxprintf): New functions.
62f19c19 4142 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 4143 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
4144 (modify_event_symbol): Do not assume that the length of
4145 name_alist_or_stem is safe to alloca and fits in int.
4146 (Fexecute_extended_command): Likewise for function name and binding.
4147 (Frecursion_depth): Wrap around reliably on integer overflow.
4148 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
4149 since some callers pass EMACS_INT values.
4150 (Fsingle_key_description): Don't crash if symbol name contains more
4151 than MAX_ALLOCA bytes.
4152 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
4153 (get_minibuffer): Arg is now EMACS_INT, not int.
4154 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 4155 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
4156 * window.h (command_loop_level, minibuf_level): Reflect API changes.
4157
2be7d702
PE
4158 * dbusbind.c (signature_cat): New function.
4159 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
4160 Do not overrun buffer; instead, report string overflow.
4161
9d1df220
PE
4162 * dispnew.c (add_window_display_history): Don't overrun buffer.
4163 Truncate instead; this is OK since it's just a log.
4164
33ef5c64
PE
4165 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
4166 even if the time zone offset is outlandishly large.
4167 Don't mishandle offset == INT_MIN.
4168
66c6fdd5
PE
4169 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
4170 when creating daemon; the previous buffer-overflow check was incorrect.
4171
d749b01b
PE
4172 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
4173 which has the guts of the old verror function.
4174
b5cd1905
PE
4175 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
4176 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
4177
6e1a67fb
PE
4178 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
4179 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 4180 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 4181 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
4182 length of string rather than counting it via multiple sprintfs;
4183 that's simpler and more reliable.
c21721cc
PE
4184 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
4185 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
4186 sprintf, in case result does not fit in int.
4187
c57b67fc
PE
4188 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
4189 (fontset_from_font): Print it.
4190
8a401434
PE
4191 * frame.c (tty_frame_count): Now printmax_t, not int.
4192 (make_terminal_frame, set_term_frame_name): Print it.
4193 (x_report_frame_params): In X, window IDs are unsigned long,
4194 not signed long, so print them as unsigned.
4195 (validate_x_resource_name): Check for implausibly long names,
4196 and don't assume name length fits in 'int'.
4197 (x_get_resource_string): Don't blindly alloca invocation name;
4198 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
4199 not fit in int.
4200
6e1a67fb
PE
4201 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
4202 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
4203 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
4204
0df02bf3
PE
4205 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
4206 Use esprintf, not sprintf, in case result does not fit in int.
4207
48e30793
PE
4208 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4209 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
4210 it as a large positive number.
4211 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
4212 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4213
a66ff6d8
PE
4214 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
4215 in case result does not fit in int.
4216
aca216ff
PE
4217 * print.c (float_to_string): Detect width overflow more reliably.
4218 (print_object): Make sprintf buffer a bit bigger, to avoid potential
4219 buffer overrun. Don't assume list length fits in 'int'. Treat
4220 print length of 0 as 0, not as infinity; to be consistent with other
4221 uses of print length in this function. Don't overflow print length
4222 index. Don't assume hash table size fits in 'long', or that
4223 vectorlike size fits in 'unsigned long'.
4224
31c286f7
PE
4225 * process.c (make_process): Use printmax_t, not int, to format
4226 process-name gensyms.
4227
55e5faa1
PE
4228 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
4229
80f2e268
PE
4230 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
4231 to avoid potential buffer overrun.
4232
670741ab
PE
4233 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
4234 if X resource line is longer than 512 bytes.
4235
b7163a50
PE
4236 * xfns.c (x_window): Make sprintf buffer a bit bigger
4237 to avoid potential buffer overrun.
4238
ae58ff1f
PE
4239 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
4240
c43c8a6a
PE
4241 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
4242
3f8236f4
PE
42432011-09-04 Paul Eggert <eggert@cs.ucla.edu>
4244
53e9fe90 4245 Integer overflow fixes for scrolling, etc.
6511acf2
PE
4246 Without these, Emacs silently mishandles large integers sometimes.
4247 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
4248 it were "C-u 1 M-x recenter" on a typical 64-bit host.
4249
6511acf2
PE
4250 * xdisp.c (try_window_id): Check Emacs fixnum range before
4251 converting to 'int'.
806add1d 4252
6511acf2 4253 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
4254 Check that an Emacs fixnum is in range before assigning it to 'int'.
4255 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
4256 values converted from Emacs fixnums.
4257 (Frecenter): Don't wrap around a line count if it is out of 'int'
4258 range; instead, treat it as an extreme value.
4259 (Fset_window_configuration, compare_window_configurations):
4260 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
4261
6511acf2
PE
4262 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
4263 that can exceed INT_MAX. Check that EMACS_INT value is in range
4264 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
4265 (match_limit): Don't assume that a fixnum can fit in 'int'.
4266
6511acf2 4267 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
4268 exceed INT_MAX.
4269
6511acf2 4270 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
4271 (Fvertical_motion): Don't wrap around LINES values that don't fit
4272 in 'int'. Instead, treat them as extreme values. This is good
4273 enough for windows, which can't have more than INT_MAX lines anyway.
4274
fcb901a7
LMI
42752011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
4276
0f2f6b6d
LMI
4277 * Require libxml/parser.h to avoid compilation warning.
4278
fcb901a7
LMI
4279 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
4280
4281 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
4282 since this reportedly can destroy thread storage.
4283
6e20a0d4
CY
42842011-08-30 Chong Yidong <cyd@stupidchicken.com>
4285
4286 * syntax.c (find_defun_start): Update all cache variables if
4287 exiting early (Bug#9401).
4288
148ae00e
EZ
42892011-08-30 Eli Zaretskii <eliz@gnu.org>
4290
f6cfbd8f
EZ
4291 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
4292
148ae00e
EZ
4293 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
4294 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
4295 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
4296
4297 * term.c (tty_append_glyph): New function.
4298 (produce_stretch_glyph): Static function and its prototype deleted.
4299
a66cfb1c
SM
4300 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
4301 Add prototypes.
148ae00e 4302
c4a07a4c
PE
43032011-08-29 Paul Eggert <eggert@cs.ucla.edu>
4304
4305 * image.c (parse_image_spec): Check for nonnegative, not for positive,
4306 when checking :margin (Bug#9390).
4307 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 4308 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
4309 so that the name doesn't mislead. All uses changed.
4310
6bc8cd65
JB
43112011-08-28 Johan Bockgård <bojohan@gnu.org>
4312
4313 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
4314 set_tty_hooks.
4315
dca4927e
EZ
43162011-08-27 Eli Zaretskii <eliz@gnu.org>
4317
4318 * xdisp.c (move_it_to): Don't bail out early when reaching
4319 position beyond to_charpos, if we are scanning backwards.
4320 (move_it_vertically_backward): When DY == 0, make sure we get to
4321 the first character in the line after the newline.
4322
f2cad773
PE
43232011-08-27 Paul Eggert <eggert@cs.ucla.edu>
4324
4325 * ccl.c: Improve and simplify overflow checking (Bug#9196).
4326 (ccl_driver): Do not generate an out-of-range pointer.
4327 (Fccl_execute_on_string): Remove unnecessary check for
4328 integer overflow, noted by Stefan Monnier in
4329 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
4330 Remove a FIXME that didn't need fixing.
4331 Simplify the newly-introduced buffer reallocation code.
4332
0cae2cdb
JB
43332011-08-27 Juanma Barranquero <lekktu@gmail.com>
4334
4335 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
4336
5fc295a4 43372011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 4338
70c60eb2 4339 Integer and memory overflow issues (Bug#9196).
726e0ab1 4340
d31850da
PE
4341 * doc.c (get_doc_string): Rework so that
4342 get_doc_string_buffer_size is the actual buffer size, rather than
4343 being 1 less than the actual buffer size; this makes xpalloc more
4344 convenient.
4345
a69fbedb
PE
4346 * image.c (x_allocate_bitmap_record, cache_image):
4347 * xselect.c (Fx_register_dnd_atom):
4348 Simplify previous changes by using xpalloc.
4349
fe5c5d37
PE
4350 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
4351 since either will do and ptrdiff_t is convenient with xpalloc.
4352
0065d054
PE
4353 * charset.c (charset_table_size)
4354 (struct charset_sort_data.priority): Now ptrdiff_t.
4355 (charset_compare): Don't overflow if priorities differ greatly.
4356 (Fsort_charsets): Don't assume list length fits in int.
4357 Check for size-calculation overflow when allocating sort data.
4358 (syms_of_charset): Allocate an initial charset table that is
4359 just under 64 KiB, to avoid problems with glibc malloc and mmap.
4360
4361 * cmds.c (internal_self_insert): Check for size-calculation overflow.
4362
4363 * composite.h (struct composition.glyph_len): Now int, not unsigned.
4364 The actual value is always <= INT_MAX, and leaving it unsigned made
4365 overflow checking harder.
4366
4367 * dispextern.h (struct glyph_matrix.rows_allocated)
4368 (struct face_cache.size): Now ptrdiff_t, for convenience in use
4369 with xpalloc. The values are still always <= INT_MAX.
4370
4371 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
4372
4373 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
4374 (SAFE_NALLOCA): New macro.
4375
4376 * region-cache.c (struct boundary.pos, find_cache_boundary)
4377 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
4378 (set_cache_region, invalidate_region_cache)
4379 (revalidate_region_cache, know_region_cache, region_cache_forward)
4380 (region_cache_backward, pp_cache):
4381 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
4382 so that ptrdiff_t * can be passed to xpalloc.
4383 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
4384 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
4385 (pp_cache): Don't assume cache_len fits in int.
4386 * region-cache.h: Adjust extern decls to match.
4387
4388 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
4389 EMACS_INT, since either will do, for xpalloc.
4390
4391 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
4392 (xnmalloc, xnrealloc, xpalloc): New functions.
4393
726e0ab1
PE
4394 * bidi.c (bidi_shelve_header_size): New constant.
4395 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
4396 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
4397
51f30bc5 4398 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
4399 * buffer.c (overlays_at, overlays_in, record_overlay_string)
4400 (overlay_strings):
4401 Don't update size of array until after memory allocation succeeds,
4402 because xmalloc/xrealloc may not return.
0065d054
PE
4403 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
4404 now that we have proper integer overflow checking.
4405 (record_overlay_string, overlay_strings): Catch overflows when
4406 calculating size of overlay_str_buf.
726e0ab1 4407
0065d054
PE
4408 * callproc.c (Fcall_process): Check for size overflow when
4409 calculating size of args2.
4410 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
4411 Normally we prefer signed values, but sticking with ptrdiff_t would
4412 require adding more-complicated checks.
726e0ab1
PE
4413
4414 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
4415 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
4416 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 4417 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
4418
4419 * character.c (Fstring): Check for size-calculation overflow.
4420
4421 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
4422 unnecessary integer overflow. Check for size overflow.
4423 (encode_coding_object): Don't update size until xmalloc succeeds.
4424
4425 * composite.c (get_composition_id): Check for overflow in glyph
4426 length calculations.
4427
4428 Integer and memory overflow fixes for display code.
4429 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
4430 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
4431 (scrolling_window): Check for overflow in size calculations.
4432 (line_draw_cost, realloc_glyph_pool, add_row_entry):
4433 Don't assume glyph table len fits in int.
4434 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
4435 (row_table_size): Now ptrdiff_t, not int.
4436 (scrolling_window): Avoid overflow in size calculations.
4437 Don't update size until allocation succeeds.
4438 * fns.c (concat): Check for overflow in size calculations.
4439 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
4440 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4441 (NEXT_ALMOST_PRIME_LIMIT): New constant.
4442
4443 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
4444 (get_doc_string): Check for size calculation overflow.
4445 Don't update size until allocation succeeds.
4446 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
4447 EMACS_INT, where ptrdiff_t will do.
4448 (Fsubstitute_command_keys): Check for string overflow.
4449
4450 * editfns.c (set_time_zone_rule): Don't assume environment length
4451 fits in int.
4452 (message_length): Now ptrdiff_t, not int.
4453 (Fmessage_box): Don't update size until allocation succeeds.
4454 Don't assume message length fits in int.
4455 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
4456
0065d054
PE
4457 * emacs.c (main): Do not reallocate argv, since there is a null at
4458 the end that can be overwritten, and this way there's no need to
4459 worry about size-calculation overflow.
4460 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
4461
4462 * eval.c (init_eval_once, grow_specpdl): Don't update size until
4463 alloc succeeds.
4464 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
4465
4466 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
4467 (x_set_scroll_bar_width, x_figure_window_size):
4468 Check for integer overflow.
4469 (x_set_alpha): Do not assume XINT fits in int.
4470
4471 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
4472 This is for the members text_lines, text_cols, total_lines, total_cols,
4473 where the system imposes an 'int' limit.
4474
4475 * fringe.c (Fdefine_fringe_bitmap):
4476 Don't update size until alloc works.
4477
4478 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
4479 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
4480
4481 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
4482 Check for size-calculation overflow.
4483 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
4484 do, as we prefer signed integers.
4485 (id_to_widget.max_size, id_to_widget.used)
4486 (xg_store_widget_in_map, xg_remove_widget_from_map)
4487 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
4488 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
4489 Use and return ptrdiff_t, not int.
4490 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
4491 * gtkutil.h: Change prototypes to match the above.
4492
4493 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
4494 are duplicate now that they've been promoted to lisp.h.
4495 (x_allocate_bitmap_record, x_alloc_image_color)
4496 (make_image_cache, cache_image, xpm_load):
4497 Don't update size until alloc is done.
4498 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
4499 (x_detect_edges):
3256efce 4500 Check for size calculation overflow.
726e0ab1
PE
4501 (ct_colors_allocated_max): New constant.
4502 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
4503 overflow.
3256efce 4504
726e0ab1
PE
4505 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
4506 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
4507 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
4508 Use ptrdiff_t, not int, to count maps.
4509 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
4510 calculations. Don't update size until allocation succeeds.
4511 Redo calculations to avoid overflow.
726e0ab1
PE
4512 * keyboard.h: Change prototypes to match the above.
4513
4514 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
4515 to count maps.
4516 (current_minor_maps): Check for size calculation overflow.
4517 * keymap.h: Change prototypes to match the above.
4518
4519 * lread.c (read1, init_obarray): Don't update size until alloc done.
4520
4521 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
4522 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
4523
726e0ab1
PE
4524 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
4525 Now ptrdiff_t, not int.
4526 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
4527 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
4528
4529 * process.c (Fnetwork_interface_list): Check for overflow
4530 in size calculation.
4531
4532 * region-cache.c (move_cache_gap): Check for size calculation overflow.
4533
4534 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
4535 overflow. Don't bother calling xmalloc when xrealloc will do.
4536
4537 * search.c (Freplace_match): Check for size calculation overflow.
4538 (Fset_match_data): Don't assume list lengths fit in 'int'.
4539
4540 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
4541 for command line length. Do not attempt to address one before the
4542 beginning of an array, as that's not portable.
4543
4544 * term.c (max_frame_lines): Remove; unused.
4545 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
4546 not int.
4547 (encode_terminal_code, calculate_costs): Check for size
4548 calculation overflow.
4549 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
4550 table lengths and related sizes. Don't update size until alloc
4551 done. Redo calculations to avoid overflow.
4552 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
4553
4554 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
4555 subtracting pointers.
4556 (gobble_line): Check for overflow more carefully. Don't update size
4557 until alloc done.
4558
4559 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
4560 Don't update size until alloc done.
4561 Redo size calculations to avoid overflow.
4562 Check for size calculation overflow.
0065d054 4563 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
4564
4565 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
4566 Use ptrdiff_t, not int, for sizes.
4567 (store_mode_line_noprop_char): Don't update size until alloc done.
4568
0065d054
PE
4569 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
4570 Use ptrdiff_t, not int, for sizes.
4571 (Finternal_make_lisp_face, cache_face):
4572 Check for size calculation overflow.
4573 (cache_face): Treat size calculation overflows as if they were
4574 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
4575
4576 * xfns.c (x_encode_text, x_set_name_internal)
4577 (Fx_change_window_property): Use ptrdiff_t, not int, to count
4578 sizes, since they can exceed INT_MAX in size. Check for size
4579 calculation overflow.
4580
0065d054
PE
4581 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
4582 (xg_select): Check for size calculation overflow.
726e0ab1
PE
4583 Don't update size until alloc done.
4584
0065d054 4585 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 4586 as sprintf is limited to int lengths.
1d526e2f 4587
252c5ee1
PE
4588 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
4589 (X_LONG_MIN): New macros.
864d7ce7
PE
4590 Use them to make the following changes clearer.
4591 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
4592 This change doesn't affect the value now, but it may help remind
4593 future maintainers not to raise the value too much later.
4594 (SELECTION_QUANTUM): Remove, replacing with ...
4595 (selection_quantum): ... new function, which avoids overflow.
4596 All uses changed.
4597 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
4598 assumption that selection length fits in 'int'.
4599 (x_reply_selection_request, x_handle_selection_request)
4600 (x_get_window_property, receive_incremental_selection)
4601 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
4602 (lisp_data_to_selection_data, clean_local_selection_data):
4603 Use ptrdiff_t, not int, to record length of selection.
4604 (x_reply_selection_request, x_get_window_property)
4605 (receive_incremental_selection, x_property_data_to_lisp):
4606 Redo calculations to avoid overflow.
4607 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 4608 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
4609 something.
4610 (x_get_window_property, receive_incremental_selection)
4611 (lisp_data_to_selection_data, x_property_data_to_lisp):
4612 Check for size-calculation overflow.
4613 (x_get_window_property, receive_incremental_selection)
4614 (lisp_data_to_selection_data, Fx_register_dnd_atom):
4615 Don't store size until memory allocation succeeds.
4616 (x_get_window_property): Plug memory leak on memory exhaustion.
4617 Don't double-block input; malloc is safe here. Don't assume 2**34
4618 - 4 fits in unsigned long. Add an xassert to check
4619 XGetWindowProperty overflow. Be more careful about overflow
4620 calculations, and distinguish size from memory overflow better.
4621 (receive_incremental_selection): When tracing, don't assume
4622 unsigned int is less than INT_MAX.
4623 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
4624 harmful) conversions of unsigned short to int.
4625 (lisp_data_to_selection_data): Don't assume that integers
4626 in the range -65535 through -1 fit in an X unsigned short.
4627 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
4628 result parameters unless successful. Rely on cons_to_unsigned
4629 to report problems with elements; the old code wasn't right anyway.
4630 (x_check_property_data): Check for int overflow; we cannot use
4631 a wider type due to X limits.
4632 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
4633
726e0ab1 4634 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 4635
0065d054
PE
4636 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
4637 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
4638 (x_color_cells): Don't store size until memory allocation succeeds.
4639 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 4640 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
4641 (x_term_init): Don't assume length fits in int (sprintf is limited
4642 to int size).
bc18e09d 4643
ebfa62c0
PE
4644 Use ptrdiff_t for composition IDs.
4645 * character.c (lisp_string_width):
4646 * composite.c (composition_table_size, n_compositions)
4647 (get_composition_id, composition_gstring_from_id):
4648 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
4649 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
4650 * window.c (Frecenter):
4651 Use ptrdiff_t, not int, for composition IDs.
4652 * composite.c (get_composition_id): Check for integer overflow.
4653 * composite.h: Adjust prototypes to match the above changes.
4654
d3411f89
PE
4655 Use ptrdiff_t for hash table indexes.
4656 * category.c (hash_get_category_set):
4657 * ccl.c (ccl_driver):
4658 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
4659 * coding.c (coding_system_charset_list, detect_coding_system):
4660 * coding.h (struct coding_system.id):
4661 * composite.c (get_composition_id, gstring_lookup_cache):
4662 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
4663 * image.c (xpm_get_color_table_h):
4664 * lisp.h (hash_lookup, hash_put):
4665 * minibuf.c (Ftest_completion):
4666 Use ptrdiff_t for hash table indexes, not int (which is too
4667 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
4668 32-bit --with-wide-int hosts).
4669
e097a6fa
PE
4670 * charset.c (Fdefine_charset_internal): Check for integer overflow.
4671 Add a FIXME comment about memory leaks.
4672 (syms_of_charset): Don't assume xmalloc returns.
4673
5637687f
PE
4674 Don't assume that stated character widths fit in int.
4675 * character.c (Fchar_width, c_string_width, lisp_string_width):
4676 * character.h (CHAR_WIDTH):
4677 * indent.c (MULTIBYTE_BYTES_WIDTH):
4678 Use sanitize_char_width to avoid undefined and/or bad behavior
4679 with outlandish widths.
a66cfb1c 4680 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
4681 now that we have two such functions. All uses changed.
4682 (sanitize_char_width): New inline function.
4683
a2271ba2
PE
4684 Don't assume that tab-width fits in int.
4685 * character.h (sanitize_width): New inline function.
4686 (SANE_TAB_WIDTH): New macro.
4687 (ASCII_CHAR_WIDTH): Use it.
4688 * indent.c (sane_tab_width): Remove. All uses replaced by
4689 SANE_TAB_WIDTH (current_buffer).
4690 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
4691
18c52557
PE
4692 * fileio.c: Integer overflow issues with file modes.
4693 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
4694
caeeedc1
PE
4695 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
4696 Remove unreachable code.
4697 (read_hex, load_charset_map_from_file): Check for integer overflow.
4698
6df6ae42 4699 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
4700 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
4701 (x_send_scroll_bar_event): Likewise. Check that the size does not
4702 exceed limits imposed by XClientMessageEvent, as well as the usual
4703 ptrdiff_t and size_t limits.
4704
b13995db
PE
4705 * keyboard.c: Overflow, signedness and related fixes.
4706 (make_lispy_movement): Use same integer type in forward decl
4707 that is used in the definition.
4708 (read_key_sequence, keyremap_step):
4709 Change bufsize argument back to int, undoing my 2011-03-30 change.
4710 We prefer signed types, and int is wide enough here.
4711 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
4712 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
4713 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
4714 length, not size_t. Use ptrdiff_t for index, not int.
4715 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
4716 possibility of integer overflow.
4717
13464394
PE
4718 Overflow, signedness and related fixes for images.
4719
4720 * dispextern.h (struct it.stack[0].u.image.image_id)
4721 (struct_it.image_id, struct image.id, struct image_cache.size)
4722 (struct image_cache.used, struct image_cache.ref_count):
4723 * gtkutil.c (update_frame_tool_bar):
4724 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
4725 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
4726 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
4727 * nsmenu.m (update_frame_tool_bar):
4728 * xdisp.c (calc_pixel_width_or_height):
4729 * xfns.c (image_cache_refcount):
4730 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
4731 on typical 64-bit hosts.
4732
4733 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4734 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
4735 Omit unnecessary casts to int.
4736 (parse_image_spec): Check that integers fall into 'int' range
4737 when the callers expect that.
4738 (image_ascent): Redo ascent calculation to avoid int overflow.
4739 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
4740 (lookup_image): Remove unnecessary tests.
4741 (xbm_image_p): Locals are now of int, not EMACS_INT,
4742 since parse_image_check makes sure they fit into int.
4743 (png_load, gif_load, svg_load_image):
4744 Prefer int to unsigned where either will do.
4745 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
4746 old tiff_error_handler and tiff_warning_handler.
4747 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
4748 stack buffer overflows. It uses only the features of vsnprintf
4749 that are common to both POSIX and native Microsoft.
4750 (tiff_error_handler, tiff_warning_handler): Use it.
4751 (tiff_load, gif_load, imagemagick_load_image):
4752 Don't assume :index value fits in 'int'.
4753 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
4754 (imagemagick_load_image): Check that crop parameters fit into
4755 the integer types that MagickCropImage accepts. Don't assume
4756 Vimagemagick_render_type has a nonnegative value. Don't assume
4757 size_t fits in 'long'.
4758 (gs_load): Use printmax_t to print the widest integers possible.
4759 Check for integer overflow when computing image height and width.
4760
c11821d4
EZ
47612011-08-26 Eli Zaretskii <eliz@gnu.org>
4762
4763 * xdisp.c (redisplay_window): Don't force window start if point
4764 will be invisible in the resulting window. (Bug#9324)
4765
0c95fcf7
EZ
47662011-08-25 Eli Zaretskii <eliz@gnu.org>
4767
4768 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
4769 the display spec is of the form `(space ...)'.
4770 (handle_display_spec): Return the value returned by
4771 handle_single_display_spec, not just 1 or zero.
4772 (handle_single_display_spec): If the display spec is of the form
4773 `(space ...)', and specifies display in the text area, return 2
4774 rather than 1.
fee65a97 4775 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
4776 accurately, and prefer exact match for point under bidi.
4777 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
4778
4779 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
4780 into disp_prop; all users changed.
4781
4782 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
4783 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
4784 for the text covered by the display property.
4785
e4ed06f1
CY
47862011-08-25 Chong Yidong <cyd@stupidchicken.com>
4787
4788 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4789 Change return value to nil.
4790 (Frecord_buffer): Delete unused function.
4791
f67cdd7f
EZ
47922011-08-24 Eli Zaretskii <eliz@gnu.org>
4793
5980d4c6
EZ
4794 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
4795 buffers, return left-to-right.
8610fe8b
EZ
4796 (set_cursor_from_row): Consider candidate row a win if its glyph
4797 represents a newline and point is on that newline. Fixes cursor
4798 positioning on the newline at EOL of R2L text within L2R
4799 paragraph, and vice versa.
4800 (try_cursor_movement): Check continued rows, in addition to
4801 continuation rows. Fixes unwarranted scroll when point enters a
4802 continued line of R2L text within an L2R paragraph, or vice versa.
4803 (cursor_row_p): Consider the case of point being equal to
4804 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
4805 from the end of a short line to the beginning of a continued line
4806 of R2L text within L2R paragraph.
4807 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
4808 composed characters.
5980d4c6 4809
f67cdd7f
EZ
4810 * bidi.c (bidi_check_type): Use xassert.
4811 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
4812 members.
4813
bca633fb
EZ
48142011-08-23 Eli Zaretskii <eliz@gnu.org>
4815
4816 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
4817 a character.
4818
4a5885a7
CY
48192011-08-23 Chong Yidong <cyd@stupidchicken.com>
4820
4821 * nsfont.m (ns_otf_to_script): Fix typo.
4822
0902a04e
KH
48232011-08-22 Kenichi Handa <handa@m17n.org>
4824
4825 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4826 extra slot even if the purpose is char-code-property-table.
4827
1a2e6670
EZ
48282011-08-23 Eli Zaretskii <eliz@gnu.org>
4829
8ddde651
EZ
4830 * xdisp.c (redisplay_window): When computing centering_position,
4831 account for the height of the header line. (Bug#8874)
4832
425cc014
EZ
4833 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4834 instead of CHAR_TO_BYTE. Fixes a crash when a completion
4835 candidate is selected by the mouse, and that candidate has a
4836 composed character under the mouse.
4837
1a2e6670
EZ
4838 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
4839 coordinates reported by pos-visible-in-window-p for a composed
4840 character in column zero.
4841
8b76d6f8
SM
48422011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
4843
4844 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
4845
dac347dd
EZ
48462011-08-22 Eli Zaretskii <eliz@gnu.org>
4847
4848 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
4849 consider it a hit if to_charpos is anywhere in the range of the
4850 composed buffer positions.
4851
e013fb34
CY
48522011-08-22 Chong Yidong <cyd@stupidchicken.com>
4853
4854 * image.c (gif_load): Don't assume that each subimage has the same
4855 dimensions as the base image. Handle disposal method that is
4856 "undefined" by the gif spec (Bug#9335).
4857
bd1ba3e8
CY
48582011-08-20 Chong Yidong <cyd@stupidchicken.com>
4859
4860 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 4861 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 4862
54a1215b
EZ
48632011-08-19 Eli Zaretskii <eliz@gnu.org>
4864
823564e5
EZ
4865 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4866 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
4867 from an Org mode buffer to a Speedbar frame.
4868
54a1215b
EZ
4869 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4870 a composition, take its buffer position from IT->cmp_it.charpos.
4871 Fixes cursor positioning at the beginning of a line that begins
4872 with a composed character.
4873
9778ebcc
EZ
48742011-08-18 Eli Zaretskii <eliz@gnu.org>
4875
0be6ee06
EZ
4876 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
4877 character bidirectional type, use STRONG_L instead. Fixes crashes
4878 in a buffer produced by `describe-categories'.
4879
9778ebcc
EZ
4880 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
4881 members before the level stack, so they would be saved and
4882 restored when copying iterator state. Fixes incorrect reordering
4883 around TABs covered by display properties.
4884
156bffbe
AS
48852011-08-18 Andreas Schwab <schwab@linux-m68k.org>
4886
6b02f655 4887 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 4888
72ad093b
CY
48892011-08-17 Chong Yidong <cyd@stupidchicken.com>
4890
4891 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
4892 (internal_condition_case_2, internal_condition_case_n):
4893 Remove unnecessary aborts (Bug#9081).
72ad093b 4894
35774242
EZ
48952011-08-17 Eli Zaretskii <eliz@gnu.org>
4896
4897 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4898 has no `load' handler, try opening the file locally. (Bug#9311)
4899
db76dd85
KB
49002011-08-16 Ken Brown <kbrown@cornell.edu>
4901
4902 * gmalloc.c: Expand comment.
4903
b215eee5
EZ
49042011-08-16 Eli Zaretskii <eliz@gnu.org>
4905
4906 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
4907 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
4908
a4579d33
KB
49092011-08-16 Ken Brown <kbrown@cornell.edu>
4910
4911 Fix memory allocation problems in Cygwin build (Bug#9273).
4912
4913 * unexcw.c ( __malloc_initialized): Declare external variable.
4914 (fixup_executable): Force the dumped emacs to reinitialize malloc.
4915
8b76d6f8
SM
4916 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
4917 New variables.
a4579d33
KB
4918 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
4919 dumped emacs.
4920 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
4921 in the static heap.
4922 [CYGWIN] (special_realloc): New function.
4923 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
4924 requests to realloc storage in the static heap.
4925
3ebec551
PE
49262011-08-15 Paul Eggert <eggert@cs.ucla.edu>
4927
4928 * bidi.c (bidi_initialize): Remove unused local.
4929
9fd8be00
EZ
49302011-08-15 Eli Zaretskii <eliz@gnu.org>
4931
6b02f655
SM
4932 * bidimirror.h:
4933 * biditype.h: Remove file.
4934 * makefile.w32-in ($(BLD)/bidi.$(O)):
4935 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
4936
4937 * dispextern.h: Fix a typo in the comment to bidi_type_t.
4938
4939 * chartab.c: Improve commentary for the uniprop_table API.
4940
32413314
EZ
4941 * bidi.c (bidi_paragraph_init): Support zero value of
4942 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
4943 (bidi_initialize): Use uniprop_table instead of including
4944 biditype.h and bidimirror.h.
32413314 4945
9fd8be00
EZ
4946 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
4947 coordinates of the iterator when restoring from ppos_it.
4948 (Bug#9296)
4949
5cf2b69b
KH
49502011-08-14 Kenichi Handa <handa@m17n.org>
4951
4952 * process.c (create_process): Call setup_process_coding_systems
72ad093b 4953 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 4954
daf17d00
EZ
49552011-08-14 Eli Zaretskii <eliz@gnu.org>
4956
4957 * xdisp.c (move_it_in_display_line_to): Don't invoke
4958 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
4959 ppos_it. Fixes vertical cursor motion when line beginning is
4960 covered by an image. (Bug#9296)
4961
08e3161a
JD
49622011-08-14 Jan Djärv <jan.h.d@swipnet.se>
4963
4964 * nsterm.h (ns_run_ascript): Declare.
4965 (NSAPP_DATA2_RUNASSCRIPT): Define.
4966
4967 * nsfns.m (as_script, as_result, as_status): New static variables.
4968 (ns_run_ascript): New function.
5e617bc2 4969 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
4970 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
4971 the event loop. Get status from as_status (Bug#7276).
4972
4973 * nsterm.m (sendEvent): If event is NSApplicationDefined and
4974 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
4975 the event loop (Bug#7276).
4976
a3720aa2
AS
49772011-08-14 Andreas Schwab <schwab@linux-m68k.org>
4978
4979 * gnutls.c (QCgnutls_bootprop_priority)
4980 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
4981 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
4982 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
4983 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
4984 (QCgnutls_bootprop_verify_hostname_error)
4985 (QCgnutls_bootprop_callbacks_verify): Rename from
4986 Qgnutls_bootprop_..., all uses changed.
4987
4988 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4989 uses changed.
4990
0a0d27fb
PE
49912011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4992
19d5c50c
PE
4993 * xfaces.c (Qframe_set_background_mode): Now static.
4994 * dispextern.h (Qframe_set_background_mode): Remove decl.
4995
0a0d27fb
PE
4996 * process.c (Fnetwork_interface_info): Declare local only if needed.
4997
377538cb
JD
49982011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4999
5000 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
5001 (Fnetwork_interface_list): Allocate in increments of bytes instead
5002 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
5003 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
5004 sockaddr.
5005 (struct ifflag_def): notrailers is smart on OSX.
5006 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
5007 Get hardware address with getifaddrs if available.
5008
08fff70c
EZ
50092011-08-12 Eli Zaretskii <eliz@gnu.org>
5010
5011 * xdisp.c (iterate_out_of_display_property): xassert that
5012 IT->position is set to within IT->object's boundaries. Break from
5013 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
5014 when IT->position is set up wrongly due to some bug.
5015 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
5016 (push_display_prop): Allow GET_FROM_STRING as IT->method on
5017 entry. Force push_it to save on the stack the current
5018 buffer/string position, to be restored by pop_it. Fix flags in
5019 the iterator structure wrt the object coming from a display
5020 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
5021 properties. (Bug#9284)
5022
7be1c708 50232011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 5024
7be1c708
CY
5025 * fontset.c (fontset_get_font_group): Add proper type checks.
5026 (Bug#9172)
aac0c6e3 5027
7be1c708 50282011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 5029
7be1c708
CY
5030 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
5031 and LC_VERSION_MIN_MACOSX.
5032 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
5033 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 5034
97bb72a6
EZ
50352011-08-08 Eli Zaretskii <eliz@gnu.org>
5036
5037 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
5038 no-display-properties-and-no-overlays under bidi display.
5039 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 5040 properties and overlays.
97bb72a6 5041
d5617611
CY
50422011-08-08 Chong Yidong <cyd@stupidchicken.com>
5043
37e11a63
CY
5044 * editfns.c (Fset_time_zone_rule): Document relationship with the
5045 setenv function.
5046
d5617611
CY
5047 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
5048 the font entity extracted from the cache (Bug#8109).
5049
58872834
CY
50502011-08-07 Chong Yidong <cyd@stupidchicken.com>
5051
5052 * composite.c (autocmp_chars): Don't reset point. That is done by
5053 restore_point_unwind (Bug#5984).
5054
75bfc667
JL
50552011-08-07 Juri Linkov <juri@jurta.org>
5056
5057 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
5058 to show the arg `TIME' instead of `TIMEVAL'.
5059
d1410150
EZ
50602011-08-06 Eli Zaretskii <eliz@gnu.org>
5061
5062 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
5063 display property strides EOL and includes a newline, as in
5064 longlines-mode. (Bug#9254)
75b771e4
EZ
5065 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
5066 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
5067
5068 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
5069 is non-zero, even if the data buffer is NULL. Fixes a crash in
5070 vertical-motion with longlines-mode. (Bug#9254)
5071
35928349
EZ
50722011-08-05 Eli Zaretskii <eliz@gnu.org>
5073
ec7cc85b
EZ
5074 * bidi.c <bidi_cache_total_alloc>: Now static.
5075 (bidi_initialize): Initialize bidi_cache_total_alloc.
5076
8b76d6f8 5077 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
5078 cache. (Bug#9221)
5079
5080 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
5081 amount allocated this far in `bidi_cache_total_alloc'.
5082 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
5083 non-zero, only free the data buffer without restoring the cache
5084 contents. All callers changed.
5085
5086 * dispextern.h (bidi_unshelve_cache): Update prototype.
5087
5088 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
5089 (move_it_in_display_line, move_it_to)
5090 (move_it_vertically_backward, move_it_by_lines): Replace the call
5091 to xfree to an equivalent call to bidi_unshelve_cache.
5092 (move_it_in_display_line_to): Fix logic of returning
412b6358 5093 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 5094
e2e2423b
EZ
50952011-08-05 Eli Zaretskii <eliz@gnu.org>
5096
5097 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
5098 came from a string character with a `cursor' property. (Bug#9229)
5099
ae9e757a
JD
51002011-08-04 Jan Djärv <jan.h.d@swipnet.se>
5101
5102 * Makefile.in (LIB_PTHREAD): New variable.
5103 (LIBES): Add LIB_PTHREAD (Bug#9216).
5104
5105 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
5106 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
5107
213bd7f2
AS
51082011-08-04 Andreas Schwab <schwab@linux-m68k.org>
5109
6b02f655 5110 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 5111
99aaf75f
JD
51122011-08-04 Jan Djärv <jan.h.d@swipnet.se>
5113
5114 * xterm.c (x_find_topmost_parent): New function.
5115 (x_set_frame_alpha): Find topmost parent window with
5116 x_find_topmost_parent and set the property there also (bug#9181).
5117 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
5118
c74e9d86
PE
51192011-08-04 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 * callproc.c (Fcall_process): Avoid vfork clobbering
5122 the local vars buffer, coding_systems, current_dir.
5123
640c8776
SM
51242011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
5125
5126 * keymap.c (Fmake_composed_keymap): Move to subr.el.
5127
f26d0e4c
PE
51282011-08-03 Paul Eggert <eggert@cs.ucla.edu>
5129
8a10d76c
PE
5130 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
5131 so that it is not optimized away.
5132
f26d0e4c
PE
5133 * xdisp.c (compute_display_string_pos): Remove unused local.
5134
55439c61
EZ
51352011-08-02 Eli Zaretskii <eliz@gnu.org>
5136
5137 Fix slow cursor motion and scrolling in large buffers with
5138 selective display, like Org Mode buffers. (Bug#9218)
5139
5140 * dispextern.h (struct bidi_it): New member disp_prop_p.
5141
5142 * xdisp.c: Remove one-slot cache of display string positions.
5143 (compute_display_string_pos): Accept an additional argument
5e617bc2 5144 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
5145 for a display string or property. If found, set DISP_PROP_P
5146 non-zero.
5147
5148 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
5149 DISP_PROP_P, and pass it to compute_display_string_pos.
5150 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
5151 non-zero. All callers of bidi_fetch_char changed.
5152
fb33fa43
SM
51532011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
5154
5155 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
5156
b099e063
DM
51572010-12-03 Don March <don@ohspite.net>
5158
5159 * keymap.c (Fdefine_key): Fix non-prefix key error message when
5160 last character M-[char] is translated to ESC [char] (bug#7541).
5161
5cc7f7af
KH
51622011-08-02 Kenichi Handa <handa@m17n.org>
5163
d0fffa3f 5164 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
5165
5166 * chartab.c (uniprop_table): Make it non-static.
5167
525d5e6e
EZ
51682011-08-01 Eli Zaretskii <eliz@gnu.org>
5169
5170 * xdisp.c (forward_to_next_line_start): Accept additional argument
5171 BIDI_IT_PREV, and store into it the state of the bidi iterator had
5172 on the newline.
5173 (reseat_at_next_visible_line_start): Use the bidi iterator state
5174 returned by forward_to_next_line_start to restore the state of
5175 it->bidi_it after backing up to previous newline. (Bug#9212)
5176
31011111
AS
51772011-07-30 Andreas Schwab <schwab@linux-m68k.org>
5178
5179 * regex.c (re_comp): Protoize.
5180 (re_exec): Fix return type.
5181 (regexec): Fix type of `ret'. (Bug#9203)
5182
476371c4
PE
51832011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5184
e5d76069
PE
5185 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
5186 This is needed if max-image-size is a floating-point number.
5187
9a79b20c
AS
51882011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5189
5190 * print.c (print_object): Print empty symbol as ##.
5191
5192 * lread.c (read1): Read ## as empty symbol.
5193
d8c2fa78
AA
51942011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
5195
5196 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
5197 setting frame foreground color (Bug#9175).
5198 (x_set_background_color): Likewise.
5199
ffe57a7a
AA
5200 * nsmenu.m (-setText): Size tooltip dimensions precisely to
5201 contents (Bug#9176).
5202 (EmacsTooltip -init): Remove bezels and add shadows to
5203 tooltip windows.
5204
bf3492a5
AA
5205 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
5206 or scroll bar (Bug#8470).
5207
d55e9c53
AA
5208 * nsfont.m (nsfont_open): Remove assignment to voffset and
5209 unnecessary vars hshink, expand, hd, full_height, min_height.
5210 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
5211
5212 * nsterm.h (nsfont_info): Remove voffset field.
5213
d8c2fa78 52142011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
5215
5216 Implement strike-through and overline on NextStep (Bug#8863).
5217
5218 * nsfont.m (nsfont_open): Use underline position provided by font,
5219 instead of hard-coded value of 2.
5220 (nsfont_draw): Call ns_draw_text_decoration instead.
5221
5222 * nsterm.h: Add declaration for ns_draw_text_decoration.
5223
5224 * nsterm.m (ns_draw_text_decoration): New function for drawing
5225 underline, overline, and strike-through.
5226 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
5227 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 5228 accommodate underlining, etc.
4843aac3 5229
4cc60b9b
EZ
52302011-07-28 Eli Zaretskii <eliz@gnu.org>
5231
bc7ece87
EZ
5232 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
5233 default.
4cc60b9b 5234
476371c4
PE
52352011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5236
66606eea
PE
5237 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
5238 Without this fix, if a signal arrives just after memory fills up,
5239 'malloc' might be invoked reentrantly.
5240
476371c4
PE
5241 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
5242 In other words, assume that every image size is allowed, on non-X
5243 hosts. This assumption is probably wrong, but it lets Emacs compile.
5244
f3fcc40d
AS
52452011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5246
5247 * regex.c (re_iswctype): Convert return values to boolean.
5248
350c992f
EZ
52492011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
5250
5251 * xdisp.c (compute_display_string_pos): Don't use cached display
5252 string position if the buffer had its restriction changed.
5253 (Bug#9184)
5254
5266b4bb
PE
52552011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5256
5257 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5258
2573a837 52592011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 5260
41f55ccd 5261 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 5262
39e378da
PE
5263 * bidi.c: Integer size and overflow fixes.
5264 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
5265 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
5266 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5267 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
5268 (bidi_find_other_level_edge):
5269 Use ptrdiff_t instead of EMACS_INT where either will do.
5270 This works better on 32-bit hosts configured --with-wide-int.
5271 (bidi_cache_ensure_space): Check for size-calculation overflow.
5272 Use % rather than repeated addition, for better worst-case speed.
5273 Don't set bidi_cache_size until after xrealloc returns, because it
5274 might not return.
5275 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
5276 (bidi_cache_ensure_space): Also check that the bidi cache size
5277 does not exceed that of the largest Lisp string or buffer. See Eli
5278 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 5279
5e927815
PE
5280 * alloc.c (__malloc_size_t): Remove.
5281 All uses replaced by size_t. See Andreas Schwab's note
5282 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
5283
ca4aa935
PE
5284 * image.c: Improve checking for integer overflow.
5285 (check_image_size): Assume that f is nonnull, since
5286 it is always nonnull in practice. This is one less thing to
5287 worry about when checking for integer overflow later.
5288 (x_check_image_size): New function, which checks for integer
5289 overflow issues inside X.
5290 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
5291 This removes the need for a memory_full check.
5292 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
5293 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
5294 (xbm_read_bitmap_data): Change locals back to 'int', since
5295 their values must fit in 'int'.
5296 (xpm_load_image, png_load, tiff_load):
5297 Invoke x_create_x_image_and_pixmap earlier,
5298 to avoid much needless work if the image is too large.
5299 (tiff_load): Treat overly large images as if
5300 x_create_x_image_and_pixmap failed, not as malloc failures.
5301 (gs_load): Use x_check_image_size.
5302
5f8f9cc2
PE
5303 * gtkutil.c: Omit integer casts.
5304 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
5305 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
5306
5adf60bc
PE
5307 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
5308
c8907a93
PE
5309 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
5310 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
5311 would wrongly return t on a 64-bit host.
5312
e3c25c68
PE
5313 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
5314 The plain *_OVERFLOW macros run afoul of GCC bug 49705
5315 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
5316 and therefore cause GCC to emit a bogus diagnostic in some cases.
5317
3f791afe
PE
5318 * image.c: Integer signedness and overflow and related fixes.
5319 This is not an exhaustive set of fixes, but it's time to
5320 record what I've got.
5321 (lookup_pixel_color, check_image_size): Remove redundant decls.
5322 (check_image_size): Don't assume that arbitrary EMACS_INT values
5323 fit in 'int', or that arbitrary 'double' values fit in 'int'.
5324 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
5325 (tiff_load, imagemagick_load_image):
5326 Check for overflow in size calculations.
5327 (x_create_x_image_and_pixmap): Remove unnecessary test for
5328 xmalloc returning NULL; that can't happen.
5329 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
5330 (xpm_color_bucket): Use better integer hashing function.
5331 (xpm_cache_color): Don't possibly over-allocate memory.
5332 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
5333 (gif_memory_source):
5334 Use ptrdiff_t, not int or size_t, to record sizes.
5335 (png_load): Don't assume values greater than 2**31 fit in 'int'.
5336 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
5337 either works, as we prefer signed integers.
5338 (tiff_read_from_memory, tiff_write_from_memory):
5339 Return tsize_t, not size_t, since that's what the TIFF API wants.
5340 (tiff_read_from_memory): Don't fail simply because the read would
5341 go past EOF; instead, return a short read.
5342 (tiff_load): Omit no-longer-needed casts.
5343 (Fimagemagick_types): Don't assume size fits into 'int'.
5344
3cc5a532
PE
5345 Improve hashing quality when configured --with-wide-int.
5346 * fns.c (hash_string): New function, taken from sxhash_string.
5347 Do not discard information about ASCII character case; this
5348 discarding is no longer needed.
5349 (sxhash-string): Use it. Change sig to match it. Caller changed.
5350 * lisp.h: Declare it.
5351 * lread.c (hash_string): Remove, since we now use fns.c's version.
5352 The fns.c version returns a wider integer if --with-wide-int is
5353 specified, so this should help the quality of the hashing a bit.
5354
b312a492
PE
5355 * emacs.c: Integer overflow minor fix.
5356 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
5357 Define only if GNU_LINUX.
5358 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
5359
dfd153ae
PE
5360 * dispnew.c: Integer signedness and overflow fixes.
5361 Remove unnecessary forward decls, that were a maintenance hassle.
5362 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
5363 All uses changed.
5364 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
5365 (scrolling_window): Use ptrdiff_t, not int, for byte count.
5366 (prepare_desired_row, line_draw_cost):
5367 Use int, not unsigned, where either works.
5368 (save_current_matrix, restore_current_matrix):
5369 Use ptrdiff_t, not size_t, where either works.
5370 (init_display): Check for overflow more accurately, and without
5371 relying on undefined behavior.
5372
a81d11a3
PE
5373 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
5374 Remove, replacing with the new symbols in lisp.h. All uses changed.
5375 * fileio.c (make_temp_name):
5376 * filelock.c (lock_file_1, lock_file):
5377 * xdisp.c (message_dolog):
5378 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
5379 Use pMd etc. instead.
5380 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
5381 replacing the pWIDE etc. symbols removed from editfns.c.
5382
3300e6fd
PE
5383 * keyboard.h (num_input_events): Now uintmax_t.
5384 This is (very slightly) less likely to mess up due to wraparound.
5385 All uses changed.
5386
fd05c7e9
PE
5387 * buffer.c: Integer signedness fixes.
5388 (alloc_buffer_text, enlarge_buffer_text):
5389 Use ptrdiff_t rather than size_t when either will do, as we prefer
5390 signed integers.
5391
903fe15d
PE
5392 * alloc.c: Integer signedness and overflow fixes.
5393 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
5394 (__malloc_size_t): Default to size_t, not to int.
5395 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
5396 (Fgarbage_collect, mark_object_loop_halt, mark_object):
5397 Prefer ptrdiff_t to size_t when either would do, as we prefer
5398 signed integers.
5399 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
5400 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
5401 Now const. Initialize with values that are in range even if char
5402 is signed.
5403 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
5404 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
5405 These functions do the right thing with sizes > 2**32.
5406 (check_depth): Now ptrdiff_t, not int.
5407 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
5408 Adjust to new way of storing sizes. Check for size overflow bugs
5409 in rest of code.
5410 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
5411 slightly wrong anyway, as it missed one instance of
5412 XMALLOC_OVERRUN_CHECK_OVERHEAD.
5413 (refill_memory_reserve): Omit needless cast to size_t.
5414 (mark_object_loop_halt): Mark as externally visible.
5415
ac82cc6a
PE
5416 * xselect.c: Integer signedness and overflow fixes.
5417 (Fx_register_dnd_atom, x_handle_dnd_message):
5418 Use ptrdiff_t, not size_t, since we prefer signed.
5419 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
5420 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
5421 x_dnd_atoms_size and x_dnd_atoms_length.
5422
c2d1e36d
PE
5423 * doprnt.c: Prefer signed to unsigned when either works.
5424 * eval.c (verror):
5425 * doprnt.c (doprnt):
5426 * lisp.h (doprnt):
5427 * xdisp.c (vmessage):
5428 Use ptrdiff_t, not size_t, when using or implementing doprnt,
5429 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
5430 prefer signed arithmetic to avoid comparison confusion.
5431 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
5432 but is a bit tricky.
5433
0e926e56
PE
5434 Assume freestanding C89 headers, string.h, stdlib.h.
5435 * data.c, doprnt.c, floatfns.c, print.c:
5436 Include float.h unconditionally.
5437 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
5438 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
5439 * regex.c: Likewise for stddef.h, string.h.
5440 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
5441 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
5442 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
5443 (STDC_HEADERS): Remove obsolete defines.
5444 * sysdep.c: Include limits.h unconditionally.
5445
9cfdb3ec
PE
5446 Assume support for memcmp, memcpy, memmove, memset.
5447 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
5448 * regex.c (memcmp, memcpy):
5449 Remove; we assume C89 now.
5450
5451 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
5452 (__malloc_safe_bcopy): Remove; no longer needed.
5453
cf950e6b 5454 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
5455 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
5456 well either way, and we prefer signed to unsigned.
5457
dbf38e02
LMI
54582011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
5459
5460 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
5461 closes the connection while we're reading (bug#9182).
5462
d6f0886c 54632011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 5464
d6f0886c
JD
5465 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
5466 are specified (Bug#9168).
24e0f6b1 5467
2eb1f9e6
PE
54682011-07-25 Paul Eggert <eggert@cs.ucla.edu>
5469
5470 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
5471 Found by GCC static checking and --with-wide-int on a 32-bit host.
5472
22381272 54732011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
5474
5475 * xdisp.c (compute_display_string_pos): Fix logic of caching
5476 previous display string position. Initialize cached_prev_pos to
5477 -1. Fixes slow-down at the beginning of a buffer.
5478
f25e39b4
EZ
54792011-07-24 Eli Zaretskii <eliz@gnu.org>
5480
5481 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
5482 for attrs[LFACE_FONTSET_INDEX].
5483
04c4b52e
PE
54842011-07-23 Paul Eggert <eggert@cs.ucla.edu>
5485
5486 * xml.c (parse_region): Remove unused local
5487 that was recently introduced.
5488
c1734fbd
EZ
54892011-07-23 Eli Zaretskii <eliz@gnu.org>
5490
be18c5a5
EZ
5491 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
5492 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
5493
c1734fbd
EZ
5494 * xdisp.c (move_it_in_display_line_to): Record the best matching
5495 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
5496 exit if none of the characters scanned was an exact match.
5497 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
5498 when exact match is impossible due to invisible text, and the
5499 lines are truncated.
5500
a258d627
JD
55012011-07-23 Jan Djärv <jan.h.d@swipnet.se>
5502
5503 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
5504 for OSX >= 10.7.
5505
b6d5a689
EZ
55062011-07-22 Eli Zaretskii <eliz@gnu.org>
5507
0f74f785
EZ
5508 Fix a significant slow-down of cursor motion with C-n, C-p,
5509 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
5510 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 5511 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
5512 (next_element_from_buffer): Call compute_stop_pos_backwards to
5513 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
5514 base_level_stop.
5515 (reseat): Don't look for prev_stop, as that could mean a very long
5516 run.
5517 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
5518 <cached_disp_overlay_modiff>: Cache for last found display string
5519 position.
551918c1 5520 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
5521 about the same buffer in the same area of character positions, and
5522 the buffer wasn't changed since the time the display string
5523 position was cached.
551918c1 5524
b2d0c91a
EZ
55252011-07-22 Eli Zaretskii <eliz@gnu.org>
5526
5527 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
5528 is an integer, which is important for empty lines. (Bug#9149)
5529
043604ee
CY
55302011-07-22 Chong Yidong <cyd@stupidchicken.com>
5531
5532 * frame.c (Fmodify_frame_parameters): In tty case, update the
5533 default face if necessary (Bug#4238).
5534
da4adb04
CY
55352011-07-21 Chong Yidong <cyd@stupidchicken.com>
5536
5537 * editfns.c (Fstring_to_char): No need to explain what a character
5538 is in the docstring (Bug#6576).
5539
9abd0532
LMI
55402011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5541
5542 * xml.c (parse_region): Make sure we always return a tree.
5543
36881d16
HK
55442011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
5545
5546 * xml.c (parse_region): If a document contains only comments,
5547 return that, too.
5548
1e98674d
LMI
55492011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5550
5551 * xml.c (make_dom): Return comments, too.
5552
590bd467
PE
55532011-07-19 Paul Eggert <eggert@cs.ucla.edu>
5554
5555 Port to OpenBSD.
5556 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
5557 and the surrounding thread.
5558 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
5559 rather than fgets, and retry after EINTR. Otherwise, 'emacs
5560 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
5561 timer goes off.
5562 * s/openbsd.h (BROKEN_SIGIO): Define.
5563 * unexelf.c (unexec) [__OpenBSD__]:
5564 Don't update the .mdebug section of the Alpha COFF symbol table.
5565
f41628b2
LMI
55662011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5567
5568 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
5569 (bug#8460).
5570
b59b67c5
PE
55712011-07-18 Paul Eggert <eggert@cs.ucla.edu>
5572
15e3a074
PE
5573 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
5574 This fixes some race conditions on the permissions of any newly
5575 created file.
5576
41bed37d
PE
5577 * alloc.c (valid_pointer_p): Use pipe, not open.
5578 This fixes some permissions issues when debugging.
5579
b59b67c5
PE
5580 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
5581 If fchown fails to set both uid and gid, try to set just gid,
5582 as that is sometimes allowed. Adjust the file's mode to eliminate
5583 setuid or setgid bits that are inappropriate if fchown fails.
5584
925a6be7
SM
55852011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5586
5587 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
5588 to compare Lisp_Objects.
5589 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
5590 global_gnutls_log_level, don't mistake it for a Lisp_Object.
5591 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
5592
52968808
AS
55932011-07-17 Andreas Schwab <schwab@linux-m68k.org>
5594
0a6a104b
AS
5595 * lread.c (read_integer): Unread even EOF character.
5596 (read1): Likewise. Properly record start position of symbol.
5597
52968808
AS
5598 * lread.c (read1): Read `#:' as empty uninterned symbol if no
5599 symbol character follows.
5600
9e381cdd
PE
56012011-07-17 Paul Eggert <eggert@cs.ucla.edu>
5602
5603 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
5604 This works around a problem with the previous change to Fcopy_file.
5605 Recent glibc declares fchown with __attribute__((warn_unused_result)),
5606 and without this change, GCC might complain about discarding
5607 fchown's return value.
5608
b5641435
JB
56092011-07-16 Juanma Barranquero <lekktu@gmail.com>
5610
5611 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
5612
a8031457
PE
56132011-07-16 Paul Eggert <eggert@cs.ucla.edu>
5614
5615 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
5616
dd889327
LMI
56172011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
5618
750c33f7
LMI
5619 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
5620 it's used from the C level.
5621
dd889327
LMI
5622 * process.c: Use the same condition for POLL_FOR_INPUT in both
5623 keyboard.c and process.c (bug#1858).
5624
87e86684
LM
56252011-07-09 Lawrence Mitchell <wence@gmx.li>
5626
5627 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
5628 (Fgnutls_boot): Use it.
5629
64348f40
AS
56302011-07-15 Andreas Schwab <schwab@linux-m68k.org>
5631
5632 * doc.c (Fsubstitute_command_keys): Revert last change.
5633
1d698799
LMI
56342011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
5635
f863868c
LMI
5636 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
5637 quotes the next character, and doesn't affect other longer
5638 sequences (bug#8935).
5639
1d698799
LMI
5640 * lread.c (syms_of_lread): Clarify that is isn't only
5641 `eval-buffer' and `eval-defun' that's affected by
5642 `lexical-binding' (bug#8460).
5643
aa4b6df6
EZ
56442011-07-15 Eli Zaretskii <eliz@gnu.org>
5645
5646 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 5647 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 5648
5d856da6
PE
56492011-07-14 Paul Eggert <eggert@cs.ucla.edu>
5650
ad6042bb
PE
5651 Fix minor problems found by static checking.
5652 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
5653 (elsz): Now a signed constant, not a size_t var. We prefer signed
5654 types to unsigned, to avoid integer comparison confusion. Without
5655 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
5656 "cannot optimize loop, the loop counter may overflow", a symptom
5657 of the confusion.
f00bbb22 5658 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
5659 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
5660
6468f31c
LMI
56612011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5662
49080b10
LMI
5663 * search.c (Fre_search_backward): Mention `case-fold-search' in
5664 all the re_search_* functions (bug#8138).
5665
6468f31c
LMI
5666 * keyboard.c (Fopen_dribble_file): Document when the file is
5667 closed (bug#8056).
5668
c965adc5
EZ
56692011-07-14 Eli Zaretskii <eliz@gnu.org>
5670
df9733bf
EZ
5671 * bidi.c (bidi_dump_cached_states): Fix format of displaying
5672 bidi_cache_idx.
5673
0bb23927
EZ
5674 Support bidi reordering of display and overlay strings.
5675 * xdisp.c (compute_display_string_pos)
5676 (compute_display_string_end): Accept additional argument STRING.
5677 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
5678 (reseat_to_string): Initialize bidi_it->string.s and
5679 bidi_it->string.schars.
5680 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
5681 NULL (avoids a crash in bidi_paragraph_init).
5682 Initialize itb.string.lstring.
0bb23927
EZ
5683 (init_iterator): Call bidi_init_it only of a valid
5684 buffer position was specified. Initialize paragraph_embedding to
5685 L2R.
5686 (reseat_to_string): Initialize the bidi iterator.
5687 (display_string): If we need to ignore text properties of
5688 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
5689 original value of -1 will not work with bidi.)
5690 (compute_display_string_pos): First arg is now struct
5691 `text_pos *'; all callers changed. Support display properties on
5692 Lisp strings.
5693 (compute_display_string_end): Support display properties on Lisp
5694 strings.
5695 (init_iterator, reseat_1, reseat_to_string): Initialize the
5696 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
5697 when iterating on a string not from display properties).
640c8776
SM
5698 (compute_display_string_pos, compute_display_string_end):
5699 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
5700 arrow keys.
5701 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
5702 base_level_stop; instead, set base_level_stop to BEGV.
5703 Fixes crashes in vertical-motion.
0bb23927
EZ
5704 (next_element_from_buffer): Improve commentary for when
5705 the iterator is before prev_stop.
5706 (init_iterator): Initialize bidi_p from the default value of
5707 bidi-display-reordering, not from buffer-local value. Use the
5708 buffer-local value only if initializing for buffer iteration.
5709 (handle_invisible_prop): Support invisible properties on strings
5710 that are being bidi-reordered.
5711 (set_iterator_to_next): Support bidi reordering of C strings and
5712 Lisp strings.
5713 (next_element_from_string): Support bidi reordering of Lisp
5714 strings.
5715 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
5716 (display_string): Support display of R2L glyph rows.
5717 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
5718 (init_iterator): Don't initialize it->bidi_p for strings
5719 here.
5720 (reseat_to_string): Initialize it->bidi_p for strings here.
5721 (next_element_from_string, next_element_from_c_string)
5722 (next_element_from_buffer): Add xassert's for correspondence
5723 between IT's object being iterated and it->bidi_it.string
5724 structure.
5725 (face_before_or_after_it_pos): Support bidi iteration.
5726 (next_element_from_c_string): Handle the case of the first string
5727 character that is not the first one in the visual order.
5728 (get_visually_first_element): New function, refactored from common
5729 parts of next_element_from_buffer, next_element_from_string, and
5730 next_element_from_c_string.
5731 (tool_bar_lines_needed, redisplay_tool_bar)
5732 (display_menu_bar): Force left-to-right direction. Add a FIXME
5733 comment for making that be controlled by a user option.
5734 (push_it, pop_it): Save and restore the state of the
5735 bidi iterator. Save and restore the bidi_p flag.
5736 (pop_it): Iterate out of display property for string iteration as
5737 well.
5738 (iterate_out_of_display_property): Support iteration over strings.
5739 (handle_single_display_spec): Set up it->bidi_it for iteration
5740 over a display string, and call bidi_init_it.
5741 (handle_single_display_spec, next_overlay_string)
5742 (get_overlay_strings_1, push_display_prop): Set up the bidi
5743 iterator for displaying display or overlay strings.
5744 (forward_to_next_line_start): Don't use the shortcut if
5745 bidi-iterating.
5746 (back_to_previous_visible_line_start): If handle_display_prop
5747 pushed the iterator stack, restore the internal state of the bidi
5748 iterator by calling bidi_pop_it same number of times.
5749 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
5750 and we are bidi-iterating, don't decrement the iterator position;
5751 instead, set the first_elt flag in the bidi iterator, to produce
5752 the same effect.
5753 (reseat_1): Remove redundant setting of string_from_display_prop_p.
5754 (push_display_prop): xassert that we are iterating a buffer.
5755 (push_it, pop_it): Save and restore paragraph_embedding member.
5756 (handle_single_display_spec, next_overlay_string)
5757 (get_overlay_strings_1, reseat_1, reseat_to_string)
5758 (push_display_prop): Set up the `unibyte' member of bidi_it.string
5759 correctly. Don't assume unibyte strings are not bidi-reordered.
5760 (compute_display_string_pos)
5761 (compute_display_string_end): Fix handling the case of C string.
5762 (push_it, pop_it): Save and restore from_disp_prop_p.
5763 (handle_single_display_spec, push_display_prop): Set the
5764 from_disp_prop_p flag.
5765 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
5766 (pop_it): Call iterate_out_of_display_property only if we are
5767 popping after iteration over a string that came from a display
5768 property. Fix a typo in popping stretch info. Add an assertion
5769 for verifying that the iterator position is in sync with the bidi
5770 iterator.
5771 (handle_single_display_spec, get_overlay_strings_1)
5772 (push_display_prop): Fix initialization of paragraph direction for
5773 string when that of the parent object is not yet determined.
5774 (reseat_1): Call bidi_init_it to resync the bidi
5775 iterator with IT's position. (Bug#7616)
5776 (find_row_edges): If ROW->start.pos gives position
5777 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
5778 (handle_stop, back_to_previous_visible_line_start, reseat_1):
5779 Reset the from_disp_prop_p flag.
5780 (SAVE_IT, RESTORE_IT): New macros.
5781 (pos_visible_p, face_before_or_after_it_pos)
5782 (back_to_previous_visible_line_start)
5783 (move_it_in_display_line_to, move_it_in_display_line)
5784 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5785 (try_scrolling, redisplay_window, display_line): Use them when
5786 saving a temporary copy of the iterator and restoring it back.
5787 (back_to_previous_visible_line_start, reseat_1)
5788 (init_iterator): Empty the bidi cache "stack".
5789 (move_it_in_display_line_to): If iterator ended up at
5790 EOL, but we never saw any buffer positions smaller than
5791 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
5792 motion in bidi-reordered lines.
5793 (move_it_in_display_line_to): Record prev_method and prev_pos
5794 immediately before the call to set_iterator_to_next. Fixes cursor
5795 motion in bidi-reordered lines with stretch glyphs and strings
5796 displayed in margins. (Bug#8133) (Bug#8867)
5797 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
5798 TO_CHARPOS.
640c8776
SM
5799 (pos_visible_p): Support positions in bidi-reordered lines.
5800 Save and restore bidi cache.
0bb23927
EZ
5801
5802 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
5803 (bidi_paragraph_info): Delete unused struct.
5804 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
5805 (bidi_cache_start): New variable.
5806 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
5807 to zero.
5808 (bidi_cache_fetch_state, bidi_cache_search)
5809 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5810 (bidi_cache_find, bidi_peek_at_next_level)
5811 (bidi_level_of_next_char, bidi_find_other_level_edge)
5812 (bidi_move_to_visually_next): Compare cache index with
5813 bidi_cache_start rather than with zero.
5814 (bidi_fetch_char): Accept new argument STRING; all callers
5815 changed. Support iteration over a string. Support strings with
5816 display properties. Support unibyte strings. Fix the type of
5817 `len' according to what STRING_CHAR_AND_LENGTH expects.
5818 (bidi_paragraph_init, bidi_resolve_explicit_1)
5819 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
5820 (bidi_level_of_next_char, bidi_move_to_visually_next):
5821 Support iteration over a string.
0bb23927
EZ
5822 (bidi_set_sor_type, bidi_resolve_explicit_1)
5823 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
5824 can now be zero (for strings); special values 0 and -1 were
5825 changed to -1 and -2, respectively.
5826 (bidi_char_at_pos): New function.
5827 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
5828 Call it instead of FETCH_MULTIBYTE_CHAR.
5829 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
5830 initialized to valid values.
5831 (bidi_init_it): Don't initialize charpos and bytepos with invalid
5832 values.
5833 (bidi_level_of_next_char): Allow the sentinel "position" to pass
5834 the test for valid cached positions. Fix the logic for looking up
5835 the sentinel state in the cache. GCPRO the Lisp string we are
5836 iterating.
5837 (bidi_push_it, bidi_pop_it): New functions.
5838 (bidi_initialize): Initialize the bidi cache start stack pointer.
5839 (bidi_cache_ensure_space): New function, refactored from part of
5840 bidi_cache_iterator_state. Don't assume the required size is just
5841 one BIDI_CACHE_CHUNK away.
5842 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
5843 (bidi_count_bytes, bidi_char_at_pos): New functions.
5844 (bidi_cache_search): Don't assume bidi_cache_last_idx is
5845 always valid if bidi_cache_idx is valid.
5846 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
5847 is valid if it's going to be used.
5848 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
5849 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
5850 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5851 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
5852 (bidi_find_other_level_edge, bidi_cache_start_stack):
5853 All variables related to cache indices are now EMACS_INT.
c965adc5 5854
0bb23927
EZ
5855 * dispextern.h (struct bidi_string_data): New structure.
5856 (struct bidi_it): New member `string'. Make flag members be 1-bit
5857 fields, and put them last in the struct.
640c8776
SM
5858 (compute_display_string_pos, compute_display_string_end):
5859 Update prototypes.
0bb23927
EZ
5860 (bidi_push_it, bidi_pop_it): Add prototypes.
5861 (struct iterator_stack_entry): New members bidi_p,
5862 paragraph_embedding, and from_disp_prop_p.
5863 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
5864 (bidi_shelve_cache, bidi_unshelve_cache):
5865 Declare prototypes.
0bb23927
EZ
5866
5867 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
5868 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
5869 and vector-like objects.
5870
5871 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
5872 cache around display iteration.
5873
5874 * window.c (Fwindow_end, window_scroll_pixel_based)
5875 (displayed_window_lines, Frecenter): Save and restore the bidi
5876 cache around display iteration.
5877
3bbd2265
LMI
58782011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5879
5880 * editfns.c (Fdelete_region): Clarify the use of the named
5881 parameters (bug#6788).
5882
adc47434
MR
58832011-07-14 Martin Rudalics <rudalics@gmx.at>
5884
5885 * indent.c (Fvertical_motion): Set and restore w->pointm when
5886 saving and restoring the window's buffer (Bug#9006).
5887
837c31f8
LMI
58882011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
5889
5890 * editfns.c (Fstring_to_char): Clarify just what is returned
5891 (bug#6576). Text by Eli Zaretskii.
5892
ac389d0c
JB
58932011-07-13 Juanma Barranquero <lekktu@gmail.com>
5894
5895 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
5896
0be0ce47
EZ
58972011-07-13 Eli Zaretskii <eliz@gnu.org>
5898
5899 * buffer.c (mmap_find): Fix a typo.
5900
cd18e7e3
JB
59012011-07-13 Johan Bockgård <bojohan@gnu.org>
5902
5903 Fix execution of x selection hooks.
5904 * xselect.c (Qx_lost_selection_functions)
5905 (Qx_sent_selection_functions): New vars.
5906 (syms_of_xselect): DEFSYM them.
5907 (x_handle_selection_request): Pass Qx_sent_selection_functions
5908 rather than Vx_sent_selection_functions to Frun_hook_with_args.
5909 (x_handle_selection_clear,x_clear_frame_selections):
5910 Pass Qx_lost_selection_functions rather than
5911 Vx_lost_selection_functions to Frun_hook_with_args.
5912
47ea7f44
PE
59132011-07-13 Paul Eggert <eggert@cs.ucla.edu>
5914
ac389d0c 5915 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
5916 The old code sometimes used this field without initializing it.
5917
47ea7f44
PE
5918 * alloc.c (gc_sweep): Don't read past end of array.
5919 In theory, the old code could also have corrupted Emacs internals,
5920 though it'd be very unlikely.
5921
bc985c87
AS
59222011-07-12 Andreas Schwab <schwab@linux-m68k.org>
5923
5924 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 5925 argument. (Bug#4026)
bc985c87 5926
0cf34688
LMI
59272011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
5928
b3dadd76
LMI
5929 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
5930 key" (bug#4257).
5931
0cf34688
LMI
5932 * window.c (Fset_window_start): Doc fix (bug#4199).
5933 (Fset_window_hscroll): Ditto.
5934
270768cd
PE
59352011-07-12 Paul Eggert <eggert@cs.ucla.edu>
5936
077e3dda 5937 Fix minor new problems caught by GCC 4.6.1.
270768cd 5938 * term.c (init_tty): Remove unused local.
490011a6 5939 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 5940 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 5941 not used otherwise.
270768cd 5942
b1f58454
CY
59432011-07-12 Chong Yidong <cyd@stupidchicken.com>
5944
5945 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
5946
22b9578d
LMI
59472011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5948
6e70ab07
LMI
5949 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
5950 are the mini-buffer and the echo area (bug#3320).
5951
22b9578d
LMI
5952 * term.c (init_tty): Remove support for supdup, c10 and perq
5953 terminals, which are no longer supported (bug#1482).
5954
8974cc9f
JB
59552011-07-10 Johan Bockgård <bojohan@gnu.org>
5956
5957 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
5958
a560d974
JD
59592011-07-10 Jan Djärv <jan.h.d@swipnet.se>
5960
5961 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
5962 for non-popups (Bug#3642).
5963
1dae0f0a
AS
59642011-07-10 Andreas Schwab <schwab@linux-m68k.org>
5965
268c2c36 5966 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 5967 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
5968 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
5969 * cm.c (losecursor): Likewise.
1dae0f0a
AS
5970 * data.c (fmod): Likewise.
5971 * dispnew.c (swap_glyphs_in_rows): Likewise.
5972 * emacs.c (memory_warning_signal): Likewise.
5973 * floatfns.c (float_error): Likewise.
5974 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
5975 (otf_open, font_otf_capability, generate_otf_features)
5976 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
5977 Likewise.
5978 * image.c (pbm_read_file): Likewise.
5979 * indent.c (string_display_width): Likewise.
5980 * intervals.c (check_for_interval, search_for_interval)
5981 (inc_interval_count, count_intervals, root_interval)
5982 (adjust_intervals_for_insertion, make_new_interval): Likewise.
5983 * lread.c (defalias): Likewise.
268c2c36 5984 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
5985 * regex.c (set_image_of_range_1, set_image_of_range)
5986 (regex_grow_registers): Likewise.
5987 * sysdep.c (strerror): Likewise.
5988 * termcap.c (valid_filename_p, tprint, main): Likewise.
5989 * tparam.c (main): Likewise.
5990 * unexhp9k800.c (run_time_remap, save_data_space)
5991 (update_file_ptrs, read_header, write_header, calculate_checksum)
5992 (copy_file, copy_rest, display_header): Likewise.
5993 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5994 Likewise.
5995 * xdisp.c (check_it): Likewise.
5996 * xfaces.c (register_color, unregister_color, unregister_colors):
5997 Likewise.
5998 * xfns.c (print_fontset_result): Likewise.
5999 * xrdb.c (member, fatal, main): Likewise.
6000
99033785
PE
60012011-07-10 Paul Eggert <eggert@cs.ucla.edu>
6002
6003 Fix minor problems found by static checking (Bug#9031).
6004 * chartab.c (char_table_set_range, map_sub_char_table):
6005 Remove unused locals.
6006 (uniprop_table): Now static.
6007 * composite.c (_work_char): Remove unused static var.
6008
9cb2ac56
JB
60092011-07-09 Juanma Barranquero <lekktu@gmail.com>
6010
6011 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
6012
f25661f0
JD
60132011-07-09 Jan Djärv <jan.h.d@swipnet.se>
6014
6015 * gtkutil.c (qttip_cb): Remove code without function.
6016
8278c4fe
EZ
60172011-07-09 Eli Zaretskii <eliz@gnu.org>
6018
6019 * w32.c (pthread_sigmask): New stub.
6020
1692ae2d 60212011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 6022
8a6ebd58 6023 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
6024 sigprocmask is portable only for single-threaded applications, and
6025 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
6026 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
6027 (LIBES): Use it.
6028 * callproc.c (Fcall_process):
6029 * process.c (create_process):
6030 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
6031 Use pthread_sigmask, not sigprocmask.
123403e4 6032
1b854618
JD
60332011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6034
6035 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
6036 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
6037 wrong (Bug#8591).
6038
3fe4b549
JD
60392011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6040
0ce7e563
JD
6041 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
6042 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
6043 (xg_hide_tooltip): Fix comment.
6044
3fe4b549
JD
6045 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
6046 in registerServicesMenuSendTypes.
6047 (validRequestorForSendType): Don't check ns_return_types.
6048
6049 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
6050 ns_return_type.
6051
5df75e47
JR
60522011-07-08 Jason Rumney <jasonr@gnu.org>
6053
22610910
JR
6054 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
6055 SH_SHOW for hidden windows (Bug#5482).
6056
5df75e47
JR
6057 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
6058 frame struct members of non-existent frames (Bug#6284).
6059
699c10bd
JD
60602011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6061
4393663b
JD
6062 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
6063 variable firstTime not needed on OSX >= 10.6.
6064 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
6065 >= 10.5. Use setKnobProportion, setDoubleValue.
6066
6067 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
6068 (MAC_OS_X_VERSION_10_5): Define if not defined.
6069 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
6070 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
6071 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
6072
6073 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
6074 cString and lossyCString on OSX >= 10.4
6075
58179cce 6076 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
6077 sizeToFit on OSX >= 10.2.
6078
6079 * nsimage.m (allocInitFromFile): Don't use deprecated method
6080 bestRepresentationForDevice on OSX >= 10.6.
6081
6082 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
6083 to avoid warning.
6084
6085 * emacs.c: Declare unexec_init_emacs_zone.
6086
a63e0781
JD
6087 * nsgui.h: Fix compiler warning about gnulib redefining verify.
6088
699c10bd
JD
6089 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
6090
6091 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
6092 on svcsMenu (Bug#8842).
6093
6094 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
6095 ns_return_types.
6096 (Fns_list_services): Just return Qnil on 10.6, code not working there.
6097
6098 * nsterm.m (QUTF8_STRING): Declare.
6099 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
6100 (validRequestorForSendType): Return type is (id).
6101 Change indexOfObjectIdenticalTo to indexOfObject.
6102 Check if we have local selection before returning self (Bug#8842).
6103 (writeSelectionToPasteboard): Put local selection into paste board
6104 if we have a local selection (Bug#8842).
6105 (syms_of_nsterm): DEFSYM QUTF8_STRING.
6106
6107 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
6108 (ns_get_local_selection): Declare.
6109
54e10184
LMI
61102011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
6111
9888ff71
LMI
6112 * keymap.c (describe_map_tree): Don't insert a double newline at
6113 the end of the buffer (bug#1169) and return whether we inserted
6114 something.
6115
54e10184
LMI
6116 * callint.c (Fcall_interactively): Change "reading args" to
6117 "providing args" to try to clarify what it does (bug#1010).
6118
15fa4783
KH
61192011-07-07 Kenichi Handa <handa@m17n.org>
6120
6121 * composite.c (composition_compute_stop_pos): Ignore a static
6122 composition starting before CHARPOS (Bug#8915).
6123
6124 * xdisp.c (handle_composition_prop): Likewise.
6125
a8815b00
EZ
61262011-07-07 Eli Zaretskii <eliz@gnu.org>
6127
6128 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
6129 (Bug#9015)
6130
ef7b981d 61312011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
6132
6133 * character.h (unicode_category_t): New enum type.
6134
6135 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
6136 (Qchar_code_property_table): New variable.
6137 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
6138 (UNIPROP_COMPRESSED_FORM_P): New macros.
6139 (char_table_ascii): Uncompress the compressed values.
6140 (sub_char_table_ref): New arg is_uniprop. Callers changed.
6141 Uncompress the compressed values.
ac389d0c 6142 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
6143 (char_table_ref_and_range): Uncompress the compressed values.
6144 (sub_char_table_set): New arg is_uniprop. Callers changed.
6145 Uncompress the compressed values.
6146 (sub_char_table_set_range): Args changed. Callers changed.
6147 (char_table_set_range): Adjuted for the above change.
6148 (map_sub_char_table): Delete args default_val and parent. Add arg
6149 top. Give decoded values to a Lisp function.
640c8776 6150 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
6151 values to a Lisp function. Gcpro more variables.
6152 (uniprop_table_uncompress)
6153 (uniprop_decode_value_run_length): New functions.
6154 (uniprop_decoder, uniprop_decoder_count): New variables.
6155 (uniprop_get_decoder, uniprop_encode_value_character)
6156 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
6157 New functions.
6158 (uniprop_encoder, uniprop_encoder_count): New variables.
6159 (uniprop_get_encoder, uniprop_table)
6160 (Funicode_property_table_internal, Fget_unicode_property_internal)
6161 (Fput_unicode_property_internal): New functions.
6162 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
6163 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 6164 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
6165 char-code-property-alist.
6166
640c8776 6167 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
6168 Vunicode_category_table.
6169
640c8776 6170 * font.c (font_range): Adjust for the change of
c805dec0
KH
6171 Vunicode_category_table.
6172
76b397fb
DN
61732011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
6174
6175 * m/iris4d.h: Remove file, move contents ...
6176 * s/irix6-5.h: ... here.
6177
22b4128e
PE
61782011-07-06 Paul Eggert <eggert@cs.ucla.edu>
6179
6180 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
6181 * alloc.c (mark_buffer):
6182 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
6183 (clone_per_buffer_values): Don't assume that
22b4128e
PE
6184 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
6185 This isn't true in general, and it's particularly not true
6186 if Emacs is configured with --with-wide-int.
6187 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
6188 New macros, used in the buffer.c change.
6189
869795d6
JD
61902011-07-05 Jan Djärv <jan.h.d@swipnet.se>
6191
6192 * xsettings.c: Use both GConf and GSettings if both are available.
6193 (store_config_changed_event): Add comment.
6194 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
6195 (store_tool_bar_style_changed): New functions.
5e617bc2 6196 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
6197 (struct xsettings): Move font inside HAVE_XFT.
6198 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 6199 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 6200 Move inside HAVE_XFT.
640c8776 6201 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
6202 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
6203 also.
6204 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 6205 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 6206 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
6207 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
6208 (parse_settings): Move check for font inside HAVE_XFT.
6209 (read_settings, apply_xft_settings): Add comment.
6210 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
6211 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
6212 call store_font_name_changed.
6213 (xft_settings_event): Add comment.
6214 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
6215 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
6216 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
6217 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
6218 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
6219 (xsettings_get_system_font, xsettings_get_system_normal_font):
6220 Add comment.
869795d6 6221
d8ed26bd
PE
62222011-07-05 Paul Eggert <eggert@cs.ucla.edu>
6223
6224 Random fixes. E.g., (random) never returned negative values.
6225 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
6226 subseconds part to the entropy, as that's a bit more random.
6227 Prefer signed to unsigned, since the signedness doesn't matter and
6228 in general we prefer signed. When given a limit, use a
6229 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
6230 latter isn't right if USE_2_TAGS_FOR_INTS.
6231 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
6232 not 0..VALMASK. Don't discard "excess" bits that random () returns.
6233
cabf1cac
SM
62342011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6235
6236 * textprop.c (text_property_stickiness):
6237 Obey Vtext_property_default_nonsticky.
6238 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
6239 * w32fns.c (syms_of_w32fns):
6240 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
6241
6e9b2be9
PE
62422011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6243
6244 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
6245 This is more efficient than Ffile_directory_p and avoids a minor race.
6246
90186c68
LMI
62472011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
6248
7c301272
LMI
6249 * buffer.c (Foverlay_put): Say what the return value is
6250 (bug#7835).
6251
c4f2d8d4
LMI
6252 * fileio.c (barf_or_query_if_file_exists): Check first if the file
6253 is a directory before asking whether to use the file name
6254 (bug#7564).
ad637907
LMI
6255 (barf_or_query_if_file_exists): Make the "File is a directory"
6256 error be more correct.
c4f2d8d4 6257
90186c68
LMI
6258 * fns.c (Frequire): Remove the mention of the .gz files, since
6259 that's installation-specific, but keep the mention of
6260 `get-load-suffixes'.
6261
da64016e
PE
62622011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6263
6264 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
6265 Report string overflow if the output is too long.
6266
7d47b580
JB
62672011-07-04 Juanma Barranquero <lekktu@gmail.com>
6268
a555cb87
JB
6269 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
6270 (syms_of_gnutls): Remove duplicate DEFSYM for
6271 Qgnutls_bootprop_verify_hostname_error, an error for
6272 Qgnutls_bootprop_verify_error (which is no longer used).
6273
7d47b580
JB
6274 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
6275 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
6276 Also (re)move comments that are misplaced or no longer relevant.
6277
1e49bfab
LMI
62782011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6279
6280 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
6281
1485f4c0
CY
62822011-07-03 Chong Yidong <cyd@stupidchicken.com>
6283
6284 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
6285 and background color parameters if they have been changed.
6286
a9ab721e
LMI
62872011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6288
6289 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
6290
cf7cff57
PE
62912011-07-03 Paul Eggert <eggert@cs.ucla.edu>
6292
2e13213d
PE
6293 * xsettings.c (SYSTEM_FONT): Define only when used.
6294 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
6295
cf7cff57
PE
6296 * keymap.c (access_keymap_1): Now static.
6297
7a8e04f7
CY
62982011-07-02 Chong Yidong <cyd@stupidchicken.com>
6299
6300 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
6301 leave any prefix arg for the up event (Bug#1586).
6302
61352f62
LMI
63032011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
6304
69bb1ef7
LMI
6305 * lread.c (syms_of_lread): Mention single symbols defined by
6306 `defvar' or `defconst' (bug#7154).
6307
61352f62 6308 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 6309 (Frequire): Mention get-load-suffixes.
61352f62 6310
28545e04
MR
63112011-07-02 Martin Rudalics <rudalics@gmx.at>
6312
6313 * window.h (window): Remove clone_number slot.
6314 * window.c (Fwindow_clone_number, Fset_window_clone_number):
6315 Remove.
6316 (make_parent_window, make_window, saved_window)
6317 (Fset_window_configuration, save_window_save): Don't deal with
6318 clone numbers.
6319 * buffer.c (Qclone_number): Remove declaration.
6320 (sort_overlays, overlay_strings): Don't deal with clone numbers.
6321
3349e122
SM
63222011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
6323
6324 Add multiple inheritance to keymaps.
6325 * keymap.c (Fmake_composed_keymap): New function.
6326 (Fset_keymap_parent): Simplify.
6327 (fix_submap_inheritance): Remove.
6328 (access_keymap_1): New function extracted from access_keymap to handle
6329 embedded parents and handle lists of maps.
6330 (access_keymap): Use it.
6331 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
6332 (Fcopy_keymap): Handle embedded parents.
6333 (Fcommand_remapping, define_as_prefix): Simplify.
6334 (Fkey_binding): Simplify.
6335 (syms_of_keymap): Move minibuffer-local-completion-map,
6336 minibuffer-local-filename-completion-map,
6337 minibuffer-local-must-match-map, and
6338 minibuffer-local-filename-must-match-map to Elisp.
6339 (syms_of_keymap): Defsubr make-composed-keymap.
6340 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
6341 (parse_menu_item): Trivial simplification.
6342
3279eb87
GM
63432011-07-01 Glenn Morris <rgm@gnu.org>
6344
6345 * Makefile.in (SETTINGS_LIBS): Fix typo.
6346
4550efdf
KI
63472011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
6348
6349 * coding.c (Fencode_coding_string): Record the last coding system
6350 used, as the function doc string says (bug#8738).
6351
0949d2b6
JD
63522011-07-01 Jan Djärv <jan.h.d@swipnet.se>
6353
6354 * xsettings.c (store_monospaced_changed): Take new font as arg and
6355 check for change against current_mono_font.
6356 (EMACS_TYPE_SETTINGS): Remove this and related defines.
6357 (emacs_settings_constructor, emacs_settings_get_property)
6358 (emacs_settings_set_property, emacs_settings_class_init)
6359 (emacs_settings_init, gsettings_obj): Remove.
6360 (something_changedCB): New function for HAVE_GSETTINGS.
6361 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
6362 with value as argument.
6363 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
6364 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 6365 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
6366 "changed".
6367
6368 * xgselect.c: Add defined (HAVE_GSETTINGS).
6369 (xgselect_initialize): Ditto.
6370
6371 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
6372 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
6373 xg_select.
6374
bbc6b304
PE
63752011-07-01 Paul Eggert <eggert@cs.ucla.edu>
6376
6377 * eval.c (struct backtrace): Simplify and port the data structure.
6378 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
6379 signed bit field, as this assumption is not portable and it makes
6380 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
6381 "char debug_on_exit : 1" as this is not portable either; instead,
6382 use the portable "unsigned int debug_on_exit : 1". Remove unused
6383 member evalargs. Remove obsolete comments about cc bombing out.
6384
9851bfc5
JD
63852011-06-30 Jan Djärv <jan.h.d@swipnet.se>
6386
51bb811f 6387 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
6388 Let HAVE_GSETTINGS override HAVE_GCONF.
6389 (store_monospaced_changed): New function.
6390 (EMACS_SETTINGS): A new type derived from GObject to handle
6391 GSettings notifications.
6392 (emacs_settings_constructor, emacs_settings_get_property)
6393 (emacs_settings_set_property, emacs_settings_class_init):
6394 New functions.
6395 (gsettings_client, gsettings_obj): New variables.
6396 (GSETTINGS_SCHEMA): New define.
6397 (something_changedCB): Call store_monospaced_changed.
6398 (init_gsettings): New function.
6399 (xsettings_initialize): Call init_gsettings.
6400 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
6401 to NULL.
6402
640c8776 6403 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
6404 GCONF_CFLAGS/LIBS.
6405
5386012d
MR
64062011-06-29 Martin Rudalics <rudalics@gmx.at>
6407
6408 * window.c (resize_root_window, grow_mini_window)
6409 (shrink_mini_window): Rename Qresize_root_window to
6410 Qwindow_resize_root_window and Qresize_root_window_vertically to
6411 Qwindow_resize_root_window_vertically.
6412
f13e0b08
PE
64132011-06-28 Paul Eggert <eggert@cs.ucla.edu>
6414
6415 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
6416
94515237
JB
64172011-06-27 Juanma Barranquero <lekktu@gmail.com>
6418
6419 * makefile.w32-in: Redesign dependencies so they reflect more
6420 clearly which files are directly included by each source file,
6421 and not through other includes.
6422
e43b6e43
MR
64232011-06-27 Martin Rudalics <rudalics@gmx.at>
6424
6425 * buffer.c (Qclone_number): Declare static and DEFSYM it.
6426 (sort_overlays, overlay_strings): When an overlay's clone number
6427 matches the window's clone number process the overlay even if
6428 the overlay's window property doesn't match the current window.
6429
d68443dc
MR
6430 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
6431 (Fwindow_hchild): Rename to Fwindow_left_child.
6432 (Fwindow_next): Rename to Fwindow_next_sibling.
6433 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
6434 (resize_window_check): Rename to window_resize_check.
6435 (resize_window_apply): Rename to window_resize_apply.
6436 (Fresize_window_apply): Rename to Fwindow_resize_apply.
6437 (Fdelete_other_windows_internal, resize_frame_windows)
6438 (Fsplit_window_internal, Fdelete_window_internal)
6439 (grow_mini_window, shrink_mini_window)
6440 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 6441
c7e73be5
JD
64422011-06-26 Jan Djärv <jan.h.d@swipnet.se>
6443
6444 * emacsgtkfixed.h: State that this is only used with Gtk+3.
6445 (emacs_fixed_set_min_size): Remove.
6446 (emacs_fixed_new): Take frame as argument.
6447
6448 * emacsgtkfixed.c: State that this is only used with Gtk+3.
6449 (_EmacsFixedPrivate): Remove minwidth/height.
6450 Add struct frame *f.
6451 (emacs_fixed_init): Initialize priv->f.
6452 (get_parent_class, emacs_fixed_set_min_size): Remove.
6453 (emacs_fixed_new): Set priv->f to argument.
6454 (emacs_fixed_get_preferred_width)
6455 (emacs_fixed_get_preferred_height): Use min_width/height from
6456 frames size_hint to set minimum and natural (Bug#8919).
6457 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
6458 and use min_width/height from frames size_hint to set
6459 min_width/height (Bug#8919).
6460
6461 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
6462 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
6463 Fix indentation.
c7e73be5 6464
cf99dcf8
EZ
64652011-06-26 Eli Zaretskii <eliz@gnu.org>
6466
6467 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
6468 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
6469 called at ZV.
6470
029529ac
CY
64712011-06-26 Chong Yidong <cyd@stupidchicken.com>
6472
6473 * process.c (wait_reading_process_output): Bypass select if
6474 waiting for a cell while ignoring keyboard input, and input is
6475 pending. Suggested by Jan Djärv (Bug#8869).
6476
7a7ef429
PE
64772011-06-25 Paul Eggert <eggert@cs.ucla.edu>
6478
6479 Use gnulib's dup2 module instead of rolling our own.
6480 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
6481
11fdef7d 64822011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
6483
6484 * dispnew.c (scrolling_window): Before scrolling, turn off a
6485 mouse-highlight in the window being scrolled.
6486
cd3520a4
JB
64872011-06-24 Juanma Barranquero <lekktu@gmail.com>
6488
6489 Move DEFSYM to lisp.h and use everywhere.
6490
6491 * character.h (DEFSYM): Move declaration...
6492 * lisp.h (DEFSYM): ...here.
6493
6494 * gnutls.c:
6495 * minibuf.c:
6496 * w32menu.c:
6497 * w32proc.c:
6498 * w32select.c: Don't include character.h.
6499
6500 * alloc.c (syms_of_alloc):
6501 * buffer.c (syms_of_buffer):
6502 * bytecode.c (syms_of_bytecode):
6503 * callint.c (syms_of_callint):
6504 * casefiddle.c (syms_of_casefiddle):
6505 * casetab.c (init_casetab_once):
6506 * category.c (init_category_once, syms_of_category):
6507 * ccl.c (syms_of_ccl):
6508 * cmds.c (syms_of_cmds):
6509 * composite.c (syms_of_composite):
6510 * dbusbind.c (syms_of_dbusbind):
6511 * dired.c (syms_of_dired):
6512 * dispnew.c (syms_of_display):
6513 * doc.c (syms_of_doc):
6514 * editfns.c (syms_of_editfns):
6515 * emacs.c (syms_of_emacs):
6516 * eval.c (syms_of_eval):
6517 * fileio.c (syms_of_fileio):
6518 * fns.c (syms_of_fns):
6519 * frame.c (syms_of_frame):
6520 * fringe.c (syms_of_fringe):
6521 * insdel.c (syms_of_insdel):
6522 * keymap.c (syms_of_keymap):
6523 * lread.c (init_obarray, syms_of_lread):
6524 * macros.c (syms_of_macros):
6525 * msdos.c (syms_of_msdos):
6526 * print.c (syms_of_print):
6527 * process.c (syms_of_process):
6528 * search.c (syms_of_search):
6529 * sound.c (syms_of_sound):
6530 * syntax.c (init_syntax_once, syms_of_syntax):
6531 * terminal.c (syms_of_terminal):
6532 * textprop.c (syms_of_textprop):
6533 * undo.c (syms_of_undo):
6534 * w32.c (globals_of_w32):
6535 * window.c (syms_of_window):
6536 * xdisp.c (syms_of_xdisp):
6537 * xfaces.c (syms_of_xfaces):
6538 * xfns.c (syms_of_xfns):
6539 * xmenu.c (syms_of_xmenu):
6540 * xsettings.c (syms_of_xsettings):
6541 * xterm.c (syms_of_xterm): Use DEFSYM.
6542
4228cf16
TZ
65432011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
6544
cd3520a4 6545 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 6546
7fcccf1e
PE
65472011-06-23 Paul Eggert <eggert@cs.ucla.edu>
6548
7efb4e0e
PE
6549 Integer and buffer overflow fixes (Bug#8873).
6550
ff5844ad
PE
6551 * print.c (printchar, strout): Check for string overflow.
6552 (PRINTPREPARE, printchar, strout):
6553 Don't set size unless allocation succeeds.
6554
90532f02
PE
6555 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
6556 for sizes. Check for string overflow more accurately.
6557 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
6558
6d84508d
PE
6559 * macros.c: Integer and buffer overflow fixes.
6560 * keyboard.h (struct keyboard.kbd_macro_bufsize):
6561 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
6562 Use ptrdiff_t, not int, for sizes.
6563 Don't increment bufsize until after realloc succeeds.
6564 Check for size-calculation overflow.
6565 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
6566
437b2cb4
PE
6567 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
6568
8b9ac8b4
PE
6569 * lread.c: Integer overflow fixes.
6570 (read_integer): Radix is now EMACS_INT, not int,
6571 to improve quality of diagnostics for out-of-range radices.
6572 Calculate buffer size correctly for out-of-range radices.
6573 (read1): Check for integer overflow in radices, and in
6574 read-circle numbers.
82cb60d3
PE
6575 (read_escape): Avoid int overflow.
6576 (Fload, openp, read_buffer_size, read1)
6577 (substitute_object_recurse, read_vector, read_list, map_obarray):
6578 Use ptrdiff_t, not int, for sizes.
6579 (read1): Use EMACS_INT, not int, for sizes.
20270765 6580 Check for size overflow.
8b9ac8b4 6581
7fcccf1e
PE
6582 * image.c (cache_image): Check for size arithmetic overflow.
6583
bfbbd7e7
PE
6584 * lread.c: Integer overflow issues.
6585 (saved_doc_string_size, saved_doc_string_length)
6586 (prev_saved_doc_string_size, prev_saved_doc_string_length):
6587 Now ptrdiff_t, not int.
6588 (read1): Don't assume doc string length fits in int. Check for
6589 out-of-range doc string lengths.
6590 (read_list): Don't assume file position fits in int.
39019e54 6591 (read_escape): Check for hex character overflow.
bfbbd7e7 6592
4e323265
LL
65932011-06-22 Leo Liu <sdl.web@gmail.com>
6594
6595 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
6596 Move to minibuffer.el.
6597
85fece3e
PE
65982011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6599
20b84ce9 6600 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
6601 The following patches are for when GLYPH_DEBUG && !XASSERT.
6602 * dispextern.h (trace_redisplay_p, dump_glyph_string):
6603 * dispnew.c (flush_stdout):
6604 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
6605 Mark as externally visible.
6606 * dispnew.c (check_window_matrix_pointers): Now static.
6607 * dispnew.c (window_to_frame_vpos):
6608 * xfns.c (unwind_create_frame):
6609 * xterm.c (x_check_font): Remove unused local.
6610 * scroll.c (CHECK_BOUNDS):
6611 * xfaces.c (cache_fache): Rename local to avoid shadowing.
6612 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
6613 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
6614 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
6615 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
6616 Now static.
6617 (debug_method_add): Use va_list and vsprintf rather than relying
6618 on undefined behavior with wrong number of arguments.
6619 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
6620 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
6621 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
6622 since we're not interested in debugging glyphs with old libraries.
6623 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
6624 GCC 4.6.0's static checking.
6625
0766b489
PE
66262011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6627
31fd4b32
PE
6628 Integer overflow and signedness fixes (Bug#8873).
6629 A few related buffer overrun fixes, too.
6630
b79e8648
PE
6631 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
6632
0766b489
PE
6633 * dispextern.h (struct face.stipple):
6634 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
6635 (x_bitmap_mask, x_allocate_bitmap_record)
6636 (x_create_bitmap_from_data, x_create_bitmap_from_file)
6637 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
6638 (x_create_bitmap_from_xpm_data):
6639 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
6640 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
6641 (.bitmaps_last):
6642 * xfaces.c (load_pixmap):
6643 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
6644 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
6645 (.bitmaps_last, struct x_output.icon_bitmap):
6646 Use ptrdiff_t, not int, for bitmap indexes.
6647 (x_allocate_bitmap_record): Check for size overflow.
6648 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
6649
b081724f
PE
6650 Use ptrdiff_t, not int, for overlay counts.
6651 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
6652 * editfns.c (overlays_around, get_pos_property):
6653 * textprop.c (get_char_property_and_overlay):
6654 * xdisp.c (next_overlay_change, note_mouse_highlight):
6655 * xfaces.c (face_at_buffer_position):
21514da7
PE
6656 * buffer.c (OVERLAY_COUNT_MAX): New macro.
6657 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
6658 (Fnext_overlay_change, Fprevious_overlay_change)
6659 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 6660 Use ptrdiff_t, not int, for sizes.
21514da7 6661 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 6662
3de73e5e
PE
6663 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
6664
2606c57b
PE
6665 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
6666 (x_session_initialize): Do not assume string length fits in int.
6667
aaafe47a
PE
6668 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
6669 This is unlikely, but can occur if DPI is outlandish.
6670
2674ddc8 6671 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
6672 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
6673
28154962
PE
6674 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
6675 * xrdb.c (magic_file_p, search_magic_path):
6676 Omit last arg SUFFIX; it was always 0. All callers changed.
6677 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
6678
7de51af5
PE
6679 * xfont.c (xfont_match): Avoid need for strlen.
6680
25ed6cc3
PE
6681 * xfns.c: Don't assume strlen fits in int.
6682 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
6683
4eab31dd
PE
6684 * xdisp.c (message_log_check_duplicate): Return intmax_t,
6685 not unsigned long, as we prefer signed integers. All callers changed.
6686 Detect integer overflow in repeat count.
6687 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 6688 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 6689
171e2a58
PE
6690 * termcap.c: Don't assume sizes fit in int and never overflow.
6691 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
6692 (gobble_line): Check for size-calculation overflow.
6693
ad39faca 6694 * minibuf.c (Fread_buffer):
6e5bb2dc 6695 * lread.c (intern, intern_c_string):
74ca2eb3
PE
6696 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
6697 Don't assume string length fits in int.
6698
52c61c22 6699 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
6700 * gtkutil.c (style_changed_cb): Avoid need for strlen.
6701
b5b8c9e5
PE
6702 * font.c: Don't assume string length fits in int.
6703 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
6704 Use ptrdiff_t, not int.
ccd6111c
PE
6705 (font_intern_prop): Don't assume string length fits in int.
6706 Don't assume integer property fits in fixnum.
6707 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 6708
882f0d81 6709 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 6710 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
6711 Reformulate so as not to need the command string.
6712 Invoke gzip -cd rather than gunzip, as it's more portable.
6713 (lock_info_type, lock_file_1, lock_file):
6714 Don't assume pid_t and time_t fit in unsigned long.
6715 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
6716 (current_lock_owner): Prefer signed type for sizes.
6717 Use memcpy, not strncpy, where memcpy is what is really wanted.
6718 Don't assume (via atoi) that time_t and pid_t fit in int.
6719 Check for time_t and/or pid_t out of range, e.g., via a network share.
6720 Don't alloca where an auto var works fine.
6721
93f4cf88
PE
6722 * fileio.c: Fix some integer overflow issues.
6723 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
6724 Don't assume string length fits in int.
6725 (directory_file_name): Don't assume string length fits in long.
6726 (make_temp_name): Don't assume pid fits in int, or that its print
6727 length is less than 20.
6728
f3e92b69
PE
6729 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
6730
1bfdaf10
PE
6731 * coding.c (make_subsidiaries): Don't assume string length fits in int.
6732
35016e9a
PE
6733 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
6734
3d1e65a1
PE
6735 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
6736 We prefer signed integers, even for size calculations.
6737
0b963a93
PE
6738 * emacs.c: Don't assume string length fits in 'int'.
6739 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
6740 (main): Don't invoke strlen when not needed.
6741
573f4b54
PE
6742 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
6743 (XD_DEBUG_MESSAGE): Don't waste a byte.
6744
989f33ba
PE
6745 * callproc.c (getenv_internal_1, getenv_internal)
6746 (Fgetenv_internal):
965d34eb
PE
6747 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
6748
e4d29b33
PE
6749 * lread.c (invalid_syntax): Omit length argument.
6750 All uses changed. This doesn't fix a bug, but it simplifies the
6751 code away from its former Hollerith-constant appearance, and it's
6752 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 6753 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 6754
eb49b136
PE
6755 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
6756 This didn't break anything, but it didn't help either.
6757 It's confusing to put a bogus integer in a place where the actual
6758 value does not matter.
9f62aeb1 6759 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 6760 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 6761
15375a22
PE
6762 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
6763 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
6764 implementation.
b61cc01c
PE
6765 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
6766 We prefer signed types, and the value cannot exceed the EMACS_INT
6767 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
6768 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
6769 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
6770 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 6771
53b2623d
PE
6772 * indent.c (sane_tab_width): New function.
6773 (current_column, scan_for_column, Findent_to, position_indentation)
6774 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 6775 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 6776
51cab52b 6777 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 6778
f2ed8a70
PE
6779 * lisp.h (lint_assume): New macro.
6780 * composite.c (composition_gstring_put_cache):
6781 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
6782
abe80cc6
PE
6783 * editfns.c, insdel.c:
6784 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 6785
b02c740e
PE
6786 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
6787
ebc96716
PE
6788 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
6789
b4e50fa0 6790 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 6791 Use much-faster test for byte-length change.
311d5d7c 6792 Don't assume string byte-length fits in 'int'.
a4cf38e4 6793 Check that character arg fits in 'int'.
85461888 6794 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 6795
c0c1ee9f
PE
6796 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
6797
a498d7f4
PE
6798 * fns.c (concat): Catch string overflow earlier.
6799 Do not rely on integer wraparound.
6800
51cab52b
PE
6801 * dispextern.h (struct it.overlay_strings_charpos)
6802 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
6803 * xdisp.c (forward_to_next_line_start)
6804 (back_to_previous_visible_line_start)
6805 (reseat_at_next_visible_line_start, next_element_from_buffer):
6806 Don't arbitrarily truncate the value of 'selective' to int.
6807
76031fad
PE
6808 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
6809
5eb55db9
PE
6810 * composite.c: Don't truncate sizes to 'int'.
6811 (composition_gstring_p, composition_reseat_it)
6812 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
6813 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
6814 not EMACS_UINT, for indexes.
5eb55db9 6815
0703a717
PE
6816 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
6817
d6202519
PE
6818 * buffer.c: Include <verify.h>.
6819 (struct sortvec.priority, struct sortstr.priority):
8961a454 6820 Now EMACS_INT, not int.
c20998a7 6821 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
6822 (struct sortstr.size, record_overlay_string)
6823 (struct sortstrlist.size, struct sortlist.used):
6824 Don't truncate size to int.
6825 (record_overlay_string): Check for size-calculation overflow.
d6202519 6826 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 6827
d5a19415
JM
68282011-06-22 Jim Meyering <meyering@redhat.com>
6829
029529ac 6830 Don't leak an XBM-image-sized buffer
d5a19415
JM
6831 * image.c (xbm_load): Free the image buffer after using it.
6832
a9041e6c
PE
68332011-06-21 Paul Eggert <eggert@cs.ucla.edu>
6834
6835 Port to Sun C.
6836 * composite.c (find_automatic_composition): Omit needless 'return 0;'
6837 that Sun C diagnosed.
6838 * fns.c (secure_hash): Fix pointer signedness issue.
6839 * intervals.c (static_offset_intervals): New function.
6840 (offset_intervals): Use it.
6841
7f3f739f
LL
68422011-06-21 Leo Liu <sdl.web@gmail.com>
6843
6844 * deps.mk (fns.o):
6845 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
6846 sha512.h.
6847
6848 * fns.c (secure_hash): Rename from crypto_hash_function and change
6849 the first arg to accept symbols.
5b66d427 6850 (Fsecure_hash): New primitive.
7f3f739f
LL
6851 (syms_of_fns): New symbols.
6852
76147d94
DD
68532011-06-20 Deniz Dogan <deniz@dogan.se>
6854
6855 * process.c (Fset_process_buffer): Clarify return value in
6856 docstring.
6857
7d7d0045
CY
68582011-06-18 Chong Yidong <cyd@stupidchicken.com>
6859
6860 * dispnew.c (add_window_display_history): Use BVAR.
6861
6862 * xdisp.c (debug_method_add): Use BVAR.
6863 (check_window_end, dump_glyph_matrix, dump_glyph)
6864 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
6865
6866 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
6867 Likewise.
6868
6869 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
6870 check till after the cache is created in init_frame_faces.
6871
ff2bc410
SM
68722011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
6873
6874 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
6875
28177add
PE
68762011-06-16 Paul Eggert <eggert@cs.ucla.edu>
6877
dd3482fe
PE
6878 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
6879 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
6880 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
6881
393d71f3 6882 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
6883 * fileio.c (Finsert_file_contents):
6884 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
6885 Remove the old (too-loose) buffer overflow checks.
6886 They weren't needed, since make_gap checks for buffer overflow.
6887 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
6888 The old code merely checked for Emacs fixnum overflow, and relied
6889 on undefined (wraparound) behavior. The new code avoids undefined
6890 behavior, and also checks for ptrdiff_t and/or size_t overflow.
6891
2e6813b0 6892 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
6893 Tune. Don't use wider integers than needed. Don't use alloca.
6894 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 6895
599a9e4f
PE
6896 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
6897
99561444
PE
6898 * insdel.c, lisp.h (buffer_overflow): New function.
6899 (insert_from_buffer_1, replace_range, replace_range_2):
6900 * insdel.c (make_gap_larger):
6901 * editfns.c (Finsert_char):
6902 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
6903
28177add
PE
6904 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
6905
e69dafad
PE
69062011-06-15 Paul Eggert <eggert@cs.ucla.edu>
6907
4baa020d 6908 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 6909
b1c46f02
PE
6910 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
6911 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
6912
e69dafad
PE
6913 * fileio.c: Don't assume EMACS_INT fits in off_t.
6914 (emacs_lseek): New static function.
6915 (Finsert_file_contents, Fwrite_region): Use it.
6916 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
6917
566684ea
PE
6918 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
6919
e6966cd6
PE
6920 * fns.c: Don't overflow int when computing a list length.
6921 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
6922 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
6923 truncation on 64-bit hosts. Check for QUIT every
6924 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
6925 faster and is responsive enough.
6926 (Flength): Report an error instead of overflowing an integer.
6927 (Fsafe_length): Return a float if the value is not representable
6928 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 6929 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 6930 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 6931
dd0b0efb
PE
6932 * alloc.c: Check that resized vectors' lengths fit in fixnums.
6933 (header_size, word_size): New constants.
6934 (allocate_vectorlike): Don't check size overflow here.
6935 (allocate_vector): Check it here instead, since this is the only
6936 caller of allocate_vectorlike that could cause overflow.
6937 Check that the new vector's length is representable as a fixnum.
6938
86fe5cfe
PE
6939 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
6940 The previous code was bogus. For example, next_almost_prime (32)
6941 returned 39, which is undesirable as it is a multiple of 3; and
6942 next_almost_prime (24) returned 25, which is a multiple of 5 so
6943 why was the code bothering to check for multiples of 7?
6944
80e88859
PE
6945 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
6946
4a2f0ad6
PE
6947 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
6948
f66c7cf8
PE
6949 Variadic C functions now count arguments with ptrdiff_t.
6950 This partly undoes my 2011-03-30 change, which replaced int with size_t.
6951 Back then I didn't know that the Emacs coding style prefers signed int.
6952 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
6953 were being counted with int, which may truncate counts on 64-bit
6954 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
6955 * lisp.h (struct Lisp_Subr.function.aMANY)
6956 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
6957 Arg counts are now ptrdiff_t, not size_t.
6958 All variadic functions and their callers changed accordingly.
6959 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
6960 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
6961 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
6962 * callint.c (Fcall_interactively): Check arg count for overflow,
6963 to avoid potential buffer overrun. Use signed char, not 'int',
6964 for 'varies' array, so that we needn't bother to check its size
6965 calculation for overflow.
6966 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
6967 * eval.c (apply_lambda):
6968 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
6969 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
6970 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
6971
a1759b76
PE
6972 * callint.c (Fcall_interactively): Don't use index var as event count.
6973
d96be9fc
PE
6974 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
6975 * mem-limits.h (SIZE): Remove; no longer used.
6976
a690a978 6977 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 6978
578c21e6
PE
6979 Remove unnecessary casts.
6980 * xterm.c (x_term_init):
6981 * xfns.c (x_set_border_pixel):
6982 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
6983 These aren't needed now that we assume ANSI C.
6984
96f53c6c
PE
6985 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6986 It's more likely to cause problems (due to unsigned overflow)
6987 than to cure them.
6988
83c77d31
PE
6989 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6990
ee2079f1
PE
6991 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6992
6da65536
PE
6993 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6994
7147c4a4
PE
6995 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6996
193e32d9
PE
6997 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6998
e5533da6
PE
6999 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
7000
9910e595
PE
7001 GLYPH_CODE_FACE returns EMACS_INT, not int.
7002 * dispextern.h (merge_faces):
7003 * xfaces.c (merge_faces):
01103c44
PE
7004 * xdisp.c (get_next_display_element, next_element_from_display_vector):
7005 Don't assume EMACS_INT fits in int.
9910e595 7006
2638320e
PE
7007 * character.h (CHAR_VALID_P): Remove unused parameter.
7008 * fontset.c, lisp.h, xdisp.c: All uses changed.
7009
045eb8d9
PE
7010 * editfns.c (Ftranslate_region_internal): Omit redundant test.
7011
c1f134b5
PE
7012 * fns.c (concat): Minor tuning based on overflow analysis.
7013 This doesn't fix any bugs. Use int to hold character, instead
7014 of constantly refetching from Emacs object. Use XFASTINT, not
7015 XINT, for value known to be a character. Don't bother comparing
7016 a single byte to 0400, as it's always less.
7017
395fcb93 7018 * floatfns.c (Fexpt):
327eeec8
PE
7019 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
7020
abbd3d23
PE
7021 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
7022 for characters.
7023
684a03ef
PE
7024 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
7025
0fed43f3
PE
7026 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
7027 Without this fix, on a 64-bit host (aset S 0 4294967386) would
7028 incorrectly succeed when S was a string, because 4294967386 was
7029 truncated before it was used.
7030
8fd02eb7
PE
7031 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
7032 Otherwise, an out-of-range integer could cause undefined behavior
7033 on a 64-bit host.
7034
f8c86b69
PE
7035 * composite.c: Use int, not EMACS_INT, for characters.
7036 (fill_gstring_body, composition_compute_stop_pos): Use int, not
7037 EMACS_INT, for values that are known to be in character range.
7038 This doesn't fix any bugs but is the usual style inside Emacs and
7039 may generate better code on 32-bit machines.
7040
34206dd2
PE
7041 Make sure a 64-bit char is never passed to ENCODE_CHAR.
7042 This is for reasons similar to the recent CHAR_STRING fix.
7043 * charset.c (Fencode_char): Check that character arg is actually
7044 a character. Pass an int to ENCODE_CHAR.
7045 * charset.h (ENCODE_CHAR): Verify that the character argument is no
7046 wider than 'int', as a compile-time check to prevent future regressions
7047 in this area.
7048
c5958d4c 7049 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
7050
7051 Make sure a 64-bit char is never passed to CHAR_STRING.
7052 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
7053 by silently ignoring the top 32 bits, allowing some values
7054 that were far too large to be valid characters.
7055 * character.h: Include <verify.h>.
7056 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
7057 arguments are no wider than unsigned, as a compile-time check
7058 to prevent future regressions in this area.
7059 * data.c (Faset):
01103c44 7060 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
7061 (Fsubst_char_in_region):
7062 * fns.c (concat):
7063 * xdisp.c (decode_mode_spec_coding):
7064 Adjust to CHAR_STRING's new requirement.
7065 * editfns.c (Finsert_char, Fsubst_char_in_region):
7066 * fns.c (concat): Check that character args are actually
7067 characters. Without this test, these functions did the wrong
7068 thing with wildly out-of-range values on 64-bit hosts.
7069
d37ca623
PE
7070 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
7071 These casts should not be needed on 32-bit hosts, either.
7072 * keyboard.c (read_char):
7073 * lread.c (Fload): Remove casts to unsigned.
7074
ea204efb
PE
7075 * lisp.h (UNSIGNED_CMP): New macro.
7076 This fixes comparison bugs on 64-bit hosts.
7077 (ASCII_CHAR_P): Use it.
7078 * casefiddle.c (casify_object):
01103c44 7079 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
7080 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
7081 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
7082 * dispextern.h (FACE_FROM_ID):
7083 * keyboard.c (read_char): Use UNSIGNED_CMP.
7084
41cb286c
PE
7085 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
7086 not to EMACS_INT, to avoid GCC warning.
7087
4a1b9832
PE
7088 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
7089
55daad71
PE
7090 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
7091 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
7092 isn't needed on 32-bit machines.
8f95c75c 7093
01103c44
PE
7094 * buffer.c (Fgenerate_new_buffer_name):
7095 Use EMACS_INT for count, not int.
0ceccced 7096 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
7097
7098 * data.c (Qcompiled_function): Now static.
7099
c6f072e7
PE
7100 * window.c (window_body_lines): Now static.
7101
20ce5912
PE
7102 * image.c (gif_load): Rename local to avoid shadowing.
7103
9c4c5f81
PE
7104 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
7105 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
7106 * alloc.c (make_save_value): Integer argument is now of type
7107 ptrdiff_t, not int.
7108 (mark_object): Use ptrdiff_t, not int.
7109 * lisp.h (pD): New macro.
7110 * print.c (print_object): Use it.
7111
c0c5c8ae
PE
7112 * alloc.c: Use EMACS_INT, not int, to count objects.
7113 (total_conses, total_markers, total_symbols, total_vector_size)
7114 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
7115 (total_free_floats, total_floats, total_free_intervals)
7116 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
7117 Now EMACS_INT, not int. All uses changed.
7118 (Fgarbage_collect): Compute overall total using a double, so that
7119 integer overflow is less likely to be a problem. Check for overflow
7120 when converting back to an integer.
5a25e253
PE
7121 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
7122 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
7123 These were 'int' variables that could overflow on 64-bit hosts;
7124 they were never used, so remove them instead of repairing them.
211a0b2a 7125 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
7126 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
7127 Previously, this ceilinged at INT_MAX, but that doesn't work on
7128 64-bit machines.
e46bb31a 7129 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 7130
c78baabf 7131 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 7132 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
7133 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
7134 when a (possibly-narrower) signed value would do just as well.
7135 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 7136
c9d624c6
PE
7137 * alloc.c: Catch some string size overflows that we were missing.
7138 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
7139 for convenience in STRING_BYTES_MAX.
7140 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
7141 The definition here is exact; the one in lisp.h was approximate.
7142 (allocate_string_data): Check for string overflow. This catches
7143 some instances we weren't catching before. Also, it catches
7144 size_t overflow on (unusual) hosts where SIZE_MAX <= min
7145 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
7146 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 7147
c9d624c6
PE
7148 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
7149 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 7150 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 7151
353032ce
PE
7152 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
7153
2bccce07
PE
7154 * alloc.c (Fmake_string): Check for out-of-range init.
7155
0ac30604
SM
71562011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
7157
7158 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
7159
c195f2de
JD
71602011-06-14 Jan Djärv <jan.h.d@swipnet.se>
7161
7162 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
7163 xg_get_default_scrollbar_width.
7164
7165 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
7166 (int_gtk_range_get_value): Move to the scroll bar part of the file.
7167 (style_changed_cb): Call update_theme_scrollbar_width and call
7168 x_set_scroll_bar_default_width and xg_frame_set_char_size for
7169 all frames (Bug#8505).
7170 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
7171 Call gtk_window_set_resizable if HAVE_GTK3.
7172 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
7173 and height if HAVE_GTK3 (Bug#8505).
7174 (scroll_bar_width_for_theme): New variable.
7175 (update_theme_scrollbar_width): New function.
7176 (xg_get_default_scrollbar_width): Move code to
7177 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
7178 (xg_initialize): Call update_theme_scrollbar_width.
7179
7180 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
7181
7182 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
7183
e10ac9f1
MR
71842011-06-12 Martin Rudalics <rudalics@gmx.at>
7185
7186 * frame.c (make_frame): Call other_buffer_safely instead of
7187 other_buffer.
7188
7189 * window.c (temp_output_buffer_show): Call display_buffer with
7190 second argument Vtemp_buffer_show_specifiers and reset latter
7191 immediately after the call.
7192 (Vtemp_buffer_show_specifiers): New variable.
7193 (auto_window_vscroll_p, next_screen_context_lines)
7194 (Vscroll_preserve_screen_position): Remove leading asterisks from
7195 doc-strings.
7196
2d3c217e 71972011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 7198
7b7f97e8 7199 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
7200 * buffer.c (Qclone_number): Remove for now, as it's unused.
7201 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
7202 (record_buffer): Remove unused local.
7203 * frame.c (other_visible_frames, frame_buffer_list): Now static.
7204 (set_frame_buffer_list): Remove; unused.
7205 * frame.h (other_visible_frames): Remove decl.
7206 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
7207 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
7208 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
7209 if HAVE_GPM.
7210 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
7211 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
7212 Define only if HAVE_GPM.
7213 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
7214 (update_hints_inhibit): Remove; never set. All uses removed.
7215 * widgetprv.h (emacsFrameClassRec): Remove decl.
7216 * window.c (delete_deletable_window): Now returns void, since it
7217 wasn't returning anything.
7218 (compare_window_configurations): Remove unused locals.
7219 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
7220 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
7221 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
7222 the same widths as pointers. This follows up on the 2011-05-06 patch.
7223 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
7224 * xterm.h: Likewise.
7225 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
7226
1384b89e
JB
72272011-06-12 Juanma Barranquero <lekktu@gmail.com>
7228
7229 * makefile.w32-in: Update dependencies.
7230 (LISP_H): Add lib/intprops.h.
7231
1100a63c
CY
72322011-06-11 Chong Yidong <cyd@stupidchicken.com>
7233
7234 * image.c (gif_load): Add animation frame delay to the metadata.
7235 (syms_of_image): Use DEFSYM. New symbol `delay'.
7236
6198ccd0
MR
72372011-06-11 Martin Rudalics <rudalics@gmx.at>
7238
7239 * window.c (delete_deletable_window): Re-add.
7240 (Fset_window_configuration): Rewrite to handle dead buffers and
7241 consequently deletable windows.
7242 (window_tree, Fwindow_tree): Remove. Supply functionality in
7243 window.el.
7244 (compare_window_configurations): Simplify code.
7245
b6e3633c
AS
72462011-06-11 Andreas Schwab <schwab@linux-m68k.org>
7247
1ab0dee5
AS
7248 * image.c (imagemagick_load_image): Fix type mismatch.
7249 (Fimagemagick_types): Likewise.
7250
b6e3633c
AS
7251 * window.h (replace_buffer_in_windows): Declare.
7252
9397e56f
MR
72532011-06-11 Martin Rudalics <rudalics@gmx.at>
7254
7255 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
7256 Qclone_number. Remove external declaration of Qdelete_window.
7257 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
7258 code.
640c8776
SM
7259 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
7260 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
7261 (Fother_buffer): Rewrite doc-string. Major rewrite for new
7262 buffer list implementation.
7263 (other_buffer_safely): New function.
7264 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
7265 calls to replace_buffer_in_windows and
7266 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
7267 if allowed.
7268 (record_buffer): Inhibit quitting and rewrite using quittable
7269 functions. Run Qbuffer_list_update_hook if allowed.
7270 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
7271 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
7272 Move switch-to-buffer to window.el.
9397e56f
MR
7273 (bury-buffer): Move to window.el.
7274 (Vbuffer_list_update_hook): New variable.
7275
7276 * lisp.h (other_buffer_safely): Add prototype in buffer.c
7277 section.
7278
7279 * window.h (resize_frame_windows): Move up in code.
7280 (Fwindow_frame): Remove EXFUN.
7281 (replace_buffer_in_all_windows): Remove prototype.
7282 (replace_buffer_in_windows_safely): Add prototype.
7283
7284 * window.c: Declare Qdelete_window static again. Move down
7285 declaration of select_count.
7286 (Fnext_window, Fprevious_window): Rewrite doc-strings.
7287 (Fother_window): Move to window.el.
7288 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
7289 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
7290 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
7291 window.el.
7292 (replace_buffer_in_windows): Implement by calling
7293 Qreplace_buffer_in_windows.
7294 (replace_buffer_in_all_windows): Remove with some functionality
7295 moved into replace_buffer_in_windows_safely.
7296 (replace_buffer_in_windows_safely): New function.
7297 (select_window_norecord, select_frame_norecord): Move in front
7298 of run_window_configuration_change_hook. Remove now obsolete
7299 declarations.
640c8776
SM
7300 (Fset_window_buffer): Rewrite doc-string.
7301 Call Qrecord_window_buffer.
9397e56f
MR
7302 (keys_of_window): Move binding for other-window to window.el.
7303
b50691aa
CY
73042011-06-11 Chong Yidong <cyd@stupidchicken.com>
7305
7306 * dispextern.h (struct image): Replace data member, whose int_val
7307 and ptr_val fields were not used by anything, with a single
7308 lisp_val object.
7309
7310 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
7311 (gif_clear_image, gif_load, imagemagick_load_image)
7312 (gs_clear_image, gs_load): Callers changed.
7313
3f754b86
PE
73142011-06-10 Paul Eggert <eggert@cs.ucla.edu>
7315
cca69397
PE
7316 * buffer.h: Include <time.h>, for time_t.
7317 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
7318
109e28d0
PE
7319 Fix minor problems found by static checking.
7320
60737f02
PE
7321 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
7322
4b66faf3
PE
7323 Make identifiers static if they are not used in other modules.
7324 * data.c (Qcompiled_function, Qframe, Qvector):
7325 * image.c (QimageMagick, Qsvg):
7326 * minibuf.c (Qmetadata):
7327 * window.c (resize_window_check, resize_root_window): Now static.
7328 * window.h (resize_window_check, resize_root_window): Remove decls.
7329
109e28d0
PE
7330 * window.c (window_deletion_count, delete_deletable_window):
7331 Remove; unused.
46a4ce9e
PE
7332 (window_body_lines): Now static.
7333 (Fdelete_other_windows_internal): Mark vars as initialized.
7334 Make sure 'resize_failed' is initialized.
7335 (run_window_configuration_change_hook): Rename local to avoid shadowing.
7336 (resize_window_apply): Remove unused local.
7337 * window.h (delete_deletable_window): Remove decl.
7338
109e28d0 7339 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
7340 (imagemagick_load_image): Fix pointer signedness problem by changing
7341 last arg from unsigned char * to char *. All uses changed.
7342 Also, fix a local for similar reasons.
7343 Remove unused locals. Remove locals to avoid shadowing.
7344 (fn_rsvg_handle_free): Remove; unused.
7345 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 7346 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 7347
3f754b86
PE
7348 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
7349
2547adb1
CY
73502011-06-10 Chong Yidong <cyd@stupidchicken.com>
7351
7352 * image.c (gif_load): Fix omitted cast error introduced by
7353 2011-06-06 change.
7354
2c8e37d4
MR
73552011-06-10 Martin Rudalics <rudalics@gmx.at>
7356
7357 * window.h (resize_proportionally, orig_total_lines)
7358 (orig_top_line): Remove from window structure.
7359 (set_window_height, set_window_width, change_window_heights)
7360 (Fdelete_window): Remove prototypes.
7361 (resize_frame_windows): Remove duplicate declaration.
7362
440a42e3
EZ
73632011-06-10 Eli Zaretskii <eliz@gnu.org>
7364
7365 * window.h (resize_frame_windows, resize_window_check)
7366 (delete_deletable_window, resize_root_window)
7367 (resize_frame_windows): Declare prototypes.
7368
7369 * window.c (resize_window_apply): Make definition be "static" to
7370 match the prototype.
7371
562dd5e9
MR
73722011-06-10 Martin Rudalics <rudalics@gmx.at>
7373
7374 * window.c: Remove declarations of Qwindow_size_fixed,
7375 window_min_size_1, window_min_size_2, window_min_size,
7376 size_window, window_fixed_size_p, enlarge_window, delete_window.
7377 Remove static from declaration of Qdelete_window, it's
7378 temporarily needed by Fbury_buffer.
7379 (replace_window): Don't assign orig_top_line and
7380 orig_total_lines.
7381 (Fdelete_window, delete_window): Remove. Window deletion is
7382 handled by window.el.
640c8776
SM
7383 (window_loop): Remove DELETE_OTHER_WINDOWS case.
7384 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
7385 (Fdelete_other_windows): Remove. Deleting other windows is
7386 handled by window.el.
7387 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
7388 handled in window.el.
7389 (window_min_size_2, window_min_size_1, window_min_size): Remove.
7390 Window minimum sizes are handled in window.el.
7391 (shrink_windows, size_window, set_window_height)
7392 (set_window_width, change_window_heights, window_height)
7393 (window_width, CURBEG, CURSIZE, enlarge_window)
7394 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
7395 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
7396 handled in window.el.
7397 (make_dummy_parent): Rename to make_parent_window and give it a
7398 second argument horflag.
7399 (make_window): Don't set resize_proportionally any more.
7400 (Fsplit_window): Remove. Windows are split in window.el.
7401 (save_restore_action, save_restore_orig_size)
7402 (shrink_window_lowest_first, save_restore_orig_size): Remove.
7403 Resize mini windows in window.el.
7404 (grow_mini_window, shrink_mini_window): Implement by calling
7405 Qresize_root_window_vertically, resize_window_check and
7406 resize_window_apply.
640c8776
SM
7407 (saved_window, Fset_window_configuration, save_window_save):
7408 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
7409 resize_proportionally.
7410 (window_min_height, window_min_width): Move to window.el.
7411 (keys_of_window): Move bindings for delete-other-windows,
7412 split-window, delete-window and enlarge-window to window.el.
7413
7414 * buffer.c: Temporarily extern Qdelete_window.
7415 (Fbury_buffer): Temporarily call Qdelete_window instead of
7416 Fdelete_window (Fbury_buffer will move to window.el soon).
7417
7418 * frame.c (set_menu_bar_lines_1): Remove code handling
7419 orig_top_line and orig_total_lines.
7420
7421 * dispnew.c (adjust_frame_glyphs_initially): Don't use
7422 set_window_height but set heights directly.
7423 (change_frame_size_1): Use resize_frame_windows.
7424
7425 * xdisp.c (init_xdisp): Don't use set_window_height but set
7426 heights directly.
7427
640c8776
SM
7428 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
7429 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
7430 run_window_configuration_change_hook.
7431
7432 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
7433 instead of change_window_heights and run
7434 run_window_configuration_change_hook.
7435
1a13852e
MR
74362011-06-09 Martin Rudalics <rudalics@gmx.at>
7437
7438 * window.c (replace_window): Rename second argument REPLACEMENT to
7439 NEW. New third argument SETFLAG. Rewrite.
7440 (delete_window, make_dummy_parent): Call replace_window with
7441 third argument 1.
7442 (window_list_1): Move down in code.
7443 (run_window_configuration_change_hook): Move set_buffer part
7444 before select_frame_norecord part in order to unwind correctly.
7445 Rename count1 to count.
7446 (recombine_windows, delete_deletable_window, resize_root_window)
7447 (Fdelete_other_windows_internal)
7448 (Frun_window_configuration_change_hook, make_parent_window)
7449 (resize_window_check, resize_window_apply, Fresize_window_apply)
7450 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
7451 (Fdelete_window_internal, Fresize_mini_window_internal):
7452 New functions.
1a13852e
MR
7453 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
7454
f3d1777e
MR
74552011-06-08 Martin Rudalics <rudalics@gmx.at>
7456
496e208e
MR
7457 * window.h (window): Add some new members to window structure -
7458 normal_lines, normal_cols, new_total, new_normal, clone_number,
7459 splits, nest, prev_buffers, next_buffers.
7460 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 7461 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 7462
f3d1777e
MR
7463 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
7464 Remove.
496e208e
MR
7465 (make_dummy_parent): Set new members of windows structure.
7466 (make_window): Move down in code. Handle new members of window
7467 structure.
7468 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
7469 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
7470 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
7471 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
7472 (Fset_window_next_buffers, Fset_window_clone_number):
7473 New functions.
496e208e
MR
7474 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
7475 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
7476 Doc-string fixes.
7477 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
7478 Argument WINDOW can be now internal window too.
7479 (Fwindow_use_time): Move up in code.
7480 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
7481 Rewrite doc-string.
7482 (Fset_window_configuration, saved_window)
7483 (Fcurrent_window_configuration, save_window_save): Handle new
7484 members of window structure.
b9e809c2
MR
7485 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
7486 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
7487 (syms_of_window): New Lisp objects Qrecord_window_buffer,
7488 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
7489 Qget_mru_window, Qresize_root_window,
7490 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
7491 Qauto_buffer_name; staticpro them.
f3d1777e 7492
abde8f8c
MR
74932011-06-07 Martin Rudalics <rudalics@gmx.at>
7494
7495 * window.c (Fwindow_total_size, Fwindow_left_column)
7496 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
7497 (Fwindow_list_1): New functions.
7498 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
7499 (Fwindow_width, Fscroll_left, Fscroll_right):
7500 Use window_body_cols instead of window_box_text_cols.
7501 (delete_window, Fset_window_configuration):
7502 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
7503 (delete_all_subwindows): Take a window as argument and not a
7504 structure. Rewrite.
190b47e6
MR
7505 (window_loop): Remove handling of GET_LRU_WINDOW and
7506 GET_LARGEST_WINDOW.
7507 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
7508
7509 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
7510 window_box_text_cols. delete_all_subwindows now takes a
7511 Lisp_Object as argument.
abde8f8c 7512
640c8776
SM
7513 * indent.c (compute_motion, Fcompute_motion):
7514 Use window_body_cols instead of window_box_text_cols.
abde8f8c 7515
fa8a67e6
MR
7516 * frame.c (delete_frame): Call delete_all_subwindows with root
7517 window as argument.
7518
a54e3482
DC
75192011-06-07 Daniel Colascione <dan.colascione@gmail.com>
7520
7521 * fns.c (Fputhash): Document return value.
7522
60002bf5
CY
75232011-06-06 Chong Yidong <cyd@stupidchicken.com>
7524
7525 * image.c (gif_load): Implement gif89a spec "no disposal" method.
7526
0c671da6 75272011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 7528
b862a52a 7529 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 7530
be44ca6c
PE
7531 Check for overflow when converting integer to cons and back.
7532 * charset.c (Fdefine_charset_internal, Fdecode_char):
7533 Use cons_to_unsigned to catch overflow.
7534 (Fencode_char): Use INTEGER_TO_CONS.
7535 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
7536 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
7537 * data.c (long_to_cons, cons_to_long): Remove.
7538 (cons_to_unsigned, cons_to_signed): New functions.
7539 These signal an error for invalid or out-of-range values.
7540 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
7541 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
7542 * font.c (Ffont_variation_glyphs):
7543 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
7544 * lisp.h: Include <intprops.h>.
7545 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
7546 (cons_to_signed, cons_to_unsigned): New decls.
7547 (long_to_cons, cons_to_long): Remove decls.
7548 * undo.c (record_first_change): Use INTEGER_TO_CONS.
7549 (Fprimitive_undo): Use CONS_TO_INTEGER.
7550 * xfns.c (Fx_window_property): Likewise.
7551 * xselect.c: Include <limits.h>.
7552 (x_own_selection, selection_data_to_lisp_data):
7553 Use INTEGER_TO_CONS.
7554 (x_handle_selection_request, x_handle_selection_clear)
7555 (x_get_foreign_selection, Fx_disown_selection_internal)
7556 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
7557 (lisp_data_to_selection_data): Use cons_to_unsigned.
7558 (x_fill_property_data): Use cons_to_signed.
7559 Report values out of range.
7560
d1f3d2af
PE
7561 Check for buffer and string overflow more precisely.
7562 * buffer.h (BUF_BYTES_MAX): New macro.
7563 * lisp.h (STRING_BYTES_MAX): New macro.
7564 * alloc.c (Fmake_string):
7565 * character.c (string_escape_byte8):
7566 * coding.c (coding_alloc_by_realloc):
7567 * doprnt.c (doprnt):
7568 * editfns.c (Fformat):
7569 * eval.c (verror):
7570 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
7571 since they may not be the same number.
7572 * editfns.c (Finsert_char):
7573 * fileio.c (Finsert_file_contents):
7574 Likewise for BUF_BYTES_MAX.
7575
dd52fcea
PE
7576 * image.c: Use ptrdiff_t, not int, for sizes.
7577 (slurp_file): Switch from int to ptrdiff_t.
7578 All uses changed.
7579 (slurp_file): Check that file size fits in both size_t (for
7580 malloc) and ptrdiff_t (for sanity and safety).
7581
7f9bbdbb
PE
7582 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
7583 if b->modtime has its maximal value.
7584
dfe18f82
PE
7585 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
7586
84acfcf0
PE
7587 Don't assume time_t can fit into int.
7588 * buffer.h (struct buffer.modtime): Now time_t, not int.
7589 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
7590 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
7591
ccd9a01a
PE
7592 Minor fixes for signed vs unsigned integers.
7593 * character.h (MAYBE_UNIFY_CHAR):
7594 * charset.c (maybe_unify_char):
7595 * keyboard.c (read_char, reorder_modifiers):
7596 XINT -> XFASTINT, since the integer must be nonnegative.
7597 * ftfont.c (ftfont_spec_pattern):
7598 * keymap.c (access_keymap, silly_event_symbol_error):
7599 XUINT -> XFASTINT, since the integer must be nonnegative.
7600 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
7601 since it makes no difference and we prefer signed.
7602 * keyboard.c (record_char): Use XUINT when all the neighbors do.
7603 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
7604 nonnegative.
7605
d6d100dd
SM
76062011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
7607
7608 * window.h (Fwindow_frame): Declare.
7609
2b6148e4
PE
76102011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7611
7612 * alloc.c: Simplify handling of large-request failures (Bug#8800).
7613 (SPARE_MEMORY): Always define.
7614 (LARGE_REQUEST): Remove.
7615 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
7616
f230ecc9
MR
76172011-06-06 Martin Rudalics <rudalics@gmx.at>
7618
727e958e
MR
7619 * lisp.h: Move EXFUNS for Fframe_root_window,
7620 Fframe_first_window and Fset_frame_selected_window to window.h.
7621
7622 * window.h: Move EXFUNS for Fframe_root_window,
7623 Fframe_first_window and Fset_frame_selected_window here from
7624 lisp.h.
7625
7626 * frame.c (Fwindow_frame, Fframe_first_window)
7627 (Fframe_root_window, Fframe_selected_window)
7628 (Fset_frame_selected_window): Move to window.c.
7629 (Factive_minibuffer_window): Move to minibuf.c.
7630 (Fother_visible_frames_p): New function.
7631
7632 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
7633
f230ecc9
MR
7634 * window.c (decode_window, decode_any_window): Move up in code.
7635 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
7636 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
7637 (Fwindow_buffer): Move up and rewrite doc-string.
7638 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
7639 (Fwindow_prev): New functions.
727e958e
MR
7640 (Fwindow_frame): Move here from frame.c. Accept any window as
7641 argument.
7642 (Fframe_root_window, Fframe_first_window)
7643 (Fframe_selected_window): Move here from frame.c. Accept frame
7644 or arbitrary window as argument. Update doc-strings.
7645 (Fminibuffer_window): Move up in code.
7646 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
7647 (Fset_frame_selected_window): Move here from frame.c.
7648 Marginal rewrite.
727e958e
MR
7649 (Fselected_window, select_window, Fselect_window): Move up in
7650 code. Minor doc-string fixes.
f230ecc9 7651
4d09bcf6
PE
76522011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
7655 Do not assume that spare memory exists; that assumption is valid
7656 only if SYSTEM_MALLOC.
7657 (LARGE_REQUEST): New macro, so that the issue of large requests
7658 is separated from the issue of spare memory.
7659
810928a2
AS
76602011-06-05 Andreas Schwab <schwab@linux-m68k.org>
7661
172418ad
AS
7662 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
7663 format. (Bug#8806)
7664
43f862f7
AS
7665 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
7666
810928a2
AS
7667 * xfns.c (x_set_scroll_bar_default_width): Move declarations
7668 before statements.
7669
a059fe24
JD
76702011-06-05 Jan Djärv <jan.h.d@swipnet.se>
7671
7672 * gtkutil.c (xg_get_default_scrollbar_width): New function.
7673
7674 * gtkutil.h: Declare xg_get_default_scrollbar_width.
7675
7676 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
7677 min width by calling x_set_scroll_bar_default_width (Bug#8505).
7678
989bf368
JB
76792011-06-05 Juanma Barranquero <lekktu@gmail.com>
7680
7681 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
7682
4b80f674
CY
76832011-06-04 Chong Yidong <cyd@stupidchicken.com>
7684
7685 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
7686 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
7687 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
7688 New error handlers.
4b80f674
CY
7689 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
7690 Obey Vx_select_enable_clipboard_manager. Catch errors in
7691 x_clipboard_manager_save (Bug#8779).
7692 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 7693 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 7694
99a33b77 76952011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
7696
7697 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
7698
99a33b77 76992011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
7700
7701 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
7702 in the current matrix if keep_current_p is non-zero.
7703
8264569d
EZ
77042011-06-04 Eli Zaretskii <eliz@gnu.org>
7705
7706 * bidi.c (bidi_level_of_next_char): Fix last change.
7707
57f97249
EZ
77082011-06-03 Eli Zaretskii <eliz@gnu.org>
7709
fec2107c 7710 Support bidi reordering of text covered by display properties.
57f97249 7711
fec2107c
EZ
7712 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
7713 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
7714 (bidi_cache_search, bidi_cache_iterator_state)
7715 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
7716 (bidi_level_of_next_char, bidi_move_to_visually_next):
7717 Support character positions inside a run of characters covered by a
fec2107c
EZ
7718 display string.
7719 (bidi_paragraph_init, bidi_resolve_explicit_1)
7720 (bidi_level_of_next_char): Call bidi_fetch_char and
7721 bidi_fetch_char_advance instead of FETCH_CHAR and
7722 FETCH_CHAR_ADVANCE.
7723 (bidi_init_it): Initialize new members.
7724 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
7725 definitions.
7726 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
7727 instead of using explicit *_CHAR codes.
d6d100dd
SM
7728 (bidi_resolve_explicit, bidi_resolve_weak):
7729 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
7730 bidirectional text is supported only in multibyte buffers.
7731 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
7732 it to initialize the frame_window_p member of struct bidi_it.
7733 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
7734 (bidi_resolve_explicit, bidi_resolve_weak)
7735 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
7736 bidi_it->nchars is non-positive.
7737 (bidi_level_of_next_char): Don't try to lookup the cache for the
7738 next/previous character if nothing is cached there yet, or if we
7739 were just reseat()'ed to a new position.
c40e2fb2 7740
0e14fe90
EZ
7741 * xdisp.c (set_cursor_from_row): Set start and stop points
7742 according to the row's direction when priming the loop that looks
7743 for the glyph on which to display cursor.
7744 (single_display_spec_intangible_p): Function deleted.
7745 (display_prop_intangible_p): Reimplement to call
7746 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
7747 Accept 3 additional arguments needed by handle_display_spec.
7748 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
7749 values: lists, `(when COND...)' forms, etc.
7750 (single_display_spec_string_p): Support property values that are
7751 lists with the argument STRING its top-level element.
7752 (display_prop_string_p): Fix the condition for processing a
7753 property that is a list to be consistent with handle_display_spec.
fec2107c 7754 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
7755 last portion of handle_display_prop.
7756 (compute_display_string_pos): Accept additional argument
7757 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
7758 value of a `display' property is a "replacing spec".
7759 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
7760 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
7761 the display property, but just return a value indicating whether
7762 the display property will replace the characters it covers.
7763 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
7764 frame_window_p members of struct bidi_it.
d6d100dd
SM
7765 (compute_display_string_pos, compute_display_string_end):
7766 New functions.
fec2107c
EZ
7767 (push_it): Accept second argument POSITION, where pop_it should
7768 jump to continue iteration.
7769 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 7770
fec2107c
EZ
7771 * keyboard.c (adjust_point_for_property): Adjust the call to
7772 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
7773
7774 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
7775 (bidi_init_it): Update prototypes.
7776 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
7777 (compute_display_string_pos, compute_display_string_end):
7778 Declare prototypes.
fec2107c
EZ
7779 (struct bidi_it): New members nchars and disp_pos. ch_len is now
7780 EMACS_INT.
fc6f18ce 7781
40087514 77822011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 7783
57f53182
PE
7784 Malloc failure behavior now depends on size of allocation.
7785 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
7786 * lisp.h: Change signatures accordingly.
7787 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
7788 All callers changed. (Bug#8762)
7789
7790 * gnutls.c: Use Emacs's memory allocators.
7791 Without this change, the gnutls library would invoke malloc etc.
7792 directly, which causes problems on non-SYNC_INPUT hosts, and which
7793 runs afoul of improving memory_full behavior. (Bug#8761)
7794 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
7795 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
7796 xfree instead of the default malloc, realloc, free.
7797 (Fgnutls_boot): No need to check for memory allocation failure,
7798 since xmalloc does that for us.
7799
ac32cd99 7800 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
7801 * category.c (hash_get_category_set):
7802 * ccl.c (ccl_driver):
7803 * charset.c (Fdefine_charset_internal):
7804 * charset.h (struct charset.hash_index):
7805 * composite.c (get_composition_id, gstring_lookup_cache)
7806 (composition_gstring_put_cache):
7807 * composite.h (struct composition.hash_index):
7808 * dispextern.h (struct image.hash):
7809 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
7810 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
7811 (hashfn_equal, hashfn_user_defined, make_hash_table)
7812 (maybe_resize_hash_table, hash_lookup, hash_put)
7813 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
7814 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
7815 (Fsxhash, Fgethash, Fputhash, Fmaphash):
7816 * image.c (make_image, search_image_cache, lookup_image)
7817 (xpm_put_color_table_h):
7818 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 7819 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 7820 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 7821 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
7822 * alloc.c (allocate_vectorlike):
7823 Check for overflow in vector size calculations.
7824 * ccl.c (ccl_driver):
7825 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
7826 * fns.c, image.c: Remove unnecessary static decls that would otherwise
7827 need to be updated by these changes.
40087514
PE
7828 * fns.c (make_hash_table, maybe_resize_hash_table):
7829 Check for integer overflow with large hash tables.
0de4bb68
PE
7830 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
7831 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
7832 (SXHASH_REDUCE): New macro.
7833 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
7834 Use it instead of discarding useful hash info with large hash values.
7835 (sxhash_float): New function.
7836 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
7837 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
7838 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
7839 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
7840 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
7841 Adjust signatures to match updated version of code.
7842 (consing_since_gc): Now EMACS_INT, since a single hash table can
7843 use more than INT_MAX bytes.
7844
698d32e2
DN
78452011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
7846
7847 Make it possible to build with GCC-4.6+ -O2 -flto.
7848
7849 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
7850
fd6fa53f
SM
78512011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
7852
7853 * minibuf.c (get_minibuffer, read_minibuf_unwind):
7854 Call minibuffer-inactive-mode.
7855
864db017
JB
78562011-05-31 Juanma Barranquero <lekktu@gmail.com>
7857
7858 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
7859 Update dependencies.
7860
2ad0baf4
DN
78612011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7862
7863 * data.c (init_data): Remove code for UTS, this system is not
7864 supported anymore.
7865
4fcc2638
DN
78662011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7867
7868 Don't force ./temacs to start in terminal mode.
7869
7870 * frame.c (make_initial_frame): Initialize faces in all cases, not
7871 only when CANNOT_DUMP is defined.
7872 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
7873
c56e0fd5
DN
78742011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7875
7876 * dispnew.c (add_window_display_history): Use const for the string
7877 pointer. Remove declaration, not needed.
7878
333d54da 78792011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 7880
55d4c1b2 7881 Use 'inline', not 'INLINE'.
333d54da 7882 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
7883 * alloc.c, fontset.c (INLINE): Remove.
7884 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
7885 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
7886 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
7887 * gmalloc.c (register_heapinfo): Use inline unconditionally.
7888 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
7889
738db178
DN
78902011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7891
7892 Make it possible to run ./temacs.
7893
7894 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
7895 syms_of_callproc does the same thing. Remove test for
7896 "initialized", do it in the caller.
7897 * emacs.c (main): Avoid calling set_initial_environment when dumping.
7898
620c53a6
SM
78992011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
7900
7901 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
7902 (read_minibuf): Use get_minibuffer.
7903 (syms_of_minibuf): Use DEFSYM.
7904 (Qmetadata): New var.
7905 * data.c (Qbuffer): Don't make it static.
7906 (syms_of_data): Use DEFSYM.
7907
e003a292
PE
79082011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7909
7910 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
7911 (CCL_CODE_MIN): New macro.
7912
ed008a6d
PE
79132011-05-30 Paul Eggert <eggert@cs.ucla.edu>
7914
3687c2ef
PE
7915 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
7916
ed008a6d
PE
7917 * eval.c (Qdebug): Now static.
7918 * lisp.h (Qdebug): Remove decl. This reverts a part of the
7919 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
7920 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
7921
d66c4c7c
CY
79222011-05-29 Chong Yidong <cyd@stupidchicken.com>
7923
7924 * image.c: Various fixes to ImageMagick code comments.
7925 (Fimagemagick_types): Doc fix.
7926
5fbc2025
PE
79272011-05-29 Paul Eggert <eggert@cs.ucla.edu>
7928
0196f88a
PE
7929 Minor fixes prompted by GCC 4.6.0 warnings.
7930
7931 * xselect.c (converted_selections, conversion_fail_tag): Now static.
7932
5fbc2025
PE
7933 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
7934 (x_clipboard_manager_save_all): Move extern decl to ...
7935 * xterm.h: ... here, so that it can be checked for consistency.
7936
1dd3c2d9
CY
79372011-05-29 Chong Yidong <cyd@stupidchicken.com>
7938
7939 * xselect.c (x_clipboard_manager_save_frame)
7940 (x_clipboard_manager_save_all): New functions.
7941 (Fx_clipboard_manager_save): Lisp function deleted.
7942
7943 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
7944 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
7945
7946 * xterm.h: Update prototype.
7947
5ba6571d
WX
79482011-05-28 William Xu <william.xwl@gmail.com>
7949
7950 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
7951 exiting (Bug#8239).
7952
3eaff834
JM
79532011-05-28 Jim Meyering <meyering@redhat.com>
7954
e1900994 7955 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
7956 * fns.c (to_uchar): Define.
7957 (crypto_hash_function): Use it to convert some newly-signed
7958 variables to unsigned, to avoid sign-extension bugs. For example,
7959 without this change, (md5 "truc") would evaluate to
7960 45723a2aff78ff4fff7fff1114760e62 rather than the expected
7961 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 7962 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 7963
0f6990a7
PE
79642011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7965
7966 Integer overflow fixes.
c8a9ca5a 7967
08686060
PE
7968 * dbusbind.c: Serial number integer overflow fixes.
7969 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
7970 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
7971 to hold a serial number that is too large for a fixnum.
7972 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7973 Check for serial numbers out of range. Decode any serial number
59568bf0 7974 that was so large that it became a float. (Bug#8722)
08686060 7975
2d1fc3c7
PE
7976 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
7977 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7978 Use XFASTINT rather than XUINT when numbers are nonnegative.
7979 (xd_append_arg, Fdbus_method_return_internal):
7980 (Fdbus_method_error_internal): Likewise. Also, for unsigned
7981 arguments, check that Lisp number is nonnegative, rather than
59568bf0 7982 silently wrapping negative numbers around. (Bug#8722)
30217ff0 7983 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 7984 (Bug#8722)
2d1fc3c7 7985
c8a9ca5a
PE
7986 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7987
519e1d69
PE
7988 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7989
6df6ae42 7990 ccl: Add integer overflow checks.
30569699
PE
7991 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7992 (IN_INT_RANGE): New macros.
7993 (ccl_driver): Use them to check for integer overflow when
7994 decoding a CCL program. Many of the new checks are whether XINT (x)
7995 fits in int; it doesn't always, on 64-bit hosts. The new version
7996 doesn't catch all possible integer overflows, but it's an
847044ea 7997 improvement. (Bug#8719)
30569699 7998
c11285dc
PE
7999 * alloc.c (make_event_array): Use XINT, not XUINT.
8000 There's no need for unsigned here.
8001
fdccd48e
PE
8002 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
8003 This follows up to the 2011-05-06 change that substituted uintptr_t
8004 for EMACS_INT. This case wasn't caught back then.
8005
37910ab2
PE
8006 Rework Fformat to avoid integer overflow issues.
8007 * editfns.c: Include <float.h> unconditionally, as it's everywhere
8008 now (part of C89). Include <verify.h>.
8009 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
8010 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
8011 (Fformat): Avoid the prepass trying to compute sizes; it was only
8012 approximate and thus did not catch overflow reliably. Instead, walk
8013 through the format just once, formatting and computing sizes as we go,
8014 checking for integer overflow at every step, and allocating a larger
8015 buffer as needed. Keep track separately whether the format is
8016 multibyte. Keep only the most-recently calculated precision, rather
8017 than them all. Record whether each argument has been converted to
8018 string. Use EMACS_INT, not int, for byte and char and arg counts.
8019 Support field widths and precisions larger than INT_MAX. Avoid
8020 sprintf's undefined behavior with conversion specifications such as %#d
8021 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
8022 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
8023 formatting out-of-range floating point numbers with int
9173deec 8024 formats. (Bug#8668)
37910ab2 8025
2e6578fb
PE
8026 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
8027
0ae6bdee
PE
8028 * data.c: Avoid integer truncation in expressions involving floats.
8029 * data.c: Include <intprops.h>.
8030 (arith_driver): When there's an integer overflow in an expression
8031 involving floating point, convert the integers to floating point
8032 so that the resulting value does not suffer from catastrophic
8033 integer truncation. For example, on a 64-bit host (* 4
8034 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
8035 Do not rely on undefined behavior after integer overflow.
8036
de883a70
PE
8037 merge count_size_as_multibyte, parse_str_to_multibyte
8038 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 8039 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
8040 Check for integer overflow.
8041 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
8042 since it's now a duplicate of the other. This is more of
8043 a character than a buffer op, so better that it's in character.c.
8044 * fns.c, print.c: Adjust to above changes.
8045
2ff916cb
PE
80462011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
8047
8048 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
8049
f1b54466
PE
80502011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8051
fb1ac845
PE
8052 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8053 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
8054 (x_clipboard_manager_save): Now static.
8055 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
8056
f1b54466
PE
8057 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8058 (crypto_hash_function): Now static.
8059 Fix pointer signedness problems. Avoid unnecessary initializations.
8060
a9f737ee
CY
80612011-05-27 Chong Yidong <cyd@stupidchicken.com>
8062
8063 * termhooks.h (Vselection_alist): Make it terminal-local.
8064
8065 * terminal.c (create_terminal): Initialize it.
8066
8067 * xselect.c: Support for clipboard managers.
8068 (Vselection_alist): Move to termhooks.h as terminal-local var.
8069 (LOCAL_SELECTION): New macro.
8070 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
8071 (symbol_to_x_atom): Remove gratuitous arg.
8072 (x_handle_selection_request, lisp_data_to_selection_data)
8073 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
8074 (x_own_selection, x_get_local_selection, x_convert_selection):
8075 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
8076 (some_frame_on_display): Delete unused function.
8077 (Fx_own_selection_internal, Fx_get_selection_internal)
8078 (Fx_disown_selection_internal, Fx_selection_owner_p)
8079 (Fx_selection_exists_p): New optional frame arg.
8080 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
8081 (x_handle_selection_clear): Don't treat other terminals with the
8082 same keyboard specially. Use the terminal-local Vselection_alist.
8083 (x_clear_frame_selections): Use Frun_hook_with_args.
8084
8085 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
8086
8087 * xterm.h: Add support for those atoms.
8088
e067f0c1
CY
80892011-05-26 Chong Yidong <cyd@stupidchicken.com>
8090
8091 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
8092 (converted_selections, conversion_fail_tag): New global variables.
8093 (x_selection_request_lisp_error): Free the above.
8094 (x_get_local_selection): Remove unnecessary code.
8095 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
8096 of converted selections stored in converted_selections.
8097 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
8098 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
8099 (x_convert_selection): New function.
8100 (x_handle_selection_event): Simplify.
8101 (x_get_foreign_selection): Don't ignore incoming requests while
8102 waiting for an answer; this will fail when we implement
8103 SAVE_TARGETS, and seems unnecessary anyway.
8104 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
8105 (Vx_sent_selection_functions): Doc fix.
8106
0f4aebc0
LL
81072011-05-26 Leo Liu <sdl.web@gmail.com>
8108
8109 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
8110
e61124cd
YM
81112011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8112
8113 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
8114
8115 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
8116 for fringe update if it has periodic bitmap.
ac389d0c 8117 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
8118 and fringe_bitmap_periodic_p.
8119
8120 * fringe.c (get_fringe_bitmap_data): New function.
8121 (draw_fringe_bitmap_1, update_window_fringes): Use it.
8122 (update_window_fringes): Record periodicity of fringe bitmap in glyph
8123 row. Mark glyph row for fringe update if periodicity changed.
8124
8125 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
8126 for fringe update unless it has periodic bitmap.
8127
f16d9837
KH
81282011-05-25 Kenichi Handa <handa@m17n.org>
8129
8130 * xdisp.c (get_next_display_element): Set correct it->face_id for
8131 a static composition.
8132
e1b90ef6
LL
81332011-05-24 Leo Liu <sdl.web@gmail.com>
8134
8135 * deps.mk (fns.o):
8136 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
8137
8138 * fns.c (crypto_hash_function, Fsha1): New function.
8139 (Fmd5): Use crypto_hash_function.
8140 (syms_of_fns): Add Ssha1.
8141
7400048f
PE
81422011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8143
8144 * gnutls.c: Remove unused macros.
8145 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
8146 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
8147 Remove macros that are defined and never used.
8148 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
8149
abb71cf4
CY
81502011-05-22 Chong Yidong <cyd@stupidchicken.com>
8151
8152 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
8153 (Fx_get_selection_internal): Minor cleanup.
8154 (Fx_own_selection_internal): Rename arguments for consistency with
8155 select.el.
8156
6307db39
PE
81572011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8158
8159 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
8160
f3d4e0a4
CY
81612011-05-22 Chong Yidong <cyd@stupidchicken.com>
8162
8163 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
8164
4d8ade89
YM
81652011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8166
8167 * dispnew.c (scrolling_window): Don't exclude the case that the
8168 last enabled row in the desired matrix touches the bottom boundary.
8169
32078c8d
GM
81702011-05-21 Glenn Morris <rgm@gnu.org>
8171
8172 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
8173 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
8174 and add some more files.
32078c8d 8175
7285dc67
EZ
81762011-05-20 Eli Zaretskii <eliz@gnu.org>
8177
8178 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
8179 report_file_error introduced by the change from 2011-05-07.
8180
89d1bd22
PE
81812011-05-20 Paul Eggert <eggert@cs.ucla.edu>
8182
8183 * systime.h (Time): Define only if emacs is defined.
8184 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
8185 where the include path doesn't have X11/X.h by default. See
8186 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
8187
cd394be1 81882011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
8189
8190 * composite.c (find_automatic_composition): Fix previous change.
8191
b9704ad9
GM
81922011-05-20 Glenn Morris <rgm@gnu.org>
8193
8194 * lisp.mk: New file, split from Makefile.in.
8195 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
8196 (shortlisp): Remove.
8197 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
8198
4a720484
GM
81992011-05-19 Glenn Morris <rgm@gnu.org>
8200
8201 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
8202 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
8203 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
8204 (lisp): Set the order to that of loadup.el.
8205 (shortlisp): Make it a copy of $lisp.
8206 (SOME_MACHINE_LISP): Remove.
8207 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
8208 Use just $shortlisp, not $SOME_MACHINE_LISP too.
8209
a28d4396
KH
82102011-05-18 Kenichi Handa <handa@m17n.org>
8211
8212 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
8213 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
8214 (find_automatic_composition): Mostly rewrite for efficiency.
8215
a2b1fa8e
JB
82162011-05-18 Juanma Barranquero <lekktu@gmail.com>
8217
8218 * makefile.w32-in: Update dependencies.
8219
8e1f5610
CS
82202011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
8221
8222 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 8223 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 8224
7025ee00 82252011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 8226
cdfa6eab
PE
8227 Fix some integer overflow issues, such as string length overflow.
8228
06d6db33
PE
8229 * insdel.c (count_size_as_multibyte): Check for string overflow.
8230
2b4560a8
PE
8231 * character.c (lisp_string_width): Check for string overflow.
8232 Use EMACS_INT, not int, for string indexes and lengths; in
8233 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
8234 the resulting string length overflows an EMACS_INT; instead,
8235 report a string overflow if no precision given. When checking for
8236 precision exhaustion, use a check that cannot possibly have
8237 integer overflow. (Bug#8675)
8238 * character.h (lisp_string_width): Adjust to new signature.
8239
cb93f9be
PE
8240 * alloc.c (string_overflow): New function.
8241 (Fmake_string): Use it. This doesn't change behavior, but saves
8242 a few bytes and will simplify future changes.
8243 * character.c (string_escape_byte8): Likewise.
8244 * lisp.h (string_overflow): New decl.
8245
1a1f3366
PE
8246 Fixups, following up to the user-interface timestamp change.
8247 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
8248 for UI timestamps, instead of unsigned long.
9fbd6841
PE
8249 * msdos.c (mouse_get_pos): Likewise.
8250 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
8251 * w32gui.h (Time): Define by including "systime.h" rather than by
8252 declaring it ourselves. (Bug#8664)
8253
d4e3e4d3
PE
8254 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
8255 * image.c (clear_image_cache): Likewise.
8256
f6a24d19
PE
8257 * term.c (term_mouse_position): Don't assume time_t wraparound.
8258
08dc5ae6
PE
8259 Be more systematic about user-interface timestamps.
8260 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
8261 and sometimes 'EMACS_UINT', to represent these timestamps.
8262 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
8263 This makes the code easier to follow, and makes it easier to catch
8264 integer overflow bugs such as Bug#8664.
8265 * frame.c (Fmouse_position, Fmouse_pixel_position):
8266 Use Time, not unsigned long, for user-interface timestamps.
8267 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
8268 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
8269 * keyboard.h (last_event_timestamp): Likewise.
8270 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
8271 * menu.h (xmenu_show): Likewise.
8272 * term.c (term_mouse_position): Likewise.
8273 * termhooks.h (struct input_event.timestamp): Likewise.
8274 (struct terminal.mouse_position_hook): Likewise.
8275 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
8276 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
8277 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
8278 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
8279 what it was before.
8280 * menu.h, termhooks.h: Include "systime.h", for Time.
8281
8e55734a
PE
8282 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
8283 Don't assume that the difference between two unsigned long values
8284 can fit into an integer. At this point, we know button_down_time
8285 <= event->timestamp, so the difference must be nonnegative, so
8286 there's no need to cast the result if double-click-time is
8287 nonnegative, as it should be; check that it's nonnegative, just in
8288 case. This bug is triggered when events are more than 2**31 ms
86db42d2 8289 apart (about 25 days). (Bug#8664)
8e55734a 8290
841f1b75 8291 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 8292 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 8293
3e26f69c
PE
8294 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
8295 that always fit in int. Use a sentinel instead of a counter, to
8296 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
8297 * frame.h (struct frame): Use int for menu_bar_items_used
8298 instead of EMACS_INT, since it always fits in int.
3e26f69c 8299
5cc152c0
PE
8300 * menu.c (grow_menu_items): Check for int overflow.
8301
d89eb65e
PE
8302 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
8303
5235bd3e
PE
8304 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
8305 Before, the code was not consistent. These values cannot exceed
8306 2**31 - 1 so there's no need to make them unsigned.
8307 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
8308 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
8309 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
8310 as modifiers.
8311 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
8312
bc827e23
PE
8313 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
8314 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
8315 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
8316 presumably because the widths might not match.
8317
78eb494e
PE
8318 * window.c (size_window): Avoid needless test at loop start.
8319
04f2d78b
CB
83202011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
8321
8322 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
8323
d2fc7e3d 83242011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
8325
8326 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
8327
d2fc7e3d 83282011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
8329
8330 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
8331 `width' to `bar_area_x' and `bar_area_width', respectively.
8332 (x_scroll_run): Take account of fringe background extension.
8333
04f2d78b
CB
8334 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
8335 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
8336 `bar_area_width', respectively.
8337 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
8338 background extension.
8339
79b70037
GM
83402011-05-10 Jim Meyering <meyering@redhat.com>
8341
8342 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
8343
2f142cc5
JB
83442011-05-10 Juanma Barranquero <lekktu@gmail.com>
8345
8346 * image.c (Finit_image_library): Return t for built-in image types,
8347 like pbm and xbm. (Bug#8640)
8348
57679c86
AS
83492011-05-09 Andreas Schwab <schwab@linux-m68k.org>
8350
8351 * w32menu.c (set_frame_menubar): Fix submenu allocation.
8352
888c9e86
EZ
83532011-05-07 Eli Zaretskii <eliz@gnu.org>
8354
b0512a1d
EZ
8355 * w32console.c (Fset_screen_color): Doc fix.
8356 (Fget_screen_color): New function.
8357 (syms_of_ntterm): Defsubr it.
8358
7285dc67
EZ
8359 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
8360 unlink the temporary file if Fcall_process didn't create it in the
8361 first place.
8362 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
8363 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
8364 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
8365 cue to call_process_cleanup not to close that handle.
8366
4d3fcc8e
BK
83672011-05-07 Ben Key <bkey76@gmail.com>
8368
8369 * makefile.w32-in: The bootstrap-temacs rule now makes use of
8370 one of two shell specific rules, either bootstrap-temacs-CMD or
8371 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
8372 to the previous implementation of the bootstrap-temacs rule.
8373 The bootstrap-temacs-CMD rule is similar to the previous
8374 implementation of the bootstrap-temacs rule except that it
8375 makes use of the ESC_CFLAGS variable instead of the CFLAGS
8376 variable.
8377
8378 These changes, along with some changes to nt/configure.bat,
8379 nt/gmake.defs, and nt/nmake.defs, are required to extend my
8380 earlier fix to add support for --cflags and --ldflags options
8381 that include quotes so that it works whether make uses cmd or
8382 sh as the shell.
8383
b4289b64
MA
83842011-05-06 Michael Albinus <michael.albinus@gmx.de>
8385
8386 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
8387 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
8388 is a constant.
8389 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
8390 a string. Handle both cases.
8391 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
8392 (Fdbus_register_method): Use Qinvalid_function.
8393
af4c0e28
JB
83942011-05-06 Juanma Barranquero <lekktu@gmail.com>
8395
8396 * makefile.w32-in: Update dependencies.
8397 (LISP_H): Add inttypes.h and stdin.h.
8398 (PROCESS_H): Add unistd.h.
8399
c51453d9
EZ
84002011-05-06 Eli Zaretskii <eliz@gnu.org>
8401
8402 * lread.c: Include limits.h (fixes the MS-Windows build broken by
8403 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
8404
8ff0ac3c 84052011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 8406
4c4b566b
PE
8407 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
8408
aab2b9b5
PE
8409 * term.c (vfatal): Remove stray call to va_end.
8410 It's not needed and the C Standard doesn't allow it here anyway.
8411
c378da0b
PE
8412 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
8413 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
8414
288b08c7
PE
8415 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
8416 bytes.
8417
e3601888
PE
8418 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
8419
db6c0e74
PE
8420 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8421
dd5963ea
PE
8422 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
8423
88c9450f
PE
8424 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
8425
2f9442b8
PE
8426 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
8427
c032b5f8
PE
8428 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
8429 * charset.c (Fdefine_charset_internal): Don't initialize
8430 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 8431 32-bit int (Bug#8600).
a108c10b
PE
8432
8433 * lread.c (read_integer): Be more consistent with string-to-number.
8434 Use string_to_number to do the actual conversion; this avoids
8435 rounding errors and fixes some other screwups. Without this fix,
8436 for example, #x1fffffffffffffff was misread as -2305843009213693952.
8437 (digit_to_number): Move earlier, for benefit of read_integer.
8438 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 8439 not a digit in any supported base. (Bug#8602)
a108c10b 8440
ad5f9eea
PE
8441 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
8442
aec1708a
PE
8443 * dispnew.c (scrolling_window): Return 1 if we scrolled,
8444 to match comment at start of function. This also removes a
8445 GCC warning about overflow in a 32+64-bit port.
8446
47be4ab5
PE
8447 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
8448
371cac43
PE
8449 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
8450 Reported by Stefan Monnier in
8451 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
8452 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8453 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 8454
d01a7826
PE
8455 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
8456 (EMACS_UINTPTR): Likewise, with uintptr_t.
8457
7fd47d5c
PE
8458 * lisp.h: Prefer 64-bit EMACS_INT if available.
8459 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
8460 on 32-bit hosts that have 64-bit int, so that they can access
8461 large files.
122b0c86
PE
8462 However, temporarily disable this change unless the temporary
8463 symbol WIDE_EMACS_INT is defined.
7fd47d5c 8464
8727937b
PE
8465 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
8466
8ac068ac
PE
8467 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
8468 This removes an assumption that EMACS_INT and long are the same
8469 width as pointers. The assumption is true for Emacs porting targets
8470 now, but we want to make other targets possible.
8471 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
8472 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
8473 In the rest of the code, change types of integers that hold casted
8474 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
8475 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
8476 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
8477 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
8478 No need to cast type when ORing.
8479 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
8480 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
8481 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
8482 assume EMACS_INT is the same width as char *.
8483 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
8484 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
8485 Remove no-longer-needed casts.
8486 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
8487 (xg_tool_bar_help_callback, xg_make_tool_item):
8488 Use EMACS_INTPTR to hold an integer
8489 that will be cast to void *; this can avoid a GCC warning
8490 if EMACS_INT is not the same width as void *.
8491 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
8492 * xdisp.c (display_echo_area_1, resize_mini_window_1):
8493 (current_message_1, set_message_1):
8494 Use a local to convert to proper width without a cast.
8495 * xmenu.c (dialog_selection_callback): Likewise.
8496
ede49d71
PE
8497 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
8498 Also, don't assume VALBITS / RAND_BITS is less than 5,
8499 and don't rely on undefined behavior when shifting a 1 left into
8500 the sign bit.
8501 * lisp.h (get_random): Change signature to match.
8502
2f30ecd0
PE
8503 * lread.c (hash_string): Use size_t, not int, for hash computation.
8504 Normally we prefer signed values; but hashing is special, because
8505 it's better to use unsigned division on hash table sizes so that
8506 the remainder is nonnegative. Also, size_t is the natural width
8507 for hashing into memory. The previous code used 'int', which doesn't
8508 retain enough info to hash well into very large tables.
8509 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
8510
2a866e7b
PE
8511 * dbusbind.c: Don't possibly lose pointer info when converting.
8512 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8513 Use XPNTR rather than XHASH, so that the high-order bits of
8514 the pointer aren't lost when converting through void *.
8515
51639eac
PE
8516 * eval.c (Fautoload): Don't double-shift a pointer.
8517
92394119
PE
8518 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
8519
dbdb9a7c
JB
85202011-05-06 Juanma Barranquero <lekktu@gmail.com>
8521
8522 * gnutls.c (DEF_GNUTLS_FN):
8523 * image.c (DEF_IMGLIB_FN): Make function pointers static.
8524
db7a0b4f
AS
85252011-05-05 Andreas Schwab <schwab@linux-m68k.org>
8526
8527 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
8528 marker. (Bug#8610)
8529
cd394be1 85302011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
8531
8532 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
8533 New version that can reserve upto 2GB of heap space.
8534
f7ff1b0f 85352011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
8536
8537 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
8538
639c109b
TZ
85392011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
8540
8541 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
8542 `gnutls_certificate_set_x509_key_file'.
8543
d2127135
JB
85442011-05-05 Juanma Barranquero <lekktu@gmail.com>
8545
8546 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
8547 Update dependencies.
8548
e968f4f3
JB
85492011-05-04 Juanma Barranquero <lekktu@gmail.com>
8550
8551 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
8552 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8553 Remove unused parameter `fildes'.
8554 * process.c (read_process_output, send_process): Don't pass it.
8555
84d358f0
JB
85562011-05-04 Juanma Barranquero <lekktu@gmail.com>
8557
8558 Fix previous change: the library cache is defined in w32.c.
8559 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
8560 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
8561
0898ca10
JB
85622011-05-04 Juanma Barranquero <lekktu@gmail.com>
8563
8564 Implement dynamic loading of GnuTLS on Windows.
8565
8566 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
8567 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
8568 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8569 Declare.
8570
8571 * gnutls.c (Qgnutls_dll): Define.
8572 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
8573 (gnutls_*): Declare function pointers.
8574 (init_gnutls_functions): New function to initialize function pointers.
8575 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
8576 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
8577 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8578 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
8579 (emacs_gnutls_write, emacs_gnutls_read)
8580 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
8581 (Fgnutls_available_p): New function.
8582 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
8583 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
8584 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
8585
8586 * image.c: Include w32.h.
8587 (Vimage_type_cache): Delete.
8588 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
8589 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
8590 (w32_delayed_load): Move to w32.c.
8591
8592 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
8593
8594 * w32.c (QCloaded_from, Vlibrary_cache): Define.
8595 (w32_delayed_load): Move from image.c. When loading a library, record
8596 its filename in the :loaded-from property of the library id.
8597 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
8598 Initialize and staticpro them.
8599 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
8600
8601 * process.c: Include lisp.h before w32.h, not after.
8602 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
8603 instead of gnutls_record_check_pending.
8604
8605 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
8606
ff4de4aa
TZ
86072011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
8608
8609 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
8610 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
8611 as passed in.
8612
abe95abb
JD
86132011-05-03 Jan Djärv <jan.h.d@swipnet.se>
8614
8615 * xterm.c (x_set_frame_alpha): Do not set property on anything
8616 else than FRAME_X_OUTER_WINDOW (Bug#8608).
8617
e16e55d4
JB
86182011-05-02 Juanma Barranquero <lekktu@gmail.com>
8619
8620 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
8621
bafcf6a5
JB
86222011-05-02 Juanma Barranquero <lekktu@gmail.com>
8623
8624 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
8625 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
8626 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
8627 (gnutls_global_initialized, Qgnutls_bootprop_priority)
8628 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
8629 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
8630 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
8631 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
8632 (Qgnutls_bootprop_callbacks_verify): Make static.
8633
e7a6747f
AS
86342011-05-01 Andreas Schwab <schwab@linux-m68k.org>
8635
19ed11ba
AS
8636 * callproc.c: Indentation fixup.
8637
e7a6747f 8638 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
8639 (wait_for_termination, interruptible_wait_for_termination):
8640 Move after wait_for_termination_1.
e7a6747f 8641
1ef14cb4
LMI
86422011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
8643
8644 * sysdep.c (interruptible_wait_for_termination): New function
8645 which is like wait_for_termination, but allows keyboard
8646 interruptions.
8647
8648 * callproc.c (Fcall_process): Add (:file "file") as an option for
8649 the STDOUT buffer.
8650 (Fcall_process_region): Ditto.
8651
330d880c
EZ
86522011-04-30 Eli Zaretskii <eliz@gnu.org>
8653
8db90b73
EZ
8654 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
8655 rather than `XVECTOR (FOO)->size'.
8656
330d880c
EZ
8657 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
8658 inttypes.h, as a gnulib replacement is used if it not available in
8659 system headers.
8660
15cbd324
EZ
86612011-04-21 Eli Zaretskii <eliz@gnu.org>
8662
8663 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
8664 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
8665 of MOST_POSITIVE_FIXNUM. (Bug#8528)
8666
8667 * coding.c (coding_alloc_by_realloc): Error out if destination
8668 will grow beyond MOST_POSITIVE_FIXNUM.
8669 (decode_coding_emacs_mule): Abort if there isn't enough place in
8670 charbuf for the composition carryover bytes. Reserve an extra
8671 space for up to 2 characters produced in a loop.
8672 (decode_coding_iso_2022): Abort if there isn't enough place in
8673 charbuf for the composition carryover bytes.
8674
86752011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 8676
ae940cca
EZ
8677 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
8678 aborting when %lld or %lll format is passed.
8679 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
8680 %llo or %llx format is passed. (Bug#8545)
8681
03ab8921
EZ
8682 * window.c (window_scroll_line_based): Use a marker instead of
8683 simple variables to record original value of point. (Bug#7952)
8684
afda1437
EZ
8685 * doprnt.c (doprnt): Fix the case where a multibyte sequence
8686 produced by %s or %c overflows available buffer space. (Bug#8545)
8687
f76dee0c
PE
86882011-04-28 Paul Eggert <eggert@cs.ucla.edu>
8689
8690 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 8691 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 8692
fdc5744d
JB
86932011-04-28 Juanma Barranquero <lekktu@gmail.com>
8694
8695 * w32.c (init_environment): Warn about defaulting HOME to C:\.
8696
638f053a
JB
86972011-04-28 Juanma Barranquero <lekktu@gmail.com>
8698
8699 * keyboard.c (Qdelayed_warnings_hook): Define.
8700 (command_loop_1): Run `delayed-warnings-hook'
8701 if Vdelayed_warnings_list is non-nil.
8702 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
8703 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
8704
d178f871
EZ
87052011-04-28 Eli Zaretskii <eliz@gnu.org>
8706
8707 * doprnt.c (doprnt): Don't return value smaller than the buffer
8708 size if the message was truncated. (Bug#8545).
8709
b124fd93
JB
87102011-04-28 Juanma Barranquero <lekktu@gmail.com>
8711
8712 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
8713 (Fx_window_property): #if-0 the whole functions, not just the bodies.
8714
e810457d
PE
87152011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
8718
ea51cceb
JB
87192011-04-27 Juanma Barranquero <lekktu@gmail.com>
8720
8721 * makefile.w32-in: Update dependencies.
8722
94dcfacf
EZ
87232011-04-27 Eli Zaretskii <eliz@gnu.org>
8724
8725 Improve `doprnt' and its usage. (Bug#8545)
8726 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
8727 `format_end'. Remove support for %l as a conversion specifier.
8728 Don't use xrealloc. Improve diagnostics when the %l size modifier
8729 is used. Update the commentary.
8730
8731 * eval.c (verror): Simplify calculation of size_t.
8732
8733 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
8734 messages.
8735
f61f41d7
PE
87362011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
8737
8738 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
8739 change.
8740
96fb4434
PE
87412011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8742
8743 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
8744 This makes this file independent of the recent pseudovector change.
8745
671875da 87462011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 8747
69e9b5a3
PE
8748 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
8749
b5f869a7 8750 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 8751 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 8752 Remove unused local.
c8926152 8753 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 8754
841a1577 8755 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
8756 GCC 4.6.0 optimizes based on type-based alias analysis.
8757 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
8758 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
8759 != &v->size, and therefore "v->size = 1; b->size = 2; return
8760 v->size;" must therefore return 1. This assumption is incorrect
8761 for Emacs, since it type-puns struct Lisp_Vector * with many other
8762 types. To fix this problem, this patch adds a new type struct
f904488f 8763 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
8764 and pseudovectors, and helps optimizing compilers not get fooled
8765 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
8766 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
8767 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
8768 the size member.
eab3844f
PE
8769 (XSETPVECTYPE): Rewrite in terms of new macro.
8770 (XSETPVECTYPESIZE): New macro, specifying both type and size.
8771 This is a bit clearer, and further avoids the possibility of
8772 undesirable aliasing.
8773 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 8774 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
8775 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
8776 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
8777 (ASIZE): Now uses header.size rather than size.
8778 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
8779 to avoid the hassle of writing XVECTOR (foo)->header.size.
8780 (struct vectorlike_header): New type.
eab3844f
PE
8781 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
8782 object, to help avoid aliasing.
8783 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
8784 (SUBRP): Likewise, since Lisp_Subr is a special case.
8785 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
8786 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
8787 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 8788 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
8789 changed to be "header.size" and "header.next".
8790 * buffer.h (struct buffer): Likewise.
8791 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
8792 * frame.h (struct frame): Likewise.
8793 * process.h (struct Lisp_Process): Likewise.
8794 * termhooks.h (struct terminal): Likewise.
8795 * window.c (struct save_window_data, struct saved_window): Likewise.
8796 * window.h (struct window): Likewise.
8797 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
8798 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
8799 * buffer.c (init_buffer_once): Likewise.
8800 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
8801 special case.
8802 * process.c (Fformat_network_address): Use local var for size,
8803 for brevity.
8804
0df1eac5
PE
8805 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
8806
847ab9d1 8807 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
8808 * data.c (atof): Remove decl; no longer used or needed.
8809 (digit_to_number): Move to lread.c.
8810 (Fstring_to_number): Use new string_to_number function, to be
8811 consistent with how the Lisp reader treats infinities and NaNs.
8812 Do not assume that floating-point numbers represent EMACS_INT
8813 without losing information; this is not true on most 64-bit hosts.
8814 Avoid double-rounding errors, by insisting on integers when
8815 parsing non-base-10 numbers, as the documentation specifies.
8816 * lisp.h (string_to_number): New decl, replacing ...
8817 (isfloat_string): Remove.
bc0a5c13 8818 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 8819 (read1): Do not accept +. and -. as integers; this
452f4150
PE
8820 appears to have been a coding error. Similarly, do not accept
8821 strings like +-1e0 as floating point numbers. Do not report
8822 overflow for integer overflows unless the base is not 10 which
8823 means we have no simple and reliable way to continue.
8824 Break out the floating-point parsing into a new
8825 function string_to_number, so that Fstring_to_number parses
8826 floating point numbers consistently with the Lisp reader.
04f2d78b 8827 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
8828 (E_CHAR, EXP_INT): Remove, replacing with ...
8829 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
8830 (string_to_number): New function, replacing isfloat_string.
8831 This function checks for valid syntax and produces the resulting
8832 Lisp float number too. Rework it so that string-to-number
bc0a5c13 8833 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
8834 so that overflow for non-base-10 numbers is reported only when
8835 there's no portable and simple way to convert to floating point.
452f4150 8836
67769ffc
PE
8837 * textprop.c (set_text_properties_1): Rewrite for clarity,
8838 and to avoid GCC warning about integer overflow.
8839
c20db43f
PE
8840 * intervals.h (struct interval): Use EMACS_INT for members
8841 where EMACS_UINT might cause problems. See
8842 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
8843 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
8844 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
8845 All uses changed.
37aa2f85
PE
8846 (offset_intervals): Tell GCC not to worry about length overflow
8847 when negating a negative length.
c20db43f 8848
2538aa2f
PE
8849 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
8850 (overrun_check_free): Likewise.
8851
f2d3008d
PE
8852 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
8853 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
8854 word size.
8855
ec8df744
PE
8856 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8857 (gnutls_make_error): Rename local to avoid shadowing.
8858 (gnutls_emacs_global_deinit): ifdef out; not used.
8859 (Fgnutls_boot): Use const for pointer to readonly storage.
8860 Comment out unused local. Fix pointer signedness problems.
8861
640ee02d
PE
8862 * lread.c (openp): Don't stuff size_t into an 'int'.
8863 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
8864 about possible signed overflow.
8865
6048fb2a
PE
8866 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8867 (GDK_KEY_g): Don't define if already defined.
8868 (xg_prepare_tooltip): Avoid pointer signedness problem.
8869 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
8870
fa3c87e1
PE
8871 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
8872 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
8873
2172544b
PE
8874 * xfns.c (Fx_window_property): Simplify a bit,
8875 to make a bit faster and to avoid GCC 4.6.0 warning.
8876 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
8877
9b821a21
PE
8878 * fns.c (internal_equal): Don't assume size_t fits in int.
8879
3c616cfa
PE
8880 * alloc.c (compact_small_strings): Tighten assertion a little.
8881
c2982e87
PE
8882 Replace pEd with more-general pI, and fix some printf arg casts.
8883 * lisp.h (pI): New macro, generalizing old pEd macro to other
8884 conversion specifiers. For example, use "...%"pI"d..." rather
8885 than "...%"pEd"...".
8886 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 8887 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
8888 * alloc.c (check_pure_size): Don't overflow by converting size to int.
8889 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
8890 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
8891 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
8892 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
8893 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
8894 64-bit hosts.
8895 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
8896 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
8897 * print.c (safe_debug_print, print_object): Likewise.
8898 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
8899 to int.
6f04d126
PE
8900 Use pI instead of if-then-else-abort. Use %p to avoid casts,
8901 avoiding the 0 flag, which is not portable.
c2982e87
PE
8902 * process.c (Fmake_network_process): Use pI to avoid cast.
8903 * region-cache.c (pp_cache): Likewise.
8904 * xdisp.c (decode_mode_spec): Likewise.
8905 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
8906 behavior on 64-bit hosts with printf arg.
6f04d126 8907 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
8908 (x_stop_queuing_selection_requests): Likewise.
8909 (x_get_window_property): Don't truncate byte count to an 'int'
8910 when tracing.
0b432f21 8911
5e073ec7
PE
8912 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
8913 here, since it parses constructs like leading '-' and spaces,
8914 which are not wanted; and it overflows with large numbers.
8915 Instead, simply match F[0-9]+, which is what is wanted anyway.
8916
36372bf9
PE
8917 * alloc.c: Remove unportable assumptions about struct layout.
8918 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
8919 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
8920 (allocate_vectorlike, make_pure_vector): Use the new macros,
8921 plus offsetof, to remove unportable assumptions about struct layout.
8922 These assumptions hold on all porting targets that I know of, but
8923 they are not guaranteed, they're easy to remove, and removing them
8924 makes further changes easier.
8925
0b432f21
PE
8926 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
8927 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
8928 (string_overrun_cookie): Now const. Use initializers that
8929 don't formally overflow signed char, to avoid warnings.
000098c1
PE
8930 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8931 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
8932 (allocate_buffer): Don't assume sizeof (struct buffer) is a
8933 multiple of sizeof (EMACS_INT); it need not be, if
8934 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 8935 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 8936
895009e1
JB
89372011-04-26 Juanma Barranquero <lekktu@gmail.com>
8938
8939 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
8940
6a7a1b0b
TZ
89412011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
8942
8943 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 8944 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
8945 Reported by Paul Eggert <eggert@cs.ucla.edu>.
8946
841a1577 89472011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
8948
8949 * lisp.h (Qdebug): List symbol.
895009e1 8950 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
8951 * keyboard.c (debug-on-event): New variable.
8952 (handle_user_signal): Break into debugger when debug-on-event
8953 matches the current signal symbol.
8954
f2d3ba6f
DN
89552011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
8956
8957 * alloc.c (check_sblock, check_string_bytes)
8958 (check_string_free_list): Convert to standard C.
8959
42ce4c63
TZ
89602011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
8961
8962 * w32.c (emacs_gnutls_push): Fix typo.
8963
825cd63c
EZ
89642011-04-25 Eli Zaretskii <eliz@gnu.org>
8965
fb11d64d
EZ
8966 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
8967 "cast to pointer from integer of different size".
8968
825cd63c
EZ
8969 Improve doprnt and its use in verror. (Bug#8545)
8970 * doprnt.c (doprnt): Document the set of format control sequences
8971 supported by the function. Use SAFE_ALLOCA instead of always
8972 using `alloca'.
8973
8974 * eval.c (verror): Don't limit the buffer size at size_max-1, that
8975 is one byte too soon. Don't use xrealloc; instead xfree and
8976 xmalloc anew.
8977
e061a11b
TZ
89782011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
8979
8980 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
8981 callbacks stage.
8982
8983 * gnutls.c: Renamed global_initialized to
8984 gnutls_global_initialized. Added internals for the
8985 :verify-hostname-error, :verify-error, and :verify-flags
8986 parameters of `gnutls-boot' and documented those parameters in the
8987 docstring. Start callback support.
9173deec
JB
8988 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8989 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8990 on error. Return error code.
e061a11b
TZ
8991 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8992 (emacs_gnutls_read): Likewise.
8993 (Fgnutls_boot): Return handshake error code.
8994 (emacs_gnutls_handle_error): New function.
8995 (wsaerror_to_errno): Likewise.
8996
8997 * w32.h (emacs_gnutls_pull): Add prototype.
8998 (emacs_gnutls_push): Likewise.
8999
9000 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
9001 (emacs_gnutls_push): Likewise.
9002
90032011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
9004
9005 * process.c (wait_reading_process_output): Check if GnuTLS
9006 buffered some data internally if no FDs are set for TLS
9007 connections.
9008
9009 * makefile.w32-in (OBJ2): Add gnutls.$(O).
9010 (LIBS): Link to USER_LIBS.
9011 ($(BLD)/gnutls.$(0)): New target.
9012
fa6996bc
EZ
90132011-04-24 Eli Zaretskii <eliz@gnu.org>
9014
eb35682e
EZ
9015 * xdisp.c (handle_single_display_spec): Rename the
9016 display_replaced_before_p argument into display_replaced_p, to
9017 make it consistent with the commentary. Fix typos in the
9018 commentary.
9019
e2ad650c
EZ
9020 * textprop.c (syms_of_textprop): Remove dead code.
9021 (copy_text_properties): Delete obsolete commentary about an
9022 interface that was deleted long ago. Fix typos in the description
9023 of arguments.
9024
1b2de274
EZ
9025 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
9026 to changes in oldXMenu/XMenu.h from 2011-04-16.
9027 <menu_help_message, prev_menu_help_message>: Constify.
9028 (IT_menu_make_room): menu->help_text is now `const char **';
9029 adjust.
9030
9031 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
9032 to changes in oldXMenu/XMenu.h from 2011-04-16.
9033 (struct XMenu): Declare `help_text' `const char **'.
9034
9035 * xfaces.c <Qunspecified>: Make extern again.
9036
9037 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 9038 required by POSIX.
1b2de274 9039
762b15be
EZ
9040 * doc.c (get_doc_string): Improve the format passed to `error'.
9041
9042 * doprnt.c (doprnt): Improve commentary.
9043
9044 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
9045
9046 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
9047 them with etags.
9048
f1052e5d
EZ
9049 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
9050 changes in globals.h immediately force recompilation.
762b15be
EZ
9051 (TAGS): Depend on $(CURDIR)/m/intel386.h and
9052 $(CURDIR)/s/ms-w32.h.
9053 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 9054
fa6996bc
EZ
9055 * character.c (Fchar_direction): Function deleted.
9056 (syms_of_character): Don't defsubr it.
9057 <char-direction-table>: Deleted.
9058
e6c3da20
EZ
90592011-04-23 Eli Zaretskii <eliz@gnu.org>
9060
9061 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
9062 * doprnt.c: Include limits.h.
9063 (SIZE_MAX): New macro.
04f2d78b
CB
9064 (doprnt): Return a size_t value. 2nd arg is now size_t.
9065 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
9066 Improve overflow protection. Support `l' modifier for integer
9067 conversions. Support %l conversion. Don't assume an EMACS_INT
9068 argument for integer conversions and for %c.
9069
9070 * lisp.h (doprnt): Restore prototype.
9071
9072 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
9073 $(SRC)/character.h.
9074
9075 * Makefile.in (base_obj): Add back doprnt.o.
9076
9077 * deps.mk (doprnt.o): Add back prerequisites.
9078 (callint.o): Depend on character.h.
9079
9080 * eval.c (internal_lisp_condition_case): Include the handler
9081 representation in the error message.
9082 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
9083 when breaking from the loop.
9084
9085 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
9086
9087 * callint.c (Fcall_interactively): When displaying error message
9088 about invalid control letter, pass the character's codepoint, not
9089 a pointer to its multibyte form. Improve display of the character
9090 in octal and display also its hex code.
9091
9092 * character.c (char_string): Use %x to display the (unsigned)
9093 codepoint of an invalid character, to avoid displaying a bogus
9094 negative value.
9095
9096 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
9097 `error', not SYMBOL_NAME itself.
9098
9099 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
9100 character arguments to `error'.
9101
9102 * charset.c (check_iso_charset_parameter): Fix incorrect argument
9103 to `error' in error message about FINAL_CHAR argument. Make sure
9104 FINAL_CHAR is a character, and use %c when it is passed as
9105 argument to `error'.
9106
4ffd0d6b 91072011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
9108
9109 * s/ms-w32.h (localtime): Redirect to sys_localtime.
9110
9111 * w32.c: Include <time.h>.
9112 (sys_localtime): New function.
9113
4ffd0d6b 91142011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
9115
9116 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
9117
4ffd0d6b 9118 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 9119
4ffd0d6b 91202011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 9121
4ffd0d6b
GM
9122 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
9123 zombies (Bug#8467).
aac0c6e3 9124
04c56954
EZ
91252011-04-19 Eli Zaretskii <eliz@gnu.org>
9126
9127 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
9128 gl_state.e_property when gl_state.object is Qt.
9129
9130 * insdel.c (make_gap_larger): Remove limitation of buffer size
9131 to <= INT_MAX.
9132
16a43933
CY
91332011-04-18 Chong Yidong <cyd@stupidchicken.com>
9134
9135 * xdisp.c (lookup_glyphless_char_display)
9136 (produce_glyphless_glyph): Handle cons cell entry in
9137 glyphless-char-display.
9138 (Vglyphless_char_display): Document it.
9139
9140 * term.c (produce_glyphless_glyph): Handle cons cell entry in
9141 glyphless-char-display.
9142
4581706e
CY
91432011-04-17 Chong Yidong <cyd@stupidchicken.com>
9144
9145 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
9146
9147 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
9148
9149 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
9150 definition for no-X builds.
9151
4887c6e2 91522011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 9153
fd35b6f9
PE
9154 Static checks with GCC 4.6.0 and non-default toolkits.
9155
5c1ccb01
PE
9156 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
9157
006c5daa
PE
9158 * process.c (keyboard_bit_set): Define only if SIGIO.
9159 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
9160 (send_process): Repair possible setjmp clobbering.
9161
efc736d3
PE
9162 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
9163
4e2fe2e6
PE
9164 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
9165
f97334a2
PE
9166 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
9167
4e75f29d
PE
9168 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
9169 Define only if needed.
9170
90efadd1
PE
9171 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
9172 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 9173 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 9174
3c647824
PE
9175 * dispextern.h (struct redisplay_interface): Rename param
9176 to avoid shadowing.
e264f262 9177 * termhooks.h (struct terminal): Likewise.
761383f4 9178 * xterm.c (xembed_send_message): Likewise.
3c647824 9179
b58c5c4a
PE
9180 * insdel.c (make_gap_smaller): Define only if
9181 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
9182
cad59032
PE
9183 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
9184 it.
9185
c339dc2e
PE
9186 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
9187 so that we aren't warned about unused symbols.
9188
91a3e27b
PE
9189 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
9190
399c71d3 9191 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 9192
8ffc96f5
PE
9193 * xfns.c (x_real_positions): Mark locals as initialized.
9194
eef9bc79
PE
9195 * xmenu.c (xmenu_show): Don't use uninitialized vars.
9196
098db9dd
PE
9197 * xterm.c: Fix problems found by static analysis with other toolkits.
9198 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
9199 (x_dispatch_event): Declare static if USE_GTK, and
9200 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 9201 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 9202 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
9203 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
9204 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 9205
eb18f6cc
PE
9206 * xmenu.c (menu_help_callback): Pointer type fixes.
9207 Use const pointers when pointing at readonly data. Avoid pointer
9208 signedness clashes.
9209 (FALSE): Remove unused macro.
9210 (update_frame_menubar): Remove unused decl.
9211
1fe72bf8
PE
9212 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
9213
60d9e1db
PE
9214 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
9215 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
9216 (single_menu_item): Rename local to avoid shadowing.
9217
39261c26
PE
9218 * keyboard.c (make_lispy_event): Remove unused local var.
9219
018c5e19
PE
9220 * frame.c, frame.h (x_get_resource_string): Bring this back, but
9221 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
9222
63d2b86e
PE
9223 * bitmaps: Change bitmaps from unsigned char back to the X11
9224 compatible char. Avoid the old compiler warnings about
9225 out-of-range initializers by using, for example, '\xab' rather
9226 than 0xab.
9227
aefd87e1
PE
9228 * xgselect.c (xgselect_initialize): Check vs interface
9229 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
9230
bf501fb9
PE
9231 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
9232
e9829fdf
PE
9233 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
9234 to read-only memory.
9235
1086c095
PE
9236 * fns.c (vector): Remove; this old hack is no longer needed.
9237
2baccd04 9238 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 9239 Remove unused var.
dde42981 9240 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 9241
72391843 9242 * xrdb.c (x_load_resources): Omit unused local.
3565b346 9243
436c16df 9244 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 9245 (x_window): Rename locals to avoid shadowing.
dc5ddd85 9246 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 9247
92bb796d 9248 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 9249 (x_term_init): Remove local to avoid shadowing.
92bb796d 9250
764430a3 9251 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
9252
9253 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
9254 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
9255
d1dfb56c
EZ
92562011-04-16 Eli Zaretskii <eliz@gnu.org>
9257
c4354cb4
EZ
9258 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
9259
d1dfb56c
EZ
9260 Fix regex.c, syntax.c and friends for buffers > 2GB.
9261 * syntax.h (struct gl_state_s): Declare character position members
9262 EMACS_INT.
9263
9264 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
9265
04f2d78b
CB
9266 * textprop.c (verify_interval_modification, interval_of):
9267 Declare arguments EMACS_INT.
d1dfb56c
EZ
9268
9269 * intervals.c (adjust_intervals_for_insertion): Declare arguments
9270 EMACS_INT.
9271
9272 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
9273
9274 * indent.c (Fvertical_motion): Local variable it_start is now
9275 EMACS_INT.
9276
9277 * regex.c (re_match, re_match_2, re_match_2_internal)
9278 (bcmp_translate, regcomp, regexec, print_double_string)
9279 (group_in_compile_stack, re_search, re_search_2, regex_compile)
9280 (re_compile_pattern, re_exec): Declare arguments and local
9281 variables `size_t' and `ssize_t' and return values `regoff_t', as
9282 appropriate.
9283 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
9284 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
9285 <compile_stack_type>: `size' and `avail' are now `size_t'.
9286
9287 * regex.h <regoff_t>: Use ssize_t, not int.
9288 (re_search, re_search_2, re_match, re_match_2): Arguments that
9289 specify buffer/string position and length are now ssize_t and
9290 size_t. Return type is regoff_t.
9291
613052cd
BK
92922011-04-16 Ben Key <bkey76@gmail.com>
9293
9294 * nsfont.m: Fixed bugs in ns_get_family and
9295 ns_descriptor_to_entity that were caused by using free to
9296 deallocate memory blocks that were allocated by xmalloc (via
9297 xstrdup). This caused Emacs to crash when compiled with
9298 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
9299 --enable-checking=xmallocoverrun). xfree is now used to
9300 deallocate these memory blocks.
9301
4170f62f 93022011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 9303
71b41406
PE
9304 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
9305
9587a89d
PE
9306 emacs_write: Accept and return EMACS_INT for sizes.
9307 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
9308 et seq.
9309 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
9310 Accept and return EMACS_INT.
9311 (emacs_gnutls_write): Return the number of bytes written on
9312 partial writes.
9313 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
9314 (emacs_read, emacs_write): Remove check for negative size, as the
9315 Emacs source code has been audited now.
9587a89d
PE
9316 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
9317 (emacs_read, emacs_write): Use it.
273a5f82
PE
9318 * process.c (send_process): Adjust to the new signatures of
9319 emacs_write and emacs_gnutls_write. Do not attempt to store
9320 a byte offset into an 'int'; it might overflow.
9587a89d 9321 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 9322
3e047f51
PE
9323 * sound.c: Don't assume sizes fit in 'int'.
9324 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 9325 Return EMACS_INT, not int.
3e047f51 9326 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
9327 Accept EMACS_INT, not int.
9328 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
9329 record read return values.
9330
cc39a9db
BK
93312011-04-15 Ben Key <bkey76@gmail.com>
9332
c9d0ec6d
JB
9333 * keyboard.c (Qundefined): Don't declare static since it is used
9334 in nsfns.m.
9335 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
9336 static since they are used in nsfont.m.
cc39a9db 9337
6c60eb9f
SM
93382011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
9339
9340 * process.c (Qprocessp): Don't declare static.
9341 * lisp.h (Qprocessp): Declare again.
9342
7990b61a
JB
93432011-04-15 Juanma Barranquero <lekktu@gmail.com>
9344
9345 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
9346
5d4cb038
PE
93472011-04-14 Paul Eggert <eggert@cs.ucla.edu>
9348
8bd7b830 9349 Improve C-level modularity by making more things 'static'.
cd64ea1d 9350
e3b27b31
PE
9351 Don't publish debugger-only interfaces to other modules.
9352 * lisp.h (safe_debug_print, debug_output_compilation_hack):
9353 (verify_bytepos, count_markers): Move decls to the only modules
9354 that need them.
9355 * region-cache.h (pp_cache): Likewise.
9356 * window.h (check_all_windows): Likewise.
9357 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
9358
5d4cb038
PE
9359 * sysdep.c (croak): Now static, if
9360 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
9361 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
9362
9363 * alloc.c (refill_memory_reserve): Now static if
9364 !defined REL_ALLOC || defined SYSTEM_MALLOC.
9365 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 9366
e87b6180
PE
9367 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
9368 Define only if USE_LUCID.
9369
ac64929e
PE
9370 * xrdb.c (x_customization_string, x_rm_string): Now static.
9371
6f37259d
PE
9372 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
9373 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
9374
1683e3ab
PE
9375 * xdisp.c (draw_row_with_mouse_face): Now static.
9376 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
9377
de9c2632
PE
9378 * window.h (check_all_windows): Mark externally visible.
9379
2b96acb7
PE
9380 * window.c (window_deletion_count): Now static.
9381
9382 * undo.c: Make symbols static if they're not exported.
9383 (last_undo_buffer, last_boundary_position, pending_boundary):
9384 Now static.
9385
50436f33
PE
9386 * textprop.c (interval_insert_behind_hooks): Now static.
9387 (interval_insert_in_front_hooks): Likewise.
9388
64520e5c
PE
9389 * term.c: Make symbols static if they're not exported.
9390 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
9391 (max_frame_lines, tty_set_terminal_modes):
9392 (tty_reset_terminal_modes, tty_turn_off_highlight):
9393 (get_tty_terminal): Now static.
9394 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
9395 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 9396 HAVE_WINDOW_SYSTEM.
64520e5c
PE
9397 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
9398 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
9399
1fa53021
PE
9400 * sysdep.c: Make symbols static if they're not exported.
9401 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
9402 Now static.
9403 (sigprocmask_set, full_mask): Remove; unused.
9404 (wait_debugging): Mark as visible.
9405 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
9406 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
9407
d4b43b22
PE
9408 * syntax.c (syntax_temp): Define only if !__GNUC__.
9409
b7c513d0
PE
9410 * sound.c (current_sound_device, current_sound): Now static.
9411
989b29ad
PE
9412 * search.c (searchbufs, searchbuf_head): Now static.
9413
13a55a78
PE
9414 * scroll.c (scroll_cost): Remove; unused.
9415 * dispextern.h (scroll_cost): Remove decl.
9416
de68a1fc
PE
9417 * region-cache.h (pp_cache): Mark as externally visible.
9418
40ccffa6
PE
9419 * process.c: Make symbols static if they're not exported.
9420 (process_tick, update_tick, create_process, chan_process):
9421 (Vprocess_alist, proc_buffered_char, datagram_access):
9422 (fd_callback_data, send_process_frame, process_sent_to): Now static.
9423 (deactivate_process): Mark defn as static, as well as decl.
9424 * lisp.h (create_process): Remove decl.
9425 * process.h (chan_process, Vprocess_alist): Remove decls.
9426
ad64fc97
PE
9427 * print.c: Make symbols static if they're not exported.
9428 (print_depth, new_backquote_output, being_printed, print_buffer):
9429 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
9430 (print_interval, print_number_index, initial_stderr_stream):
9431 Now static.
9432 * lisp.h (Fprinc): Remove decl.
9433 (debug_output_compilation_hack): Mark as externally visible.
9434
adddb265
PE
9435 * sysdep.c (croak): Move decl from here to syssignal.h.
9436 * syssignal.h (croak): Put it here, so the API can be checked when
9437 'croak' is called from dissociate_if_controlling_tty.
9438
1717ede2
PE
9439 * minibuf.c: Make symbols static if they're not exported.
9440 (minibuf_save_list, choose_minibuf_frame): Now static.
9441 * lisp.h (choose_minibuf_frame): Remove decl.
9442
fa5fb2bc
PE
9443 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
9444
1e3890d1
PE
9445 * lread.c: Make symbols static if they're not exported.
9446 (read_objects, initial_obarray, oblookup_last_bucket_number):
9447 Now static.
9448 (make_symbol): Remove; unused.
9449 * lisp.h (initial_obarray, make_symbol): Remove decls.
9450
8a1414fa
PE
9451 * keyboard.c: Make symbols static if they're not exported.
9452 (single_kboard, recent_keys_index, total_keys, recent_keys):
9453 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
9454 (this_single_command_key_start, echoing, last_auto_save):
9455 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
9456 (command_loop, echo_now, keyboard_init_hook, help_char_p):
9457 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
9458 (Vlispy_mouse_stem, double_click_count):
9459 Now static.
9460 (force_auto_save_soon): Define only if SIGDANGER.
9461 (ignore_mouse_drag_p): Now static if
9462 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
9463 (print_help): Remove; unused.
9464 (stop_character, last_timer_event): Mark as externally visible.
9465 * keyboard.h (ignore_mouse_drag_p): Declare only if
9466 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
9467 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
9468 * lisp.h (echoing): Remove decl.
9469 (force_auto_save_soon): Declare only if SIGDANGER.
9470 * xdisp.c (redisplay_window): Simplify code, to make it more
9471 obvious that ignore_mouse_drag_p is not accessed if !defined
9472 USE_GTK && !defined HAVE_NS.
9473
93ea6e8f
PE
9474 * intervals.c: Make symbols static if they're not exported.
9475 (merge_properties_sticky, merge_interval_right, delete_interval):
9476 Now static.
9477 * intervals.h (merge_interval_right, delete_interval): Remove decls.
9478
77382fcc
PE
9479 * insdel.c: Make symbols static if they're not exported.
9480 However, leave prepare_to_modify_buffer alone. It's never
9481 called from outside this function, but that appears to be a bug.
9482 (combine_after_change_list, combine_after_change_buffer):
4889fc82 9483 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
9484 (adjust_after_replace_noundo): Remove; unused.
9485 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 9486 (signal_before_change): Remove decls.
77382fcc 9487
9306c32e
PE
9488 * indent.c (val_compute_motion, val_vmotion): Now static.
9489
cd44d2eb
PE
9490 * image.c: Make symbols static if they're not exported.
9491 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
9492 if USE_GTK.
9493 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
9494 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
9495
ad9a7a06
PE
9496 * fringe.c (standard_bitmaps): Now static.
9497 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
9498
81626931
PE
9499 * frame.c: Make symbols static if they're not exported.
9500 (x_report_frame_params, make_terminal_frame): Now static.
9501 (get_frame_param): Now static, unless HAVE_NS.
9502 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
9503 (x_get_resource_string): Remove; not used.
9504 * frame.h (make_terminal_frame, x_report_frame_params):
9505 (x_get_resource_string); Remove decls.
9506 (x_fullscreen_adjust): Declare only if WINDOWSNT.
9507 * lisp.h (get_frame_param): Declare only if HAVE_NS.
9508
239f9db9
PE
9509 * font.c, fontset.c: Make symbols static if they're not exported.
9510 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
9511 (FACE_SUITABLE_FOR_CHAR_P): Use it.
9512 * font.c (font_close_object): Now static.
9513 * font.h (font_close_object): Remove.
9514 * fontset.c (FONTSET_OBJLIST): Remove.
9515 (free_realized_fontset) #if-0 the body, which does nothing.
9516 (face_suitable_for_char_p): #if-0, as it's never called.
9517 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
9518 * xfaces.c (face_at_string_position):
9519 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
9520 since 0 is always ASCII.
9521
dfcf3579
PE
9522 * fns.c (weak_hash_tables): Now static.
9523
5045092b
PE
9524 * fileio.c: Make symbols static if they're not exported.
9525 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
9526 (Vwrite_region_annotation_buffers): Now static.
9527
57a96f5c
PE
9528 * eval.c: Make symbols static if they're not exported.
9529 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
9530 * lisp.h (backtrace_list): Remove decl.
9531
35f08c38
PE
9532 * emacs.c: Make symbols static if they're not exported.
9533 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
9534 (fatal_error_code, fatal_error_signal_hook, standard_args):
9535 Now static.
9536 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
9537 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
9538 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
9539 * lisp.h (fatal_error_signal_hook): Remove decl.
9540 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
9541
f44bd759
PE
9542 * editfns.c: Move a (normally-unused) function to its only use.
9543 * editfns.c, lisp.h (get_operating_system_release): Remove.
9544 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
9545 worth the hassle of breaking this out.
9546
b532497d
PE
9547 * xterm.c: Make symbols static if they're not exported.
9548 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
9549 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
9550 (x_destroy_window, x_delete_display):
9551 Now static.
9552 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
9553 (x_mouse_leave): Remove; unused.
9554 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
9555 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
9556 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
9557 Remove decls.
9558 (x_mouse_leave): Declare only if WINDOWSNT.
9559 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
9560 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
9561 USE_X_TOOLKIT.
9562
1675728f
PE
9563 * ftxfont.c: Make symbols static if they're not exported.
9564 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
9565 HAVE_FREETYPE.
9566 * font.h (ftxfont_driver): Likewise.
9567
e4cebfca
PE
9568 * xfns.c: Make symbols static if they're not exported.
9569 (x_last_font_name, x_display_info_for_name):
9570 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
9571 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
9572 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
9573 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
9574 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
9575 (last_show_tip_args): Now static.
9576 (xic_defaut_fontset, xic_create_fontsetname): Define only if
9577 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
9578 (x_screen_planes): Remove; unused.
9579 * dispextern.h (x_screen_planes): Remove decl.
9580
5bf46f05
PE
9581 * dispnew.c: Make symbols static if they're not exported.
9582 * dispextern.h (redraw_garbaged_frames, scrolling):
9583 (increment_row_positions): Remove.
9584 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
9585 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
9586 Now static.
9587 (redraw_garbaged_frames): Remove; unused.
9588
435f4c28
PE
9589 * xfaces.c: Make symbols static if they're not exported.
9590 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
9591 Remove decls.
9592 * xterm.h (defined_color): Remove decls.
9593 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
9594 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
9595 (menu_face_changed_default, defined_color, free_realized_face):
9596 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
9597 (ascii_face_of_lisp_face): Remove; unused.
9598
8524aef3
PE
9599 * xdisp.c: Make symbols static if they're not exported.
9600 * dispextern.h (scratch_glyph_row, window_box_edges):
9601 (glyph_to_pixel_coords, set_cursor_from_row):
9602 (get_next_display_element, set_iterator_to_next):
9603 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
9604 (show_mouse_face): Remove decls
9605 * frame.h (message_buf_print): Likewise.
9606 * lisp.h (pop_message, set_message, check_point_in_composition):
9607 Likewise.
9608 * xterm.h (set_vertical_scroll_bar): Likewise.
9609 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
9610 (message_buf_print, scratch_glyph_row, displayed_buffer):
9611 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
9612 (get_next_display_element, show_mouse_face, window_box_edges):
9613 (frame_to_window_pixel_xy, check_point_in_composition):
9614 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
9615 (glyph_to_pixel_coords): Remove; unused.
9616
16390cd2
PE
9617 * dired.c (file_name_completion): Now static.
9618
9619 * dbusbind.c (xd_in_read_queued_messages): Now static.
9620
a25f4dfa
PE
9621 * lisp.h (circular_list_error, FOREACH): Remove; unused.
9622 * data.c (circular_list_error): Remove.
9623
14a9c8df
PE
9624 * commands.h (last_point_position, last_point_position_buffer):
9625 (last_point_position_window): Remove decls.
9626 * keyboard.c: Make these variables static.
9627
04f2d78b
CB
9628 * coding.h (coding, code_convert_region, encode_coding_gap):
9629 Remove decls.
74ab6df5
PE
9630 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
9631 (iso_code_class, detect_coding, code_convert_region): Now static.
9632 (encode_coding_gap): Remove; unused.
9633
38dfbee1
PE
9634 * chartab.c (chartab_chars, chartab_bits): Now static.
9635
a2cb4e63
PE
9636 * charset.h (charset_iso_8859_1): Remove decl.
9637 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
9638 Now static.
9639
127198fd
PE
9640 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
9641 * ccl.c (Vccl_program_table): Now static.
9642 (check_ccl_update): Remove; unused.
9643
d85b608f
PE
9644 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
9645 * category.h: ... from here.
9646 * category.c (check_category_table, set_category_set): Now static.
9647
31cd66f3
PE
9648 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
9649 * lisp.h: Remove these decls.
9650
c358e587
PE
9651 * buffer.c (buffer_count): Remove unused var.
9652
e78aecca
PE
9653 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
9654 so that it's not optimized away.
9655 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
9656 * dispextern.h (bidi_dump_cached_states): Remove, since it's
9657 exported only to the debugger.
9658
e192d7d3 9659 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 9660 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 9661
92470028
PE
9662 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
9663 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
9664 was inaccessible from Lisp.
9665 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
9666 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
9667
244ed907
PE
9668 alloc.c: Import and export fewer symbols, and remove unused items.
9669 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
9670 is defined.
9671 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
9672 it's not optimized away by whole-program optimization.
9673 (message_enable_multibyte, free_misc): Remove.
9674 (catchlist, handlerlist, mark_backtrace):
9675 Declare only if BYTE_MARK_STACK.
9676 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
9677 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
9678 (message_enable_multibyte): Remove decl.
9679 (free_misc, interval_free_list, float_block, float_block_index):
9680 (n_float_blocks, float_free_list, cons_block, cons_block_index):
9681 (cons_free_list, last_marked_index):
9682 Now static.
9683 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
9684 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
9685 (mark_backtrace): Define only if BYTE_MARK_STACK.
9686 * xdisp.c (message_enable_multibyte): Now static.
9687
61c2b50e 9688 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
9689 This makes it easier for human readers (and static analyzers)
9690 to see whether these variables are used from other modules.
9691 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
9692 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
9693 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
9694 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
9695 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
9696 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
9697 * xmenu.c, xselect.c:
9698 Declare Q* vars static if they are not used in other modules.
9699 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
9700 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
9701 Remove decls of unexported vars.
9702 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
9703
95c82688
PE
9704 * lisp.h (DEFINE_FUNC): Make sname 'static'.
9705
16a97296
PE
9706 Make Emacs functions such as Fatom 'static' by default.
9707 This makes it easier for human readers (and static analyzers)
9708 to see whether these functions can be called from other modules.
9709 DEFUN now defines a static function. To make the function external
9710 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
9711 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
9712 (Finit_image_library):
16a97296
PE
9713 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
9714 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
9715 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
9716 Remove decls, since these functions are now static.
9717 (Funintern, Fget_internal_run_time): New decls, since these functions
9718 were already external.
95c82688 9719
16a97296
PE
9720 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
9721 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
9722 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
9723 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
9724 * keyboard.c, keymap.c, lread.c:
9725 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
9726 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
9727 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
9728 Mark functions with DEFUE instead of DEFUN,
9729 if they are used in other modules.
9730 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
9731 decls for now-static functions.
9732 * buffer.h (Fdelete_overlay): Remove decl.
9733 * callproc.c (Fgetenv_internal): Mark as internal.
9734 * composite.c (Fremove_list_of_text_properties): Remove decl.
9735 (Fcomposition_get_gstring): New forward static decl.
9736 * composite.h (Fcomposite_get_gstring): Remove decl.
9737 * dired.c (Ffile_attributes): New forward static decl.
9738 * doc.c (Fdocumntation_property): New forward static decl.
9739 * eval.c (Ffetch_bytecode): New forward static decl.
9740 (Funintern): Remove extern decl; now in .h file where it belongs.
9741 * fileio.c (Fmake_symbolic_link): New forward static decl.
9742 * image.c (Finit_image_library): New forward static decl.
9743 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
9744 * intervals.h (Fprevious_property_change):
9745 (Fremove_list_of_text_properties): Remove decls.
9746 * keyboard.c (Fthis_command_keys): Remove decl.
9747 (Fcommand_execute): New forward static decl.
9748 * keymap.c (Flookup_key): New forward static decl.
9749 (Fcopy_keymap): Now static.
9750 * keymap.h (Flookup_key): Remove decl.
9751 * process.c (Fget_process): New forward static decl.
9752 (Fprocess_datagram_address): Mark as internal.
9753 * syntax.c (Fsyntax_table_p): New forward static decl.
9754 (skip_chars): Remove duplicate decl.
9755 * textprop.c (Fprevious_property_change): New forward static decl.
9756 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
9757 Now internal.
9758 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
9759 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
9760
785bbd42
PE
9761 * editfns.c (Fformat): Remove unreachable code.
9762
8b913b57
AS
97632011-04-14 Andreas Schwab <schwab@linux-m68k.org>
9764
9765 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
9766 change. (Bug#8496)
9767
a6744a35
EZ
97682011-04-13 Eli Zaretskii <eliz@gnu.org>
9769
9770 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
9771 when at ZV. (Bug#8487)
9772
e7974947
AS
97732011-04-12 Andreas Schwab <schwab@linux-m68k.org>
9774
baad03f0
AS
9775 * charset.c (Fclear_charset_maps): Use xfree instead of free.
9776 (Bug#8437)
9777 * keyboard.c (parse_tool_bar_item): Likewise.
9778 * sound.c (sound_cleanup, alsa_close): Likewise.
9779 * termcap.c (tgetent): Likewise.
9780 * xfns.c (x_default_font_parameter): Likewise.
9781 * xsettings.c (read_and_apply_settings): Likewise.
9782
e7974947
AS
9783 * alloc.c (overrun_check_malloc, overrun_check_realloc)
9784 (overrun_check_free): Protoize.
9785
28272684
PE
97862011-04-12 Paul Eggert <eggert@cs.ucla.edu>
9787
9788 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
9789 since callers should never pass a negative size.
9790 Change the signature to match that of plain 'read' and 'write'; see
9791 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
9792 * lisp.h: Update prototypes of emacs_write and emacs_read.
9793
11997c76
EZ
97942011-04-11 Eli Zaretskii <eliz@gnu.org>
9795
9796 * xdisp.c (redisplay_window): Don't try to determine the character
9797 position of the scroll margin if the window start point w->startp
e896f03c 9798 is outside the buffer's accessible region. (Bug#8468)
11997c76 9799
8a2cbd72
EZ
98002011-04-10 Eli Zaretskii <eliz@gnu.org>
9801
9802 Fix write-region and its subroutines for buffers > 2GB.
9803 * fileio.c (a_write, e_write): Modify declaration of arguments and
9804 local variables to support buffers larger than 2GB.
9805 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
9806
9807 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
9808 argument, local variables, and return value.
9809
9810 * lisp.h: Update prototypes of emacs_write and emacs_read.
9811
9812 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
9813
4073e537 98142011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 9815
1ebfdcb6
PE
9816 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
9817
b2ded58d
PE
9818 Fix more problems found by GCC 4.6.0's static checks.
9819
7d66342c
PE
9820 * xdisp.c (vmessage): Use a better test for character truncation.
9821
bbf47d44
PE
9822 * charset.c (load_charset_map): <, not <=, for optimization,
9823 and to avoid potential problems with integer overflow.
9248994d 9824 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 9825 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 9826 * editfns.c (Fformat): Likewise.
1e69125e 9827 * syntax.c (skip_chars): Likewise.
3befa583 9828
e3019616
PE
9829 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
9830 This also lets GCC 4.6.0 generate slightly better loop code.
9831
becfa255
PE
9832 * callint.c (Fcall_interactively): <, not <=, for optimization.
9833 (Fcall_interactively): Count the number of arguments produced,
9834 not the number of arguments given. This is simpler and lets GCC
9835 4.6.0 generate slightly better code.
9836
dae0cd48
PE
9837 * ftfont.c: Distingish more carefully between FcChar8 and char.
9838 The previous code passed unsigned char * to a functions like
9839 strlen and xstrcasecmp that expect char *, which does not
9840 conform to the C standard.
9841 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
9842 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9843 char * when the C standard requires it.
9844
76032d70
PE
9845 * keyboard.c (read_char): Remove unused var.
9846
eb3f1cc8
PE
9847 * eval.c: Port to Windows vsnprintf (Bug#8435).
9848 Include <limits.h>.
9849 (SIZE_MAX): Define if the headers do not.
9850 (verror): Do not give up if vsnprintf returns a negative count.
9851 Instead, grow the buffer. This ports to Windows vsnprintf, which
9852 does not conform to C99. Problem reported by Eli Zaretskii.
9853 Also, simplify the allocation scheme, by avoiding the need for
9854 calling realloc, and removing the ALLOCATED variable.
9855
70476b54
PE
9856 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
9857
12020a9e
PE
9858 Remove invocations of doprnt, as Emacs now uses vsnprintf.
9859 But keep the doprint source code for now, as we might revamp it
9860 and use it again (Bug#8435).
ea6c7ae6
PE
9861 * lisp.h (doprnt): Remove.
9862 * Makefile.in (base_obj): Remove doprnt.o.
9863 * deps.mk (doprnt.o): Remove.
9864
5fdb398c
PE
9865 error: Print 32- and 64-bit integers portably (Bug#8435).
9866 Without this change, on typical 64-bit hosts error ("...%d...", N)
9867 was used to print both 32- and 64-bit integers N, which relied on
9868 undefined behavior.
61bdb816 9869 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
9870 * lisp.h (error, verror): Mark as printf-like functions.
9871 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
9872 Report overflow in size calculations when allocating printf buffer.
9873 Do not truncate output string at its first null byte.
9874 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
9875 Truncate the output at a character boundary, since vsnprintf does not
9876 do that.
9877 * charset.c (check_iso_charset_parameter): Convert internal
9878 character to string before calling 'error', since %c now has the
9879 printf meaning.
9880 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
9881 overflow when computing char to be passed to 'error'. Do not
9882 pass Lisp_Object to 'error'; pass the integer instead.
9883 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
9884 formatted with plain %d.
9885
b189fa66
PE
9886 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
9887
bff87ef0
PE
9888 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
9889
7e2cac20
PE
9890 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
9891
ce4d90b5
PE
9892 * xterm.c (x_catch_errors): Remove duplicate declaration.
9893
266c9547
PE
9894 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
9895
79c49ad2
PE
9896 * xdisp.c, lisp.h (message_nolog): Remove; unused.
9897
368f4090
JM
98982011-04-10 Jim Meyering <meyering@redhat.com>
9899
9900 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
9901 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
9902 return ssize_t not "int", and use size_t as the buffer length.
9903 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
9904 * gnutls.h: Update declarations.
9905 * process.c (read_process_output): Use ssize_t, to match.
9906 (send_process): Likewise.
9907
a32d4040
CY
99082011-04-09 Chong Yidong <cyd@stupidchicken.com>
9909
9910 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
9911
8546720e 99122011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 9913
04f2d78b
CB
9914 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
9915 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 9916
8546720e
GM
9917 * xterm.c (handle_one_xevent):
9918 * xmenu.c (create_and_show_popup_menu):
9919 * xselect.c (x_decline_selection_request)
9920 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 9921
0a2f5c1a 99222011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
9923
9924 Fix some uses of `int' instead of EMACS_INT.
9925 * search.c (string_match_1, fast_string_match)
9926 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
9927 (scan_buffer, find_next_newline_no_quit)
9928 (find_before_next_newline, search_command, Freplace_match)
9929 (Fmatch_data): Make some `int' variables be EMACS_INT.
9930
9931 * xdisp.c (display_count_lines): 3rd argument and return value now
9932 EMACS_INT. All callers changed.
9933 (pint2hrstr): Last argument is now EMACS_INT.
9934
9935 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
9936 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9937 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
9938 (decode_coding_utf_16, decode_coding_emacs_mule)
9939 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
9940 (decode_coding_ccl, decode_coding_charset)
9941 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
9942 (decode_coding_iso_2022, decode_coding_emacs_mule)
9943 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
9944 <char_offset, last_offset>: Declare EMACS_INT.
9945 (encode_coding_utf_8, encode_coding_utf_16)
9946 (encode_coding_emacs_mule, encode_invocation_designation)
9947 (encode_designation_at_bol, encode_coding_iso_2022)
9948 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
9949 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
9950 Declare EMACS_INT.
9951 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
9952 (encode_invocation_designation): Last argument P_NCHARS is now
9953 EMACS_INT.
9954 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
9955 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
9956
9957 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
9958 All users changed.
9959
9960 * ccl.c (Fccl_execute_on_string): Declare some variables
9961 EMACS_INT.
9962
8546720e 99632011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
9964
9965 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
9966
4e19a977
CS
99672011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
9968
9969 * process.c (Fformat_network_address): Doc fix.
9970
87302331
R
99712011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
9972
ee7683eb 9973 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 9974
cbb59342
CY
99752011-04-08 Chong Yidong <cyd@stupidchicken.com>
9976
9977 * keyboard.c (read_char): Call Lisp function help-form-show,
9978 instead of using internal_with_output_to_temp_buffer.
9979 (Qhelp_form_show): New var.
e0d38eeb 9980 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
9981
9982 * print.c (internal_with_output_to_temp_buffer): Function deleted.
9983
9984 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
9985
e67a13ab
CY
99862011-04-06 Chong Yidong <cyd@stupidchicken.com>
9987
04f2d78b
CB
9988 * process.c (Flist_processes): Remove to Lisp.
9989 (list_processes_1): Delete.
e67a13ab 9990
973f782d
EZ
99912011-04-06 Eli Zaretskii <eliz@gnu.org>
9992
7c106b1e
EZ
9993 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9994
973f782d
EZ
9995 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9996
41cf7d1a 99972011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 9998
ca23cc88
PE
9999 Fix more problems found by GCC 4.6.0's static checks.
10000
f390e2d5
PE
10001 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
10002
42eea0d0
PE
10003 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
10004
b69769da 10005 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 10006
f9541e84
PE
10007 * xdisp.c (vmessage): Mark as a printf-like function.
10008
13841b55
PE
10009 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
10010
c136c10f
PE
10011 * sound.c (sound_warning): Don't crash if arg contains a printf format.
10012
5e2d4a30
PE
10013 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
10014 printf-like functions.
10015 (tiff_load): Add casts to remove these marks before passing them
10016 to system-supplied API.
10017
583f48b9
PE
10018 * eval.c (Fsignal): Remove excess argument to 'fatal'.
10019
b25d760e
PE
10020 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
10021 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
10022 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
10023 directly, rather than having caller test rule sign. This avoids
10024 some unnecessary tests.
10025 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
10026 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
10027 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 10028
bc7b6697 10029 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 10030 (xfont_open): Avoid unnecessary tests.
bc7b6697 10031
27ccc379
PE
10032 * composite.c (composition_gstring_put_cache): Use unsigned integer.
10033
dcd5c89a
PE
10034 * composite.h, composite.c (composition_gstring_put_cache):
10035 Use EMACS_INT, not int, for length.
10036
b13a45c6
PE
10037 * composite.h (COMPOSITION_DECODE_REFS): New macro,
10038 breaking out part of COMPOSITION_DECODE_RULE.
10039 (COMPOSITION_DECODE_RULE): Use it.
10040 * composite.c (get_composition_id): Remove unused local vars,
10041 by using the new macro.
10042
1e792e4d
PE
10043 * textprop.c (set_text_properties_1): Change while to do-while,
10044 since the condition is always true at first.
10045
dc6c6455 10046 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
10047 (interval_deletion_adjustment): Return unsigned value.
10048 All uses changed.
dc6c6455 10049
aba7731a
PE
10050 * process.c (list_processes_1, create_pty, read_process_output):
10051 (exec_sentinel): Remove vars that were set but not used.
afd4052b 10052 (create_pty): Remove unnecessary "volatile"s.
bc57d757 10053 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 10054 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 10055 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 10056
fdfc4bf3
PE
10057 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
10058
fca8fe46 10059 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 10060 (update_syntax_table): Use unsigned instead of int.
fca8fe46 10061
06a0259a 10062 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 10063 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 10064 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 10065
e7b9e80f
PE
10066 * print.c (print_error_message): Avoid int overflow.
10067
56201685
PE
10068 * font.c (font_list_entities): Redo for clarity,
10069 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
10070
78834453 10071 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 10072 (font_score): Avoid potential overflow in diff calculation.
78834453 10073
0bc0b309 10074 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 10075 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 10076
e610eaca
PE
10077 * eval.c (funcall_lambda): Rename local to avoid shadowing.
10078
b895abce
PE
10079 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
10080 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
10081 can always succeed if overflow has undefined behavior.
10082
1f1d9321 10083 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 10084 (wordify): Omit three unnecessary tests.
1f1d9321 10085
c59478bc
PE
10086 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
10087 All callers changed. This avoids the need for an unused var.
10088
79b73827
PE
10089 * casefiddle.c (casify_region): Remove var that is set but not used.
10090
a4db5dfe
PE
10091 * dired.c (file_name_completion): Remove var that is set but not used.
10092
43aae36e
PE
10093 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
10094
2a47c44d 10095 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 10096 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 10097
a37c69bf
PE
10098 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
10099 Check for integer overflow on size calculations.
10100
328ab8e7
PE
10101 * buffer.c (Fprevious_overlay_change): Remove var that is set
10102 but not used.
10103
e5a2a5cb
PE
10104 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
10105 Remove vars that are set but not used.
8d84a6eb 10106 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 10107 (timer_check_2): Mark vars as initialized.
e5a2a5cb 10108
a60e5f68
PE
10109 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
10110
f661cb61 10111 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 10112 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 10113
f0397f5a
PE
10114 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
10115 that are set but not used.
10116
8664db06 10117 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 10118 if XCreateBitmapFromData fails (Bug#8410).
8664db06 10119
6abdaa4a
PE
10120 * xselect.c (x_get_local_selection, x_handle_property_notify):
10121 Remove vars that are set but not used.
10122
0ce7538d 10123 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 10124 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 10125
9ae848fc
PE
10126 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
10127 Remove var that is set but not used.
0b918413
PE
10128 (scroll_bar_windows_size): Now size_t, not int.
10129 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
10130 Check for overflow.
9ae848fc 10131
a5a62657
PE
10132 * xfaces.c (realize_named_face): Remove vars that are set but not used.
10133 (map_tty_color) [!defined MSDOS]: Likewise.
10134
5c5cdd39
PE
10135 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
10136
66ebf983
PE
10137 * coding.c: Remove vars that are set but not used.
10138 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
10139 All callers changed.
10140 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
10141 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
10142 (decode_coding_charset): Remove vars that are set but not used.
10143
1be4d761
PE
10144 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
10145 that is set but not used.
10146
47553fa8
PE
10147 * print.c (print_object): Remove var that is set but not used.
10148
1f7196bf 10149 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
10150 The gnulib version avoids calling malloc in the usual case,
10151 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
10152 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
10153 * filelock.c (current_lock_owner): Likewise.
10154 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
10155 * sysdep.c: Include allocator.h, careadlinkat.h.
10156 (emacs_no_realloc_allocator): New static constant.
10157 (emacs_readlink): New function.
fdb61804
PE
10158 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
10159 ../lib/careadlinkat.h.
d1fdcab7 10160
f84c17c7
SM
101612011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
10162
10163 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
10164 first non-nil return value).
10165
ef3862ad
JD
101662011-04-03 Jan Djärv <jan.h.d@swipnet.se>
10167
10168 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
10169 if not defined (Bug#8403).
10170
376a7006
JB
101712011-04-02 Juanma Barranquero <lekktu@gmail.com>
10172
10173 * xdisp.c (display_count_lines): Remove parameter `start',
10174 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10175 (get_char_face_and_encoding): Remove parameter `multibyte_p',
10176 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10177 (fill_stretch_glyph_string): Remove parameters `row' and `area',
10178 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
10179 and thereabouts. All callers changed.
10180 (get_per_char_metric): Remove parameter `f', unused since
10181 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10182
6ca3801d
JM
101832011-04-02 Jim Meyering <meyering@redhat.com>
10184
10185 do not dereference NULL upon failed strdup
10186 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
10187 (ns_get_family): Likewise.
10188
d8e2b5ba
JB
101892011-04-02 Juanma Barranquero <lekktu@gmail.com>
10190
10191 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
10192
8c74fcbd
JD
101932011-04-02 Jan Djärv <jan.h.d@swipnet.se>
10194
10195 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
10196 later (Bug#8403).
10197
7200d79c
SM
101982011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
10199
03408648 10200 Add lexical binding.
7200d79c 10201
03408648
SM
10202 * window.c (Ftemp_output_buffer_show): New fun.
10203 (Fsave_window_excursion):
10204 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
10205
10206 * lread.c (lisp_file_lexically_bound_p): New function.
10207 (Fload): Bind Qlexical_binding.
10208 (readevalloop): Remove `evalfun' arg.
10209 Bind Qinternal_interpreter_environment.
10210 (Feval_buffer): Bind Qlexical_binding.
10211 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
10212 Mark as dynamic.
10213 (syms_of_lread): Declare `lexical-binding'.
10214
10215 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
10216
10217 * keyboard.c (eval_dyn): New fun.
10218 (menu_item_eval_property): Use it.
ca105506
SM
10219
10220 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 10221
03408648
SM
10222 * fns.c (concat, mapcar1): Accept byte-code-functions.
10223
10224 * eval.c (Fsetq): Handle lexical vars.
10225 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
10226 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
10227 (FletX, Flet): Obey lexical binding.
10228 (Fcommandp): Handle closures.
10229 (Feval): New `lexical' arg.
10230 (eval_sub): New function extracted from Feval. Use it almost
10231 everywhere where Feval was used. Look up vars in lexical env.
10232 Handle closures.
10233 (Ffunctionp): Move from subr.el.
10234 (Ffuncall): Handle closures.
10235 (apply_lambda): Remove `eval_flags'.
10236 (funcall_lambda): Handle closures and new byte-code-functions.
10237 (Fspecial_variable_p): New function.
10238 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
10239 but without exporting it to Lisp.
23aba0ea 10240
23aba0ea 10241 * doc.c (Fdocumentation, store_function_docstring):
03408648 10242 * data.c (Finteractive_form): Handle closures.
23aba0ea 10243
03408648
SM
10244 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
10245 interactive spec.
ba83908c 10246
04f2d78b
CB
10247 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
10248 New byte-codes.
03408648
SM
10249 (exec_byte_code): New function extracted from Fbyte_code to handle new
10250 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 10251
03408648 10252 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 10253
03408648 10254 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 10255
e2abce01
JB
102562011-03-31 Juanma Barranquero <lekktu@gmail.com>
10257
10258 * xdisp.c (redisplay_internal): Fix prototype.
10259
63696a73 102602011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 10261
63696a73 10262 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
10263 (try_scrolling): Use it when setting scroll_limit.
10264 Limit scrolling to 100 screen lines.
63696a73
EZ
10265 (redisplay_window): Even when falling back on "recentering",
10266 position point in the window according to scroll-conservatively,
10267 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
10268
10269 (try_scrolling): When point is above the window, allow searching
10270 as far as scroll_max, or one screenful, to compute vertical
10271 distance from PT to the scroll margin position. This prevents
10272 try_scrolling from unnecessarily failing when
10273 scroll-conservatively is set to a value slightly larger than the
10274 window height. Clean up the case of PT below the margin at bottom
10275 of window: scroll_max can no longer be INT_MAX. When aggressive
10276 scrolling is in use, don't let point enter the opposite scroll
10277 margin as result of the scroll.
10278 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
10279 threshold of 100 lines for never-recentering scrolling.
10280
e4cc2dfc
JB
102812011-03-31 Juanma Barranquero <lekktu@gmail.com>
10282
10283 * dispextern.h (move_it_by_lines):
10284 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
10285 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
10286 (message_log_check_duplicate): Remove parameters `prev_bol' and
10287 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10288 (redisplay_internal): Remove parameter `preserve_echo_area',
10289 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
10290
10291 * indent.c (Fvertical_motion):
10292 * window.c (window_scroll_pixel_based, Frecenter):
10293 Don't pass `need_y_p' to `move_it_by_lines'.
10294
1c470562
SM
102952011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
10296
44f230aa
SM
10297 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
10298 steal a few bits to be more compact.
10299 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
10300 Remove unneeded casts.
10301
1c470562
SM
10302 * bytecode.c (Fbyte_code): CAR and CDR can GC.
10303
888adce9
ZK
103042011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
10305
10306 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
10307 binding" message (bug#7967).
10308
f838ed7b
PE
103092011-03-30 Paul Eggert <eggert@cs.ucla.edu>
10310
77861b95
PE
10311 Fix more problems found by GCC 4.6.0's static checks.
10312
de6dbc14
PE
10313 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
10314 Remove unused local var.
10315
f838ed7b
PE
10316 * editfns.c (Fmessage_box): Remove unused local var.
10317
792c7b2b
PE
10318 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
10319 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10320 Omit unused local vars.
c499e557 10321 * window.c (shrink_windows): Omit unused local var.
b01a1c29 10322 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
10323 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
10324 Omit unused local var.
10325
ba0165e1
PE
10326 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
10327 Don't assume string length fits in int.
32ad8845 10328 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 10329 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 10330
3c59b4c9
PE
10331 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
10332 instead of alloca (Bug#8344).
10333
a3eed478 10334 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 10335 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 10336
eb4d412d
PE
10337 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
10338
1658b401
PE
10339 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
10340 concerns.
10341
10342 * term.c (produce_glyphless_glyph): Remove unnecessary test.
10343
10344 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 10345
9a2c6e05
PE
10346 * keyboard.c (syms_of_keyboard): Use the same style as later
10347 in this function when indexing through an array. This also
10348 works around GCC bug 48267.
10349
03d0a109
PE
10350 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
10351
44f730c8
PE
10352 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
10353
fe75f926
PE
10354 * chartab.c (sub_char_table_ref_and_range): Redo for slight
10355 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
10356
ffa8c828
PE
10357 * keyboard.c, keyboard.h (num_input_events): Now size_t.
10358 This avoids undefined behavior on integer overflow, and is a bit
10359 more convenient anyway since it is compared to a size_t variable.
10360
c5101a77
PE
10361 Variadic C functions now count arguments with size_t, not int.
10362 This avoids an unnecessary limitation on 64-bit machines, which
10363 caused (substring ...) to crash on large vectors (Bug#8344).
10364 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
10365 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 10366 All variadic functions and their callers changed accordingly.
c5101a77
PE
10367 (struct gcpro.nvars): Now size_t, not int. All uses changed.
10368 * data.c (arith_driver, float_arith_driver): Likewise.
10369 * editfns.c (general_insert_function): Likewise.
10370 * eval.c (struct backtrace.nargs, interactive_p)
10371 (internal_condition_case_n, run_hook_with_args, apply_lambda)
10372 (funcall_lambda, mark_backtrace): Likewise.
10373 * fns.c (concat): Likewise.
10374 * frame.c (x_set_frame_parameters): Likewise.
10375 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
10376 0 if not found, not -1. All callers changed.
10377
dd3f25f7
PE
10378 * alloc.c (garbage_collect): Don't assume stack size fits in int.
10379 (stack_copy_size): Now size_t, not int.
10380 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
10381
461c2ab9
JB
103822011-03-28 Juanma Barranquero <lekktu@gmail.com>
10383
10384 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
10385 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10386 All callers changed.
10387
10388 * lisp.h (multibyte_char_to_unibyte):
10389 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
10390 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10391 * character.h (CHAR_TO_BYTE8):
10392 * cmds.c (internal_self_insert):
10393 * editfns.c (general_insert_function):
10394 * keymap.c (push_key_description):
10395 * search.c (Freplace_match):
10396 * xdisp.c (message_dolog, set_message_1): All callers changed.
10397
f6d62986
SM
103982011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10399
10400 * keyboard.c (safe_run_hook_funcall): New function.
10401 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
10402 don't set the hook to nil, but remove the offending function instead.
10403 (Qcommand_hook_internal): Remove, unused.
10404 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
10405 Vcommand_hook_internal.
10406
10407 * eval.c (enum run_hooks_condition): Remove.
10408 (funcall_nil, funcall_not): New functions.
10409 (run_hook_with_args): Call each function through a `funcall' argument.
10410 Remove `cond' argument, now redundant.
10411 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
10412 (Frun_hook_with_args_until_failure): Adjust accordingly.
10413 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
10414
1db5b1ad
JB
104152011-03-28 Juanma Barranquero <lekktu@gmail.com>
10416
10417 * dispextern.h (string_buffer_position): Remove declaration.
10418
10419 * print.c (strout): Remove parameter `multibyte', unused since
10420 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
10421
10422 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
10423 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
10424 All callers changed.
10425
10426 * w32.c (_wsa_errlist): Use braces for struct initializers.
10427
10428 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
10429 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
10430 All callers changed.
10431 (string_buffer_position): Likewise. Also, make static (it's never
10432 used outside xdisp.c).
10433 (cursor_row_p): Remove parameter `w', unused since
10434 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
10435 (decode_mode_spec): Remove parameter `precision', introduced during
10436 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
10437 All callers changed.
10438
5ffb62aa
JD
104392011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10440
10441 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
10442
461c2ab9 104432011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
10444
10445 * nsterm.m (ns_menu_bar_is_hidden): New variable.
10446 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
10447 (ns_update_auto_hide_menu_bar): New functions.
10448 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
10449 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
10450 ns_constrain_all_frames.
10451 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
10452 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
10453
5c380ffb
JD
104542011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10455
10456 * nsmenu.m (runDialogAt): Remove argument to timer_check.
10457
9af30bdf
GM
104582011-03-27 Glenn Morris <rgm@gnu.org>
10459
10460 * syssignal.h: Replace RETSIGTYPE with void.
10461 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
10462 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
10463 Replace SIGTYPE with void everywhere.
10464 * s/usg5-4-common.h (SIGTYPE): Remove definition.
10465 * s/template.h (SIGTYPE): Remove commented out definition.
10466
e2abce01
JB
104672011-03-26 Eli Zaretskii <eliz@gnu.org>
10468
10469 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
10470 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
10471
f868cd8a
JB
104722011-03-26 Juanma Barranquero <lekktu@gmail.com>
10473
59eb0929
JB
10474 * w32.c (read_unc_volume): Use parameter `henum', instead of
10475 global variable `wget_enum_handle'.
10476
10477 * keymap.c (describe_vector): Remove parameters `indices' and
10478 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
10479 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
10480
f868cd8a
JB
10481 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
10482
10483 * keyboard.c (timer_check): Remove parameter `do_it_now',
10484 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
10485 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
10486 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
10487
10488 * keyboard.c (read_char):
10489 * w32menu.c (w32_menu_display_help):
10490 * xmenu.c (show_help_event, menu_help_callback):
10491 Adjust calls to `show_help_echo'.
10492
10493 * gtkutil.c (xg_maybe_add_timer):
10494 * keyboard.c (readable_events):
10495 * process.c (wait_reading_process_output):
10496 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
10497
10498 * insdel.c (adjust_markers_gap_motion):
10499 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
10500 (gap_left, gap_right): Don't call it.
10501
2ecf6fdb
CY
105022011-03-25 Chong Yidong <cyd@stupidchicken.com>
10503
10504 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
10505 incurred during fontification.
10506
6b1f9ba4
JB
105072011-03-25 Juanma Barranquero <lekktu@gmail.com>
10508
10509 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
10510 (DEFVAR_PER_BUFFER): Don't pass it.
10511
10512 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
10513 (scrolling_window): Don't pass it.
10514
0f4a96b5
JB
105152011-03-25 Juanma Barranquero <lekktu@gmail.com>
10516
10517 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
10518
10519 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
10520 and `suffix'.
10521 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
10522 of variables specific to SELinux and computation of `encoded_absname'.
10523
10524 * image.c (XPutPixel): Remove unused variable `height'.
10525
10526 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
10527
10528 * unexw32.c (get_section_info): Remove unused variable `section'.
10529
10530 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
10531 (system_process_attributes): Remove unused variable `sess'.
10532 (sys_read): Remove unused variable `err'.
10533
10534 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
10535 (w32_wnd_proc): Remove unused variable `isdead'.
10536 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
10537 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
10538 (x_create_tip_frame): Remove unused variable `tem'.
10539
10540 * w32inevt.c (w32_console_read_socket):
10541 Remove unused variable `no_events'.
10542
10543 * w32term.c (x_draw_composite_glyph_string_foreground):
10544 Remove unused variable `width'.
10545
1149507c
JB
105462011-03-24 Juanma Barranquero <lekktu@gmail.com>
10547
10548 * w32term.c (x_set_glyph_string_clipping):
10549 Don't pass uninitialized region to CombineRgn.
10550
9c88f339
JB
105512011-03-23 Juanma Barranquero <lekktu@gmail.com>
10552
10553 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
10554 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
10555 (Fx_close_connection): Remove unused variable `i'.
10556
10557 * w32font.c (w32font_draw): Return number of glyphs.
10558 (w32font_open_internal): Remove unused variable `i'.
10559 (w32font_driver): Add missing initializer.
10560
10561 * w32menu.c (utf8to16): Remove unused variable `utf16'.
10562 (fill_in_menu): Remove unused variable `items_added'.
10563
10564 * w32term.c (last_mouse_press_frame): Remove static global variable.
10565 (w32_clip_to_row): Remove unused variable `f'.
10566 (x_delete_terminal): Remove unused variable `i'.
10567
10568 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
10569 (NOTHING): Remove unused static global variable.
10570 (uniscribe_check_otf): Remove unused variable `table'.
10571 (uniscribe_font_driver): Add missing initializers.
10572
dee091a3
JD
105732011-03-23 Julien Danjou <julien@danjou.info>
10574
10575 * term.c (Fsuspend_tty, Fresume_tty):
10576 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
10577 * window.c (temp_output_buffer_show):
10578 * insdel.c (signal_before_change):
10579 * frame.c (Fhandle_switch_frame):
10580 * fileio.c (Fdo_auto_save):
10581 * emacs.c (Fkill_emacs):
10582 * editfns.c (save_excursion_restore):
10583 * cmds.c (internal_self_insert):
10584 * callint.c (Fcall_interactively):
10585 * buffer.c (Fkill_all_local_variables):
10586 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
10587 Use Frun_hooks.
0f4a96b5 10588 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 10589 unconditionally since it does the check itself.
dee091a3 10590
2c520ab5 105912011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 10592
c9c49752
PE
10593 Fix more problems found by GCC 4.5.2's static checks.
10594
8abc3f12
PE
10595 * coding.c (encode_coding_raw_text): Avoid unnecessary test
10596 the first time through the loop, since we know p0 < p1 then.
10597 This also avoids a gcc -Wstrict-overflow warning.
10598
a2d26660
PE
10599 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
10600 leading to a memory leak, possible in functions like
10601 load_charset_map_from_file that can allocate an unbounded number
b12ef411 10602 of objects (Bug#8318).
a2d26660 10603
916c72e9
PE
10604 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
10605 that could (at least in theory) be that large.
10606
19ab8a18
PE
10607 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
10608 This is less likely to overflow, and avoids undefined behavior if
10609 overflow does occur. All callers changed. Use strtoul to scan
10610 for the unsigned long integer.
b7cbbd6f
PE
10611 (pint2hrstr): Simplify and tune code slightly.
10612 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 10613
f0641eff
PE
10614 * scroll.c (do_scrolling): Work around GCC bug 48228.
10615 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
10616
7f650bb9
PE
10617 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
10618 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
10619 (validate_x_resource_name): Simplify count usage.
10620 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 10621
37dd57d1
PE
10622 * fileio.c (Fcopy_file): Report error if fchown or fchmod
10623 fail (Bug#8306).
81e56e61 10624
699979fc 10625 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 10626
401bf9b4
PE
10627 * process.c (Fmake_network_process): Use socklen_t, not int,
10628 where POSIX says socklen_t is required in portable programs.
10629 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 10630 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
10631 (Fmake_network_process, server_accept_connection):
10632 (wait_reading_process_output, read_process_output):
10633 Likewise.
10634
b93aacde
PE
10635 * process.c: Rename or move locals to avoid shadowing.
10636 (list_processes_1, Fmake_network_process):
10637 (read_process_output_error_handler, exec_sentinel_error_handler):
10638 Rename or move locals.
4dc343ee 10639 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 10640 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 10641 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 10642 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 10643 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 10644
af8a867c 10645 Make tparam.h and terminfo.c consistent.
44f230aa
SM
10646 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
10647 Include tparam.h instead, since it declares them.
af8a867c
PE
10648 * cm.h (PC): Remove extern decl; tparam.h now does this.
10649 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
10650 * terminfo.c: Include tparam.h, to check interfaces.
10651 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
10652 (tparam): Adjust signature to match interface in tparam.h;
10653 this removes some undefined behavior. Check that outstring and len
10654 are zero, which they always are with Emacs.
10655 * tparam.h (PC, BC, UP): New extern decls.
10656
0248044d 10657 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 10658 (xftfont_open): Rename locals to avoid shadowing.
0248044d 10659
8ff096c1 10660 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
10661 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
10662 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 10663 (ftfont_list): Remove unused local.
49eaafba
PE
10664 (get_adstyle_property, ftfont_pattern_entity):
10665 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
10666 Rename locals to avoid shadowing.
8ff096c1 10667
e2be39f6
PE
10668 * xfont.c (xfont_list_family): Mark var as initialized.
10669
c9735e30
PE
10670 * xml.c (make_dom): Now static.
10671
8f5201ae
PE
10672 * composite.c (composition_compute_stop_pos): Rename local to
10673 avoid shadowing.
b246f932
PE
10674 (composition_reseat_it): Remove unused locals.
10675 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 10676 (composition_update_it): Mark var as initialized.
11b61122
PE
10677 (find_automatic_composition): Mark vars as initialized,
10678 with a FIXME (Bug#8290).
8f5201ae 10679
760fbc2c
PE
10680 character.h: Rename locals to avoid shadowing.
10681 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
10682 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
10683 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
10684 (BUF_DEC_POS): Be more systematic about renaming local temporaries
10685 to avoid shadowing.
10686
ff08eb85
PE
10687 * textprop.c (property_change_between_p): Remove; unused.
10688
fc7bf025
PE
10689 * intervals.c (interval_start_pos): Now static.
10690
235d7abc
PE
10691 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
10692
44f230aa
SM
10693 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
10694 Rename locals to avoid shadowing.
3e7d6594 10695
50060332
PE
10696 * sound.c (wav_play, au_play, Fplay_sound_internal):
10697 Fix pointer signedness.
d01f234b 10698 (alsa_choose_format): Remove unused local var.
c83b8872
PE
10699 (wav_play): Initialize a variable to 0, to prevent undefined
10700 behavior (Bug#8278).
50060332 10701
c4fc4e30
PE
10702 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
10703
918436ed
PE
10704 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
10705
c939f91b
PE
10706 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
10707 clobbering (Bug#8298).
b9c7f648
PE
10708 * sysdep.c (sys_subshell): Likewise.
10709 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 10710
6bd8c144
PE
10711 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
10712 This should get cleaned up, so that child_setup has the
10713 same signature on all platforms.
10714
7710357c 10715 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 10716 (relocate_fd): Rename locals to avoid shadowing.
7710357c 10717
c59da222
CY
107182011-03-22 Chong Yidong <cyd@stupidchicken.com>
10719
10720 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
10721 not to be necessary, and produces flickering.
10722
66b87493
GM
107232011-03-20 Glenn Morris <rgm@gnu.org>
10724
10725 * config.in: Remove file.
10726
45b6f6d5
JB
107272011-03-20 Juanma Barranquero <lekktu@gmail.com>
10728
10729 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
10730 are now in src/globals.h.
10731 (syms_of_minibuf): Remove spurious & from previous change.
10732
cd394be1 107332011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
10734
10735 * minibuf.c (completing-read-function): New variable.
10736 (completing-read-default): Rename from completing-read.
10737 (completing-read): Call completing-read-function.
10738
b14e3e21
CY
107392011-03-19 Juanma Barranquero <lekktu@gmail.com>
10740
10741 * xfaces.c (Fx_load_color_file):
10742 Read color file from absolute filename (bug#8250).
10743
f2b726e6
JB
107442011-03-19 Juanma Barranquero <lekktu@gmail.com>
10745
10746 * makefile.w32-in: Update dependencies.
10747
09f6ff02
EZ
107482011-03-17 Eli Zaretskii <eliz@gnu.org>
10749
10750 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
10751
29a6015a
PE
107522011-03-17 Paul Eggert <eggert@cs.ucla.edu>
10753
a3a6c54e
PE
10754 Fix more problems found by GCC 4.5.2's static checks.
10755
b766f867
PE
10756 * process.c (make_serial_process_unwind, send_process_trap):
10757 (sigchld_handler): Now static.
10758
be02381c
PE
10759 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
10760 That way, the code declares only the vars that it needs.
10761 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
10762 * s/cygwin.h (PTY_ITERATION): Likewise.
10763 * s/darwin.h (PTY_ITERATION): Likewise.
10764 * s/gnu-linux.h (PTY_ITERATION): Likewise.
10765
57048744
PE
10766 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
10767 * process.c (allocate_pty): Don't declare stb unless it's needed.
10768
7914961c 10769 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
10770 (CONSTANTLIM): Remove; unused.
10771 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
10772 Define only if needed.
7914961c 10773
b3967b18
PE
10774 * unexelf.c (unexec): Name an expression,
10775 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
10776 Use a different way to cause a compilation error if anyone uses
10777 n rather than nn, a way that does not involve shadowing.
73366a00 10778 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 10779
29a6015a
PE
10780 * deps.mk (unexalpha.o): Remove; unused.
10781
43cfc33e 10782 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 10783 * unexec.h: New file.
ce701a33
PE
10784 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
10785 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
10786 Depend on unexec.h.
10787 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
10788 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
10789 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 10790 Change as necessary to match prototype in unexec.h.
ce701a33 10791
01f44d5a
PE
10792 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
10793 shadowing.
4f63c6bb 10794 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 10795
a6670b0b
PE
10796 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
10797 Rename locals to avoid shadowing.
10798
cef2010d 10799 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 10800 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 10801
d4d7173a
PE
10802 * print.c (Fredirect_debugging_output): Fix pointer signedess.
10803
f08b802a
PE
10804 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
10805 warning when compiling print.c.
10806
3ddb0639
PE
10807 * font.c (font_unparse_fcname): Abort in an "impossible" situation
10808 instead of using an uninitialized var.
5ad03b97 10809 (font_sort_entities): Mark var as initialized.
3ddb0639 10810
170a2692
PE
10811 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
10812
e663c700
PE
10813 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
10814 pointers to constants.
89bc529a 10815 (font_parse_fcname): Remove unused vars.
7b81e2d0 10816 (font_delete_unmatched): Now static.
ea838e10 10817 (font_get_spec): Remove; unused.
13a547c6
PE
10818 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
10819 (font_update_drivers, Ffont_get_glyphs, font_add_log):
10820 Rename or move locals to avoid shadowing.
e663c700 10821
2a80c887 10822 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 10823 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 10824
1384fa33 10825 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 10826 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 10827
8b2c52e9
PE
10828 * alloc.c (mark_backtrace): Move decl from here ...
10829 * lisp.h: ... to here, so that it can be checked.
10830
475545b5 10831 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 10832 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
10833 (lisp_indirect_variable): Name an expression,
10834 to avoid gcc -Wbad-function-cast warning.
1faed8ae 10835 (Fdefvar): Rename locals to avoid shadowing.
475545b5 10836
b1349114 10837 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 10838 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 10839 Use const pointer when appropriate.
b1349114 10840
a2928364
PE
10841 * lisp.h (get_system_name, get_operating_system_release):
10842 Move decls here, to check interfaces.
10843 * process.c (get_operating_system_release): Move decl to lisp.h.
10844 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
10845 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
10846 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
10847 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
10848 (Fformat_time_string, Fencode_time, Finsert_char):
10849 (Ftranslate_region_internal, Fformat):
10850 Rename or remove local vars to avoid shadowing.
9710023e 10851 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 10852
a415e694
PE
10853 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
10854 avoid shadowing.
10855
8ef4622d
PE
10856 * lisp.h (eassert): Check that the argument compiles, even if
10857 ENABLE_CHECKING is not defined.
10858
946f9a5b
PE
10859 * data.c (Findirect_variable): Name an expression, to avoid
10860 gcc -Wbad-function-cast warning.
112396d6 10861 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 10862 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
10863 (Fmake_variable_buffer_local, Fmake_local_variable):
10864 Mark variables as initialized.
52746918 10865 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 10866
e5aab7e7 10867 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
10868 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
10869 Rename locals to avoid shadowing.
dff45157
PE
10870 (mark_stack): Move local variables into the #ifdef region where
10871 they're used.
7bc26fdb
PE
10872 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
10873 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
10874 needed otherwise.
10875 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
10876 (GC_STRING_CHARS): Remove; not used.
d40d4be1 10877 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 10878
e5aab7e7
PE
10879 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
10880 avoids undefined behavior in theory.
10881
4da60324
PE
10882 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
10883
88043301
PE
10884 Use functions, not macros, for up- and down-casing (Bug#8254).
10885 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10886 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
10887 to use the following functions instead of these macros.
10888 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
10889 EMACS_INT, since callers assume the returned value fits in int.
10890 (upcase1): Likewise, for UPCASE_TABLE.
10891 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 10892 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 10893 the race-condition problem in the old DOWNCASE.
88043301 10894
19ed5445
PE
10895 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
10896 Rename locals to avoid shadowing.
10897 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
10898 (regex_compile, re_search_2, re_match_2_internal):
10899 Remove unused local vars.
952db0d7
PE
10900 (FREE_VAR): Rewrite so as not to use empty "else",
10901 which gcc can warn about.
da053e48 10902 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
10903 (RETALLOC_IF): Define only if needed.
10904 (WORDCHAR_P): Likewise. This one is never needed, but is used
10905 only in a comment talking about a compiler bug, so put inside
10906 the #if 0 of that comment.
10907 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
10908 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
10909 Remove; unused.
19ed5445 10910
1f3561e4 10911 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
10912 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
10913 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 10914
ded6f8f7
PE
10915 * search.c (simple_search): Remove unused var.
10916
dbd37a95
PE
10917 * dired.c (compile_pattern): Move decl from here ...
10918 * lisp.h: ... to here, so that it can be checked.
10919 (struct re_registers): New forward decl.
10920
7e47afad
PE
10921 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
10922
85f24f61
PE
10923 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
10924 All uses changed.
10925 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
10926 Rename locals to avoid shadowing.
5671df8f 10927 (Fvertical_motion): Mark locals as initialized.
85f24f61 10928
181aa2be 10929 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 10930 (casify_region): Mark local as initialized.
181aa2be 10931
930d429c
PE
10932 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
10933
7082eac6
PE
10934 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
10935 New macros, so that the caller can use some names other than
10936 gcpro1, gcpro2, etc.
10937 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
10938 of the new macros.
10939 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
10940 argument, for consistency with GCPRO2_VAR, etc: it is now the
10941 prefix of the variable, not the variable itself. All uses
10942 changed.
38b2c076
PE
10943 * dired.c (directory_files_internal, file_name_completion):
10944 Rename locals to avoid shadowing.
10945
15206ed9
PE
10946 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
10947 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
10948 dired.c's scmp function, had undefined behavior.
10949 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10950 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
10951 * buffer.h: ... to here, because these macros use current_buffer,
10952 and the new implementation with inline functions needs to have
10953 current_buffer in scope now, rather than later when the macros
10954 are used.
10955 (downcase, upcase1): New static inline functions.
10956 (DOWNCASE, UPCASE1): Reimplement using these functions.
10957 This avoids undefined behavior in expressions like
10958 DOWNCASE (x) == DOWNCASE (y), which previously suffered
10959 from race conditions in accessing the global variables
10960 case_temp1 and case_temp2.
10961 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
10962 * lisp.h (case_temp1, case_temp2): Remove their decls.
10963 * character.h (ASCII_CHAR_P): Move from here ...
10964 * lisp.h: ... to here, so that the inline functions mentioned
10965 above can use them.
10966
4a6bea26
PE
10967 * dired.c (directory_files_internal_unwind): Now static.
10968
f14b7e14
PE
10969 * fileio.c (file_name_as_directory, directory_file_name):
10970 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
10971 Now static.
2893f146
PE
10972 (file_name_as_directory): Use const pointers when appropriate.
10973 (Fexpand_file_name): Likewise. In particular, newdir might
10974 point at constant storage, so make it a const pointer.
fd4ead52 10975 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
10976 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
10977 signedness issues.
f839df0c
PE
10978 (Fset_file_times, Finsert_file_contents, auto_save_error):
10979 Rename locals to avoid shadowing.
f14b7e14 10980
5716756e 10981 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
10982 (Ftry_completion, Fall_completions): Rename or remove locals
10983 to avoid shadowing.
5716756e 10984
b4c3046a
PE
10985 * marker.c (bytepos_to_charpos): Remove; unused.
10986
b45db522
PE
10987 * lisp.h (verify_bytepos, count_markers): New decls,
10988 so that gcc does not warn that these functions aren't declared.
10989
85876d07
PE
10990 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10991 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 10992 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 10993 (copy_text): Remove unused local var.
85876d07 10994
03d78a21 10995 * filelock.c (within_one_second): Now static.
b3dd38ab 10996 (lock_file_1): Rename local to avoid shadowing.
03d78a21 10997
5df8f01b
PE
10998 * buffer.c (fix_overlays_before): Mark locals as initialized.
10999 (fix_start_end_in_overlays): Likewise. This function should be
11000 simplified by using pointers-to-pointers, but that's a different
11001 matter.
b1d876f1 11002 (switch_to_buffer_1): Now static.
8f54f30a
PE
11003 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
11004 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 11005
a70072c9 11006 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 11007 Fix pointer signedness issue.
edced198
PE
11008 (sys_subshell): Mark local as volatile if checking for lint,
11009 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 11010 (MAXPATHLEN): Define only if needed.
a70072c9 11011
a0977c44
PE
11012 * process.c (serial_open, serial_configure): Move decls from here ...
11013 * systty.h: ... to here, so that they can be checked.
11014
a884fdcc
PE
11015 * fns.c (get_random, seed_random): Move extern decls from here ...
11016 * lisp.h: ... to here, so that they can be checked.
11017
604efe86 11018 * sysdep.c (reset_io): Now static.
b8950c94 11019 (wait_for_termination_signal): Remove; unused.
604efe86 11020
38fc62d9
PE
11021 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
11022 (copy_keymap_item, append_key, push_text_char_description):
11023 Now static.
1004a21a 11024 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 11025 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
11026 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
11027 (describe_map_tree):
11028 Rename locals to avoid shadowing.
38fc62d9 11029
2f2650da
PE
11030 * keyboard.c: Declare functions static if they are not used elsewhere.
11031 (echo_char, echo_dash, cmd_error, top_level_2):
11032 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
11033 (read_char, kbd_buffer_get_event, make_lispy_position):
11034 (make_lispy_event, make_lispy_movement, apply_modifiers):
11035 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
11036 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
11037 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 11038 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 11039 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 11040
a053e86c 11041 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
11042 (mark_kboards): Move decl here ...
11043 * alloc.c (mark_kboards): ... from here.
a053e86c 11044
4752793e
PE
11045 * lisp.h (force_auto_save_soon): New decl.
11046
74f10ca7 11047 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
11048 (DEFINE_DUMMY_FUNCTION): New macro.
11049 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
11050 Use it.
c03cd23f
PE
11051 (main): Add casts to avoid warnings
11052 if GCC considers string literals to be constants.
74f10ca7 11053
022e70d4
PE
11054 * lisp.h (fatal_error_signal): Add decl, since it's exported.
11055
59d6fe83
PE
11056 * dbusbind.c: Pointer signedness fixes.
11057 (xd_signature, xd_append_arg, xd_initialize):
11058 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11059 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11060 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
11061 (Fdbus_register_signal): Use SSDATA when the context wants char *.
11062
78320123
PE
11063 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
11064 if GCC considers string literals to be constants.
49cebcca 11065 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 11066
35ac2a97
SM
110672011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
11068
fb103ca9
SM
11069 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
11070 (print_preprocess, print_object): New macro to fix last change.
11071
35ac2a97
SM
11072 * print.c (print_preprocess): Don't forget font objects.
11073
62973b41
JB
110742011-03-16 Juanma Barranquero <lekktu@gmail.com>
11075
11076 * emacs.c (USAGE3): Doc fixes.
11077
0e48bb22
AS
110782011-03-15 Andreas Schwab <schwab@linux-m68k.org>
11079
11080 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
11081 structure.
11082
7684e57b
JB
110832011-03-14 Juanma Barranquero <lekktu@gmail.com>
11084
11085 * lisp.h (VWindow_system, Qfile_name_history):
11086 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
11087 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
11088 (w32_system_caret_x, w32_system_caret_y): Declare extern.
11089
11090 * w32select.c: Don't #include "keyboard.h".
c96bbc66 11091 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
11092
11093 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
11094 * w32console.c (detect_input_pending, read_input_pending)
11095 (encode_terminal_code):
11096 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
11097 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
11098 (w32_system_caret_y, Qfile_name_history):
11099 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
11100 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
11101 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
11102 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
11103 * w32proc.c (Qlocal, report_file_error):
11104 * w32term.c (Vwindow_system, updating_frame):
11105 * w32uniscribe.c (initialized, uniscribe_font_driver):
11106 Remove unneeded extern declarations.
11107
2aa46d6c
CY
111082011-03-14 Chong Yidong <cyd@stupidchicken.com>
11109
c96bbc66 11110 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 11111
cffc6f3b
CY
111122011-03-13 Chong Yidong <cyd@stupidchicken.com>
11113
11114 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
11115 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
11116 These macros can no longer be used for assignment.
11117
44f230aa
SM
11118 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11119 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
11120 (record_buffer_markers, fetch_buffer_markers): New functions for
11121 recording and fetching special buffer markers.
11122 (set_buffer_internal_1, set_buffer_temp): Use them.
11123
11124 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
11125
11126 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
11127
11128 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
11129 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
11130
11131 * xdisp.c (hscroll_window_tree):
11132 (reconsider_clip_changes): Use PT instead of BUF_PT.
11133
d251f04b
EZ
111342011-03-13 Eli Zaretskii <eliz@gnu.org>
11135
11136 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
11137 $(EMACS_ROOT)/lib/intprops.h.
11138
f0c77cd1
PE
111392011-03-13 Paul Eggert <eggert@cs.ucla.edu>
11140
3eca4629
PE
11141 Fix more problems found by GCC 4.5.2's static checks.
11142
7c86ee98
PE
11143 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
11144 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
11145 (xg_free_frame_widgets): Make it clear that a local variable is
11146 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
11147 (gdk_window_get_screen): Make it clear that this macro is needed
11148 only if USE_GTK_TOOLTIP.
1e5524e7
PE
11149 (int_gtk_range_get_value): New function, which avoids a diagnostic
11150 from gcc -Wbad-function-cast.
11151 (xg_set_toolkit_scroll_bar_thumb): Use it.
11152 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
11153 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
11154 (get_utf8_string, xg_get_file_with_chooser):
11155 Rename locals to avoid shadowing.
11156 (create_dialog): Move locals to avoid shadowing.
7c86ee98 11157
41729b81
PE
11158 * xgselect.c (xg_select): Remove unused var.
11159
f0c77cd1
PE
11160 * image.c (four_corners_best): Mark locals as initialized.
11161 (gif_load): Initialize transparent_p to zero (Bug#8238).
11162 Mark another local as initialized.
ec6cf4c6 11163 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 11164
ce0ad53d 11165 * image.c (clear_image_cache): Now static.
d5d5a617 11166 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 11167 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
11168 (x_edge_detection): Remove unnecessary cast that
11169 gcc -Wbad-function-cast diagnoses.
2037898d 11170 (gif_load): Fix pointer signedness.
6ae141d6
PE
11171 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
11172 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 11173
33383987 111742011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 11175
d32df629
PE
11176 Improve quality of tests for time stamp overflow.
11177 For example, without this patch (encode-time 0 0 0 1 1
11178 1152921504606846976) returns the obviously-bogus value (-948597
11179 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
11180 reports time overflow. See
11181 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
11182 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
11183 * editfns.c: Include limits.h and intprops.h.
11184 (TIME_T_MIN, TIME_T_MAX): New macros.
11185 (time_overflow): Move earlier, to before first use.
11186 (hi_time, lo_time): New functions, for an accurate test for
11187 out-of-range times.
11188 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
11189 (Fget_internal_run_time): Don't assume time_t fits in int.
11190 (make_time): Use list2 instead of Fcons twice.
11191 (Fdecode_time): More accurate test for out-of-range times.
11192 (check_tm_member): New function.
11193 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
11194 (lisp_time_argument): Don't rely on undefined left-shift and
11195 right-shift behavior when checking for time stamp overflow.
8be6f318 11196
fe31d94c
PE
11197 * editfns.c (time_overflow): New function, refactoring common code.
11198 (Fformat_time_string, Fdecode_time, Fencode_time):
11199 (Fcurrent_time_string): Use it.
11200
8be6f318
PE
11201 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
11202 * dired.c (make_time): Move to ...
11203 * editfns.c (make_time): ... here.
11204 * systime.h: Note the move.
11205
09d9db2c 112062011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 11207
126bc0dc
YM
11208 * fringe.c (update_window_fringes): Remove unused variables.
11209
c47cbdfd
YM
11210 * unexmacosx.c (copy_data_segment): Also copy __got section.
11211 (Bug#8223)
11212
7ac80be9
EZ
112132011-03-12 Eli Zaretskii <eliz@gnu.org>
11214
c96bbc66 11215 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
11216 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
11217 Constify `char *' arguments and their references according to
11218 prototypes in tparam.h.
11219
ecb0f94d 11220 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 11221
7ac80be9
EZ
11222 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
11223 Adapt all references accordingly.
11224
11225 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
11226
ef1fd07e
TT
112272011-03-11 Tom Tromey <tromey@redhat.com>
11228
11229 * buffer.c (syms_of_buffer): Remove obsolete comment.
11230
7ef4b50c
EZ
112312011-03-11 Eli Zaretskii <eliz@gnu.org>
11232
11233 * termhooks.h (encode_terminal_code): Declare prototype.
11234
11235 * msdos.c (encode_terminal_code): Don't declare prototype.
11236
11237 * term.c (encode_terminal_code): Now external again, used by
11238 w32console.c and msdos.c.
11239
44f230aa
SM
11240 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
11241 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 11242
4b1ec863 112432011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 11244
1714f52b 11245 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 11246
4b1ec863
PE
11247 * fringe.c (update_window_fringes): Mark locals as initialized
11248 (Bug#8227).
11249 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 11250
524c7aa6
PE
11251 * alloc.c (mark_fringe_data): Move decl from here ...
11252 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
11253 to check its interface.
11254 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
11255
a5c0af81 11256 * fontset.c (free_realized_fontset): Now static.
7519b8cd 11257 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 11258 (fontset_font): Mark local as initialized.
a9a06e0b 11259 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 11260
b4716021
PE
11261 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
11262
811e9bac 11263 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 11264 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
11265 (x_own_selection, Fx_disown_selection_internal): Rename locals
11266 to avoid shadowing.
11267 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 11268
7e3ab302
PE
11269 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
11270 so that the caller can use some name other than gcpro1.
11271 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
11272 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11273 (Fx_backspace_delete_keys_p):
11274 Use them to avoid shadowing, and rename vars to avoid shadowing.
11275 (x_decode_color, x_set_name, x_window): Now static.
6b437900 11276 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 11277 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
11278 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
11279 Remove unused locals.
7e3ab302
PE
11280 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11281 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
11282 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
11283 macros.
f78faa98 11284
e2b13473
PE
11285 * xterm.h (x_mouse_leave): New decl.
11286
77f23912
PE
11287 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
11288 Remove unused functions.
cdf4ba58
PE
11289 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
11290 (x_calc_absolute_position): Now static.
7411c686 11291 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 11292 Don't declare local "event" unless it's used.
ed7bf3a5
PE
11293 (x_iconify_frame, x_free_frame_resources): Don't declare locals
11294 unless they are used.
38d0b34a
PE
11295 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
11296 (x_fatal_error_signal): Remove; not used.
a6067996
PE
11297 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
11298 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
11299 (x_error_catcher, x_connection_closed, x_error_handler):
11300 (x_error_quitter, xembed_send_message, x_iconify_frame):
11301 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 11302 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 11303 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 11304
44f230aa
SM
11305 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
11306 Rename or move locals to avoid shadowing.
6b463e58 11307 (tty_defined_color, merge_face_heights): Now static.
5967d051 11308 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
11309 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
11310 does not deduce is never used uninitialized.
73719eba
PE
11311 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
11312 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 11313
426994c3 11314 * terminal.c (store_terminal_param): Now static.
5489860b 11315
032f1620 11316 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 11317 (set_frame_menubar): Remove unused local.
d4323972 11318 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
11319 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
11320 since they might point to immutable storage.
281585b0
PE
11321 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
11322 since it's unused otherwise.
032f1620 11323
367c19e5 11324 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 11325 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
11326 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
11327 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 11328 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
11329 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
11330 does not deduce are never used uninitialized.
70739cbe 11331
07b48fa9
PE
11332 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
11333
8868a238 11334 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
11335 * window.c (window_loop, size_window):
11336 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 11337
7e5cf297 11338 * window.c (display_buffer): Now static.
d6550a9f
PE
11339 (size_window): Mark variables that gcc -Wuninitialized
11340 does not deduce are never used uninitialized.
a586633d
PE
11341 * window.h (check_all_windows): New decl, to forestall
11342 gcc -Wmissing-prototypes diagnostic.
5b555da1 11343 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 11344
f6095868
PE
11345 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
11346 shadowing.
11347 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
11348 Include <limits.h>.
11349 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
11350 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
11351 (load_charset_map): Mark variables that gcc -Wuninitialized
11352 does not deduce are never used uninitialized.
53df7c11 11353 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 11354
f38b440c
PE
11355 * coding.c (coding_set_source, coding_set_destination):
11356 Use "else { /* comment */ }" rather than "else /* comment */;"
11357 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
11358 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
11359 a block, when the outer 'i' will do.
11360 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
11361 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
11362 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
11363 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
11364 (Fdecode_sjis_char, Fdefine_coding_system_internal):
11365 Rename locals to avoid shadowing.
11366 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
11367 * coding.c (emacs_mule_char, encode_invocation_designation):
11368 Now static, since they're not used elsewhere.
413bb2db 11369 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 11370 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
11371 (decode_coding_emacs_mule): Mark variables that gcc
11372 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
11373 (detect_coding_iso_2022): Initialize a local variable that might
11374 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 11375 this initialization is needed. (Bug#8211)
5f58e762
PE
11376 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
11377 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
11378 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
11379 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
11380 Remove unused macros.
f38b440c 11381
232b38b9 11382 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 11383 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 11384 * character.c (string_count_byte8): Likewise.
232b38b9 11385
fb90da1b
PE
11386 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
11387 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
11388
fb93dbc2
PE
11389 * chartab.c (copy_sub_char_table): Now static, since it's not used
11390 elsewhere.
5c156ace
PE
11391 (sub_char_table_ref_and_range, char_table_ref_and_range):
11392 Rename locals to avoid shadowing.
bbcd0949 11393 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 11394
7d3b3862 11395 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 11396 (BIDI_BOB): Remove unused macro.
7d3b3862 11397
6be7d3da
PE
11398 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
11399 deduce are never used uninitialized.
c2ed9c8b 11400 * term.c (encode_terminal_code): Likewise.
6be7d3da 11401
75f8807f 11402 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 11403
50938595
PE
11404 * tparam.h: New file.
11405 * term.c, tparam.h: Include it.
11406 * deps.mk (term.o, tparam.o): Depend on tparam.h.
11407 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
11408 Move these decls to tparam.h, and make them agree with what
11409 is actually in tparam.c. The previous trick of using incompatible
11410 decls in different modules does not conform to the C standard.
11411 All callers of tparam changed to use tparam's actual API.
11412 * tparam.c (tparam1, tparam, tgoto):
11413 Use const pointers where appropriate.
11414
fbceeba2
PE
11415 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
11416 * cm.h (struct cm): Likewise.
11417 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
11418 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
11419 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
11420 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
11421 (turn_on_face, init_tty): Likewise.
11422 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 11423
7f3f1250
PE
11424 * term.c (term_mouse_position): Rename local to avoid shadowing.
11425
e6ca6543
PE
11426 * alloc.c (mark_ttys): Move decl from here ...
11427 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
11428
c40f8d15
AS
114292011-03-11 Andreas Schwab <schwab@linux-m68k.org>
11430
11431 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
11432
cfe0661d
JB
114332011-03-09 Juanma Barranquero <lekktu@gmail.com>
11434
11435 * search.c (compile_pattern_1): Remove argument regp, unused since
11436 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
11437 (compile_pattern): Don't pass it.
11438
0afb4571
J
114392011-03-08 Jan Djärv <jan.h.d@swipnet.se>
11440
11441 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
11442 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
11443 for ! HAVE_GTK3.
11444 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
11445
11446 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
11447
11448 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
11449 gdk_window_get_screen, gdk_window_get_geometry,
11450 gdk_x11_window_lookup_for_display and GDK_KEY_g.
11451 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
11452 (xg_get_pixbuf_from_pixmap): New function.
11453 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
11454 to Pixmap, take frame as parameter, remove GdkColormap parameter.
11455 Call xg_get_pixbuf_from_pixmap instead of
11456 gdk_pixbuf_get_from_drawable.
11457 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
11458 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
11459 (xg_check_special_colors): Use GtkStyleContext and its functions
11460 for HAVE_GTK3.
11461 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
11462 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
11463 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
11464 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
11465 Call gtk_widget_get_preferred_size.
0afb4571
J
11466 (xg_frame_resized): gdk_window_get_geometry only takes 5
11467 parameters.
44f230aa
SM
11468 (xg_win_to_widget, xg_event_is_for_menubar):
11469 Call gdk_x11_window_lookup_for_display.
0afb4571
J
11470 (xg_set_widget_bg): New function.
11471 (delete_cb): New function.
895009e1 11472 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 11473 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
11474 (xg_set_background_color): Call xg_set_widget_bg.
11475 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
11476 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
11477 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
11478 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
11479 if ! HAVE_GTK3.
11480 (update_frame_tool_bar): Call gtk_widget_hide.
11481 (xg_initialize): Use GDK_KEY_g.
11482
11483 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
11484 if ! HAVE_GTK3
11485 (x_session_initialize): Call gdk_x11_set_sm_client_id.
11486
11487 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
11488 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
11489 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
11490
1c2cc4ef
JB
114912011-03-08 Juanma Barranquero <lekktu@gmail.com>
11492
11493 * w32xfns.c (select_palette): Check success of RealizePalette against
11494 GDI_ERROR, not zero.
11495
33383987 11496See ChangeLog.11 for earlier changes.
aac0c6e3
MR
11497
11498;; Local Variables:
11499;; coding: utf-8
aac0c6e3
MR
11500;; End:
11501
2f097256 11502 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
11503
11504 This file is part of GNU Emacs.
11505
11506 GNU Emacs is free software: you can redistribute it and/or modify
11507 it under the terms of the GNU General Public License as published by
11508 the Free Software Foundation, either version 3 of the License, or
11509 (at your option) any later version.
11510
11511 GNU Emacs is distributed in the hope that it will be useful,
11512 but WITHOUT ANY WARRANTY; without even the implied warranty of
11513 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11514 GNU General Public License for more details.
11515
11516 You should have received a copy of the GNU General Public License
11517 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.