Tweak the value returned from Fgarbage_collect again.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
5b835e1d
DA
12012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Tweak the value returned from Fgarbage_collect again.
4 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6 Adjust documentation.
7 (total_vector_bytes): Rename to total_vector_slots, adjust
8 accounting.
9 (total_free_vector_bytes): Rename to total_free_vector_slots,
10 adjust accounting.
11 (Qstring_bytes, Qvector_slots): New symbols.
12 (syms_of_alloc): DEFSYM them.
13
9cd47b72
DA
142012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
15
16 Buffer compaction primitive which may be used from Lisp.
17 * buffer.c (compact_buffer, Fcompact_buffer): New function.
18 (syms_of_buffer): Register Fcompact_buffer.
19 * alloc.c (Fgarbage_collect): Use compact_buffer.
20 * buffer.h (compact_buffer): New prototype.
21 (struct buffer_text): New member.
22
d17337e5
DA
232012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
24
25 New macro to iterate over all buffers, miscellaneous cleanups.
26 * lisp.h (all_buffers): Remove declaration.
27 * buffer.h (all_buffers): Add declaration, with comment.
28 (for_each_buffer): New macro.
29 * alloc.c (Fgarbage_collect, mark_object): Use it.
30 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
31 (init_buffer): Likewise.
32 * data.c (Fset_default): Likewise.
33 * coding.c (code_conversion_restore): Remove redundant check
34 for dead buffer.
35 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
36
60cfd278
AS
372012-07-18 Andreas Schwab <schwab@linux-m68k.org>
38
39 Fix bug that created negative-length intervals.
40 * intervals.c (merge_interval_right, merge_interval_left):
41 Do not zero out this interval if it is absorbed by its children,
42 as this interval's total length doesn't change in that case. See
43 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
44
d06714cb
PE
452012-07-18 Paul Eggert <eggert@cs.ucla.edu>
46
83713154
PE
47 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
48 when invoking (make-bool-vector N t) and N is a positive
49 multiple of 8 -- the last 8 bits were mistakenly cleared.
50
d06714cb
PE
51 Remove some struct layout assumptions in bool vectors.
52 * alloc.c (bool_header_size): New constant.
53 (header_size, word_size): Move earlier, as they're now used earlier.
54 Use 'word_size' in a few more places, where it's appropriate.
55 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
56 padding before the data member of a bool vector.
57 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
58 than doing the check by hand with an abort ().
59
464d5a5e
SM
602012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
61
5fbc0409
SM
62 * eval.c (Fdefvar): Don't check constants since we only set the var if
63 it's not yet defined anyway (bug#11904).
64
464d5a5e
SM
65 * lisp.h (last_undo_boundary): Declare new var.
66 * keyboard.c (command_loop_1): Set it.
67 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
68 were auto-added by the command loop (bug#11774).
69
8dc2e44a
AS
702012-07-18 Andreas Schwab <schwab@linux-m68k.org>
71
72 * w32font.c (Qsymbol): Remove local definition.
73 (syms_of_w32font): Don't DEFSYM it.
74
169925ec
DA
752012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
76
77 Fix sweep_vectors to handle large bool vectors correctly.
78 * alloc.c (sweep_vectors): Account total_vector_bytes for
79 bool vectors larger than VBLOCK_BYTES_MAX.
80
5fbfb018
CY
812012-07-18 Chong Yidong <cyd@gnu.org>
82
83 * frame.c (x_set_frame_parameters): Revert bogus change introduced
84 in 2012-05-25 commit by Paul Eggert (Bug#11738).
85
3ab6e069
DA
862012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
87
88 Return more descriptive data from Fgarbage_collect.
89 Suggested by Stefan Monnier in
90 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
91 * alloc.c (bounded_number): New function.
92 (total_buffers, total_vectors): New variable.
93 (total_string_size): Rename to total_string_bytes, adjust users.
94 (total_vector_size): Rename to total_vector_bytes, adjust users.
95 (sweep_vectors): Account total_vectors and total_vector_bytes.
96 (Fgarbage_collect): New return value. Adjust documentation.
97 (gc_sweep): Account total_buffers.
98 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
99 (VECTOR_SIZE): Remove.
100 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
101 (Qinterval, Qmisc): New symbols.
102 (syms_of_data): Initialize them.
103 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
104 (Qcons, Qbuffer): New declarations.
105
6d02fe5b
PE
1062012-07-17 Paul Eggert <eggert@cs.ucla.edu>
107
108 * alloc.c (Fmemory_free): Account for memory-free's own storage.
109 Round up, not down. Improve doc.
110
b7ffe040
DA
1112012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
112
113 Restore old code in allocate_string_data to avoid Faset breakage.
114 Reported by Julien Danjou <julien@danjou.info> in
115 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
116 * alloc.c (allocate_string_data): Restore old code with minor
117 adjustments, fix comment to explain this subtle issue.
118
4dc7c8d5
SM
1192012-07-17 Eli Zaretskii <eliz@gnu.org>
120
121 Remove FILE_SYSTEM_CASE.
122 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
123
124 * fileio.c (FILE_SYSTEM_CASE): Don't define.
125 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
126 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
127 call-process-region passes it through expand-file-name.
128
129 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
130
1312012-07-17 Andreas Schwab <schwab@linux-m68k.org>
132
133 Fix crash when creating indirect buffer (Bug#11917)
134 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
135 Don't handle unbound variables specially if non-zero.
136 (Fbuffer_local_variables): Pass zero.
137 (clone_per_buffer_values): Pass non-zero.
138
1392012-07-17 Andreas Schwab <schwab@linux-m68k.org>
140
141 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
142 to make the loop interruptible.
143
1442012-07-17 Andreas Schwab <schwab@linux-m68k.org>
145
146 * gnutls.c (emacs_gnutls_handshake): Only retry if
147 GNUTLS_E_INTERRUPTED.
148
cce7fefc
DA
1492012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
150
151 Cleanup and convert miscellaneous checks to eassert.
152 * alloc.c (mark_interval): Fix comment, partially rephrase
153 old comment from intervals.h (see below).
154 * intervals.c (find_interval, adjust_intervals_for_insertion)
155 (delete_interval, adjust_intervals_for_deletion)
156 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
157 Convert to eassert.
158 (adjust_intervals_for_insertion, make_new_interval):
159 Remove obsolete and unused code.
160 * intervals.h (struct interval): Remove obsolete comment.
161 * textprotp.c (erase_properties): Remove unused code.
162 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
163 (Fremove_list_of_text_properties): Convert to eassert.
164
9ea10cc3
CY
1652012-07-17 Chong Yidong <cyd@gnu.org>
166
167 * editfns.c (Finsert_char): Doc fix.
168
3900d5de
DA
1692012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
170
171 Fix previous change to make Fmemory_free always accurate.
172 * alloc.c (make_interval): Update total_free_intervals.
173 (make_float): Likewise for total_free_floats.
174 (free_cons, Fcons): Likewise for total_free_conses.
175 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
176 Likewise for total_free_vector_bytes.
177 (Fmake_symbol): Likewise for total_free_symbols.
178 (bytes_free): Remove.
179
7098646f
DA
1802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
181
182 Simple free memory accounting feature.
183 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
184 (sweep_vectors): Accumulate size of free vectors.
185 (Fgarbage_collect): Setup bytes_free.
186 (Fmemory_free): New function.
187 (syms_of_alloc): Register it.
188
22657b40
DA
1892012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
190
191 Cleanup overlays checking.
192 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
193 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
194 eassert and OVERLAYP.
195 (sort_overlays): Change to use OVERLAYP.
196
ddfc8813
RK
1972012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
198
199 * editfns.c (Finsert_char): Make it interactive, and make the
200 second arg optional. Copy interactive spec and docstring from
201 ucs-insert.
202
7c26cf3c
PE
2032012-07-17 Paul Eggert <eggert@cs.ucla.edu>
204
205 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
206 Unlike the other wrapped functions, fabs has an unspecified
207 effect on errno.
208
5d127af9
JD
2092012-07-16 Jan Djärv <jan.h.d@swipnet.se>
210
211 * nsterm.m (keyDown): Interpret flags without left/right bits
212 as the left key (Bug#11670).
213
6a0dd1d7
DA
2142012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
215
216 Remove empty and useless init functions.
217 * lisp.h (init_character_once, init_fns, init_image)
218 (init_filelock, init_sound): Remove prototype.
219 * character.c (init_character_once): Remove.
220 * filelock.c (init_filelock): Likewise.
221 * fns.c (init_fns): Likewise.
222 * image.c (init_image): Likewise.
223 * sound.c (init_sound): Likewise.
224 * emacs.c (main): Adjust accordingly.
225
7a6136fd
DA
2262012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
227
228 * gtkutil.h: Tiny cleanups.
229 (use_old_gtk_file_dialog): Remove useless declaration.
230 (xg_uses_old_file_dialog): Add suggested const attribute.
231
ce811ad9
EZ
2322012-07-15 Eli Zaretskii <eliz@gnu.org>
233
234 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
235 (bidi_paragraph_init): Use it to limit search forward for a strong
236 directional character in abnormally large paragraphs full of
237 neutral or weak characters. (Bug#11943)
238
c9adfeaa
SF
2392012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
240
241 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
242 the toolbar (Bug#9451).
243 (xg_make_tool_item): Give the widget event box a transparent
244 background.
245
fff62aa9
DA
2462012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
247
248 Cleanup basic allocation variables and functions.
249 * alloc.c (ignore_warnings, init_intervals, init_float)
250 (init_cons, init_symbol, init_marker): Remove.
251 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
252 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
253 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
254 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
255 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
256 (staticidx, init_alloc_once, init_strings, free_ablock):
257 Remove redundant initialization.
258 * fns.c (init_weak_hash_tables): Remove.
259 * lisp.h (init_weak_hash_tables): Remove prototype.
260
9730daca
DA
2612012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
262
263 Use zero_vector where appropriate.
264 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
265 accordingly.
266 * lisp.h (zero_vector): New declaration.
267 * font.c (null_vector): Remove.
268 (syms_of_font): Remove initialization and staticpro.
269 (font_list_entities, font_find_for_lface): Change to use zero_vector.
270 * keymap.c (Faccessible_keymaps): Likewise.
271
2e2d2a13
LL
2722012-07-15 Leo Liu <sdl.web@gmail.com>
273
274 * fringe.c: Fix typo in comments.
275
cd276f6e
LL
2762012-07-14 Leo Liu <sdl.web@gmail.com>
277
278 * fringe.c: Add a new bitmap exclamation-mark.
279
5a1131d9
EZ
2802012-07-14 Eli Zaretskii <eliz@gnu.org>
281
282 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
283
284 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
285 (HAVE_MENUS): Don't define, defined by editing config.in with
286 msdos/sed2v2.inp.
287 (GMALLOC_INHIBIT_VALLOC): Don't define.
288 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
289
22e983b7
JB
2902012-07-14 Juanma Barranquero <lekktu@gmail.com>
291
292 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
293
5b3f250f
GM
2942012-07-14 Glenn Morris <rgm@gnu.org>
295
296 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
297 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
298 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
299
33d63ff4
GM
3002012-07-13 Glenn Morris <rgm@gnu.org>
301
5b633342
GM
302 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
303
33d63ff4
GM
304 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
305 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
306
b55b9f85
JD
3072012-07-13 Jan Djärv <jan.h.d@swipnet.se>
308
0dc8cf50
JD
309 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
310 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
311 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
312 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
313 where appropriate.
314 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
315 as boolean expression.
316 (x_set_window_size): Remove unused variable toolbar.
317 (ns_get_color_default, ns_mod_to_lisp): Remove.
318 (ns_mouse_position): Remove unused variables xchar and ychar.
319 (ns_compute_glyph_string_overhangs): Remove unused variable face.
320 (ns_set_vertical_scroll_bar): Remove unused variable count.
321 (ns_delete_terminal): Remove unused variable i.
322 (ns_term_init): Remove unused variables r, g and b.
323 (mouseDown): Remove unused variable window.
324 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
325 (initFrameFromEmacs): Remove unused variable vbextra.
326 (mouseEntered): Remove unused variables p and dpyinfo.
327 (mouseExited): Remove unused variables p and r.
328 (ns_define_frame_cursor, ns_clear_frame_area)
329 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
330 (menuDown): Assign [sender tag] to variable and cast the variable.
331
332 * nsterm.h (menuDown): Add id as type to argument sender.
333 (ns_display_info_for_name): Add Lisp_Object argument.
334 (ns_term_init): Add Lisp_Object argument.
335 (ns_map_event_to_object): Add void argument.
336 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
337 prototype with arguments and only declare if __OBJC__.
338 (nxatoms_of_nsselect): Add void argument.
339 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
340 (ns_alloc_autorelease_pool): Add void argument.
341 (ns_release_autorelease_pool): Add void* argument.
342 (ns_get_defaults_value): Add const char* argument.
343
344 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
345 (initFromContents): Use SSDATA where appropriate.
346 (ns_update_menubar): Add braces to ambigous if-else.
347 (initWithTitle): Put () around assignment in if statement.
348 (ns_menu_show): Remove unused variables window and keymap.
349 (update_frame_tool_bar): Remove unused variable selected_p.
350 (initWithContentRect): Remove unused variable this_cmd_name.
351
352 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
353 appropriate.
354 (setXBMColor): Remove unused variable len.
355 (setPixmapData): Put () around assignment in loop statement.
356
357 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
358 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
359 where appropriate.
360 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
361 around assignment in loop statement.
362 (nsfont_open): Remove unused variable i.
363 (nsfont_open): Remove unused variable len.
364 (nsfont_draw): Remove unused variable cs.
365
366 * nsfns.m (x_set_icon_name, ns_set_name_internal)
367 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
368 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
369 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
370 (Fns_font_name, Fns_perform_service)
371 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
372 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
373 (ns_set_name): Remove unused variable view.
374 (x_set_menu_bar_lines): Remove unused variable olines.
375 (x_set_tool_bar_lines): Remove unused variable root_window.
376 (Fns_list_colors): Put () around assignment in while statement.
377 (Fns_perform_service): Remove unused variable len.
378 (Fns_display_usable_bounds): Remove unused variable top.
379 (syms_of_nsfns): Remove unused variable i.
380
b55b9f85
JD
381 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
382 memcpy (Bug#11907).
383
ed9265fc 3842012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
385
386 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
387 and free it with DestroyExceptionInfo (Bug#11558).
388
ef099b57
JB
3892012-07-13 Juanma Barranquero <lekktu@gmail.com>
390
391 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
392 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
393 Set here, not in nt/config.nt.
394
ea814a5d
EZ
3952012-07-13 Eli Zaretskii <eliz@gnu.org>
396
397 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
398 cursor overflow into the last glyph on display line when the right
399 fringe is off. (Bug#11832)
400
1a952767
PE
4012012-07-13 Paul Eggert <eggert@cs.ucla.edu>
402
403 * xdisp.c (produce_special_glyphs): Now static.
404 * dispextern.h (produce_special_glyphs): Remove decl.
405
983188fd
GM
4062012-07-13 Glenn Morris <rgm@gnu.org>
407
32fb4bb6
GM
408 * s/bsd-common, s/cygwin.h: Remove empty files.
409 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
410
983188fd
GM
411 * s/usg5-4-common.h (USG, USG5):
412 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
413 * s/sol2-6.h (SOLARIS2):
414 * s/irix6-5.h (IRIX6_5):
415 * s/hpux10-20.h (USG, USG5, HPUX):
416 * s/gnu-linux.h (USG, GNU_LINUX):
417 * s/freebsd.h (BSD_SYSTEM):
418 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
419 * s/cygwin.h (CYGWIN):
420 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
421 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
422
d1e68667 4232012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
424
425 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 426
6de0e799
GM
4272012-07-13 Glenn Morris <rgm@gnu.org>
428
739ae010
GM
429 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
430
dbee5793
GM
431 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
432
6de0e799
GM
433 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
434 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
435
b82da769
GM
4362012-07-12 Glenn Morris <rgm@gnu.org>
437
4fae5a7a 438 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
439
440 * process.c (init_process_emacs): Rename from init_process.
441 The old name is also the name of a Mach system call.
442 * lisp.h, emacs.c: Update for this name change.
443 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
444 longer needed.
445
5a979817
EZ
4462012-07-12 Eli Zaretskii <eliz@gnu.org>
447
448 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
449 memmove call that removes glyphs covered by the left truncation
450 glyph. Improve commentary.
451 (display_line): Fix display of continuation glyphs on GUI frames
452 when the right fringe is turned off and variable-size fonts are
453 used in the window. Move the code that appends a stretch glyph to
454 produce_special_glyphs, so that it could be used for truncation
455 and continuation glyphs alike.
456 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
457 glyph of a suitably computed width, to align the special glyphs at
458 the window margin. Code moved from display_line. (Bug#11832)
459
3e91a053
GM
4602012-07-12 Glenn Morris <rgm@gnu.org>
461
ba9e4b84
GM
462 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
463
464 * s/gnu-linux.h, s/hpux10-20.h:
465 Do not unconditionally define HAVE_XRMSETDATABASE.
466
3e91a053
GM
467 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
468
b300b1f4
PE
4692012-07-12 Paul Eggert <eggert@cs.ucla.edu>
470
471 Fix typos that broke OS X build.
472 Reported by Randal L. Schwartz in
473 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
474 * nsterm.m (ns_timeout): Add missing local decl.
475 (ns_get_color): snprintf -> sprintf, to fix typo.
476
6e777848
GM
4772012-07-12 Glenn Morris <rgm@gnu.org>
478
3f922c37
GM
479 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
480 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
481 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
482 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
483
0ab7b23a
GM
484 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
485 Move PTY_OPEN to configure.
486
6e777848
GM
487 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
488 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
489 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
490
4a7edc24
DA
4912012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
492
493 Use empty_unibyte_string where applicable.
494 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
495 * lread.c (read1): Likewise.
496 * xsettings.c (syms_of_xsettings): Likewise.
497
308aab79
GM
4982012-07-12 Glenn Morris <rgm@gnu.org>
499
42bd1719
GM
500 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
501 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
502 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
503 * s/hpux10-20.h (RUN_TIME_REMAP):
504 * s/bsd-common.h (TABDLY): Move to configure.
505
506 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
507
508 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
509
ea0bbd17 510 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 511 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
512
513 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 514
308aab79
GM
515 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
516 * s/template.h: Move NARROWPROTO to configure.
517
ee1cf5cf
GM
5182012-07-11 Glenn Morris <rgm@gnu.org>
519
30fe9bf4
GM
520 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
521 unused since 2011-01-17 change to systty.h.
522
ee1cf5cf
GM
523 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
524 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
525 Move HAVE_PTYS and HAVE_SOCKETS to configure.
526
63e47e07
PE
5272012-07-11 Paul Eggert <eggert@cs.ucla.edu>
528
529 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
530
c43fb4c3
GM
5312012-07-11 Glenn Morris <rgm@gnu.org>
532
533 * s/darwin.h, s/gnu-linux.h, s/template.h:
534 Move INTERRUPT_INPUT to configure.
535
e8df9267
DA
5362012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
537
538 Minor adjustments to interning code.
539 * lisp.h (intern, intern_c_string): Redefine as static inline
540 wrappers for intern_1 and intern_c_string_1, respectively.
541 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
542 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
543 Vobarray checking.
e8df9267
DA
544 * font.c (font_intern_prop): Likewise. Adjust comment.
545 * w32font.c (intern_font_name): Likewise.
546
34348bd4
AS
5472012-07-11 Andreas Schwab <schwab@linux-m68k.org>
548
d96a1e0c
AS
549 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
550
34348bd4
AS
551 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
552 of Fcar/Fcdr if possible.
553 * font.c (check_otf_features): Likewise.
554 * fontset.c (Fnew_fontset): Likewise.
555 * gnutls.c (Fgnutls_boot): Likewise.
556 * minibuf.c (read_minibuf): Likewise.
557 * msdos.c (IT_set_frame_parameters): Likewise.
558 * xmenu.c (Fx_popup_dialog): Likewise.
559 * w32menu.c (Fx_popup_dialog): Likewise.
560
c8add24e
GM
5612012-07-11 Glenn Morris <rgm@gnu.org>
562
4b575b3c
GM
563 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
564 since nothing has defined it on these platforms.
565
09f4e3b0
GM
566 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
567 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
568
172bedef
GM
569 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
570 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
571 Move CLASH_DETECTION to configure.
572
249685df
GM
573 * s/gnu.h: Remove file, which is now empty.
574
c8add24e
GM
575 * s/gnu.h, s/gnu-linux.h:
576 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
577
b41253a3
JW
5782012-07-11 John Wiegley <johnw@newartisans.com>
579
580 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
581 function attribute, so we only use it if it exists in the
582 compiler.
583
d923b542
DA
5842012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
585
586 Avoid call to strlen in fast_c_string_match_ignore_case.
587 * search.c (fast_c_string_match_ignore_case): Change to use
588 length argument. Adjust users accordingly.
589 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
590
5ebbef1d
PE
5912012-07-11 Paul Eggert <eggert@cs.ucla.edu>
592
bb352260
PE
593 Assume mkdir, rmdir.
594 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
595 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
596
57054ddd
PE
597 Assume rename.
598 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
599
b747d3f7
PE
600 Assume perror.
601 * s/hpux10-20.h (HAVE_PERROR): Remove.
602 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
603 Remove dummy definition, as this problem was obsolete long ago.
604
5ebbef1d
PE
605 Assume strerror.
606 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
607
984e7f30
DA
6082012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
609
610 Avoid calls to strlen in font processing functions.
611 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 612 (font_open_by_name): Change to use length argument. Adjust
984e7f30 613 users accordingly.
d923b542
DA
614 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
615 Adjust prototypes.
616 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
617 Change to return ptrdiff_t.
984e7f30
DA
618 (xfont_list_pattern, xfont_match): Use length returned by
619 xfont_decode_coding_xlfd.
620 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
621
20e94fdd
GM
6222012-07-11 Glenn Morris <rgm@gnu.org>
623
9d596af3
GM
624 * s/darwin.h, s/freebsd.h, s/netbsd.h:
625 Move DONT_REOPEN_PTY to configure.
626
20e94fdd
GM
627 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
628 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
629
e99a530f
PE
6302012-07-10 Paul Eggert <eggert@cs.ucla.edu>
631
22ffb973
PE
632 Remove "#define unix" that is no longer needed (Bug#11905).
633 * s/aix4-2.h (unix): Remove; no longer needed.
634
e9a9ae03
PE
635 EMACS_TIME simplification (Bug#11875).
636 This replaces macros (which typically do not work in GDB)
637 with functions, typedefs and enums, making the code easier to debug.
638 The functional style also makes code easier to read and maintain.
639 * systime.h: Include <sys/time.h> on all hosts, not just if
640 WINDOWSNT, since 'struct timeval' is needed in general.
641 (EMACS_TIME): Now a typedef, not a macro.
642 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
643 not macros.
644 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
645 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
646 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
647 (EMACS_TIME_LE): Now functions, not macros.
648 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
649 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
650 which are not functions. All uses rewritten to use:
651 (make_emacs_time): New function.
652 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
653 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
654 not functions. All uses rewritten to use the following, respectively:
655 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
656 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 657 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
658 * fileio.c (Fcopy_file):
659 * xterm.c (XTflash): Get the current time closer to when it's used.
660 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
661
ffacb126
PE
662 * bytecode.c (targets): Suppress -Woverride-init warnings.
663
e99a530f
PE
664 Simplify by avoiding confusing use of strncpy etc.
665 * doc.c (Fsnarf_documentation):
666 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
667 * frame.c (Fmake_terminal_frame):
668 * gtkutil.c (get_utf8_string):
669 * lread.c (openp):
670 * nsmenu.m (ns_update_menubar):
671 * regex.c (regerror):
672 Prefer memcpy to strncpy and strncat when either will do.
673 * fileio.c (Fsubstitute_in_file_name):
674 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
675 (menu_separator_name_p):
676 * nsmenu.m (ns_update_menubar):
677 Prefer memcmp to strncmp when either will do.
678 * nsterm.m: Include <ftoastr.h>.
679 (ns_get_color):
680 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
681 Prefer snprintf to strncpy.
682 * nsterm.m (ns_term_init):
683 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
684 * nsterm.m (ns_term_init):
685 Avoid the need for strncpy, by using build_string or
686 make_unibyte_string directly. Use dtoastr, not snprintf.
687 * process.c (Fmake_network_process): Diagnose service names that
688 are too long, rather than silently truncating them or creating
689 non-null-terminated names.
690 (Fnetwork_interface_info): Likewise, for interface names.
691 * sysdep.c (system_process_attributes) [GNU_LINUX]:
692 Prefer sprintf to strncat.
693 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
694 Prefer vsnprintf to vsprintf + strncpy.
695
c59592b3
GM
6962012-07-10 Glenn Morris <rgm@gnu.org>
697
698 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
699 Clarify fallback case.
700
7d7bbefd
DA
7012012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
702
703 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
704 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
705 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 706 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
707 where argument type is known to be a Lisp_Cons.
708
3a4c8000
TT
7092012-07-10 Tom Tromey <tromey@redhat.com>
710
711 * bytecode.c (BYTE_CODE_THREADED): New macro.
712 (BYTE_CODES): New macro. Replaces all old byte-code defines.
713 (enum byte_code_op): New type.
714 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
715 (exec_byte_code): Use them. Use token threading when applicable.
716
2a0213a6
DA
7172012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
718
719 Optimize pure C strings initialization.
720 * lisp.h (make_pure_string): Fix prototype.
721 (build_pure_c_string): New function, defined as static inline. This
722 provides a better opportunity to optimize away calls to strlen when
723 the function is called with compile-time constant argument.
724 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
725 argument, adjust users accordingly. Use build_pure_c_string where
726 appropriate.
727 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
728 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
729 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
730
cb1caeaf
DA
7312012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
732
733 Avoid calls to strlen in miscellaneous functions.
734 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
735 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
736 * lread.c (openp): Likewise.
737
c293e30c
DA
7382012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
739
740 Avoid calls to strlen in path processing functions.
741 * fileio.c (file_name_as_directory): Add comment. Change to add
742 srclen argument and return the length of result. Adjust users
743 accordingly.
744 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 745 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
746 users accordingly.
747 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
748
9e059e3f
GM
7492012-07-10 Glenn Morris <rgm@gnu.org>
750
d02eb359
GM
751 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
752 Move PENDING_OUTPUT_COUNT definition to configure.
753
882cf227
GM
754 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
755 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
756 * s/gnu.h (DATA_START): Move definitions to configure.
757
af6e839f
GM
758 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
759 We include usg5-4-common.h, which defines them both.
760
40289a12
GM
761 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
762 O_RDONLY already includes it).
763
9e059e3f
GM
764 Stop ns builds setting the EMACSLOADPATH environment variable.
765 * nsterm.m (ns_load_path): Rename from ns_init_paths.
766 Now it does not set EMACSLOADPATH, just returns the load-path string.
767 * nsterm.h: Update accordingly.
768 * lread.c [HAVE_NS]: Include nsterm.h.
769 (init_lread) [HAVE_NS]: Use ns_load_path.
770 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
771
7c4e8ec0
GM
7722012-07-09 Glenn Morris <rgm@gnu.org>
773
d4f600ff
GM
774 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
775 since the included bsd-common.h does so.
776
cbb31951
GM
777 Stop ns builds setting the EMACSPATH environment variable.
778 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
779 (ns_init_paths): Do not set EMACSPATH.
780 * nsterm.h (ns_exec_path): Add it.
781 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
782 Use ns_exec_path.
783
7c4e8ec0
GM
784 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
785
26bccfae
PE
7862012-07-09 Paul Eggert <eggert@cs.ucla.edu>
787
a0bee46f
PE
788 * process.c (wait_reading_process_output): 'waitchannels' was unset
789 when read_kbd || !NILP (wait_for_cell); fix this.
790
5994c183
PE
791 Add GCC-style 'const' attribute to functions that can use it.
792 * character.h (char_resolve_modifier_mask):
793 * keyboard.h (make_ctrl_char):
794 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
795 (init_character_once, next_almost_prime, init_fns, init_image)
796 (flush_pending_output, init_sound):
797 * mem-limits.h (start_of_data):
798 * menu.h (finish_menu_items):
799 Add ATTRIBUTE_CONST.
800 * emacs.c (DEFINE_DUMMY_FUNCTION):
801 Declare the dummy function with ATTRIBUTE_CONST.
802 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
803 Add decls with ATTRIBUTE_CONST.
804
26bccfae
PE
805 Minor improvements to make_formatted_string.
806 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
807 where int is good enough, as vsprintf returns an int.
808 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
809
a8290ec3
DA
8102012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
811
812 Use make_formatted_string to avoid double length calculation.
813 * lisp.h (make_formatted_string): New prototype.
814 * alloc.c (make_formatted_string): New function.
815 * buffer.c (Fgenerate_new_buffer_name): Use it.
816 * dbus.c (syms_of_dbusbind): Likewise.
817 * editfns.c (Fcurrent_time_zone): Likewise.
818 * filelock.c (get_boot_time): Likewise.
819 * frame.c (make_terminal_frame, set_term_frame_name)
820 (x_report_frame_params): Likewise.
821 * image.c (gs_load): Likewise.
822 * minibuf.c (get_minibuffer): Likewise.
823 * msdos.c (dos_set_window_size): Likewise.
824 * process.c (make_process): Likewise.
825 * xdisp.c (ensure_echo_area_buffers): Likewise.
826 * xsettings.c (apply_xft_settings): Likewise.
827
d01ba2f1
GM
8282012-07-09 Glenn Morris <rgm@gnu.org>
829
830 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
831 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
832 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
833 * nsterm.h (ns_etc_directory): Add it.
834 * callproc.c [HAVE_NS]: Include nsterm.h.
835 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
836
f1f924b6
DA
8372012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
838
839 Move marker debugging code under MARKER_DEBUG.
840 * marker.c (MARKER_DEBUG): Move marker debugging code under
841 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
842 for bootstrap with --enable-checking (~3x slowdown reported
843 by Juanma Barranquero <lekktu@gmail.com>).
844 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
845
ab531b66
PE
8462012-07-08 Paul Eggert <eggert@cs.ucla.edu>
847
848 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
849 See <http://bugs.gnu.org/11825#29>.
850
c4b3bc8a
EZ
8512012-07-08 Eli Zaretskii <eliz@gnu.org>
852
853 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
854 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
855 (display_line): Add commentary about displaying truncation glyphs
856 on GUI frames.
857 (produce_special_glyphs): Move here from term.c.
858
859 * term.c (produce_special_glyphs): Move to xdisp.c.
860
861 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
862 section.
c4b3bc8a 863
b676b881
AS
8642012-07-07 Andreas Schwab <schwab@linux-m68k.org>
865
f17c5273
AS
866 * xdisp.c (display_line): Avoid warning about implicit declaration
867 of FRAME_FONT.
868
298819b9
AS
869 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
870
b676b881
AS
871 * lisp.h: Remove empty conditional.
872
6045c4fd
PE
8732012-07-07 Paul Eggert <eggert@cs.ucla.edu>
874
b3350bf9
PE
875 * lread.c (load_path_check): Now static.
876
6045c4fd
PE
877 Fix some minor --with-ns problems found by static checking.
878 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
879 (x_set_font) [!HAVE_X_WINDOWS]:
880 * image.c (xpm_load_image) [HAVE_NS]:
881 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
882 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
883 Remove unused local.
884 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
885 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
886 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
887 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
888 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
889 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
890 Fix pointer signedness problem.
891 * xfaces.c (FRAME_X_FONT_TABLE):
892 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
893
929e7845
GM
8942012-07-07 Glenn Morris <rgm@gnu.org>
895
896 * lread.c (load_path_check): New function, split from init_lread.
897 (init_lread): Reorganize. Motivation:
898 If EMACSLOADPATH is set, check/warn about that rather than the
899 defaults, which we are not going to use. Hence we can remove
900 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
901 Don't warn if site-lisp directories are missing.
902 If not installed, start from a blank load-path, since
903 PATH_LOADSEARCH refers to the eventual installation directories.
904
58dd0aa4
EZ
9052012-07-07 Eli Zaretskii <eliz@gnu.org>
906
907 Support truncation and continuation glyphs on GUI frames, when
908 fringes are disabled. (Bug#11832)
909 * xdisp.c (init_iterator): Get dimensions of truncation and
910 continuation glyphs even if on GUI frames. Adjust
911 it->last_visible_x on GUI frames when the left or right fringes,
912 or both, are absent.
913 (start_display, move_it_in_display_line_to): Handle the case of a
914 GUI frame without a fringe to display continuation or truncation
915 glyphs.
916 (insert_left_trunc_glyphs): Support GUI frames: make sure
917 truncation glyphs overwrite enough glyphs from the current line to
918 have sufficient space in pixels.
919 (display_line): Support truncation and continuation glyphs on GUI
920 frames. If some spare pixels are left on the line after inserting
921 the truncation glyphs, fill that space with a stretch glyph of a
922 suitably computed width.
923
924 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
925 produce_glyphs, to support GUI sessions.
926
31571fd7
PE
9272012-07-07 Paul Eggert <eggert@cs.ucla.edu>
928
5a16b9bc
PE
929 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
930
f3047c75
PE
931 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
932
31571fd7
PE
933 Do not require float-time's arg to fit in time_t (Bug#11825).
934 This works better on hosts where time_t is unsigned, and where
935 float-time is applied to the (negative) difference between two times.
936 * editfns.c (decode_time_components): Last arg is now double *,
937 not int *, and means to store all the result as a double, without
938 worrying about whether the seconds part fits in time_t.
939 All callers changed.
940 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
941 All callers changed.
942 (Ffloat_time): Do not fail merely because the specified time falls
943 outside of time_t range.
944
4516fbef
GM
9452012-07-07 Glenn Morris <rgm@gnu.org>
946
947 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
948 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
949 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
950
07adc2c6
JB
9512012-07-07 Juanma Barranquero <lekktu@gmail.com>
952
953 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
954 Update dependencies.
955
956 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
957
fd573f31
PE
9582012-07-06 Paul Eggert <eggert@cs.ucla.edu>
959
fee5959d
PE
960 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
961 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
962 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
963 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
964 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
965 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
966
fd573f31
PE
967 * xfont.c (compare_font_names): Redo to omit the need for casts.
968
ddadbc0e
AS
9692012-07-06 Andreas Schwab <schwab@linux-m68k.org>
970
fca8d6b6
AS
971 * xfns.c (Fx_change_window_property): Doc fix.
972 * w32fns.c (Fx_change_window_property): Doc fix.
973
ddadbc0e
AS
974 * w32fns.c (Fx_window_property): Accept the same arguments as the
975 X Windows version. Doc fix.
976 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
977
ed9265fc 9782012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
979 Eli Zaretskii <eliz@gnu.org>
980
981 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
982 Windows-specific code from nt/config.nt moved here.
983 Obsolete settings removed.
984
216ee680
PE
9852012-07-06 Paul Eggert <eggert@cs.ucla.edu>
986
987 * process.c: Avoid unnecessary calls to gettime.
988 (wait_reading_process_output): Don't get the time of day
989 when gobbling data immediately and not waiting, as there's no need
990 for it in that case. This removes a FIXME.
991
bdd091e4
JD
9922012-07-06 Jan Djärv <jan.h.d@swipnet.se>
993
994 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
995 is defined (Bug#11768).
996
9d44f8ce
DA
9972012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
998
999 Fix marker debugging code.
1000 * marker.c (byte_char_debug_check): Do not perform the check
1001 if buffer is not multibyte.
090bd7cb
JB
1002 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1003 Call byte_char_debug_check with correct arguments.
9d44f8ce 1004
90fc4786
DA
10052012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1006
1007 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
1008 * marker.c (byte_char_debug_check, count_markers):
1009 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
1010 (byte_debug_flag): Remove.
1011 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1012 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
1013
7b7ae965
DA
10142012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1015
4e57b342
DA
1016 Avoid code repetition in marker-related functions.
1017 * marker.c (attach_marker): New function.
1018 (Fset_marker, set_marker_restricted, set_marker_both)
1019 (set_marker_restricted_both): Use it.
1020 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
1021 Consistently rename charno to charpos.
1022 (marker_position): Add eassert.
1023 (marker_byte_position): Convert to eassert.
1024
10252012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1026
1027 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 1028 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 1029 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 1030
657924ff
DA
10312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1032
1033 Introduce fast path for the widely used marker operation.
1034 * alloc.c (build_marker): New function.
1035 * lisp.h (build_marker): New prototype.
1036 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
1037 * composite.c (autocmp_chars): Likewise.
1038 * editfns.c (buildmark): Remove.
1039 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
1040 (save_restriction_save): Use build_marker.
1041 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
1042 * window.c (save_window_save): Likewise.
1043
041a49a6
DA
10442012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1045
1046 Do not use Fdelete_overlay in delete_all_overlays
1047 to avoid redundant calls to unchain_overlay.
1048 * buffer.c (drop_overlay): New function.
1049 (delete_all_overlays, Fdelete_overlay): Use it.
1050 * minibuf.c (get_minibuffer): Fix comment.
1051
7dca65a4
PE
10522012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 Port to OpenBSD 5.1 amd64.
1055 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
1056 This is needed for OpenBSD, and should be harmless on all BSD systems.
1057 Also, include <sys/sysctl.h>, as it should be available on all
1058 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
1059 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
1060 use p_pid member, not kp_proc.pid.
1061
8eb876e2
GM
10622012-07-06 Glenn Morris <rgm@gnu.org>
1063
1064 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
1065
38182d90
PE
10662012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1067
1068 More xmalloc and related cleanup.
1069 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
1070 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
1071 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
1072 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
1073 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
1074 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
1075 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
1076 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
1077 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
1078 * xterm.c:
1079 Omit needless casts involving void * pointers and allocation.
1080 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
1081 as the former is more robust if P's type is changed.
1082 Prefer xzalloc to xmalloc + memset 0.
1083 Simplify malloc-or-realloc to realloc.
1084 Don't worry about xmalloc returning a null pointer.
1085 Prefer xstrdup to xmalloc + strcpy.
1086 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
1087 growing it.
1088 * keyboard.c (apply_modifiers_uncached): Prefer local array to
1089 alloca of a constant.
1090
6dd5a677
EZ
10912012-07-05 Eli Zaretskii <eliz@gnu.org>
1092
1093 * xdisp.c (display_line): Fix horizontal pixel coordinates when
1094 hscroll is larger than the line width. Fixes long and futile
1095 looping inside extend_face_to_end_of_line (on a TTY) producing
1096 glyphs that are not needed and thrown away.
1097
6b312f0f
DA
10982012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1099
1100 * marker.c (set_marker_restricted_both): Simplify by using
1101 clip_to_bounds.
1102
f520ef9b
PE
11032012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1104
1105 * editfns.c (region_limit): Simplify by using clip_to_bounds.
1106
383b7c95
JD
11072012-07-05 Jan Djärv <jan.h.d@swipnet.se>
1108
1109 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
1110 not defined (Bug#11768).
1111 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
1112 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
1113 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
1114 followed by gtk_box_set_homogeneous (Bug#11768).
1115 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
1116 (update_theme_scrollbar_width, xg_create_scroll_bar):
1117 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
1118 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
1119 (is_box_type): New function (Bug#11768).
1120 (xg_tool_item_stale_p): Call is_box_type.
5293d758 1121 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
1122 with default display (Bug#11768).
1123
d6e7bf45
EZ
11242012-07-05 Eli Zaretskii <eliz@gnu.org>
1125
1126 * xdisp.c (window_hscroll_limited): New function.
1127 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
1128 coordinates when window's hscroll is set to insanely large
1129 values. (Bug#11857)
1130
431391ec
JB
11312012-07-05 Juanma Barranquero <lekktu@gmail.com>
1132
1133 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
1134 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
1135
23f86fce
DA
11362012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1137
1138 Cleanup xmalloc.
1139 * lisp.h (xzalloc): New prototype. Omit needless casts.
1140 * alloc.c (xzalloc): New function. Omit needless casts.
1141 * charset.c: Omit needless casts. Convert all calls to
1142 xmalloc with following memset to xzalloc.
1143 * dispnew.c: Likewise.
1144 * fringe.c: Likewise.
1145 * image.c: Likewise.
1146 * sound.c: Likewise.
1147 * term.c: Likewise.
1148 * w32fns.c: Likewise.
1149 * w32font.c: Likewise.
1150 * w32term.c: Likewise.
1151 * xfaces.c: Likewise.
1152 * xfns.c: Likewise.
1153 * xterm.c: Likewise.
1154 * atimer.c: Omit needless casts.
1155 * buffer.c: Likewise.
1156 * callproc.c: Likewise.
1157 * ccl.c: Likewise.
1158 * coding.c: Likewise.
1159 * composite.c: Likewise.
1160 * doc.c: Likewise.
1161 * doprnt.c: Likewise.
1162 * editfns.c: Likewise.
1163 * emacs.c: Likewise.
1164 * eval.c: Likewise.
1165 * filelock.c: Likewise.
1166 * fns.c: Likewise.
1167 * gtkutil.c: Likewise.
1168 * keyboard.c: Likewise.
1169 * lisp.h: Likewise.
1170 * lread.c: Likewise.
1171 * minibuf.c: Likewise.
1172 * msdos.c: Likewise.
1173 * print.c: Likewise.
1174 * process.c: Likewise.
1175 * region-cache.c: Likewise.
1176 * search.c: Likewise.
1177 * sysdep.c: Likewise.
1178 * termcap.c: Likewise.
1179 * terminal.c: Likewise.
1180 * tparam.c: Likewise.
1181 * w16select.c: Likewise.
1182 * w32.c: Likewise.
1183 * w32reg.c: Likewise.
1184 * w32select.c: Likewise.
1185 * w32uniscribe.c: Likewise.
1186 * widget.c: Likewise.
1187 * xdisp.c: Likewise.
1188 * xmenu.c: Likewise.
1189 * xrdb.c: Likewise.
1190 * xselect.c: Likewise.
1191
0497dc44
PE
11922012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1193
1194 * fileio.c (time_error_value): Check the right error number.
1195 Problem reported by Troels Nielsen in
1196 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
1197
356e7178
PE
11982012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1199
4e71fd89
PE
1200 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
1201 This should be fixed in a better way; see Eli Zaretskii in
1202 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
1203 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
1204
f0941253
PE
1205 * fileio.c (time_error_value): Rename from special_mtime.
1206 The old name's problems were noted by Eli Zaretskii in
1207 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
1208
065c9eb4
PE
1209 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
1210 This variable's comment says Emacs needs at least one GDB-visible
1211 symbol of type enum pvec_type, to work around GDB problems.
1212 The symbol's value doesn't matter.
1213
356e7178
PE
1214 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
1215 that causes compilation to fail on pre-C99 compilers.
1216
ed9265fc 12172012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
1218
1219 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
1220 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
1221
3884d954
DA
12222012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1223
d209e2fb 1224 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
1225 headers for buffer_defaults and buffer_local_symbols.
1226 Reported by Juanma Barranquero <lekktu@gmail.com>.
1227
ee28be33
SM
12282012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1229
1230 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
1231 * lisp.h (enum pvec_type): Use fewer bits.
1232 (PSEUDOVECTOR_SIZE_BITS): New constant.
1233 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
1234 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
1235 change in pvec_type.
1236 (PSEUDOVECTOR_TYPEP): New macro.
1237 (TYPED_PSEUDOVECTORP): Use it.
1238 * fns.c (internal_equal): Adapt code to extract pvectype.
1239 * emacs.c (gdb_pvec_type): Update type.
1240 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
1241 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
1242 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
1243 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
1244 (sweep_vectors): Use it. Use local var `total_bytes' instead of
1245 abusing vector->header.next.nbytes.
1246 (live_vector_p): Use PVEC_TYPE.
1247 (mark_object): Adapt code to extract pvectype. Use switch.
1248
c7f2cd7f
PE
12492012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1250
1251 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
1252 Tighten new eassert a bit.
1253
8ce70ed2
DA
12542012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1255
1256 Fix compilation with --enable-gcc-warnings and -O1
1257 optimization level.
1258 * doprnt.c (doprnt): Change type of tem to int, initialize
1259 to avoid compiler warning. Add eassert.
1260 * search.c (simple_search): Initialize match_byte to avoid
1261 compiler warning. Add eassert.
1262
dea7f1e5
PE
12632012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1264
24a212eb
PE
1265 Avoid weird behavior with large horizontal scrolls.
1266 Without this change, for example, large hscroll values would
1267 mess up Emacs's display on Fedora 15 x86, presumably due to
1268 overflows in int calculations in the display code.
1269 Also, if buffers had long lines, Emacs would freeze.
1270 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
1271 (set_window_hscroll): New function, containing the old guts of
1272 Fset_window_hscroll. Return the clipped value.
1273 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
1274 This avoids the need to check against PTRDIFF_MAX.
1275
dea7f1e5
PE
1276 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
1277
76046526
DA
12782012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1279
1280 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
1281
39adff0d
PE
12822012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1283
63807d47
PE
1284 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
1285 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
1286 since GCC 4.4.6 issues a bogus warning for them.
1287
39adff0d
PE
1288 Fix bugs in file timestamp newness comparisons.
1289 * fileio.c (Ffile_newer_than_file_p):
1290 * lread.c (Fload): Use full timestamp resolution of files,
1291 not just the 1-second resolution, so that files that are only
1292 slightly newer still count as newer.
1293 * fileio.c (Ffile_newer_than_file_p): Don't assume file
1294 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
1295
dbeed9a6
PE
12962012-07-03 Paul Eggert <eggert@cs.ucla.edu>
1297
1298 * fileio.c: Improve handling of file time marker. (Bug#11852)
1299 (special_mtime): New function.
1300 (Finsert_file_contents, Fverify_visited_file_modtime):
1301 Use it to set special mtime values consistently.
1302
636334d6
AS
13032012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1304
1305 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1306 marker for non-existing file. (Bug#11852)
1307
e2017fe2
GM
13082012-07-03 Glenn Morris <rgm@gnu.org>
1309
1310 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1311 and did not make it into globals.h).
1312
404dbd37
TT
13132012-07-03 Tom Tromey <tromey@redhat.com>
1314
1315 * window.c (Fset_window_margins, Fset_window_fringes)
1316 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1317 * textprop.c (Fprevious_property_change): No longer static.
1318 * syntax.c (Fsyntax_table_p): No longer static.
1319 * process.c (Fget_process, Fprocess_datagram_address): No longer
1320 static.
1321 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1322 * keyboard.c (Fcommand_execute): No longer static.
1323 Remove EXFUN.
1324 * insdel.c (Fcombine_after_change_execute): No longer static.
1325 * image.c (Finit_image_library): No longer static.
1326 * fileio.c (Fmake_symbolic_link): No longer static.
1327 * eval.c (Ffetch_bytecode): No longer static.
1328 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
1329 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1330 No longer static.
404dbd37
TT
1331 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1332 static.
1333 * dired.c (Ffile_attributes): No longer static.
1334 * composite.c (Fcomposition_get_gstring): No longer static.
1335 * callproc.c (Fgetenv_internal): No longer static.
1336
1337 * ccl.h: Remove EXFUNs.
1338 * buffer.h: Remove EXFUNs.
1339 * dispextern.h: Remove EXFUNs.
1340 * intervals.h: Remove EXFUNs.
1341 * fontset.h: Remove EXFUN.
1342 * font.h: Remove EXFUNs.
1343 * dosfns.c (system_process_attributes): Remove EXFUN.
1344 * keymap.h: Remove EXFUNs.
1345 * lisp.h: Remove EXFUNs.
1346 * w32term.h: Remove EXFUNs.
1347 * window.h: Remove EXFUNs.
1348 * xsettings.h: Remove EXFUN.
1349 * xterm.h: Remove EXFUN.
1350
8e4fd1e1
GM
13512012-07-03 Glenn Morris <rgm@gnu.org>
1352
1353 * lisp.h (Frandom): Make it visible to C.
1354 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1355 buffer for invisible buffers. (Bug#1229)
1356
ca95b3eb
DA
13572012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1358
1359 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1360 values which aren't power of 2.
1361 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1362 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1363 accordingly.
1364
7555c33f
SM
13652012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1366
1367 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1368
1369 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1370
d12e8f5a
DA
13712012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1372
1373 * alloc.c (allocate_vector_block): Remove redundant
1374 calls to mallopt if DOUG_LEA_MALLOC is defined.
1375 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1376 avoid calls to mallopt if zero_vector is returned.
1377
296094c3
DA
13782012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1379
1380 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
1381 is enabled, avoid dereferencing NULL current_sblock if
1382 running undumped.
1383
36429c89
DA
13842012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1385
1386 Cleanup basic buffer management.
1387 * buffer.h (struct buffer): Change layout to use generic vector
1388 marking code. Fix some comments. Change type of 'clip_changed'
1389 to bitfield. Remove unused #ifndef old.
1390 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1391 (GET_OVERLAYS_AT): Fix indentation.
1392 (for_each_per_buffer_object_at): New macro.
1393 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1394 (Fbuffer_local_variables): Use it.
1395 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1396 * alloc.c (allocate_buffer): Adjust to match new layout of
1397 struct buffer. Fix comment.
1398 (mark_overlay): New function.
1399 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1400 Lisp area of struct buffer.
1401 (mark_object): Use it. Adjust marking of misc objects
1402 and related comments.
1403
3b3e4cac
PE
14042012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1405
1406 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1407 wrapper that is not needed because the wrapped code is a no-op (zero
1408 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1409 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1410
cf5c0175
DA
14112012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1412
1413 * alloc.c (mark_buffer): Simplify. Remove prototype.
1414 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1415 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1416 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1417 redundant calls to mark_vectorlike for bool vectors.
1418
ca26824c
GM
14192012-06-30 Glenn Morris <rgm@gnu.org>
1420
2e4c5312
GM
1421 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1422
ca26824c
GM
1423 * epaths.in (PATH_SITELOADSEARCH): New.
1424 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1425 This is rather than relying on --enable-locallisppath elements
1426 having "site-lisp" in their names. (Bug#10208#25, 11658)
1427
0d23c240
EZ
14282012-06-30 Eli Zaretskii <eliz@gnu.org>
1429
c9240d7a
EZ
1430 * w32proc.c (sys_select): Accept and ignore one more argument.
1431
1432 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1433
0d23c240 1434 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1435 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1436
1437 * sysdep.c: Don't include dos.h and dosfns.h.
1438
1439 * process.c (sys_select):
1440 * msdos.c (sys_select): Accept one more argument and ignore it.
1441
1442 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1443 adapt data types and code to that.
1444
1445 * dosfns.c:
1446 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1447 which clashes with the gnulib function of the same name.
1448
af5a5a98
AS
14492012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1450
c5e4379c
AS
1451 * font.c (font_style_to_value, font_style_symbolic)
1452 (font_prop_validate_style): Add type checks for values in
1453 font_style_table.
1454
af5a5a98
AS
1455 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1456 argument.
1457 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1458 uses.
1459
8d38f461
EZ
14602012-06-29 Eli Zaretskii <eliz@gnu.org>
1461
2e5a6631
EZ
1462 * xdisp.c (try_window_id): Undo last change.
1463
8d38f461
EZ
1464 * w32.c (getwd): Adjust commentary about startup_dir.
1465 (init_environment): Always call sys_access, even in non-MSVC
1466 builds. Don't chdir to the directory of the Emacs executable.
1467 This undoes code from 1997 which was justified by the need to
1468 "avoid conflicts when removing and renaming directories". But its
1469 downside was that every relative file name was being interpreted
1470 relative to the directory of the Emacs executable, which can never
1471 be TRT. In particular, it broke sys_access when called with
1472 relative file names.
1473 (sys_access): Map GetLastError to errno.
1474
2af3565e
DA
14752012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1476
1477 * window.h (struct window): Change type of 'fringes_outside_margins'
1478 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1479 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1480 Adjust comment.
1481 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1482 to ptrdiff_t.
1483
c8d3a25c 14842012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1485
c8d3a25c
GM
1486 * gnutls.c (emacs_gnutls_handshake):
1487 Add QUIT to make the loop interruptible.
57570cd3 1488
c8d3a25c 14892012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1490
c8d3a25c
GM
1491 * charset.c (init_charset): Make lack of etc/charsets fatal.
1492
3e984ee8
DA
14932012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1494
1495 * editfns.c (region_limit): Fix type mismatch.
1496
ef884f23
DA
14972012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1498
1499 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1500 undefined. Convert from xassert to eassert.
1501 * nsmenu.m: Convert from xassert to eassert.
1502 * nsterm.m: Likewise.
1503
7d7e0027
SM
15042012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1505
1506 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1507
aa754e6a
PE
15082012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1509
1510 Avoid integer overflow on scroll-left and scroll-right.
1511 * window.c (HSCROLL_MAX): New macro.
1512 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1513 overflow when requested scroll falls outside ptrdiff_t range.
1514
80b00b08
DA
15152012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1516
1517 * window.h (struct window): Change type of 'hscroll',
1518 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1519 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1520 Adjust users accordingly.
1521 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1522 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1523 from EMACS_INT to ptrdiff_t.
1524 (make_window): Omit redundant initialization.
1525
62b2bcf6
JB
15262012-06-28 Juanma Barranquero <lekktu@gmail.com>
1527
1528 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1529
45942c7d
DA
15302012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1531
1532 * window.h (struct window): Change type of 'use_time' and
1533 'sequence_number' from Lisp_Object to int.
1534 * frame.c (make_frame): Adjust users accordingly.
1535 * print.c (print_object): Likewise.
1536 * window.c (select_window, Fwindow_use_time, make_parent_window)
1537 (make_window): Likewise.
1538
e509cfa6
DA
15392012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1540
1541 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1542 enabled with --enable-checking=[all,glyphs] configure option.
1543 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1544 adjust comments accordingly.
1545 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1546 undefined, adjust comments accordingly.
1547 * image.c: Likewise.
1548 * scroll.c: Likewise.
1549 * w32fns.c: Likewise.
1550 * w32term.c: Likewise.
1551 * xdisp.c: Likewise.
1552 * xfaces.c: Likewise.
1553 * xfns.c: Likewise.
1554 * xterm.c: Likewise.
1555
a54e2c05
DA
15562012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1557
1558 Generalize run-time debugging checks.
1559 * dispextern.h (XASSERTS): Remove.
1560 * fontset.c (xassert): Remove.
1561 Convert from xassert to eassert.
1562 * alloc.c: Convert from xassert to eassert.
1563 * bidi.c: Likewise.
1564 * dispnew.c: Likewise.
1565 * fns.c: Likewise.
1566 * fringe.c: Likewise.
1567 * ftfont.c: Likewise.
1568 * gtkutil.c: Likewise.
1569 * image.c: Likewise.
1570 * keyboard.c: Likewise.
1571 * menu.c: Likewise.
1572 * process.c: Likewise.
1573 * scroll.c: Likewise.
1574 * sound.c: Likewise.
1575 * term.c: Likewise.
1576 * w32console.c: Likewise.
1577 * w32fns.c: Likewise.
1578 * w32term.c: Likewise.
1579 * window.c: Likewise.
1580 * xdisp.c: Likewise.
1581 * xfaces.c: Likewise.
1582 * xfns.c: Likewise.
1583 * xselect.c: Likewise.
1584 * xterm.c: Likewise.
1585
1ec4b7b2
SM
15862012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1587
1588 * fns.c (maybe_resize_hash_table): Output message when growing the
1589 purify-hashtable.
1590
2014308a
DA
15912012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1592
1593 * alloc.c (allocate_string_data): Remove dead code.
1594 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1595 avoid GCC warning about unused macro.
1596
246155eb
DA
15972012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1598
1599 * alloc.c (allocate_string): Omit intervals initialization.
1600 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1601 as in make_pure_string and make_pure_c_string.
1602
43184b7b
DA
16032012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1604
d209e2fb 1605 * alloc.c (allocate_string): Fix last change.
43184b7b 1606
3fe6dd74
DA
16072012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1608
d209e2fb 1609 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1610 to memset, add explicit initialization where appropriate.
1611
1ba6038a
GM
16122012-06-27 Glenn Morris <rgm@gnu.org>
1613
1614 * lisp.mk (lisp): Remove paths.elc.
1615
c89926a5
CY
16162012-06-27 Chong Yidong <cyd@gnu.org>
1617
1618 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1619
ed6b3510
JW
16202012-06-26 John Wiegley <johnw@newartisans.com>
1621
1ec4b7b2 1622 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1623 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1624
ed6b3510
JW
1625 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1626 when building with Clang.
1627
8edd4a2b
SM
16282012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1629
1630 * eval.c (Fapply): Allow calling it with a single argument.
1631
f6f62d1b
EZ
16322012-06-26 Eli Zaretskii <eliz@gnu.org>
1633
1634 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1635 _stricmp and _strnicmp.
1636 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1637
62efea5e
DA
16382012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1639
1640 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1641 allocated window.
1642 (allocate_process): Likewise for new process.
8edd4a2b 1643 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1644 (allocate_frame): Likewise.
1645 * frame.c (make_frame): Omit redundant initialization.
1646 * window.c (make_parent_window): Use memset.
1647 (make_window): Omit redundant initialization.
1648 * process.c (make_process): Omit redundant initialization.
1649 * terminal.c (create_terminal): Likewise.
1650
42997f4d
DA
16512012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1652
1653 * term.c (delete_tty): Remove redundant call to memset.
1654
1130ecfc
DA
16552012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1656
1657 * alloc.c: Remove build_string.
1658 * lisp.h: Define build_string as static inline. This provides
1659 a better opportunity to optimize away calls to strlen when the
1660 function is called with compile-time constant argument.
1661 * image.c (imagemagick_error): Convert to build_string.
1662 * w32proc.c (sys_spawnve): Likewise.
1663 * xterm.c (x_term_init): Likewise.
1664
cf38a720
PE
16652012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1666
99027bdd
PE
1667 Use sprintf return value instead of invoking strlen on result.
1668 In the old days this wasn't portable, since some sprintf
1669 implementations returned char *. But they died out years ago and
1670 Emacs already assumes sprintf returns int.
1671 Similarly for float_to_string.
1672 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1673 * ccl.c (ccl_driver):
1674 * character.c (string_escape_byte8):
1675 * data.c (Fnumber_to_string):
1676 * doprnt.c (doprnt):
1677 * print.c (print_object):
1678 * xdisp.c (message_dolog):
1679 * xfns.c (syms_of_xfns):
1680 Use sprintf or float_to_string result to avoid need to call strlen.
1681 * data.c (Fnumber_to_string):
1682 Use make_unibyte_string, since the string must be ASCII.
1683 * lisp.h, print.c (float_to_string): Now returns int length.
1684 * term.c (produce_glyphless_glyph):
1685 Use sprintf result rather than recomputing it.
1686
cf38a720
PE
1687 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1688 * Makefile.in (ALL_CFLAGS):
1689 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1690 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1691
3511c784
DA
16922012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1693
0a08eb21 1694 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1695 strcasecmp if available.
1696 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1697
fb7da12e
AS
16982012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1699
1700 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1701 Avoid comma operator.
1702 * menu.c (push_submenu_start, push_submenu_end)
1703 (push_left_right_boundary, push_menu_pane): Likewise.
1704 * msdos.c (dos_rawgetc): Likewise.
1705
afa2ffd8
DA
17062012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1707
1708 * xfns.c (xic_create_fontsetname): Remove redundant calls
1709 to memset.
1710
b3b4476b
PE
17112012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1712
4495ff38
PE
1713 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1714 sprintf already null-terminates its output.
1715
b3b4476b
PE
1716 * xfns.c (x_window): Remove redundant cast.
1717
b00876c9
DA
17182012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1719
1720 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1721 `const char *' to `char *' to avoid compiler warning.
1722
d188e26b
PE
17232012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1724
885d1d74
PE
1725 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1726 instead of truncating it to 63 (admittedly a generous limit).
1727
d188e26b
PE
1728 * process.c: Fix spelling and caps in comments.
1729
e2f560b1
DN
17302012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1731
e86db54b 1732 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1733 * sysdep.c (setpgrp): Remove definition, not used in this file.
1734
7583a3a1
JB
17352012-06-24 Juanma Barranquero <lekktu@gmail.com>
1736
1737 * makefile.w32-in: Update dependencies.
1738
696056c2
EZ
17392012-06-24 Eli Zaretskii <eliz@gnu.org>
1740
1741 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1742 (SYSTIME_H): Add nt/inc/sys/time.h.
1743
1744 * systime.h [WINDOWSNT]: Include sys/time.h.
1745
1746 * s/ms-w32.h (struct timespec): Definition moved from
1747 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1748
845ca893
PE
17492012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1750
1751 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1752 * buffer.h (buffer_slot_type_mismatch):
1753 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1754 * eval.c (unwind_to_catch):
1755 * image.c (my_png_error, my_error_exit):
1756 * keyboard.c (quit_throw_to_read_char, user_error)
1757 (Fexit_recursive_edit, Fabort_recursive_edit):
1758 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1759 (wrong_type_argument, buffer_overflow, __executable_start)
1760 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1761 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1762 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1763 (fatal):
1764 (child_setup) [!DOS_NT]:
1765 * lread.c (end_of_file_error, invalid_syntax):
1766 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1767 * puresize.h (pure_write_error):
1768 * search.c (matcher_overflow):
1769 * sound.c (sound_perror, alsa_sound_perror):
1770 * sysdep.c, syssignal.h (croak):
1771 * term.c (maybe_fatal, vfatal):
1772 * textprop.c (text_read_only):
1773 * undo.c (user_error):
1774 * unexmacosx.c (unexec_error):
1775 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1776 Use _Noreturn rather than NO_RETURN.
1777 No need for separate decl merely because of _Noreturn.
1778 * sound.c (sound_warning, parse_sound):
1779 Remove unnecessary forward decls.
1780
f1dd8073
PE
17812012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1782
1783 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1784 * lisp.h (WAIT_READING_MAX): New macro.
1785 * dispnew.c (Fsleep_for, sit_for):
1786 * keyboard.c (kbd_buffer_get_event):
1787 * process.c (Faccept_process_output):
1788 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1789 This improves on the previous patch, which introduced a bug
1790 when time_t is unsigned and as wide as intmax_t.
1791 See <http://bugs.gnu.org/9000#51>.
1792
b82c1755
EZ
17932012-06-23 Eli Zaretskii <eliz@gnu.org>
1794
1795 * dispnew.c (sit_for, Fsleep_for):
1796 * keyboard.c (kbd_buffer_get_event):
1797 * process.c (Faccept_process_output): Avoid compiler warnings when
1798 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1799
ca300656
JB
18002012-06-23 Juanma Barranquero <lekktu@gmail.com>
1801
049ec95b
JB
1802 * makefile.w32-in: Update dependencies.
1803
ca300656
JB
1804 * w32.c (ltime): Add return type and declare static.
1805 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1806
db7b8d06
PE
18072012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1810 Privately reported by Herbert J. Skuhra.
1811 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1812 All uses changed.
1813 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1814 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1815
0bd8297f
EZ
18162012-06-23 Eli Zaretskii <eliz@gnu.org>
1817
96512555
EZ
1818 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1819 last argument of make_unibyte_string.
1820
0bd8297f
EZ
1821 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1822 language ID in the event parameters.
1823
1824 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1825 event.code, not the obscure "character set ID".
1826
63def6b6
CY
18272012-06-23 Chong Yidong <cyd@gnu.org>
1828
1829 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1830
e8a02204
EZ
18312012-06-23 Eli Zaretskii <eliz@gnu.org>
1832
388cdec0
EZ
1833 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1834 * w32.c (fdutimens): New function.
1835
1836 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1837
1838 * s/ms-w32.h (pselect): Redirect to sys_select.
1839
1840 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1841
e8a02204
EZ
1842 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1843 in the logic of incrementing and decrementing the value of
1844 use_relocatable_buffers.
1845
d054f3fb
PE
18462012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1849 Privately reported by Herbert J. Skuhra.
1850 [__FreeBSD__]: Remove "*/" typo after "#include".
1851 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1852 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1853 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1854 Don't assume EMACS_TIME and struct timeval are the same type.
1855
d35af63c
PE
18562012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1857
1858 Support higher-resolution time stamps (Bug#9000).
1859 The time stamps are only nanosecond-resolution at the C level,
1860 since that's the best that any real-world system supports now.
1861 But they are picosecond-resolution at the Lisp level, as that's
1862 easy, and leaves room for future OS improvements.
1863
1864 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1865 (LIBES): Use it.
1866
1867 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1868 Don't get current time unless it's needed.
1869
1870 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1871 now provides it if it's absent.
1872 (start_atimer): Port to higher-res time stamps.
1873 Check for time stamp overflow. Don't get current time more
1874 often than is needed.
1875
1876 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1877 Include systime.h, not time.h.
1878 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1879
1880 * dired.c: Include stat-time.h.
1881 (Ffile-attributes): File times now have higher resolution.
1882
1883 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1884 (struct image): Timestamp now has higher resolution.
1885
1886 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1887 has at least microseconds now. All uses removed.
1888 (update_frame, update_single_window, update_window, update_frame_1)
1889 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1890
1891 * editfns.c (time_overflow): Now extern.
1892 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1893 (float-time, Fformat_time_string, Fcurrent_time_string)
1894 (Fcurrent_time_zone): Accept and generate higher-resolution
1895 time stamps.
1896 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1897 (decode_time_components, lisp_seconds_argument): New functions.
1898 (make_time): Now static.
1899 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1900 Report an error if the time is invalid, rather than having the caller
1901 do that.
1902
1903 * fileio.c: Include <stat-time.h>
1904 (Fcopy_file): Copy higher-resolution time stamps.
1905 Prefer to set the time stamp via a file descriptor if that works.
1906 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1907 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1908 (Fvisited_file_modtime, Fset_visited_file_modtime):
1909 Support higher-resolution time stamps.
1910
1911 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1912
1913 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1914
1915 * image.c (prepare_image_for_display, clear_image_cache)
1916 (lookup_image): Port to higer-resolution time stamps.
1917
1918 * keyboard.c (start_polling, bind_polling_period):
1919 Check for time stamp overflow.
1920 (read_char, kbd_buffer_get_event, timer_start_idle)
1921 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1922 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1923 Port to higher-resolution time stamps. Do not assume time_t is signed.
1924 (decode_timer): New function. Timers are now vectors of length 9,
1925 not 8, to accommodate the picosecond component.
1926 (timer_check_2): Use it.
1927
1928 * nsterm.m (select_timeout, timeval_subtract): Remove.
1929 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1930 as they're a bit more accurate and handle overflow better.
1931 (ns_select): Change prototype to be compatible with pselect.
1932 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1933 * nsterm.h (ns_select): Adjust prototype.
1934
1935 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1936 us-resolution time stamps.
1937 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1938
1939 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1940
1941 * lisp.h (time_overflow): New decl.
1942 (wait_reading_process_output): First arg is now intmax_t, not int,
1943 to accommodate larger waits.
1944
1945 * process.h (struct Lisp_Process.read_output_delay):
1946 Now counts nanoseconds, not microseconds.
1947 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1948 EMACS_HAS_USECS.
1949 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1950 (wait_reading_process_output):
1951 Port to ns-resolution time stamps.
1952 (Faccept_process_output, wait_reading_process_output):
1953 Check for time stamp overflow. Do not assume time_t is signed.
1954 (select_wrapper): Remove; we now use pselect.
1955 (Fprocess_attributes): Now generates ns-resolution time stamps.
1956
1957 * sysdep.c: Include utimens.h. Don't include utime.h
1958 or worry about struct utimbuf; gnulib does that for us now.
1959 (gettimeofday): Remove; gnulib provides a substitute.
1960 (make_timeval): New function.
1961 (set_file_times): Now sets ns-resolution time stamps.
1962 New arg FD; all uses changed.
1963 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1964 (system_process_attributes):
1965 Now returns ns-resolution time stamp. All uses changed.
1966 Check for time stamp overflow.
1967
1968 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1969 provides a substitute now.
1970
1971 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1972 since it guarantees struct timespec.
1973 (EMACS_TIME): Now struct timespec, so that we can support
1974 ns-resolution time stamps.
1975 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1976 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1977 (EMACS_USECS): Remove.
1978 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1979 so multiply the arg by 1000 before storing it.
1980 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1981 New macros.
1982 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1983 Port to ns-resolution time stamps.
1984 (EMACS_TIME_NEG_P): Remove; replaced by....
1985 (EMACS_TIME_SIGN): New macro.
1986 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1987 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1988 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1989 (make_timeval, make_lisp_time, decode_time_components): New decls.
1990 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1991 that it mishandled time_t overflow. You can't compare by subtracting!
1992 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1993 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1994
1995 * term.c: Include <sys/time.h>.
1996 (timeval_to_Time): New function, for proper overflow wraparound.
1997 (term_mouse_position, term_mouse_click): Use it.
1998
1999 * undo.c (record_first_change): Support higher-resolution time stamps
2000 in the undo buffer.
2001 (Fprimitive_undo): Use them when restoring time stamps.
2002
2003 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
2004 (w32_get_internal_run_time):
2005 Port to higher-resolution Emacs time stamps.
2006 (ltime): Now accepts single 64-bit integer, as that's more convenient
2007 for callers.
2008
2009 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
2010
2011 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
2012 for compatibility with pselect. Support ns-resolution time stamps.
2013
2014 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
2015
2016 * xselect.c (wait_for_property_change, x_get_foreign_selection):
2017 Check for time stamp overflow, and support ns-resolution time stamps.
2018
2019 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
2020 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
2021 (timeval_subtract): Remove; no longer needed.
2022 (XTflash, XTring_bell, x_wait_for_event):
2023 Port to ns-resolution time stamps. Don't assume time_t is signed.
2024
b6a92dfe
CY
20252012-06-22 Chong Yidong <cyd@gnu.org>
2026
2027 * xdisp.c (x_consider_frame_title): Revert last change.
2028
d251c37c
EZ
20292012-06-22 Eli Zaretskii <eliz@gnu.org>
2030
2031 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
2032 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
2033 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
2034 staticidx goes up to 1597 out of 1600 = 0x640.)
2035
f10deafb
PE
20362012-06-20 Paul Eggert <eggert@cs.ucla.edu>
2037
2038 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
2039 Otherwise, the umask might be mistakenly 0 while handling input signals.
2040
ec6de1e2
SM
20412012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
2042
2043 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
2044
28be1ada
DA
20452012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
2046
2047 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
2048 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
2049 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
2050 access to `contents' member of Lisp_Vector objects with AREF and ASET
2051 where appropriate.
2052
c6bf3022
CY
20532012-06-19 Chong Yidong <cyd@gnu.org>
2054
2055 * frame.c (delete_frame): When selecting a frame on a different
2056 text terminal, do not alter the terminal's top-frame.
2057
2058 * xdisp.c (format_mode_line_unwind_data): Record the target
2059 frame's selected window and its terminal's top-frame.
2060 (unwind_format_mode_line): Restore them.
2061 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
2062 Callers changed.
2063 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
2064 since tty frames can be explicitly named.
2065 (prepare_menu_bars): Likewise.
2066
2067 * term.c (Ftty_top_frame): New function.
2068
defd4196
PE
20692012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2070
2071 Port byte-code-meter to modern targets.
2072 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
2073 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 2074 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
2075 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
2076 (METER_1, METER_2): Simplify.
2077
1053a871
SM
20782012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2079
2080 * data.c (Fdefalias): Return `symbol' (bug#11686).
2081
b7e8d081
MR
20822012-06-18 Martin Rudalics <rudalics@gmx.at>
2083
2084 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
2085 gets killed during executing of this function (Bug#11665).
2086 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
2087 (Vkill_buffer_query_functions): In doc-string say that functions
2088 run by this hook should not change the current buffer.
2089
7ea2b339
PE
20902012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2091
2092 Fix recently-introduced process.c problems found by static checking.
2093 * process.c (write_queue_push, write_queue_pop, send_process):
2094 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
2095 (write_queue_pop): Fix pointer signedness problem.
2096 (send_process): Remove unused local.
2097
96a313a1
CY
20982012-06-17 Chong Yidong <cyd@gnu.org>
2099
2100 * xdisp.c (redisplay_internal): No need to redisplay terminal
2101 frames that are not on top.
2102
20ca2e94
TN
21032012-06-17 Troels Nielsen <bn.troels@gmail.com>
2104
2105 * process.c (make_process): Initialize write_queue.
2106 (write_queue_push, write_queue_pop): New functions.
2107 (send_process): Use them to maintain correct ordering of process
2108 writes (Bug#10815).
2109
9a900ca9
PE
21102012-06-17 Paul Eggert <eggert@cs.ucla.edu>
2111
310fbfa8
PE
2112 * lisp.h (eassert): Assume C89 or later.
2113 This removes the need for CHECK.
2114 (CHECK): Remove. Its comments about always evaluating its
2115 argument were confusing, as 'eassert' typically does not evaluate
2116 its argument.
2117
27bb1ca4
PE
2118 * coding.c (produce_chars): Use ptrdiff_t, not int.
2119
9a900ca9
PE
2120 * xterm.c (x_draw_underwave): Check for integer overflow.
2121 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
2122
41b7f8bc 21232012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
2124
2125 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
2126 referenced (Bug#11583).
2127
9b0e3eba
AA
21282012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
2129
2130 Implement wave-style variant of underlining.
2131 * dispextern.h (face_underline_type): New enum.
2132 (face): Add field for underline type.
2133 * nsterm.m (ns_draw_underwave): New function.
2134 (ns_draw_text_decoration): Use it.
2135 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
2136 New functions.
2137 (x_draw_glyph_string): Use them.
2138 * xfaces.c (Qline, Qwave): New Lisp objects.
2139 (check_lface_attrs, merge_face_ref)
1053a871
SM
2140 (Finternal_set_lisp_face_attribute, realize_x_face):
2141 Handle wave-style underline face attributes.
9b0e3eba
AA
2142 * xterm.c (x_draw_underwave): New function.
2143 (x_draw_glyph_string): Use it.
2144
0fb52f11
JB
21452012-06-16 Juanma Barranquero <lekktu@gmail.com>
2146
2147 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
2148 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
2149 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
2150 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
2151 ($(BLD)/w32select.$(O)): Update dependencies.
2152
e5560ff7
AS
21532012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2154
2155 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
2156 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
2157 * character.c (_fetch_multibyte_char_p): Remove.
2158 * alloc.c: Include "character.h" before "buffer.h".
2159 * bidi.c: Likewise.
2160 * buffer.c: Likewise.
2161 * bytecode.c: Likewise.
2162 * callint.c: Likewise.
2163 * callproc.c: Likewise.
2164 * casefiddle.c: Likewise.
2165 * casetab.c: Likewise.
2166 * category.c: Likewise.
2167 * cmds.c: Likewise.
2168 * coding.c: Likewise.
2169 * composite.c: Likewise.
2170 * dired.c: Likewise.
2171 * dispnew.c: Likewise.
2172 * doc.c: Likewise.
2173 * dosfns.c: Likewise.
2174 * editfns.c: Likewise.
2175 * emacs.c: Likewise.
2176 * fileio.c: Likewise.
2177 * filelock.c: Likewise.
2178 * font.c: Likewise.
2179 * fontset.c: Likewise.
2180 * fringe.c: Likewise.
2181 * indent.c: Likewise.
2182 * insdel.c: Likewise.
2183 * intervals.c: Likewise.
2184 * keyboard.c: Likewise.
2185 * keymap.c: Likewise.
2186 * lread.c: Likewise.
2187 * macros.c: Likewise.
2188 * marker.c: Likewise.
2189 * minibuf.c: Likewise.
2190 * nsfns.m: Likewise.
2191 * nsmenu.m: Likewise.
2192 * print.c: Likewise.
2193 * process.c: Likewise.
2194 * regex.c: Likewise.
2195 * region-cache.c: Likewise.
2196 * search.c: Likewise.
2197 * syntax.c: Likewise.
2198 * term.c: Likewise.
2199 * textprop.c: Likewise.
2200 * undo.c: Likewise.
2201 * unexsol.c: Likewise.
2202 * w16select.c: Likewise.
2203 * w32fns.c: Likewise.
2204 * w32menu.c: Likewise.
2205 * window.c: Likewise.
2206 * xdisp.c: Likewise.
2207 * xfns.c: Likewise.
2208 * xmenu.c: Likewise.
2209 * xml.c: Likewise.
2210 * xselect.c: Likewise.
2211
2f07e6af
EZ
22122012-06-16 Eli Zaretskii <eliz@gnu.org>
2213
1053a871
SM
2214 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
2215 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 2216 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
2217 row.
2218 (handle_face_prop): Use chunk-relative overlay string index when
2219 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
2220 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
2221 the rightmost. (Bug#11720)
2f07e6af 2222
29b83cec
AS
22232012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2224
2225 * category.h (CHAR_HAS_CATEGORY): Define as inline.
2226 (CATEGORY_MEMBER): Enforce 1/0 value.
2227 * category.c (_temp_category_set): Remove.
2228
4c5501e9
EZ
22292012-06-16 Eli Zaretskii <eliz@gnu.org>
2230
2231 * window.c (Fdelete_other_windows_internal)
2232 (Fdelete_window_internal): Don't access frame's mouse highlight
2233 info of the initial frame. (Bug#11677)
2234
2b570124
PE
22352012-06-14 Paul Eggert <eggert@cs.ucla.edu>
2236
e93864f9
PE
2237 * .gdbinit (xgetint): Fix recently-introduced paren typo.
2238 Assume USE_2_TAGS_FOR_INTS.
2239 (xreload): Adjust $tagmask width to match recent lisp.h change.
2240
2b570124
PE
2241 Simplify lisp.h in minor ways that should not affect code.
2242 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
2243 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
2244 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
2245 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
2246 (INTTYPEBITS): New macro, for clarity.
2247 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
2248 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
2249 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
2250 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
2251 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
2252
81755f69
JB
22532012-06-13 Juanma Barranquero <lekktu@gmail.com>
2254
2255 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
2256
16192a57
GM
22572012-06-13 Glenn Morris <rgm@gnu.org>
2258
2259 * s/bsd-common.h (BSD4_3):
2260 * s/usg5-4-common.h (USG5_4): No longer define; unused.
2261
646b5f55
AS
22622012-06-13 Andreas Schwab <schwab@linux-m68k.org>
2263
2264 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
2265 instead of union.
2266 (XLI, XIL): Define.
1053a871
SM
2267 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
2268 Use them.
2269 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 2270 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 2271 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
2272 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
2273 * frame.c (delete_frame): Remove outdated comment.
2274 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
2275 USE_LISP_UNION_TYPE.
2276 (Fw32_unregister_hot_key): Likewise.
2277 (Fw32_toggle_lock_key): Likewise.
2278 * w32menu.c (add_menu_item): Likewise.
2279 (w32_menu_display_help): Use XIL instead of checking
2280 USE_LISP_UNION_TYPE.
2281 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
2282 (init_heap): Likewise.
2283 * w32term.c (w32_read_socket): Update comment.
2284
1d3823c9
GM
22852012-06-13 Glenn Morris <rgm@gnu.org>
2286
c62ff706
GM
2287 * s/usg5-4-common.h, src/s/unixware.h:
2288 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
2289
1d3823c9
GM
2290 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
2291
bfe3e0a2
PE
22922012-06-13 Paul Eggert <eggert@cs.ucla.edu>
2293
2294 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
2295 * alloc.c (make_number) [!defined make_number]:
2296 Remove, as lisp.h always defines this now.
2297 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
2298 (roundup_size): Verify that it is a power of 2.
2299 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2300 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2301 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2302 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2303 USE_LSB_TAG now is always defined to be either 0 or 1.
2304 All uses changed.
2305 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2306 code works fine either way, and efficiency is not a concern here,
2307 as the union type is for debugging, not for production.
2308 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2309 Use an inline function on all platforms when using the union type,
2310 since this is simpler and 'static inline' can be used portably
2311 within Emacs now.
2312 (LISP_INITIALLY_ZERO): New macro.
2313 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2314 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2315
45fa9c0f
GM
23162012-06-12 Glenn Morris <rgm@gnu.org>
2317
b4492cba
GM
2318 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2319
2320 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 2321
45fa9c0f
GM
2322 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2323 Move BROKEN_SIGIO to configure.
2324
2325 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2326 Move NO_TERMIO to configure.
2327
0e25d334
CY
23282012-06-12 Chong Yidong <cyd@gnu.org>
2329
2330 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2331 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2332 MagickExportImagePixels is undefined.
2333
43682bb6
PE
23342012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2335
2336 * image.c (imagemagick_load_image): Remove unused label.
2337
a9be7d2b
GM
23382012-06-11 Glenn Morris <rgm@gnu.org>
2339
2340 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2341 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2342 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2343 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2344
3017f87f
SM
23452012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2346
2347 * alloc.c (make_byte_code): New function.
2348 (Fmake_byte_code): Use it. Don't purify here.
2349 * lread.c (read1): Use it as well to avoid extra allocation.
2350
1b9b4cf4
CY
23512012-06-11 Chong Yidong <cyd@gnu.org>
2352
2353 * image.c (imagemagick_load_image): Implement transparency.
2354
95988fcf
AS
23552012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2356
2357 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2358 account for preceding backslashes. (Bug#11663)
2359
cd4eb164
CY
23602012-06-09 Chong Yidong <cyd@gnu.org>
2361
2362 * term.c: Support italics in capable terminals (Bug#9652).
2363 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2364 (turn_on_face): Output using TS_enter_italic_mode if available.
2365 Don't handle unused blinking and alt-charset cases.
2366 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2367 and tty_alt_charset_p cases.
2368 (tty_capable_p, init_tty): Support italics.
2369
2370 * termchar.h (struct tty_display_info): Add field for italics.
2371 Remove unused blink field.
2372
2373 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2374 Handle slant.
2375
2376 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2377 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2378 tty_alt_charset_p. Add tty_italic_p.
2379
ff88beb8
MA
23802012-06-09 Michael Albinus <michael.albinus@gmx.de>
2381
2382 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
2383 dbus_type_is_basic if available.
2384 (xd_extract_signed, xd_extract_unsigned): Rename from
2385 extract_signed and extract_unsigned, respectively. Adapt callers.
2386
44286096
CY
23872012-06-09 Chong Yidong <cyd@gnu.org>
2388
1682701f
CY
2389 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2390
44286096
CY
2391 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2392 case (Bug#9752).
2393
d86feb17
PE
23942012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 * xdisp.c (vmessage): Treat frame message as multibyte.
2397 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2398 would generate the diagnostic "Making \302\247 buffer-local while
2399 let-bound!".
2400
d5c20fe8
EZ
24012012-06-08 Eli Zaretskii <eliz@gnu.org>
2402
2403 * dispnew.c (showing_window_margins_p): Undo last change, which
2404 was done due to an inadvertent commit.
2405 (adjust_frame_glyphs_for_frame_redisplay): Do call
2406 showing_window_margins_p.
2407
513749ee
SM
24082012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2409
2410 * eval.c (Fmake_var_non_special): New primitive.
2411 (syms_of_eval): Defsubr it.
2412 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2413
d4a8f5c1
JB
24142012-06-08 Juanma Barranquero <lekktu@gmail.com>
2415
2416 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2417 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2418
8bbbc977
EZ
24192012-06-08 Eli Zaretskii <eliz@gnu.org>
2420
2421 * alloc.c (allocate_vectorlike): Fix last change.
2422
f3372c87
DA
24232012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2424
2425 Block-based vector allocation of small vectors.
2426 * lisp.h (struct vectorlike_header): New field `nbytes',
2427 adjust comment accordingly.
2428 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2429 to denote vector blocks. Adjust users (live_vector_p,
2430 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2431 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2432 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2433 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2434 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2435 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2436 (roundup_size): New constant.
2437 (struct vector_block): New data type.
2438 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2439 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2440 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2441 (sweep_vectors): New functions.
2442 (allocate_vectorlike): Return `zero_vector' as the only vector of
2443 0 items. Allocate new vector from block if vector size is less than
2444 or equal to VBLOCK_BYTES_MAX.
2445 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2446 (init_alloc_once): Add call to init_vectors.
2447
4f18a4ed
SM
24482012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2449
2450 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2451
86f158bc
PE
24522012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2453
2454 * doprnt.c (doprnt): Truncate multibyte char correctly.
2455 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2456 would mishandle a string argument "Xc" if X was a multibyte
2457 character of length 2: it would truncate after X's first byte
2458 rather than including all of X.
2459
c5cfcbe0
CY
24602012-06-06 Chong Yidong <cyd@gnu.org>
2461
2462 * buffer.c (word_wrap): Doc fix.
2463
c05cf390
PE
24642012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2465
2466 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2467
0c3461de
GM
24682012-06-03 Glenn Morris <rgm@gnu.org>
2469
2470 * xdisp.c (tool-bar-style): Doc fix.
2471
c71232db
UM
24722012-06-03 Ulrich Müller <ulm@gentoo.org>
2473
2474 * Makefile.in (PAXCTL): Define.
2475 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2476 binary via PaX flags if the paxctl utility is available.
2477 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2478 Restore PaX flags to their default. (Bug#11398)
2479
383f7350
CY
24802012-06-03 Chong Yidong <cyd@gnu.org>
2481
2482 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2483 buffer (Bug#11226).
2484
5f2c76c6
CY
24852012-06-03 Chong Yidong <cyd@gnu.org>
2486
2487 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2488 (note_mode_line_or_margin_highlight): If there is no help echo,
2489 use mode-line-default-help-echo. Handle the case where the mouse
2490 position is past the end of the mode line string.
2491
2492 * buffer.c (buffer_local_value_1): New function, split from
2493 Fbuffer_local_value; can return Qunbound.
2494 (Fbuffer_local_value): Use it.
2495 (Vmode_line_format): Docstring tweaks.
2496
773d47f6
PE
24972012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2498
2499 * sysdep.c (system_process_attributes): Improve comment.
2500
f2d6a3df
SM
25012012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2502
2503 * keyboard.c: Export real-this-command to Elisp.
2504 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2505 and DEFVAR it. Update all users.
2506
63810350
PE
25072012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2508
7bd5c1f4
PE
2509 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2510
63810350
PE
2511 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2512 Convert pctcpu and pctmem to Lisp float properly.
2513 Let the compiler fold better, as 100.0/0x8000 is exact.
2514
a2821611
AS
25152012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2516
2517 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2518 cons_block.
2519
5fceba1d
PE
25202012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2521
2522 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2523
c98ff5dd
DA
25242012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2525
2526 For a 'struct window', replace some Lisp_Object fields to
2527 bitfields where appropriate, remove unused fields.
2528 * window.h (struct window): Remove unused 'last_mark_x' and
2529 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2530 change it's type from Lisp_Object to bitfield.
2531 Change type of 'force_start', 'optional_new_start',
2532 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2533 fields from Lisp_Object to bitfield. Adjust users accordingly.
2534
ca34e0be
PE
25352012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2536
2537 Pacify gcc -Wdouble-precision when using Xaw.
2538 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2539 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2540 Use 'float' consistently, rather than 'float' in most places
2541 and 'double' in a couple of places.
2542
efc00ab1 25432012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2544
2545 * xdisp.c (handle_stop): Detect whether we have overlay strings
2546 loaded by testing it->current.overlay_string_index to be
2547 non-negative, instead of checking whether n_overlay_strings is
2548 positive. (Bug#11587)
2549
efc00ab1 25502012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2551
2552 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2553
2554 * doc.c (Fsubstitute_command_keys): Doc fix.
2555
efc00ab1 25562012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2557
2558 * search.c (search_buffer): Remove calls to
2559 r_alloc_inhibit_buffer_relocation, as it is now called by
2560 maybe_unify_char, which was the cause of relocation of buffer text
2561 in bug#11519.
2562
efc00ab1 25632012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2564
2565 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2566 for the duration of call to load_charset, to avoid problems with
2567 callers of maybe_unify_char that access buffer text through C
2568 pointers.
2569
2570 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2571 decrement the inhibition flag, instead of just setting or
2572 resetting it.
2573
ba93a187
PE
25742012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2575
2576 Remove obsolete '#define static' cruft.
2577 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2578 This #undef was "temporary" in 2000; it is no longer needed
2579 now that '#define static' has gone away.
2580 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2581 (gray_bitmap_bits): Remove; no longer needed.
2582 All uses replaced with definiens.
2583 * xterm.c: Include "bitmaps/gray.xbm".
2584
9e4bf381
PE
25852012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2586
2587 Clean up __executable_start, monstartup when --enable-profiling.
2588 The following changes affect the code only when profiling.
2589 * dispnew.c (__executable_start): Rename from safe_bcopy.
2590 Define only on platforms that need it.
2591 * emacs.c: Include <sys/gmon.h> when profiling.
2592 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2593 (__executable_start): Remove decl, since lisp.h does it now.
2594 (safe_bcopy): Remove decl; no longer has that name.
2595 (main): Coalesce #if into single bit of code, for simplicity.
2596 Cast pointers to uintptr_t, since standard libraries want integers
2597 and not pointers.
2598 * lisp.h (__executable_start): New decl.
2599
32d72c2f
GM
26002012-05-31 Glenn Morris <rgm@gnu.org>
2601
2602 * image.c (Fimagemagick_types): Doc fix.
2603
baac5bc7
JM
26042012-05-30 Jim Meyering <meyering@redhat.com>
2605
2606 * callproc.c (Fcall_process_region): Include directory component
2607 in mkstemp error message (Bug#11586).
2608
72cb32cf
PE
26092012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2610
2611 * alloc.c, lisp.h (make_pure_vector): Now static.
2612
61b108cc
SM
26132012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2614
2615 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2616 Move to byte-run.el.
2617 (Fautoload): Do the hash-doc more carefully.
2618 * data.c (Fdefalias): Purify definition, except for keymaps.
2619 (Qdefun): Move from eval.c.
2620 * lisp.h (Qdefun): Remove.
2621 * lread.c (read1): Tiny simplification.
2622
471fe23d
TN
26232012-05-29 Troels Nielsen <bn.troels@gmail.com>
2624
934f3f58 2625 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2626 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2627 Bug#9642, but explicitly check that the buffer the overlay would
2628 be moved to is live and rearrange lines to make sure that errors
2629 will not put the overlay in an inconsistent state.
2630 (Fdelete_overlay): Cosmetics.
2631
85d0efd1
EZ
26322012-05-28 Eli Zaretskii <eliz@gnu.org>
2633
2634 * w32term.c (my_bring_window_to_top): New function.
2635 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2636 could be different from the original one.
2637 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2638 (Bug#11513)
2639
2640 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2641 by calling BringWindowToTop.
2642
2643 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2644 (WM_EMACS_END): Increase by one.
2645
da92a98c
PE
26462012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2647
2648 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2649 This avoids undefined behavior that might cause the eassert
2650 to not catch an out-of-range value.
2651
74d1f848
JB
26522012-05-28 Juanma Barranquero <lekktu@gmail.com>
2653
2654 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2655 Update dependencies.
2656
9e1a06fc
EZ
26572012-05-27 Eli Zaretskii <eliz@gnu.org>
2658
2659 * bidi.c (bidi_mirror_char): Fix last change.
2660
f3dd7312
AS
26612012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2662
2663 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2664 when referring to sectname field in printf format.
2665
81899c91
PE
26662012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2667
57b81a9f
PE
2668 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2669 Only r_alloc_inhibit_buffer_relocation needed to be added;
2670 the others were already declared.
2671
81899c91
PE
2672 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2673 before checking whether it's out of range. Put the check inside
2674 eassert. See
2675 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2676
33017faf 26772012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2678
2679 * callproc.c (Fcall_process): Restore a line that was accidentally
2680 commented out in the 2011-02-13 change (bug#11547).
2681
33017faf 26822012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2683
2684 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2685 defined on ralloc.c.
2686
2687 * buffer.c [REL_ALLOC]: Remove prototypes of
2688 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2689 they are now on lisp.h.
2690
2691 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2692
2693 * search.c (search_buffer): Use it to inhibit relocation of buffer
2694 text while re_search_2 is doing its job, because re_search_2 is
2695 passed C pointers to buffer text. (Bug#11519)
2696
23415acf
EZ
2697 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2698 Update value to 24.
2699
44e27368
EZ
2700 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2701 state after an additional call to move_it_in_display_line_to, keep
2702 the values of it->max_ascent and it->max_descent found for the
2703 entire line.
2704 (pos_visible_p): Revert the comparison against bottom_y to what it
2705 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2706 (Bug#11464)
2707
c1892f11
PE
27082012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2709
2710 Fix coding-related core dumps with gcc -ftrapv.
2711 The code was computing A - B, where A and B are pointers, and B is
2712 random garbage. This can lead to core dumps on platforms that
2713 have special pointer registers, and it also leads to core dumps on
2714 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2715 A - B only when B is initialized properly.
2716 * coding.c (coding_set_source, coding_set_destination): Return void.
2717 (coding_change_source, coding_change_destinations): New functions,
2718 with the old behaviors of coding_set_source and coding_set_destination.
2719 All callers that need an offset changed to use these new functions.
2720
eb7afdad
GM
27212012-05-26 Glenn Morris <rgm@gnu.org>
2722
2723 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2724
f12fdf02
EZ
27252012-05-26 Eli Zaretskii <eliz@gnu.org>
2726
53a63be6 2727 Extend mouse support on W32 text-mode console.
61b108cc
SM
2728 * xdisp.c (draw_row_with_mouse_face):
2729 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2730
eb3f6f01 2731 * w32console.c: Include window.h.
61b108cc
SM
2732 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2733 New functions.
eb3f6f01
EZ
2734 (initialize_w32_display): Initialize mouse-highlight data.
2735
53a63be6
EZ
2736 * w32inevt.c: Include termchar.h and window.h.
2737 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2738 moves, call note_mouse_highlight. If help_echo changed, call
2739 gen_help_event to produce help-echo message in the echo area.
2740 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2741 highlight info.
2742
4cfd81f6
PE
27432012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2744
2745 * lread.c (read1): Simplify slightly to avoid an overflow warning
2746 with GCC 4.7.0 on x86-64.
2747
4446092a
EZ
27482012-05-26 Eli Zaretskii <eliz@gnu.org>
2749
2750 * bidi.c (bidi_mirror_char): Revert last change: an int is
2751 definitely wide enough here.
2752
42b2a986 27532012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2754
42b2a986 2755 Fix integer width and related bugs (Bug#9874).
eb106a49 2756 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2757 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2758 (string_bytes, check_sblock, allocate_string_data):
2759 (compact_small_strings, Fmake_bool_vector, make_string)
2760 (make_unibyte_string, make_multibyte_string)
2761 (make_string_from_bytes, make_specified_string)
2762 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2763 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2764 (mark_vectorlike):
2765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2766 (allocate_pseudovector):
2767 Use int, not EMACS_INT, where int is wide enough.
2768 (inhibit_garbage_collection, Fgarbage_collect):
2769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2770 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2771 int might not be wide enough.
2772 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2773 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2774 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2775 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2776 (bidi_level_of_next_char, bidi_move_to_visually_next):
2777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2778 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2779 (Fkill_buffer, Fset_buffer_major_mode)
2780 (advance_to_char_boundary, Fbuffer_swap_text)
2781 (Fset_buffer_multibyte, overlays_at, overlays_in)
2782 (overlay_touches_p, struct sortvec, record_overlay_string)
2783 (overlay_strings, recenter_overlay_lists)
2784 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2785 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2786 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2787 (Foverlay_recenter, last_overlay_modification_hooks_used)
2788 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2790 (validate_region): Omit unnecessary test for b <= e,
2791 since that's guaranteed by the previous test.
d311d28c
PE
2792 (adjust_overlays_for_delete): Avoid pos + length overflow.
2793 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2794 (report_overlay_modification):
2795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2796 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2797 Omit pointer cast, which isn't needed anyway, and doesn't work
2798 after the EMACS_INT -> ptrdiff_t change.
02481186 2799 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2800 * buffer.h: Adjust decls to match defn changes elsewhere.
2801 (struct buffer_text, struct buffer):
2802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2803 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2804 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2805 not int, to avoid needless 32-bit limit on 64-bit hosts.
2806 (exec_byte_code): Use tighter memory-full test, one that checks
2807 for alloca overflow. Don't compute the address of the object just
2808 before an array, as that's not portable. Use EMACS_INT, not
2809 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2810 * callint.c (Fcall_interactively):
2811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2812 * callproc.c (call_process_kill, Fcall_process):
2813 Don't assume pid_t fits into an Emacs fixnum.
2814 (call_process_cleanup, Fcall_process, child_setup):
2815 Don't assume pid_t fits into int.
2816 (call_process_cleanup, Fcall_process, delete_temp_file)
2817 (Fcall_process_region):
2818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2819 (Fcall_process): Simplify handling of volatile integers.
2820 Use int, not EMACS_INT, where int will do.
2821 * casefiddle.c (casify_object, casify_region, operate_on_word)
2822 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2824 (casify_object): Avoid integer overflow when overallocating buffer.
2825 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2826 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2827 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2828 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2829 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2830 integers are now checked earlier. All uses replaced with XINT.
2831 (ccl_driver):
2832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2833 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2834 (ccl_driver, Fregister_code_conversion_map):
2835 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2836 (resolve_symbol_ccl_program): Check that vector header is in range.
2837 Always copy the vector, so that we can check its contents reliably
2838 now rather than having to recheck each instruction as it's being
2839 executed. Check that vector words fit in 'int'.
2840 (ccl_get_compiled_code, Fregister_ccl_program)
2841 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2842 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2843 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2844 contents are in range.
2845 (Fccl_execute_on_string): Check that status is in range.
2846 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2847 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2848 Accept and return EMACS_INT, not int, because callers can pass values
2849 out of 'int' range.
2850 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2851 (multibyte_chars_in_text, parse_str_as_multibyte)
2852 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2853 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2854 (string_escape_byte8, Fget_byte):
2855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2856 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2857 avoid mishandling large integers.
2858 * character.h: Adjust decls to match defn changes elsewhere.
2859 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2860 (Ffind_charset_region):
2861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2862 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2863 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2864 Don't assume fixnum fits in int.
d311d28c
PE
2865 (load_charset_map_from_vector, Fmap_charset_chars):
2866 Remove now-unnecessary CHECK_NATNUMs.
2867 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2868 Don't rely on undefined behavior with signed left shift overflow.
2869 Don't assume unsigned int fits into fixnum, or that fixnum fits
2870 into unsigned int. Don't require max_code to be a valid fixnum;
2871 that's not true for gb10830 4-byte on a 32-bit host. Allow
2872 invalid_code to be a cons, for the same reason. Require code_offset
2873 to be a character. Avoid int overflow if max_char is close
2874 to INT_MAX.
2875 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2876 this is intended anyway and avoids some undefined behavior.
2877 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2878 INDEX_TO_CODE_POINT, as that's what it expects.
2879 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2880 * charset.h (DECODE_CHAR): Return int, not unsigned;
2881 this is what was intended anyway, and it avoids undefined behavior.
2882 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2883 integer-overflow issues.
2884 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2885 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2886 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2887 * chartab.c (Fmake_char_table, Fset_char_table_range)
2888 (uniprop_get_decoder, uniprop_get_encoder):
2889 Don't assume fixnum fits in int.
2890 * cmds.c (move_point): New function, that does the gist of
2891 Fforward_char and Fbackward_char, but does so while checking
2892 for integer overflow more accurately.
c96e5d6a 2893 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2894 (Fforward_line, Fend_of_line, internal_self_insert)
2895 (internal_self_insert):
2896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2897 Fix a FIXME, by checking for integer overflow when calculating
2898 target_clm and actual_clm.
2899 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2900 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2901 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2902 (coding_alloc_by_making_gap, alloc_destination)
2903 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2904 (encode_coding_utf_16, detect_coding_emacs_mule)
2905 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2906 (detect_coding_iso_2022, decode_coding_iso_2022)
2907 (encode_invocation_designation, encode_designation_at_bol)
2908 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2909 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2910 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2911 (encode_coding_ccl, encode_coding_raw_text)
2912 (detect_coding_charset, decode_coding_charset)
2913 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2914 (produce_composition, produce_charset, produce_annotation)
2915 (decode_coding, handle_composition_annotation)
2916 (handle_charset_annotation, consume_chars, decode_coding_gap)
2917 (decode_coding_object, encode_coding_object, detect_coding_system)
2918 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2919 (code_convert_region, code_convert_string)
8f50130c
PE
2920 (Fdefine_coding_system_internal)
2921 (coding_set_source, coding_set_destination):
d311d28c
PE
2922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2923 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2924 (Fdefine_coding_system_internal):
2925 Don't assume fixnums fit in int.
2926 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2927 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2928 (Funencodable_char_position, Fcheck_coding_systems_region)
2929 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2931 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2932 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2933 Don't access memory outside of the args array.
d311d28c 2934 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2935 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2936 result of ENCODE_CHAR.
d311d28c
PE
2937 * coding.h: Adjust decls to match defn changes elsewhere.
2938 (struct coding_system):
2939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2940 * composite.c (get_composition_id, find_composition)
2941 (run_composition_function, update_compositions)
2942 (compose_text, composition_gstring_put_cache)
2943 (composition_gstring_p, composition_gstring_width)
2944 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2945 (composition_compute_stop_pos, composition_reseat_it)
2946 (composition_update_it, struct position_record)
2947 (find_automatic_composition, composition_adjust_point)
2948 (Fcomposition_get_gstring, Ffind_composition_internal):
2949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2950 (update_compositions):
2951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2952 * composite.h: Adjust decls to match defn changes elsewhere.
2953 (struct composition):
2954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2955 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2956 Do not attempt to compute the address of the object just before a
2957 buffer; this is not portable.
2958 (Faref, Faset):
2959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2960 (Faset): Use int, not EMACS_INT, where int is wide enough.
2961 (Fstring_to_number): Don't assume fixnums fit in int.
2962 (Frem): Don't assume arg is nonnegative.
2963 * dbusbind.c (xd_append_arg): Check for integers out of range.
2964 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2965 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2966 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2967 (xd_get_connection_references): Return ptrdiff_t, not int.
2968 All uses changed.
2969 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2970 (xd_read_message_1):
2971 Use int, not unsigned, where the dbus API uses int.
2972 (Fdbus_message_internal): Don't overflow mtype.
2973 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2974 * dired.c (directory_files_internal, file_name_completion, scmp)
2975 (file_name_completion_stat):
2976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2977 (file_name_completion): Don't overflow matchcount.
2978 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2979 * dispextern.h: Adjust decls to match defn changes elsewhere.
2980 (struct text_pos, struct glyph, struct bidi_saved_info)
2981 (struct bidi_string_data, struct bidi_it, struct composition_it)
2982 (struct it):
2983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2984 (struct display_pos, struct composition_it, struct it):
2985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2986 * dispnew.c (increment_matrix_positions)
2987 (increment_row_positions, mode_line_string)
2988 (marginal_area_string):
2989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2990 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2992 (duration_to_sec_usec): New function, to check for overflow better.
2993 (Fsleep_for, sit_for): Use it.
2994 * doc.c (get_doc_string, store_function_docstring):
2995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2996 (get_doc_string, Fsnarf_documentation):
2997 Use int, not EMACS_INT, where int is wide enough.
2998 (get_doc_string):
2999 Use SAFE_ALLOCA, not alloca.
3000 Check for overflow when converting EMACS_INT to off_t.
3001 * doprnt.c (doprnt):
3002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3003 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
3004 Don't assume uid_t fits into fixnum.
3005 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
3006 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
3007 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
3008 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
3009 (general_insert_function)
3010 (Finsert_char, make_buffer_string, make_buffer_string_both)
3011 (update_buffer_properties, Fbuffer_substring)
3012 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
3013 (Fsubst_char_in_region, check_translation)
3014 (Ftranslate_region_internal, save_restriction_restore, Fformat)
3015 (transpose_markers, Ftranspose_regions):
3016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3017 (clip_to_bounds): Move to lisp.h as an inline function).
3018 (Fconstrain_to_field): Don't assume integers are nonnegative.
3019 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
3020 (Fsubst_char_in_region, Fsave_restriction):
3021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3022 (Femacs_pid): Don't assume pid_t fits into fixnum.
3023 (lo_time): Use int, not EMACS_INT, when int suffices.
3024 (lisp_time_argument): Check for usec out of range.
3025 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
3026 (Fuser_login_name, Fuser_full_name): Signal an error
3027 if a uid argument is out of range, rather than relying on
3028 undefined behavior.
c8d5c857
PE
3029 (Fformat_time_string): Remove now-unnecessary check.
3030 lisp_time_argument checks for out-of-range usec now.
243e0530 3031 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
3032 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
3033 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
3034 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
3035 (init_cmdargs, Fdump_emacs):
3036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3037 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
3038 the bottom (typically) 32 bits of the fixnum.
3039 * eval.c (specpdl_size, call_debugger):
3040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3041 (when_entered_debugger, Fbacktrace_debug):
3042 Don't assume fixnum can fit in int.
3043 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
3044 the object just before a buffer; this is not portable.
3045 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
3046 (grow_specpdl, unbind_to):
3047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3048 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
3049 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 3050 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
3051 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
3052 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
3053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3054 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
3055 (a_write, e_write):
3056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3057 (Fcopy_file, non_regular_nbytes, read_non_regular)
3058 (Finsert_file_contents):
3059 Use int, not EMACS_INT, where int is wide enough.
3060 (READ_BUF_SIZE): Verify that it fits in int.
3061 (Finsert_file_contents): Check that counts are in proper range,
3062 rather than assuming fixnums fit into ptrdiff_t etc.
3063 Don't assume fixnums fit into int.
125b3835 3064 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
3065 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
3066 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
3067 (string_char_to_byte, string_byte_to_char)
3068 (string_make_multibyte, string_to_multibyte)
3069 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
3070 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
3071 (substring_both, Fdelete, internal_equal, Ffillarray)
3072 (Fclear_string, mapcar1)
3073 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
3074 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
3075 (larger_vector, make_hash_table, maybe_resize_hash_table)
3076 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
3077 (Fmaphash, secure_hash):
3078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3079 (concat): Check for string index and length overflow.
3080 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
3081 (Frequire):
3082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3083 (larger_vector): New API (vec, incr_min, size_max) replaces old
3084 one (vec, new_size, init). This catches size overflow.
3085 INIT was removed because it was always Qnil.
3086 All callers changed.
3087 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
3088 the upper bound on a hash table index size.
3089 (make_hash_table, maybe_resize_hash_table): Use it.
3090 (secure_hash): Computer start_byte and end_byte only after
3091 they're known to be in ptrdiff_t range.
3092 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
3093 (Ffont_get_glyphs, Ffont_at):
3094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3095 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
3096 (Flist_fonts, Fopen_font):
3097 Don't assume fixnum can fit in int.
3098 (check_gstring): Don't assume index can fit in int.
3099 (font_match_p): Check that fixnum is a character, not a nonnegative
3100 fixnum, since the later code needs to stuff it into an int.
3101 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
3102 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
3103 conversion overflow issues.
3104 (Fopen_font): Check for integer out of range.
3105 (Ffont_get_glyphs): Don't assume index can fit in int.
3106 * font.h: Adjust decls to match defn changes elsewhere.
3107 * fontset.c (reorder_font_vector): Redo score calculation to avoid
3108 integer overflow.
3109 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
3110 printmax_t, where ptrdiff_t is wide enough.
3111 (Finternal_char_font):
3112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3113 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
3114 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
3115 (Fset_frame_position, x_set_frame_parameters)
3116 (x_set_line_spacing, x_set_border_width)
3117 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
3118 Check that fixnums are in proper range for system types.
3119 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
3120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3121 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
3122 Use SAFE_ALLOCA_LISP, not alloca.
3123 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
3124 intptr_t is wide enough.
3125 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
3126 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
3127 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
3128 Check for fixnum out of range.
3129 * ftfont.c (ftfont_list): Don't assume index fits in int.
3130 Check that fixnums are in proper range for system types.
3131 (ftfont_shape_by_flt):
3132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
3133 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3135 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
3136 Check that fixnums are in proper range for system types.
3137 * gnutls.h: Adjust decls to match defn changes elsewhere.
3138 * gtkutil.c (xg_dialog_run):
3139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3140 (update_frame_tool_bar):
3141 Check that fixnums are in proper range for system types.
3142 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 3143 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
3144 * indent.c (last_known_column, last_known_column_point):
3145 (current_column_bol_cache):
3146 (skip_invisible, current_column, check_display_width):
3147 (check_display_width, scan_for_column, current_column_1)
3148 (Findent_to, Fcurrent_indentation, position_indentation)
3149 (indented_beyond_p, Fmove_to_column, compute_motion):
3150 (Fcompute_motion, Fvertical_motion):
3151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3152 (last_known_column_modified): Use EMACS_INT, not int.
3153 (check_display_width):
3154 (Fcompute_motion):
3155 Check that fixnums and floats are in proper range for system types.
3156 (compute_motion): Don't assume index or fixnum fits in int.
3157 (compute_motion, Fcompute_motion):
3158 Use int, not EMACS_INT, when it is wide enough.
3159 (vmotion): Omit local var start_hpos that is always 0; that way
3160 we don't need to worry about overflow in expressions involving it.
3161 * indent.h: Adjust decls to match defn changes elsewhere.
3162 (struct position):
3163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3164 Use int, not EMACS_INT, where int is wide enough.
3165 Remove unused members ovstring_chars_done and tab_offset;
3166 all uses removed.
3167 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
3168 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
3169 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
3170 (make_gap, copy_text, insert, insert_and_inherit)
3171 (insert_before_markers, insert_before_markers_and_inherit)
3172 (insert_1, count_combining_before, count_combining_after)
3173 (insert_1_both, insert_from_string)
3174 (insert_from_string_before_markers, insert_from_string_1)
3175 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
3176 (adjust_after_replace, adjust_after_insert, replace_range)
3177 (replace_range_2, del_range, del_range_1, del_range_byte)
3178 (del_range_both, del_range_2, modify_region)
3179 (prepare_to_modify_buffer, signal_before_change)
3180 (signal_after_change, Fcombine_after_change_execute):
3181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3182 * intervals.c (traverse_intervals, rotate_right, rotate_left)
3183 (balance_an_interval, split_interval_right, split_interval_left)
3184 (find_interval, next_interval, update_interval)
3185 (adjust_intervals_for_insertion, delete_node, delete_interval)
3186 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3187 (static_offset_intervals, offset_intervals)
3188 (merge_interval_right, merge_interval_left, make_new_interval)
3189 (graft_intervals_into_buffer, temp_set_point_both)
3190 (temp_set_point, set_point, adjust_for_invis_intang)
3191 (set_point_both, move_if_not_intangible, get_property_and_range)
3192 (get_local_map, copy_intervals, copy_intervals_to_string)
3193 (compare_string_intervals, set_intervals_multibyte_1):
3194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3195 * intervals.h: Adjust decls to match defn changes elsewhere.
3196 (struct interval):
3197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3198 * keyboard.c (this_command_key_count, this_single_command_key_start)
3199 (before_command_key_count, before_command_echo_length, echo_now)
3200 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
3201 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
3202 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
3203 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
3204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3205 (last_non_minibuf_size, last_point_position, echo_truncate)
3206 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
3207 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
3208 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
3209 (stuff_buffered_input):
3210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3211 (last_auto_save, command_loop_1, read_char):
3212 Use EMACS_INT, not int, to avoid integer overflow.
3213 (record_char): Avoid overflow in total_keys computation.
3214 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
3215 * keyboard.h: Adjust decls to match defn changes elsewhere.
3216 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
3217 (Fkey_description, Fdescribe_vector, Flookup_key):
3218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3219 (click_position): New function, to check that positions are in range.
3220 (Fcurrent_active_maps):
3221 (describe_command):
3222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3223 (Faccessible_keymaps, Fkey_description):
3224 (preferred_sequence_p):
3225 Don't assume fixnum can fit into int.
3226 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
3227 Check for integer overflow in size calculations.
3228 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
3229 avoid mishandling large integers.
3230 * lisp.h: Adjust decls to match defn changes elsewhere.
3231 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
3232 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
3233 (struct Lisp_Marker):
3234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3235 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
3236 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
3237 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
3238 All callers changed.
3239 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
3240 Assume the arg has valid form, since it always does.
3241 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
3242 unsigned integer system type.
3243 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
3244 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
3245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3246 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
3247 (duration_to_sec_usec): New decl.
3248 * lread.c (read_from_string_index, read_from_string_index_byte)
3249 (read_from_string_limit, readchar, unreadchar, openp)
3250 (read_internal_start, read1, oblookup):
3251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3252 (Fload, readevalloop, Feval_buffer, Feval_region):
3253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3254 (openp): Check for out-of-range argument to 'access'.
3255 (read1): Use int, not EMACS_INT, where int is wide enough.
3256 Don't assume fixnum fits into int.
6efdadfd 3257 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
3258 (read_filtered_event): Use duration_to_sec_usec
3259 to do proper overflow checking on durations.
d311d28c
PE
3260 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
3261 in size calculation.
3262 (Fexecute_kbd_macro):
3263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3264 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
3265 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
3266 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
3267 (set_marker_both, set_marker_restricted_both, marker_position)
3268 (marker_byte_position, Fbuffer_has_markers_at):
3269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3270 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 3271 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
3272 It now merely ensures that the menu is large enough, without
3273 necessarily growing it, as this avoids some integer overflow issues.
3274 All callers changed.
3275 (keymap_panes, parse_single_submenu, Fx_popup_menu):
3276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3277 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
3278 Use SAFE_ALLOCA_LISP, not alloca.
3279 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
3280 to EMACS_INT. Check that fixnums are in proper range for system types.
3281 * minibuf.c (minibuf_prompt_width, string_to_object)
3282 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
3283 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
3284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3285 (get_minibuffer, read_minibuf_unwind):
3286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3287 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
3288 this simplifies overflow checking. All callers changed.
3289 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
3290 (Ftest_completion):
3291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3292 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
3293 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
3294 Check that fixnums are in proper range for system types.
3295 (Fx_create_frame, Fx_show_tip):
3296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3297 * nsfont.m (ns_findfonts, nsfont_list_family):
3298 Don't assume fixnum fits in long.
3299 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3301 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3302 wide enough.
17fdb222 3303 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
3304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3305 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3306 (PRINTDECLARE, PRINTPREPARE):
3307 (strout, print_string):
3308 (print, print_preprocess, print_check_string_charset_prop)
3309 (print_object):
3310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3311 (PRINTDECLARE):
3312 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3314 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 3315 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 3316 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
3317 (print_error_message): Use SAFE_ALLOCA, not alloca.
3318 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
3319 (print_depth, new_backquote_output, print_number_index):
3320 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
3321 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3322 (Fset_process_window_size, Fformat_network_address)
3323 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 3324 (sigchld_handler):
d311d28c 3325 Check that fixnums are in proper range for system types.
d44287d4 3326 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
3327 Check for process-ids out of pid_t range rather than relying on
3328 undefined behavior.
e4d81efc 3329 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
3330 (Fformat_network_address, read_process_output, send_process)
3331 (Fprocess_send_region, status_notify):
3332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3333 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3334 (wait_reading_process_output, read_process_output, exec_sentinel):
3335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3336 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3337 (Faccept_process_output): Use duration_to_sec_usec to do proper
3338 overflow checking on durations.
dde14581
PE
3339 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3340 Don't assume pid_t fits in int.
02481186
PE
3341 * process.h (struct Lisp_Process): Members tick and update_tick
3342 are now of type EMACS_INT, not int.
b62b53e8
PE
3343 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3344 configured --with-wide-int.
d311d28c
PE
3345 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3346 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3347 * search.c (looking_at_1, string_match_1):
3348 (fast_string_match, fast_c_string_match_ignore_case)
3349 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3350 (scan_newline, find_before_next_newline, search_command)
3351 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3352 (set_search_regs, wordify):
3353 (Freplace_match):
3354 (Fmatch_data):
3355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3356 (string_match_1, search_buffer, set_search_regs):
3357 (Fmatch_data):
3358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3359 (wordify): Check for overflow in size calculation.
3360 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3361 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3362 Check that fixnums are in proper range for system types.
3363 * sound.c (struct sound_device)
3364 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3366 (Fplay_sound_internal):
3367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 3368 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
3369 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3370 (Fparse_partial_sexp):
3371 Don't assume fixnums can fit in int.
3372 (struct lisp_parse_state, find_start_pos, find_start_value)
3373 (find_start_value_byte, find_start_begv)
3374 (update_syntax_table, char_quoted, dec_bytepos)
3375 (find_defun_start, prev_char_comend_first, back_comment):
3376 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3377 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3379 (Finternal_describe_syntax_value): Check that match_lisp is a
3380 character, not an integer, since the code stuffs it into int.
3381 (scan_words, scan_sexps_forward):
3382 Check that fixnums are in proper range for system types.
3383 (Fforward_word):
3384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3385 (scan_sexps_forward):
3386 Use CHARACTERP, not INTEGERP, since the value must fit into int.
3387 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3388 * syntax.h: Adjust decls to match defn changes elsewhere.
3389 (struct gl_state_s):
3390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3391 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3392 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3393 * sysdep.c (wait_for_termination_1, wait_for_termination)
3394 (interruptible_wait_for_termination, mkdir):
3395 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3396 (emacs_read, emacs_write):
3397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3398 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3399 and double all fit in int.
d311d28c
PE
3400 * term.c (set_tty_color_mode):
3401 Check that fixnums are in proper range for system types.
3402 * termhooks.h (struct input_event):
3403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3404 * textprop.c (validate_interval_range, interval_of)
3405 (Fadd_text_properties, set_text_properties_1)
3406 (Fremove_text_properties, Fremove_list_of_text_properties)
3407 (Ftext_property_any, Ftext_property_not_all)
3408 (copy_text_properties, text_property_list, extend_property_ranges)
3409 (verify_interval_modification):
3410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3411 (Fnext_single_char_property_change)
3412 (Fprevious_single_char_property_change):
3413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3414 (copy_text_properties):
3415 Check for integer overflow in index calculation.
d311d28c
PE
3416 * undo.c (last_boundary_position, record_point, record_insert)
3417 (record_delete, record_marker_adjustment, record_change)
3418 (record_property_change):
3419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3420 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3422 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3423 (Fx_hide_tip, Fx_file_dialog):
3424 * w32menu.c (set_frame_menubar):
3425 Use ptrdiff_t, not int, for consistency with rest of code.
3426 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3427 (select_window, Fdelete_other_windows_internal)
3428 (window_scroll_pixel_based, window_scroll_line_based)
3429 (Frecenter, Fset_window_configuration):
3430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3431 (Fset_window_hscroll, run_window_configuration_change_hook)
3432 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3433 (Fscroll_other_window, Frecenter):
d311d28c
PE
3434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3435 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3436 Don't assume fixnum fits in int.
3437 (Fset_window_scroll_bars):
3438 Check that fixnums are in proper range for system types.
3439 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3440 (string_pos, c_string_pos, number_of_chars, init_iterator)
3441 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3442 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3443 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3444 (face_before_or_after_it_pos, handle_invisible_prop)
3445 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3446 (display_prop_intangible_p, string_buffer_position_lim)
3447 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3448 (get_overlay_strings_1, get_overlay_strings)
3449 (iterate_out_of_display_property, forward_to_next_line_start)
3450 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3451 (get_next_display_element, set_iterator_to_next)
3452 (get_visually_first_element, compute_stop_pos_backwards)
3453 (handle_stop_backwards, next_element_from_buffer)
3454 (move_it_in_display_line_to, move_it_in_display_line)
3455 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3456 (add_to_log, message_dolog, message_log_check_duplicate)
3457 (message2, message2_nolog, message3, message3_nolog
3458 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3459 (current_message_1, truncate_echo_area, truncate_message_1)
3460 (set_message, set_message_1, store_mode_line_noprop)
3461 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3462 (text_outside_line_unchanged_p, check_point_in_composition)
3463 (reconsider_clip_changes)
3464 (redisplay_internal, set_cursor_from_row, try_scrolling)
3465 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3466 (redisplay_window, find_last_unchanged_at_beg_row)
3467 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3468 (trailing_whitespace_p, find_row_edges, display_line)
3469 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3470 (display_mode_element, store_mode_line_string)
3471 (pint2str, pint2hrstr, decode_mode_spec)
3472 (display_count_lines, display_string, draw_glyphs)
3473 (x_produce_glyphs, x_insert_glyphs)
3474 (rows_from_pos_range, mouse_face_from_buffer_pos)
3475 (fast_find_string_pos, mouse_face_from_string_pos)
3476 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3478 (safe_call, init_from_display_pos, handle_fontified_prop)
3479 (handle_single_display_spec, load_overlay_strings)
3480 (with_echo_area_buffer, setup_echo_area_for_printing)
3481 (display_echo_area, echo_area_display)
3482 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3483 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3484 (redisplay_window, dump_glyph_row, display_mode_line)
3485 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3486 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3488 (handle_single_display_spec, build_desired_tool_bar_string)
3489 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3490 (get_specified_cursor_type):
3491 Check that fixnums are in proper range for system types.
3492 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3493 (Flookup_image_map):
3494 Don't assume fixnums fit in int.
3495 (compare_overlay_entries):
3496 Avoid mishandling comparisons due to subtraction overflow.
3497 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3498 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3499 (handle_tool_bar_click):
3500 Use int, not unsigned, since we prefer signed and the signedness
3501 doesn't matter here.
3502 (get_next_display_element, next_element_from_display_vector):
3503 Use int, not EMACS_INT, when int is wide enough.
3504 (start_hourglass): Use duration_to_sec_usec to do proper
3505 overflow checking on durations.
3506 * xfaces.c (Fbitmap_spec_p):
3507 Check that fixnums are in proper range for system types.
3508 (compare_fonts_by_sort_order):
3509 Avoid mishandling comparisons due to subtraction overflow.
3510 (Fx_family_fonts, realize_basic_faces):
3511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3512 (Fx_family_fonts):
3513 Don't assume fixnum fits in int.
3514 Use SAFE_ALLOCA_LISP, not alloca.
3515 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3516 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3517 (face_at_buffer_position, face_for_overlay_string)
3518 (face_at_string_position):
3519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3520 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3521 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3522 (Fx_show_tip):
3523 Check that fixnums are in proper range for system types.
3524 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3525 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3527 (Fx_change_window_property): Don't assume fixnums fit in int.
3528 * xfont.c (xfont_chars_supported):
3529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3530 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3531 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3533 * xml.c (parse_region):
3534 * xrdb.c (magic_file_p):
3535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3536 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3537 (x_get_local_selection, x_reply_selection_request)
3538 (x_handle_selection_request, wait_for_property_change):
3539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3540 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3541 short is wide enough.
3542 (x_send_client_event): Don't assume fixnum fits in int.
3543 * xterm.c (x_x_to_emacs_modifiers):
3544 Don't assume EMACS_INT overflows nicely into int.
3545 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3546 may come from Lisp.
3547 (handle_one_xevent): NATNUMP can eval its arg twice.
3548 (x_connection_closed):
3549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3550 * xterm.h: Adjust decls to match defn changes elsewhere.
3551 (struct scroll_bar): Use struct vectorlike_header
3552 rather than rolling our own approximation.
3553 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3554
c6574eb5
GM
35552012-05-25 Glenn Morris <rgm@gnu.org>
3556
3557 * lisp.mk (lisp): Update for more files being compiled now.
3558
e8d32c7e
SM
35592012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3560
48def666
SM
3561 * lread.c: Remove `read_pure' which makes no difference.
3562 (read_pure): Remove var.
3563 (unreadpure): Remove function.
3564 (readevalloop): Don't call read_list with -1 flag.
3565 (read1, read_vector): Don't test read_pure any more.
3566 (read_list): Simplify.
3567
e8d32c7e
SM
3568 * fileio.c, character.h: Minor style tweaks.
3569
4b2addb7
DA
35702012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3571
3572 * window.h (clip_changed): Remove useless declaration.
3573
584461b2
JB
35742012-05-22 Juanma Barranquero <lekktu@gmail.com>
3575
3576 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3577 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3578
34374650
PE
35792012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3580
3581 Remove src/m/*.
3582 This directory predates autoconf and is no longer needed nowadays.
3583 Move its few remaining bits of functionality to where they're needed.
3584 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3585 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3586 * m/template.h: Remove.
3587 * Makefile.in (M_FILE): Remove. All uses removed.
3588 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3589 * lisp.h (USE_LSB_TAG):
3590 * mem-limits.h (EXCEEDS_LISP_PTR):
3591 Use VAL_MAX, not VALBITS, in #if.
3592 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3593 (EMACS_UINT): Define unconditionally now.
3594 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3595 (BITS_PER_EMACS_INT): New constants, replacing
3596 what used to be in config.h, but not useful in #if.
3597 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3598 define them any more.
3599 (VAL_MAX): New macro.
3600 (VALMASK): Use it.
3601 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3602 BITS_PER_EMACS_INT, in #if.
3603 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3604 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3605 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3606 * s/ms-w32.h (DATA_START):
3607 Move here from removed file m/intel386.h.
3608 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3609 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3610
261cb4bb
PE
36112012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3612
3613 Assume C89 or later.
3614 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3615 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3616 (xrealloc):
3617 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3618 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3619 * textprop.c, tparam.c (NULL): Remove.
3620 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3621 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3622 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3623 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3624 * xterm.c (input_signal_count): Assume volatile works.
3625
ff23cd9f
KB
36262012-05-21 Ken Brown <kbrown@cornell.edu>
3627
3628 * xgselect.c (xg_select): Fix first argument in call to 'select'
3629 (bug#11508).
3630
1b170bc6
KB
36312012-05-20 Ken Brown <kbrown@cornell.edu>
3632
3633 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3634 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3635
b2f4d39f
KB
36362012-05-19 Ken Brown <kbrown@cornell.edu>
3637
3638 * xfns.c (x_in_use): Remove `static' qualifier.
3639 * xterm.h (x_in_use): Declare.
3640 * xgselect.c: Include xterm.h.
3641 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3642 and `display_arg' (bug#9754).
3643
003fdae2
PE
36442012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3645
9232a6d9
PE
3646 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3647
003fdae2
PE
3648 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3649 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3650
784b56e2
EZ
36512012-05-18 Eli Zaretskii <eliz@gnu.org>
3652
3653 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3654
3655 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3656 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3657
3658 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3659 reference to image_cache->refcount.
3660 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3661
a0a79cde
JL
36622012-05-17 Juri Linkov <juri@jurta.org>
3663
3664 * search.c (Fword_search_regexp, Fword_search_backward)
3665 (Fword_search_forward, Fword_search_backward_lax)
3666 (Fword_search_forward_lax): Move functions to isearch.el
3667 (bug#10145, bug#11381).
3668
b0572523
PE
36692012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3670
3671 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3672
9660f5fc
SM
36732012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3674
3675 * lread.c (init_obarray): Declare Qt and Qnil as special.
3676
4374de83
GM
36772012-05-14 Glenn Morris <rgm@gnu.org>
3678
3679 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3680 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3681
dc44c39a
PE
36822012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3683
078c97cb
PE
3684 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3685
dc44c39a
PE
3686 * unexaix.c: Port to more-recent AIX compilers.
3687 (report_error, report_error_1, make_hdr, copy_sym)
3688 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3689 Make arguments const char *, not char *, to avoid violations of C
3690 standard and to fix some AIX warnings reported by Gilles Pion.
3691
e18afed7 36922012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3693
3694 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3695 already have overlays loaded.
3696 (handle_single_display_spec): Before returning without displaying
3697 fringe bitmap, synchronize the bidi iterator with the main display
3698 iterator, by calling iterate_out_of_display_property.
3699 (iterate_out_of_display_property): Detect buffer iteration by
3700 testing that it->string is a Lisp string.
3701 (get_next_display_element): When the current object is exhausted,
3702 and there's something on it->stack, call set_iterator_to_next to
3703 proceed with what's on the stack, instead of returning zero.
3704 (set_iterator_to_next): If called at the end of a Lisp string,
3705 proceed to consider_string_end without incrementing string
3706 position. Don't increment display vector index past the end of
3707 the display vector. (Bug#11417)
c8fb9dc6
EZ
3708 (pos_visible_p): Don't report a position visible when move_it_to
3709 stopped at the last line of window, which happens to be scanned
3710 backwards by the bidi iteration. (Bug#11464)
ac268e67 3711
e18afed7 37122012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3713
3714 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3715 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3716 are on a TTY, and thus unable to display on the fringes.
3717 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3718 so we need to signal to the caller that this is a "replacing"
3719 display spec. This fixes display when the spec is invalid or we
3720 are on a TTY.
3721
e18afed7 37222012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3723
3724 * unexaix.c (make_hdr): Fix typo in prototype.
3725 This bug broke the build on AIX. Problem reported by Gilles Pion.
3726
9d0a235a
MA
37272012-05-14 Michael Albinus <michael.albinus@gmx.de>
3728
3729 * keyboard.c (kbd_buffer_get_event): Read special events also in
3730 batch mode. (Bug#11415)
3731
9e6b06ed
GM
37322012-05-12 Glenn Morris <rgm@gnu.org>
3733
3734 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3735
c1a1d7a3
EZ
37362012-05-12 Eli Zaretskii <eliz@gnu.org>
3737
3738 * lisp.mk (lisp): Add newcomment.elc.
3739
3fe7cdc8
GM
37402012-05-12 Glenn Morris <rgm@gnu.org>
3741
3742 * Makefile.in (MKDIR_P): New, set by configure.
3743 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3744
53f7d2c0
PE
37452012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3746
3747 Remove unused function hourglass_started.
3748 * dispextern.h (hourglass_started):
3749 * w32fns.c (hourglass_started):
3750 * xdisp.c (hourglass_started): Remove.
3751
75aafb17
JB
37522012-05-10 Juanma Barranquero <lekktu@gmail.com>
3753
3754 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3755 Update dependencies.
3756
12959e8e
PE
37572012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3758
97107e2e
PE
3759 * xgselect.c (xg_select): Put maxfds+1 into a var.
3760 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3761
12959e8e
PE
3762 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3763
836d29b3
DA
37642012-05-10 Dave Abrahams <dave@boostpro.com>
3765
3766 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3767 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3768
5cb67954
MA
37692012-05-09 Michael Albinus <michael.albinus@gmx.de>
3770
3771 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3772 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3773 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3774 Initialize xd_registered_buses.
3775
3478ec45
PE
37762012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3777
b263a6b0
PE
3778 Untag more efficiently if USE_LSB_TAG.
3779 This is based on a proposal by YAMAMOTO Mitsuharu in
3780 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3781 For an admittedly artificial (nth 8000 longlist) benchmark on
3782 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3783 Emacs's overall text size by 1%.
3784 * lisp.h (XUNTAG): New macro.
3785 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3786 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3787 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3788 * eval.c (Fautoload):
3789 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3790 * frame.h (XFRAME): Use XUNTAG.
3791
3478ec45
PE
3792 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3793 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3794 Remove unportable assumptions about print widths of types like
3795 dbus_uint32_t.
3796 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3797 intptr_t when converting between pointer and integer, to avoid GCC
3798 warnings about wrong width.
3799
666b903b 38002012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3801
3802 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3803 stack for each reader_thread, instead of defaulting to 8MB
3804 determined by the linker. This avoids failures in creating
3805 subprocesses on Windows 7, see the discussion in this thread:
3806 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3807
b120cc17
JC
38082012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3809
3810 Fix up display of the *Minibuf-0* buffer in the mini window.
3811 * keyboard.c (read_char): Don't clear the echo area if there's no
3812 message to clear.
3813 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3814 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3815
9a4b36f8
MA
38162012-05-07 Michael Albinus <michael.albinus@gmx.de>
3817
3818 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3819 batch mode.
3820
e5f9458f
CY
38212012-05-06 Chong Yidong <cyd@gnu.org>
3822
3823 * lisp.mk (lisp): Update.
3824
eceeb5fc 38252012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3826
3827 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3828
71873e2b
SM
38292012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3830
3831 * data.c (PUT_ERROR): New macro.
3832 (syms_of_data): Use it. Add new error type `user-error'.
3833 * undo.c (user_error): New function.
3834 (Fprimitive_undo): Use it.
3835 * print.c (print_error_message): Adjust print style for `user-error'.
3836 * keyboard.c (user_error): New function.
3837 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3838
ab0fa4e4
PE
38392012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3840
3841 Do not limit current-time-string to years 1000..9999.
3842 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3843 (Fcurrent_time_string): Support any year that is supported by the
3844 underlying localtime representation. Don't use asctime, as it
3845 has undefined behavior for years outside the range -999..9999.
3846
7ed806a7
PE
38472012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 Fix race conditions involving setenv, gmtime, localtime, asctime.
3850 Without this fix, interrupts could mess up code that uses these
3851 nonreentrant functions, since setting TZ invalidates existing
3852 tm_zone or tzname values, and since most of these functions return
3853 pointers to static storage.
3854 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3855 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3856 Grow the critical sections to include not just invoking
3857 localtime/gmtime, but also accessing these functions' results
3858 including their tm_zone values if any, and any related TZ setting.
3859 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3860 so that the struct tm is saved in the critical section.
3861 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3862 motivated by the fact that memory allocation needs to be outside
3863 the critical section.
3864
0c16dfed
DA
38652012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3866
3867 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3868 with RESET_INTERVAL.
3869
3870 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3871 Remove duplicated buffer name initialization.
3872
3f83ace8
JM
38732012-05-02 Jim Meyering <jim@meyering.net>
3874
3875 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3876
c7b8541e
JM
3877 * xfns.c (x_window): Use xstrdup (Bug#11375).
3878
90207a15 38792012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3880
3881 * xdisp.c (pos_visible_p): If already at a newline from the
3882 display string before the 'while' loop, don't walk back the glyphs
3883 from it3.glyph_row. Solves assertion violation when the display
3884 string begins with a newline (egg.el). (Bug#11367)
3885
b593d6a9
AH
38862012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3887
3888 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3889 Move to simple.el.
3890
4737362e
GM
38912012-05-01 Glenn Morris <rgm@gnu.org>
3892
99cf43f9
GM
3893 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3894 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3895 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3896 All were removed before 23.1.
3897
9311dcff
GM
3898 * dispnew.c: Remove HAVE_LIBNCURSES test;
3899 it is always true on relevant platforms.
3900
4d5c6349
GM
3901 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3902 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3903
4737362e
GM
3904 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3905
74dd3a6b
AS
39062012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3907
3908 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3909 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3910 Remove.
3911
13c379ee
PE
39122012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3913
3914 Do not avoid creating empty evaporating overlays (Bug#9642).
3915 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3916 That is, do not delete an evaporating overlay if it becomes
3917 empty after its bounds are adjusted to fit within its buffer.
3918 This fix caused other problems, and I'm reverting it until we get
3919 to the bottom of them.
3920
a8e7d6d7 39212012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3922
3923 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3924
a8e7d6d7 39252012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3926
3927 * xdisp.c (pos_visible_p): If the window start position is beyond
3928 ZV, start the display from buffer beginning. Prevents assertion
3929 violation in init_iterator when the minibuffer window is scrolled
3930 via the scroll bar.
3931
3932 * window.c (window_scroll_pixel_based): Likewise.
3933
a8e7d6d7 39342012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3935
3936 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3937
a8e7d6d7 39382012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3939
3940 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3941 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3942
a8e7d6d7 39432012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3944
b593d6a9
AH
3945 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3946 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3947
1c6900d9
EZ
39482012-04-26 Eli Zaretskii <eliz@gnu.org>
3949
4c3fa1d9
EZ
3950 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3951 display element, check also the underlying string or buffer
3952 character. (Bug#11341)
3953
1c6900d9
EZ
3954 * w32menu.c: Include w32heap.h.
3955 (add_menu_item): If the call to AppendMenuW (via
3956 unicode_append_menu) fails, disable Unicode menus only if we are
3957 running on Windows 9X/Me.
3958
42bf8205
AS
39592012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3960
3961 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3962 (xgetint): Add missing shift for LSB tags.
3963
b1bac16e
MR
39642012-04-24 Martin Rudalics <rudalics@gmx.at>
3965
3966 * keyboard.c (read_char): Don't wipe echo area for select window
3967 events: These might get delayed via `mouse-autoselect-window'
3968 (Bug#11304).
3969
d69621cc
JB
39702012-04-24 Juanma Barranquero <lekktu@gmail.com>
3971
3972 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3973 manipulation of :loaded-from data.
3974
02fd101b
JB
39752012-04-23 Juanma Barranquero <lekktu@gmail.com>
3976
3977 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3978 now a cons (bug#11311).
3979
888bec30
PE
39802012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3981
89a438bd
PE
3982 Do not create empty overlays with the evaporate property (Bug#9642).
3983 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3984 if it becomes empty after its bounds are adjusted to fit within
3985 its buffer. Without this fix, in a nonempty buffer (let ((o
3986 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3987 yields an empty overlay that has the evaporate property, which is
3988 not supposed to happen.
3989
1068fe4d
PE
3990 Fix minor GTK3 problems found by static checking.
3991 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3992 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3993 (struct _EmacsFixedClass, emacs_fixed_get_type):
3994 Move decls here from emacsgtkfixed.h, since they needn't be public.
3995 (emacs_fixed_get_type): Now static.
3996 (emacs_fixed_class_init): Omit unused local.
3997 (emacs_fixed_child_type): Remove; unused.
3998 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3999 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4000 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
4001 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
4002 (EMACS_FIXED_GET_CLASS): Remove; unused.
4003 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
4004
888bec30
PE
4005 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
4006 Problem reported by Juanma Barranquero for Windows -Wunused-function.
4007
de85e130
PE
40082012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4009
d0baac98 4010 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 4011 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
4012 (__malloc_size_t, __malloc_ptrdiff_t):
4013 Remove. All uses removed, replaced by the definiens if needed,
4014 since we can assume C89 or better now.
4015 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
4016 (protect_malloc_state, align, get_contiguous_space)
4017 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
4018 (malloc_atfork_handler_child, malloc_enable_thread)
4019 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
4020 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
4021 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
4022 (special_realloc, _realloc_internal_nolock, _realloc_internal)
4023 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
4024 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
4025 Define using prototypes, not old style.
4026 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
4027 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
4028 (align): Don't assume that signed integer overflow wraps around.
4029 Omit unused local var.
4030 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
4031 (_free_internal_nolock, memalign, mallochook, reallochook):
4032 Omit no-longer-needed casts.
4033 (valloc): Use getpagesize, not __getpagesize.
4034 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
4035 (struct hdr): The 'magic' member is now size_t, not unsigned long.
4036
de85e130
PE
4037 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
4038
dcbf5805
MA
40392012-04-22 Michael Albinus <michael.albinus@gmx.de>
4040
4041 Move functions from C to Lisp. Make non-blocking method calls
4042 the default. Implement further D-Bus standard interfaces.
4043
4044 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
4045 (QCdbus_request_name_allow_replacement)
4046 (QCdbus_request_name_replace_existing)
4047 (QCdbus_request_name_do_not_queue)
4048 (QCdbus_request_name_reply_primary_owner)
4049 (QCdbus_request_name_reply_in_queue)
4050 (QCdbus_request_name_reply_exists)
4051 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
4052 (QCdbus_registered_serial, QCdbus_registered_method)
4053 (QCdbus_registered_signal): New Lisp objects.
4054 (XD_DEBUG_MESSAGE): Use sizeof.
4055 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
4056 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
4057 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
4058 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
4059 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
4060 (xd_signature, xd_append_arg): Allow float for integer types.
4061 (xd_get_connection_references): New function.
b593d6a9
AH
4062 (xd_get_connection_address): Rename from xd_initialize.
4063 Return cached address.
dcbf5805
MA
4064 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
4065 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
4066 level.
4067 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 4068 Return number of refcounts.
dcbf5805
MA
4069 (Fdbus_get_unique_name): Make stronger parameter check.
4070 (Fdbus_message_internal): New defun.
4071 (Fdbus_call_method, Fdbus_call_method_asynchronously)
4072 (Fdbus_method_return_internal, Fdbus_method_error_internal)
4073 (Fdbus_send_signal, Fdbus_register_service)
4074 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
4075 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
4076 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
4077 (Vdbus_compiled_version, Vdbus_runtime_version)
4078 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
4079 (Vdbus_message_type_method_return, Vdbus_message_type_error)
4080 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
4081 (Vdbus_registered_buses, Vdbus_registered_objects_table):
4082 Adapt docstring.
dcbf5805 4083
52828e02
PE
40842012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4085
da05bc4c
PE
4086 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
4087 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
4088 Do not assume ptrdiff_t is the same width as 'int'.
4089
52828e02
PE
4090 * alloc.c: Handle unusual debugging option combinations.
4091 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
4092 since the two debugging options are incompatible.
4093 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
4094 is defined.
4095 (mem_init, mem_insert, mem_insert_fixup):
4096 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
4097 (NEED_MEM_INSERT): Remove; no longer needed.
4098
f01769f9
LL
40992012-04-22 Leo Liu <sdl.web@gmail.com>
4100
4101 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
4102
5790543d
PE
41032012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4104
4105 * sysdep.c [__FreeBSD__]: Minor cleanups.
4106 (list_system_processes, system_process_attributes) [__FreeBSD__]:
4107 Use Emacs indenting style more consistently. Avoid some casts.
4108 Use 'double' consistently rather than mixing 'float' and 'double'.
4109
b91b7e4d
EW
41102012-04-21 Eduard Wiebe <usenet@pusto.de>
4111
b593d6a9
AH
4112 * sysdep.c (list_system_processes, system_process_attributes):
4113 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 4114
6114eb15
AS
41152012-04-21 Andreas Schwab <schwab@linux-m68k.org>
4116
4117 * lisp.mk (lisp): Update.
4118
2f38dff7
PE
41192012-04-20 Paul Eggert <eggert@cs.ucla.edu>
4120
4121 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
4122 It is never used otherwise.
4123
4ae29f89
SM
41242012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
4125
4126 * print.c (print_preprocess): Only check print_depth if print-circle
4127 is nil.
4128 (print_object): Check for cycles even when print-circle is nil and
4129 print-gensym is t, but only check print_depth if print-circle is nil.
4130
f30d612a
CY
41312012-04-20 Chong Yidong <cyd@gnu.org>
4132
4133 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4134 set the status to "failed" and ensure that sentinel is run.
4135
c07a4c0b 41362012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
4137
4138 * process.c (Fset_process_inherit_coding_system_flag)
4139 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 4140 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 4141
c07a4c0b 41422012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
4143
4144 * xdisp.c (string_buffer_position_lim): Limit starting position to
4145 BEGV.
4146 (set_cursor_from_row): If called for a mode-line or header-line
4147 row, return zero immediately.
4148 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
4149 farther than the first row after the header line, if any.
4150 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
4151 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
4152
c07a4c0b 41532012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4154
4ae29f89
SM
4155 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
4156 (bug#11238).
ad3a2b41 4157
c07a4c0b 41582012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 41592012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
4160
4161 configure: new option --enable-gcc-warnings (Bug#11207)
4162 * Makefile.in (C_WARNINGS_SWITCH): Remove.
4163 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
4164 (ALL_CFLAGS): Use new macros rather than old.
4165 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
4166 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
4167 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
4168 -Wunused-result, -Wunused-variable. This should go away once
4169 the Emacs and Gnulib regex code is merged.
4170 (xmalloc, xrealloc): Now static.
4171
aba027e8
PE
41722012-04-17 Paul Eggert <eggert@cs.ucla.edu>
4173
4174 * dired.c (Fsystem_groups): Remove unused local.
4175
e5a36063
GM
41762012-04-17 Glenn Morris <rgm@gnu.org>
4177
4178 * dired.c (Fsystem_users): Doc fix.
4179
316411f0
DA
41802012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
4181
4182 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
4183 (syms_of_dired): Add them.
4184
9426aba4
PE
41852012-04-16 Paul Eggert <eggert@cs.ucla.edu>
4186
b62a57be
PE
4187 Fix minor alloc.c problems found by static checking.
4188 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
4189 New extern decls, to avoid calling undeclared functions.
4190 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
4191 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
4192 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
4193 (NEED_MEM_INSERT): New macro.
4194 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 4195 Remove one incorrect comment and fix another.
b62a57be 4196
3539f31f
PE
4197 Fix minor ralloc.c problems found by static checking.
4198 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4199 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
4200 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
4201 (r_alloc_sbrk): Now static.
4202
a041960a
PE
4203 Improve ralloc.c interface checking.
4204 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4205 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
4206 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
4207 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
4208 [REL_ALLOC]: ... to here, to check interface.
4209 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
4210 Remove decls. This fixes an "It stinks!".
4211
9426aba4
PE
4212 * alloc.c (which_symbols): Fix alignment issue / type clash.
4213
d55c12ed
AS
42142012-04-15 Andreas Schwab <schwab@linux-m68k.org>
4215
4216 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
4217 (struct Lisp_Misc_Any): Likewise.
4218 (struct Lisp_Free): Likewise.
4219 * alloc.c (union aligned_Lisp_Symbol): Define.
4220 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
4221 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
4222 (union aligned_Lisp_Misc): Define.
4223 (MARKER_BLOCK_SIZE, struct marker_block): Use union
4224 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 4225 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 4226
b948ce8b
PE
42272012-04-14 Paul Eggert <eggert@cs.ucla.edu>
4228
4229 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
4230 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
4231 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
4232 * s/netbsd.h, s/sol2-6.h:
4233 Remove definition of GC_MARK_STACK, since the default now works.
4234 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
4235 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
4236 no longer the default.
4237 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
4238
35dc09a1 42392012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4240
35dc09a1
GM
4241 * lread.c (lisp_file_lexically_bound_p):
4242 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 4243
35dc09a1
GM
42442012-04-14 Eli Zaretskii <eliz@gnu.org>
4245
4246 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
4247 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
4248
42492012-04-14 Jan Djärv <jan.h.d@swipnet.se>
4250
4251 * nsterm.m (constrainFrameRect): Always constrain when there is only
4252 one screen (Bug#10962).
4253
bcd86815
KB
42542012-04-13 Ken Brown <kbrown@cornell.edu>
4255
4256 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
4257
c25df26e
RT
42582012-04-13 Reuben Thomas <rrt@sc3d.org>
4259
4260 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
4261
0fc59f1e
DC
42622012-04-11 Daniel Colascione <dancol@dancol.org>
4263
4264 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
4265 against is gone. It's better to use vfork now so that when Cygwin
4266 gains a new, working vfork, we use it automatically (bug#10398).
4267
de8c03dc
SM
42682012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4269
4270 * window.c (save_window_save): Obey window-point-insertion-type.
4271
2f097256
GM
42722012-04-11 Glenn Morris <rgm@gnu.org>
4273
4274 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
4275
453b951e
SM
42762012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4277
4278 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
4279
75f1671a 42802012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
4281
4282 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
4283 (force_quit_count): New var.
4284 (handle_interrupt): Use it.
4285
2a8ce227
JB
42862012-04-10 Juanma Barranquero <lekktu@gmail.com>
4287
4288 * w32.c (w32_delayed_load): Record the full path of the library
4289 being loaded (bug#10424).
4290
935396c0
GM
42912012-04-09 Glenn Morris <rgm@gnu.org>
4292
05920a43
GM
4293 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
4294 not just in the obarray, before snarfing them. (Bug#11036)
4295
935396c0
GM
4296 * Makefile.in ($(leimdir)/leim-list.el):
4297 Pass EMACS rather than BUILT_EMACS.
4298
a18ecafa
TZ
42992012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4300
4301 * process.c (make_process):
4302 * process.h: Add integer `gnutls_handshakes_tried' member to
4303 process struct.
4304
6bbef4e5
JC
4305 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4306 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
4307
4308 * gnutls.c (gnutls_log_function2i): Convenience log function.
4309 (emacs_gnutls_read): Use new log functions,
4310 `gnutls_handshakes_tried' process member, and
4311 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4312 attempts per process (connection).
4313
b4d3bc10
CY
43142012-04-09 Chong Yidong <cyd@gnu.org>
4315
4316 * eval.c (Fuser_variable_p, user_variable_p_eh)
4317 (lisp_indirect_variable): Functions deleted.
4318 (Fdefvar): Caller changed.
4319
4320 * callint.c (Finteractive, Fcall_interactively):
4321 * minibuf.c (Fread_variable): Callers changed.
4322
70f4d973
EZ
43232012-04-09 Eli Zaretskii <eliz@gnu.org>
4324
4325 * xdisp.c (set_cursor_from_row): If the display string appears in
4326 the buffer at position that is closer to point than the position
4327 after the display string, display the cursor on the first glyph of
4328 the display string. Fixes cursor display when a 'display' text
4329 property immediately follows invisible text. (Bug#11094)
4330
cb3c2e3e
PE
43312012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4332
4333 composite.c: use 'double' consistently
4334 * composite.c (get_composition_id): Use 'double' consistently
4335 instead of converting 'float' to 'double' and vice versa; this is
4336 easier to understand and avoids a GCC warning.
4337
fd06db5d
GM
43382012-04-09 Glenn Morris <rgm@gnu.org>
4339
50fe702a
GM
4340 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4341 preparation for dumping it with emacs. (Bug#4789)
4342 (leimdir): New variable.
4343 ($(leimdir)/leim-list.el): New rule.
4344 (emacs$(EXEEXT)): Depend on leim-list.el.
4345
fd06db5d
GM
4346 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4347 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4348 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4349
55c131ee
AS
43502012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4351
4352 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4353 proper alignment.
4354
9209588f
JB
43552012-04-07 Juanma Barranquero <lekktu@gmail.com>
4356
4357 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4358 Remove unused local variable.
4359
e3fb2efb
PE
43602012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4361
4362 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4363 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4364 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4365 objects, as mark_maybe_pointer will catch them otherwise.
4366 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4367 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4368
b5385551
PE
43692012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4370
4371 Fix typo that broke non-Windows builds.
4372 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4373
9078ead6
EZ
43742012-04-07 Eli Zaretskii <eliz@gnu.org>
4375
4376 Support building on MS-Windows with libxml2.
4377
4378 * makefile.w32-in (OBJ2): Add xml.$(O).
4379 (GLOBAL_SOURCES): Add xml.c.
4380 ($(BLD)/xml.$(O)): New dependency list.
4381
4382 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
4383 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
4384 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
4385 [!WINDOWSNT]: New macros.
4386 (init_libxml2_functions, libxml2_loaded_p): New functions.
4387 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4388 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4389 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4390 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4391 linked in).
6bbef4e5
JC
4392 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4393 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4394 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4395
4396 * emacs.c: Don't include libxml/parser.h.
4397 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4398 xmlCleanupParser directly.
4399
4400 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4401
3811fdf3
EZ
44022012-04-07 Eli Zaretskii <eliz@gnu.org>
4403
4404 * indent.c (Fvertical_motion): If there is a display string at
4405 point, use it.vpos to compute how many lines to backtrack after
4406 move_it_to point. (Bug#11133)
4407
2f8e16b2
EZ
44082012-04-06 Eli Zaretskii <eliz@gnu.org>
4409
4410 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4411 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4412 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4413 macros related to unification of CJK characters. For the details,
4414 see the discussion following the message here:
4415 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4416
3d439cd1
CY
44172012-04-04 Chong Yidong <cyd@gnu.org>
4418
4419 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4420
8bc53d00
EZ
44212012-04-01 Eli Zaretskii <eliz@gnu.org>
4422
4423 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4424 instead of alloca. (Bug#11138)
4425
3b0512a3
AS
44262012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4427
4428 * w32menu.c (is_simple_dialog): Properly check lisp types.
4429 (Bug#11141)
4430
8427ddd2
EZ
44312012-03-31 Eli Zaretskii <eliz@gnu.org>
4432
979022ef
EZ
4433 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4434 position we get to after a call to move_it_to fails the
4435 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4436 only if we wind up in a string from display property. (Bug#11063)
4437
a6b1c7cc
EZ
4438 * window.c (Fdelete_other_windows_internal): Invalidate the row
4439 and column information about mouse highlight, so that redisplay
4440 restores it after reallocating the glyph matrices. (Bug#7464)
4441
8427ddd2
EZ
4442 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4443 string comes from a `display' text property, use the buffer
4444 position of that property as if we actually saw that position in
4445 the row's glyphs.
697ba24b
EZ
4446 (move_it_by_lines): Remove the assertion that
4447 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4448 violated when there's a before-string at the beginning of a line.
4449 (Bug#11063)
8427ddd2 4450
65a0a738
EZ
44512012-03-30 Eli Zaretskii <eliz@gnu.org>
4452
4453 * xdisp.c (append_space_for_newline): If the default face was
4454 remapped, use the remapped face for the appended newline.
4455 (extend_face_to_end_of_line): Use the remapped default face for
4456 extending the face to the end of the line.
4457 (display_line): Call extend_face_to_end_of_line when the default
4458 face was remapped. (Bug#11068)
4459
581355cc
EZ
44602012-03-29 Eli Zaretskii <eliz@gnu.org>
4461
4462 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4463
e8fc049f
SM
44642012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4465
4466 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4467
4fb9a543
GM
44682012-03-27 Glenn Morris <rgm@gnu.org>
4469
4470 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4471 Doc fixes.
4472
679910f1
KH
44732012-03-26 Kenichi Handa <handa@m17n.org>
4474
4475 * dispextern.h (struct glyph): Fix previous change. Change the
4476 bit length of glyphless.ch to 25 (Bug#11082).
4477
90d49b7f
CY
44782012-03-26 Chong Yidong <cyd@gnu.org>
4479
4480 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4481 (command_loop_1): Use it; inhibit selection update for
4482 handle-select-window too (Bug#8996).
4483
f514f6f0
FP
44842012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4485
e8fc049f 4486 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4487
bf43fa51
KH
44882012-03-25 Kenichi Handa <handa@m17n.org>
4489
4490 * dispextern.h (struct glyph): Change the bit length of
4491 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4492
8a0c01dd
EZ
44932012-03-24 Eli Zaretskii <eliz@gnu.org>
4494
4495 * s/ms-w32.h (tzname): Include time.h before redirecting to
4496 _tzname. Fixes the MSVC build. (Bug#9960)
4497
7d1c3a76
AS
44982012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4499
8ed79523
AS
4500 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4501 characters.
4502
7d1c3a76
AS
4503 * xterm.c (XTread_socket): Only modify handling_signal if
4504 !SYNC_INPUT. (Bug#11080)
4505
e99a9b8b
EZ
45062012-03-23 Eli Zaretskii <eliz@gnu.org>
4507
4508 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4509 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4510 when fetching a multibyte character consumes more bytes than
4511 CHAR_BYTES returns, due to unification of CJK characters in
4512 string_char. (Bug#11073)
4513
5063c0e1
TN
45142012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4515
4516 * process.c (wait_reading_process_output): Handle pty disconnect
4517 by refraining from sending oneself a SIGCHLD (bug#10933).
4518
9f851fbd
CY
45192012-03-22 Chong Yidong <cyd@gnu.org>
4520
4521 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4522
5063c0e1 4523 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4524 Mark string as coming from a prefix property.
4525 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4526 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4527
fb5b8aca
CY
45282012-03-21 Chong Yidong <cyd@gnu.org>
4529
4530 * xfaces.c (Vface_remapping_alist): Doc fix.
4531
62356a1b
EZ
45322012-03-20 Eli Zaretskii <eliz@gnu.org>
4533
4534 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4535 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4536 Doc fixes.
62356a1b 4537
025de85b
CY
45382012-03-20 Chong Yidong <cyd@gnu.org>
4539
4540 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4541 to reflect default non-nil value of redisplay-dont-pause.
4542
4827f94e
KH
45432012-03-19 Kenichi Handa <handa@m17n.org>
4544
4545 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4546 it fit in a valid range (Bug#11003).
4547
e50a24a2
EZ
45482012-03-18 Eli Zaretskii <eliz@gnu.org>
4549
4550 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4551 that is not from display property, accept the row as a "cursor
4552 row" if one of the string's character has a non-nil `cursor'
4553 property. Fixes cursor positioning when there are newlines in
4554 overlay strings, e.g. in icomplete.el. (Bug#11035)
4555
9af5ed87
PE
45562012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4557
4558 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4559
d1f55f16
CY
45602012-03-12 Chong Yidong <cyd@gnu.org>
4561
4562 * eval.c (inhibit_lisp_code): Rename from
4563 inhibit_window_configuration_change_hook; move from window.c.
4564
4565 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4566 * window.c (run_window_configuration_change_hook)
4567 (syms_of_window): Callers changed.
4568
66c5eebd
CY
45692012-03-11 Chong Yidong <cyd@gnu.org>
4570
413df973
CY
4571 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4572
66c5eebd
CY
4573 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4574
1de11f56
CY
45752012-03-10 Chong Yidong <cyd@gnu.org>
4576
4577 * frame.c (other_visible_frames): Don't assume the selected frame
4578 is visible (Bug#10955).
4579
cae07000
SM
45802012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4581
4582 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4583
89c94350
JD
45842012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4585
4586 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4587 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4588 zero (Bug#10954).
4589
999dd333
GM
45902012-03-03 Glenn Morris <rgm@gnu.org>
4591
01a6dcc8 4592 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4593
de0100f2
EZ
45942012-03-02 Eli Zaretskii <eliz@gnu.org>
4595
4596 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4597 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4598 (redisplay_window, next_element_from_string): Fix typos in
4599 comments.
3e441275
EZ
4600 (redisplay_window): Pass to move_it_vertically the margin in
4601 pixels, not in screen lines.
de0100f2 4602
96a72ee9
GM
46032012-03-02 Glenn Morris <rgm@gnu.org>
4604
4605 * buffer.c (buffer-list-update-hook): Doc fix.
4606
312508d7
EZ
46072012-02-29 Eli Zaretskii <eliz@gnu.org>
4608
4609 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4610 push_it before setting up the iterator for the first overlay
4611 string, even if we have an empty string loaded.
4612 (next_overlay_string): If there's an empty string on the iterator
4613 stack, pop the stack. (Bug#10903)
4614
27f3c637
PE
46152012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4616
4617 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4618 Suggested by Stefan Monnier in
4619 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4620 * alloc.c (widen_to_Lisp_Object): New static function.
4621 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4622 and widening them to Lisp_Objects. This would work even if
4623 USE_LSB_TAG is defined and wide integers are used, which might
4624 happen in a future version of Emacs.
4625
3c9dfce6
CY
46262012-02-25 Chong Yidong <cyd@gnu.org>
4627
fa74b241
CY
4628 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4629 Doc fix.
4630
3c9dfce6
CY
4631 * xselect.c (Fx_selection_exists_p): Doc fix.
4632 (x_clipboard_manager_save_all): Print an informative message
4633 before saving to clipboard manager.
4634
9486df08
CY
46352012-02-24 Chong Yidong <cyd@gnu.org>
4636
4637 * keyboard.c (process_special_events): Handle all X selection
4638 requests in kbd_buffer, not just the next one (Bug#8869).
4639
f01d3321
CY
46402012-02-23 Chong Yidong <cyd@gnu.org>
4641
4642 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4643 call when setting menu-bar-lines and tool-bar-lines parameters.
4644 (unwind_create_frame_1): New helper function.
4645
4646 * window.c (inhibit_window_configuration_change_hook): New var.
4647 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4648 (syms_of_window): Initialize it.
f01d3321 4649
86b847b6
CY
46502012-02-22 Chong Yidong <cyd@gnu.org>
4651
4652 * xterm.c (x_draw_image_relief): Add missing type check for
4653 Vtool_bar_button_margin (Bug#10743).
4654
a59225b1
CY
46552012-02-21 Chong Yidong <cyd@gnu.org>
4656
4657 * fileio.c (Vfile_name_handler_alist): Doc fix.
4658
4659 * buffer.c (Fget_file_buffer): Protect against invalid file
4660 handler return value.
4661
310f5bd4
PE
46622012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4663
cb3a28cc
PE
4664 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4665 when computing $valmask.
4666
310f5bd4
PE
4667 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4668 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4669 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4670 It's useless in that case, and it can cause problems on hosts
4671 that allocate halves of EMACS_INT values separately.
4672 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4673 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4674 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4675 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4676 it avoids undefined behavior on hosts where shifting right by more
4677 than the word width has undefined behavior.
4678
2375c96a
CY
46792012-02-19 Chong Yidong <cyd@gnu.org>
4680
4681 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4682 (Funhandled_file_name_directory, Ffile_name_as_directory)
4683 (Fdirectory_file_name, Fexpand_file_name)
4684 (Fsubstitute_in_file_name): Protect against invalid file handler
4685 return values (Bug#10845).
4686
3eb49e71
EZ
46872012-02-18 Eli Zaretskii <eliz@gnu.org>
4688
4689 * .gdbinit (pitx): Fix incorrect references to fields of the
4690 iterator stack.
4691
7b926f3f
CY
46922012-02-17 Chong Yidong <cyd@gnu.org>
4693
4694 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4695
11273115
PE
46962012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4697
4698 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4699 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4700
c3a70e2b
CY
47012012-02-15 Chong Yidong <cyd@gnu.org>
4702
4703 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4704 marked as special. Also, starting docstrings with * is obsolete.
4705
0ca43699
AS
47062012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4707
4708 * gnutls.c (emacs_gnutls_write): Fix last change.
4709
2e8f3c56
LI
47102012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4711
4712 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4713 send_process.
4714
af70074f
SM
47152012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4716
4717 * keymap.c (Fsingle_key_description): Handle char ranges.
4718
95986d52
CY
47192012-02-12 Chong Yidong <cyd@gnu.org>
4720
afd83bd1
CY
4721 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4722 as that creates a dangerous corner case.
4723
95986d52
CY
4724 * window.c (Fdelete_window_internal): Invalidate the mouse
4725 highlight (Bug#9904).
4726
bd7da63e
GM
47272012-02-12 Glenn Morris <rgm@gnu.org>
4728
4729 * xselect.c (Fx_own_selection_internal)
4730 (Fx_get_selection_internal, Fx_disown_selection_internal)
4731 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4732 * nsselect.m (Fx_own_selection_internal)
4733 (Fx_disown_selection_internal, Fx_selection_exists_p)
4734 (Fx_selection_owner_p, Fx_get_selection_internal):
4735 Sync docs and argument specs with the xselect.c versions.
4736
77abcbc2
LI
47372012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4738
4739 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4740
90b671e2
EZ
47412012-02-11 Eli Zaretskii <eliz@gnu.org>
4742
1c0ca0b7
EZ
4743 * w32select.c (Fx_selection_exists_p): Sync doc string and
4744 argument list with xselect.c. (Bug#10783)
4745
4746 * w16select.c (Fx_selection_exists_p): Sync doc string and
4747 argument list with xselect.c. (Bug#10783)
90b671e2 4748
49241268
GM
47492012-02-10 Glenn Morris <rgm@gnu.org>
4750
4751 * fns.c (Fsecure_hash): Doc fix.
4752
f998bbe7 47532012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4754
4755 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4756
0992bd9c
CY
47572012-02-07 Chong Yidong <cyd@gnu.org>
4758
4759 * buffer.c (Fbuffer_local_variables)
4760 (buffer_lisp_local_variables): Handle unbound vars correctly;
4761 don't let Qunbound leak into Lisp.
4762
af008560
GM
47632012-02-07 Glenn Morris <rgm@gnu.org>
4764
dd605cc4
GM
4765 * image.c (Fimagemagick_types): Doc fix.
4766
af008560
GM
4767 * image.c (imagemagick-render-type): Change it from a lisp object
4768 to an integer. Move the doc here from the lisp manual.
4769 Treat all values not equal to 0 the same.
4770
1449fa1d
CY
47712012-02-06 Chong Yidong <cyd@gnu.org>
4772
4773 * doc.c (store_function_docstring): Avoid applying docstring of
4774 alias to base function (Bug#2603).
4775
3723ec07
AS
47762012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4777
4778 * .gdbinit (pp1, pv1): Remove redundant defines.
4779 (pr): Use pp.
4780
79c1cc1e
CY
47812012-02-04 Chong Yidong <cyd@gnu.org>
4782
4783 * nsterm.m: Declare a global (Bug#10694).
4784
d7f29f8e
EZ
47852012-02-04 Eli Zaretskii <eliz@gnu.org>
4786
cae07000
SM
4787 * w32.c (get_emacs_configuration_options):
4788 Include --enable-checking, if specified, in the return value.
d7f29f8e 4789
3b95a6f9
MR
47902012-02-04 Martin Rudalics <rudalics@gmx.at>
4791
4792 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4793 after rounding frame sizes. (Bug#9723)
4794
d6fa96a6
EZ
47952012-02-04 Eli Zaretskii <eliz@gnu.org>
4796
4797 * keyboard.c (adjust_point_for_property): Don't position point
4798 before BEGV. (Bug#10696)
4799
df0b2940
PE
48002012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4801
4802 Handle overflow when computing char display width (Bug#9496).
4803 * character.c (char_width): Return EMACS_INT, not int.
4804 (char_width, c_string_width): Check for overflow when
4805 computing the width; this is possible now that individual
4806 characters can have unbounded width. Problem introduced
4807 by merge from Emacs 23 on 2012-01-19.
4808
6bee44d6
MA
48092012-02-02 Michael Albinus <michael.albinus@gmx.de>
4810
4811 * dbusbind.c (Fdbus_register_method): Mention the return value
4812 :ignore in the docstring.
4813
44f92739
GM
48142012-02-02 Glenn Morris <rgm@gnu.org>
4815
1b9f60cc
GM
4816 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4817
44f92739
GM
4818 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4819 Unconditionally set to t. (Bug#10673)
4820 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4821 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4822 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4823
c5d3843c
KH
48242012-02-02 Kenichi Handa <handa@m17n.org>
4825
4826 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4827 0, do not call append_composite_glyph.
4828
159462d4 48292012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4830
4831 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4832 NULL (Bug#6988).
4833 (x_produce_glyphs): If the component of a composition is a null
4834 string, set it->pixel_width to 1 to avoid zero-width glyph.
4835
78cef877
EZ
48362012-02-01 Eli Zaretskii <eliz@gnu.org>
4837
4838 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4839 first 2 arguments are identical. This makes inserting large
4840 output from a subprocess an order of magnitude faster on
4841 MS-Windows, where all sbrk'ed memory is always contiguous.
4842
97897668
GM
48432012-01-31 Glenn Morris <rgm@gnu.org>
4844
4845 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4846 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4847 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4848
31fd3586
GM
48492012-01-29 Glenn Morris <rgm@gnu.org>
4850
4851 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4852
0e24a8b2
CY
48532012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4854
4855 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4856
cc0adcb0
CY
48572012-01-28 Chong Yidong <cyd@gnu.org>
4858
4859 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4860
acc28cb9
CY
48612012-01-26 Chong Yidong <cyd@gnu.org>
4862
9c69cfb7
CY
4863 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4864
acc28cb9
CY
4865 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4866 repeat counts (Bug#10507).
4867
48da7392
GM
48682012-01-26 Glenn Morris <rgm@gnu.org>
4869
4870 * lread.c (syms_of_lread): Doc fix.
4871
14af5f7f
CY
48722012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4873
4874 * coding.c (encode_designation_at_bol): Change return value to
4875 EMACS_INT.
4876
0b21c100
CY
48772012-01-25 Chong Yidong <cyd@gnu.org>
4878
4879 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4880
3c2907f7
CY
48812012-01-21 Chong Yidong <cyd@gnu.org>
4882
4883 * floatfns.c (Fcopysign): Make the second argument non-optional,
4884 since nil is not allowed anyway.
4885
959ad23f
AS
48862012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4887
4888 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4889 (send_process): Likewise.
4890
34a02f46
MR
48912012-01-19 Martin Rudalics <rudalics@gmx.at>
4892
4893 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4894 (Vwindow_persistent_parameters): Do not use Qstate.
4895 Rewrite doc-strings.
34a02f46 4896
1259009a 48972012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4898
4899 * character.c (char_width): New function.
70d4fdf6
GM
4900 (Fchar_width, c_string_width, lisp_string_width):
4901 Use char_width (Bug#9496).
25ed9e61 4902
6a6ee00d
MR
49032012-01-16 Martin Rudalics <rudalics@gmx.at>
4904
4905 * window.c (Vwindow_persistent_parameters): New variable.
4906 (Fset_window_configuration, save_window_save): Handle persistent
4907 window parameters.
4908
c85efaf7
EZ
49092012-01-14 Eli Zaretskii <eliz@gnu.org>
4910
4911 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4912 thrashing the stack of the thread. (Bug#9087)
4913
5944709e
PE
49142012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4915
4916 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4917
e71f5d99
EZ
49182012-01-11 Eli Zaretskii <eliz@gnu.org>
4919
4920 * xdisp.c (rows_from_pos_range): Handle the case where the
4921 highlight ends on a newline. (Bug#10464)
4922 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4923 he end column for display of highlight that ends on a newline
4924 before a R2L line.
4925
ce316182
GM
49262012-01-11 Glenn Morris <rgm@gnu.org>
4927
4928 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4929 from load-path also when installation-directory is nil. (Bug#10208)
4930
5b43da69
GM
49312012-01-10 Glenn Morris <rgm@gnu.org>
4932
74cc8ff9
GM
4933 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4934
7d8d6e4e
GM
4935 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4936 Update template values to be closer to their typical values these days.
5b43da69 4937
a0db8d43
EZ
49382012-01-09 Eli Zaretskii <eliz@gnu.org>
4939
4940 * xdisp.c (rows_from_pos_range): Accept additional argument
4941 DISP_STRING, and accept any glyph in a row whose object is that
4942 string as eligible for mouse highlight. Fixes mouse highlight of
4943 display strings from overlays. (Bug#10464)
4944
9a0115ab 49452012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4946
b9110d6a 4947 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4948 * fileio.c (auto_saving_dir_umask): New static var.
4949 (Fmake_directory_internal): Use it.
4950 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4951 creating the directory. The old code temporarily assigns
4952 too-generous permissions to the directory.
4953 (do_auto_save_eh): Clear it.
b9110d6a 4954 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4955 that the var is always cleared.
4956
6c1bd3f3
EZ
49572012-01-07 Eli Zaretskii <eliz@gnu.org>
4958
4959 * search.c (scan_buffer): Pass character positions to
4960 know_region_cache, not byte positions. (Bug#6540)
4961
069d2b50
L
49622012-01-07 LynX <_LynX@bk.ru> (tiny change)
4963
4964 * w32.c (sys_rename): Report EXDEV when rename of a directory
4965 fails because the target is on another logical disk. (Bug#10284)
4966
75bf0d33
DB
49672012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4968
4969 * xterm.c (x_embed_request_focus): New function.
4970
4971 * xterm.h: Add prototype.
4972
4973 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4974
1c6e5a32
GM
49752012-01-05 Glenn Morris <rgm@gnu.org>
4976
4977 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4978
651e947e
EZ
49792012-01-01 Eli Zaretskii <eliz@gnu.org>
4980
4981 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4982 Load gnutls_transport_set_lowat only if GnuTLS version is below
4983 2.11.1.
4984 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4985 GnuTLS versions below 2.11.1.
4986
3778cdd8
AL
49872011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4988
4989 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4990 to the doc string advising against its use for altering the way
4991 windows are scrolled.
4992
0e5317f7
KH
49932011-12-28 Kenichi Handa <handa@m17n.org>
4994
4995 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4996 coding-system ASCII compatible only when it does not produce BOM
4997 on encoding (Bug#10383).
4998
93d5ca1f
JD
49992011-12-26 Jan Djärv <jan.h.d@swipnet.se>
5000
5001 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
5002 can scroll.
5003 (create_and_show_popup_menu): Always use menu_position_func for
5004 Gtk3 (Bug#10361).
5005
ca22b785
AS
50062011-12-24 Andreas Schwab <schwab@linux-m68k.org>
5007
5008 * callint.c (Fcall_interactively): Don't truncate prompt string.
5009
d048e1e6
EZ
50102011-12-23 Eli Zaretskii <eliz@gnu.org>
5011
5012 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
5013 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 5014 resumed from there (after widening). (Bug#10360)
d048e1e6 5015
5ccaba1f
JD
50162011-12-22 Jan Djärv <jan.h.d@swipnet.se>
5017
5018 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
5019
204ee57f
JD
50202011-12-21 Jan Djärv <jan.h.d@swipnet.se>
5021
b81d40f0
JB
5022 * nsterm.m (x_free_frame_resources):
5023 Release f->output_data.ns->miniimage.
204ee57f
JD
5024 (ns_index_color): Fix indentation. Do not retain
5025 color_table->colors[i].
5026
5027 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
5028 before returning.
5029
5030 * nsfns.m (x_set_background_color): Assign return value from
5031 ns_index_color to face-background instead of NSColor*.
5032 (ns_implicitly_set_icon_type): Fix indentation.
5033 Change assignment in for loop to comparison.
5034
5035 * emacs.c (ns_pool): New variable.
5036 (main): Assign ns_pool.
5037 (Fkill_emacs): Call ns_release_autorelease_pool.
5038
5039 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
5040 autorelease fdesc, release fdAttrs and tdict.
5041 (ns_get_covering_families): Release charset.
5042 (ns_findfonts): Release NSFontDescriptor created with new.
5043 (ns_uni_to_glyphs): Fix indentation.
5044 (setString): Release attrStr before assigning new value.
5045
c803b2b7
JD
50462011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5047
678f4426
JD
5048 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
5049 and NS_IMPL_COCOA.
5050 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
5051 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
5052
cd394be1 50532011-12-18 David Reitter <reitter@cmu.edu>
678f4426 5054
5fecd5fc
JD
5055 * nsterm.m (ns_term_init): Subscribe for notifications
5056 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
5057 to method trackingNotification in EmacsMenu.
5058
5059 * nsmenu.m (trackingMenu): New variable.
3771cb17 5060 (trackingNotification): New method (from Aquamacs).
5fecd5fc 5061 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 5062 from Aquamacs (Bug#7030).
678f4426
JD
5063
50642011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 5065
c803b2b7
JD
5066 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
5067 (symbol_to_nsstring): Fix indentation.
5068 (ns_symbol_to_pb): New function.
cae07000
SM
5069 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
5070 (Fns_rotate_cut_buffers_internal): Remove.
5071 (Fns_store_selection_internal): Rename from
c803b2b7
JD
5072 Fns_store_cut_buffer_internal.
5073 (ns_get_foreign_selection, Fx_own_selection_internal)
5074 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
5075 (Fns_get_selection_internal, Fns_store_selection_internal):
5076 Use ns_symbol_to_pb and check if return value is nil.
5077 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
5078 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
5079 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
5080 renamed to Sns_store_selection_internal.
5081 (ns_handle_selection_request): Move code to Fx_own_selection_internal
5082 and remove this function.
5083 (ns_handle_selection_clear): Remove, never used.
5084 (Fx_own_selection_internal): Move code from ns_handle_selection_request
5085 here.
5086
e1b01a3a
KB
50872011-12-17 Ken Brown <kbrown@cornell.edu>
5088
5089 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
5090 GID is unknown (Bug#10257).
5091
2adb6e85
PE
50922011-12-17 Paul Eggert <eggert@cs.ucla.edu>
5093
5094 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
5095 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
5096 which caused a build failure on GNU/Linux IA-64. This problem was
5097 introduced by my 2011-10-07 patch.
5098
d1d7b339
JL
50992011-12-15 Juri Linkov <juri@jurta.org>
5100
5101 * image.c (imagemagick_error): New function. (Bug#10112)
5102 (imagemagick_load_image): Comment out `MagickSetResolution' call.
5103 Use `imagemagick_error' where ImageMagick functions return
5104 `MagickFalse'.
5105 (Fimagemagick_types): Add `Fnreverse' to return the list in the
5106 proper order.
5107
100d5755
KH
51082011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5109
5110 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
5111 fill background (Bug#8992).
5112
454592a6
MR
51132011-12-13 Martin Rudalics <rudalics@gmx.at>
5114
5115 * window.c (Vwindow_combination_resize)
5116 (Vwindow_combination_limit): Use t instead of non-nil in
5117 doc-strings.
61d4b438
MR
5118 (Vrecenter_redisplay): Add first sentence of doc-string on
5119 separate line.
53524d93 5120 (Frecenter): Fix doc-string typo.
454592a6 5121
3633e3aa
KH
51222011-12-11 Kenichi Handa <handa@m17n.org>
5123
5124 * coding.c (Funencodable_char_position): Pay attention to the
5125 buffer text relocation (Bug#9389).
5126
7b9d523a 51272011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 5128
7b9d523a
JD
5129 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
5130 gtk_init (Bug#10100).
5131
b73189c6
EZ
51322011-12-10 Eli Zaretskii <eliz@gnu.org>
5133
5134 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
5135 IT->string is nil. (Bug#10263)
5136
f7dfe5d6
JD
51372011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5138
83faebb4
JD
5139 * nsterm.h (x_free_frame_resources): Declare.
5140
f7dfe5d6
JD
5141 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
5142 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
5143
5144 * nsterm.h (ns_get_defaults_value): Declare.
5145
5146 * nsterm.m (ns_default): Call ns_get_defaults_value.
5147
7cd4e72c
EZ
51482011-12-09 Eli Zaretskii <eliz@gnu.org>
5149
5150 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
5151 (Bug#10170)
5152
b34d7317
YM
51532011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5154
5155 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
5156 that where the value of an _OBJC_* symbol points to is in the .bss
5157 section (Bug#10240).
5158
76470ad1
KH
51592011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5160
5161 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 5162 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 5163
745fff94
KH
51642011-12-08 Kenichi Handa <handa@m17n.org>
5165
5166 * ftfont.c (get_adstyle_property): Fix previous change
5167 (Bug#10233).
5168
6e44397c
JB
51692011-12-07 Juanma Barranquero <lekktu@gmail.com>
5170
5171 * w32.c (init_environment): If no_site_lisp, remove site-lisp
5172 dirs from the default value of EMACSLOADPATH (bug#10208).
5173
7efa6272
GM
51742011-12-07 Glenn Morris <rgm@gnu.org>
5175
5176 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
5177 installation and source directories as well. (Bug#10208)
5178
f6fc4d87
CY
51792011-12-06 Chong Yidong <cyd@gnu.org>
5180
5181 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
5182
2bf26180
GM
51832011-12-06 Glenn Morris <rgm@gnu.org>
5184
5185 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
5186 as an error, not just -1. (Bug#10217)
5187
3a6ad4f0
CY
51882011-12-05 Chong Yidong <cyd@gnu.org>
5189
5190 * keyboard.c (process_special_events): New function.
5191 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5192
75a3b399
PE
51932011-12-05 Paul Eggert <eggert@cs.ucla.edu>
5194
5195 * coding.c (encode_designation_at_bol): Don't use uninitialized
5196 local variable (Bug#9318).
5197
c3c9e25e
KH
51982011-12-05 Kenichi Handa <handa@m17n.org>
5199
5200 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
5201 return Qnil (Bug#8046, Bug#10193).
5202
5eb05ea3
KH
52032011-12-05 Kenichi Handa <handa@m17n.org>
5204
5205 * coding.c (encode_designation_at_bol): New args charbuf_end and
5206 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
5207 (coding_set_source): Return how many bytes coding->source was
5208 relocated.
5209 (coding_set_destination): Return how many bytes
5210 coding->destination was relocated.
5211 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 5212 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
5213
52142011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5215
5216 * coding.c (CODING_CHAR_CHARSET_P): New macro.
5217 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
5218 macro (Bug#9318).
5219
52202011-12-05 Andreas Schwab <schwab@linux-m68k.org>
5221
5222 The following changes are to fix Bug#9318.
5223
a79703f5 5224 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
5225 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
5226 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 5227 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 5228
7dbda6df
JB
52292011-12-05 Juanma Barranquero <lekktu@gmail.com>
5230
5231 * lisp.h (process_quit_flag): Fix external declaration.
5232
6d5eb5b0
SM
52332011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
5234
5235 Don't macro-inline non-performance-critical code.
5236 * eval.c (process_quit_flag): New function.
5237 * lisp.h (QUIT): Use it.
5238
a0c3fad0
JD
52392011-12-04 Jan Djärv <jan.h.d@swipnet.se>
5240
5241 * nsfns.m (get_geometry_from_preferences): New function.
5242 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
5243
6c07aac2
AS
52442011-12-04 Andreas Schwab <schwab@linux-m68k.org>
5245
5246 * emacs.c (Qkill_emacs): Define.
5247 (syms_of_emacs): Initialize it.
5248 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
5249 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
5250 (quit_throw_to_read_char): Add parameter `from_signal'.
5251 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
5252 * lisp.h (QUIT): Call Fkill_emacs if requested.
5253
c052ead4
JD
52542011-12-03 Jan Djärv <jan.h.d@swipnet.se>
5255
5256 * widget.c (update_wm_hints): Return if wmshell is null.
5257 (widget_update_wm_size_hints): New function.
5258
5259 * widget.h (widget_update_wm_size_hints): Declare.
5260
5261 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
5262 widget_update_wm_size_hints (Bug#10104).
5263
9e49252b
EZ
52642011-12-03 Eli Zaretskii <eliz@gnu.org>
5265
5266 * xdisp.c (handle_invisible_prop): If the invisible text ends just
5267 before a newline, prepare the bidi iterator for consuming the
5268 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 5269 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 5270
02b16839
JL
52712011-12-02 Juri Linkov <juri@jurta.org>
5272
5273 * search.c (Fword_search_regexp): New Lisp function created from
5274 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
5275 (Fword_search_backward, Fword_search_forward)
5276 (Fword_search_backward_lax, Fword_search_forward_lax):
5277 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
5278 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
5279
0068070e
SM
52802011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
5281
5282 * fileio.c (Finsert_file_contents): Move after-change-function call
5283 to before the "handled:" label, since all "goto handled" appear in
5284 cases where the *-change-functions have already been properly called
5285 (bug#10117).
5286
3360a3fc
AS
52872011-12-01 Andreas Schwab <schwab@linux-m68k.org>
5288
5289 * keyboard.c (interrupt_signal): Don't call kill-emacs when
5290 waiting for input. (Bug#10169)
5291
73d6c093
EZ
52922011-11-30 Eli Zaretskii <eliz@gnu.org>
5293
5294 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
5295 verifies glyph row's hash code--we have just reallocated the
5296 glyphs, so their contents can be complete garbage. (Bug#10164)
5297
febe6bea
JB
52982011-11-30 Juanma Barranquero <lekktu@gmail.com>
5299
5300 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5301
801a4313
EZ
53022011-11-30 Eli Zaretskii <eliz@gnu.org>
5303
5304 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5305 attributes are tested _before_ calling verify_row_hash, to protect
5306 against GCC re-ordering of the tests. (Bug#10164)
5307
2b56b87e
JD
53082011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5309
5310 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5311
5312 * xterm.c (handle_one_xevent): Only set async_visible and friends
5313 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 5314 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
5315 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5316
dbf31225
PE
53172011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5320 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5321 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5322 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5323 All uses changed to use GCPRO1 etc.
5324 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5325 Revert to old implementation (i.e., before 2011-03-11).
5326
1305621b
YM
53272011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5328
5329 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5330 of scroll runs so as to avoid assigning disabled bogus rows and
5331 unnecessary graphics copy operations.
5332
8c9afb46
EZ
53332011-11-27 Eli Zaretskii <eliz@gnu.org>
5334
5335 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5336 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5337 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5338 (malloc, free, realloc, calloc): Redirect to e_* only when
5339 compiling Emacs.
5340
5341 * lisp.h (GCTYPEBITS): Move before first use.
5342 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5343 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5344 this macro definition.
5345
5346 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5347 _MSC_VER.
5348
54e9e3bf
JD
53492011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5350
6d5eb5b0
SM
5351 * gtkutil.c (xg_create_frame_widgets):
5352 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
5353 present with Gtk+ 2.0.
5354
83aca1cb
PE
53552011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5356
5357 * fileio.c (Finsert_file_contents): Undo previous change; see
5358 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5359
5b76caa4
PE
53602011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5361
5362 Rename locals to avoid shadowing.
5363 * fileio.c (Finsert_file_contents):
5364 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5365 * process.c (wait_reading_process_output):
5366 Rename inner 'proc' to 'p' to avoid shadowing.
5367 Indent for consistency with usual Emacs style.
5368
8c535114
EZ
53692011-11-25 Eli Zaretskii <eliz@gnu.org>
5370
5371 * xdisp.c (redisplay_window): If cursor row is not fully visible
5372 after recentering, and scroll-conservatively is set to a large
5373 number, scroll window by a few more lines to make the cursor fully
5374 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
5375 (start_display): Don't move to the next line if the display should
5376 start at a newline that is part of a display vector or an overlay
5377 string. (Bug#10119)
8c535114 5378
fa4fdb5c
JL
53792011-11-24 Juri Linkov <juri@jurta.org>
5380
5381 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
5382 after the `MagickPingImage' call. (Bug#10112)
5383
90ec88df
CY
53842011-11-23 Chong Yidong <cyd@gnu.org>
5385
5386 * window.c (Fcoordinates_in_window_p): Accept only live windows.
5387
56e2e794
MR
53882011-11-23 Martin Rudalics <rudalics@gmx.at>
5389
5390 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5391 making another buffer current. (Bug#10114)
5392
b6e64c41
GM
53932011-11-23 Glenn Morris <rgm@gnu.org>
5394
5395 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5396
6b21de18
CY
53972011-11-23 Chong Yidong <cyd@gnu.org>
5398
5399 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5400 using it (Bug#5984).
5401
b12cd789
EZ
54022011-11-22 Eli Zaretskii <eliz@gnu.org>
5403
5404 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5405 and header-lines, as they don't have one computed for them.
5406 (Bug#10098)
5407
5408 * .gdbinit (prow): Make displayed values more self-explaining.
5409 Add row's hash code.
5410
261b6fd4
LMI
54112011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5412
5413 * process.c (wait_reading_process_output): Fix asynchrounous
5414 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5415 (wait_reading_process_output): Add comment and URL.
261b6fd4 5416
e7cfd277
JD
54172011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5418
5419 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5420
a9b9b7f5
CY
54212011-11-21 Chong Yidong <cyd@gnu.org>
5422
5423 * window.c (Fnext_window, Fprevious_window): Doc fix.
5424
b0d15b4f
SM
54252011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5426
5427 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5428
fe7a3057
JB
54292011-11-20 Juanma Barranquero <lekktu@gmail.com>
5430
5431 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5432
d2999b1a
MR
54332011-11-20 Martin Rudalics <rudalics@gmx.at>
5434
5435 * window.c (Fset_window_combination_limit): Rename argument
5436 STATUS to LIMIT.
5437 (Vwindow_combination_limit): Remove "status" from doc-string.
5438
d5ff9cd0
AS
54392011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5440
5441 * m/ibms390.h: Remove.
5442 * m/ibms390x.h: Don't include "ibms390.h".
5443
a5bb9bd3
SM
54442011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5445
5446 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5447 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5448
cd1181db
JB
54492011-11-20 Juanma Barranquero <lekktu@gmail.com>
5450
5451 * casetab.c (Fset_case_table):
5452 * charset.c (Fcharset_after): Fix typos.
5453
615a3b8d 54542011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5455
17e845af
PE
5456 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5457 Otherwise, valgrind does not work on some platforms.
5458 Problem reported by Andreas Schwab in
6a0bf43d
PE
5459 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5460 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5461 is set, removing the need for VIRT_ADDRESS_VARIES.
5462 (PURE_P): Use a more-efficient implementation that needs just one
5463 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5464 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5465 to 4 (xorl, subq, cmpq, setbe).
5466 * alloc.c (pure): Always extern now, since that's the
5467 VIRT_ADDR_VARIES behavior.
5468 (PURE_POINTER_P): Use a single comparison, not two, for
5469 consistency with the new puresize.h.
5470 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5471 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5472 Remove VIRT_ADDR_VARIES no longer needed.
5473
f8fe6f96
EZ
54742011-11-19 Eli Zaretskii <eliz@gnu.org>
5475
5476 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5477 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5478 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5479 behave as if the cursor position were at the window margin.
5480
5481 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5482 and the cursor position is out of bounds, behave as if the cursor
5483 position were at the window margin. (Bug#10075)
5484
df05a53c
CY
54852011-11-18 Chong Yidong <cyd@gnu.org>
5486
5487 * window.c (Fwindow_combination_limit): Make first argument
5488 non-optional, since it is meaningless for live windows like the
5489 selected window.
61ccba97 5490
2071918e
DA
54912011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5492
5493 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5494
b50a28de
SM
54952011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5496
5497 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5498 (graft_intervals_into_buffer): Simplify.
5499
015137db
EZ
55002011-11-18 Eli Zaretskii <eliz@gnu.org>
5501
5502 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5503 hash values of the two rows.
5504 (copy_row_except_pointers): Preserve the used[] arrays and the
5505 hash values of the two rows. (Bug#10035)
68c95424 5506 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5507
5508 * xdisp.c (row_hash): New function, body extracted from
5509 compute_line_metrics.
5510 (compute_line_metrics): Call row_hash, instead of computing the
5511 hash code inline.
5512
5513 * dispnew.c (verify_row_hash): Call row_hash for computing the
5514 hash code of a row, instead of duplicating code from xdisp.c.
5515
5516 * dispextern.h (row_hash): Add prototype.
5517
a2addb04
TH
55182011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5519
5520 * frame.c (delete_frame): Don't delete the terminal when the last
5521 X frame is closed if emacs is built with GTK toolkit.
5522
df85d315
JB
55232011-11-17 Juanma Barranquero <lekktu@gmail.com>
5524
5525 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5526
a0c2d0ae
MR
55272011-11-17 Martin Rudalics <rudalics@gmx.at>
5528
5529 * window.c (Vwindow_splits): Rename to
5530 Vwindow_combination_resize. Suggested by Juri Linkov.
5531 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5532 of Vwindow_splits.
5533
58179cce
JB
55342011-11-16 Juanma Barranquero <lekktu@gmail.com>
5535
7877f373
JB
5536 * nsfns.m (Fns_font_name):
5537 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5538
b6f67890
MR
55392011-11-16 Martin Rudalics <rudalics@gmx.at>
5540
5541 * window.h (window): Rename slot "nest" to "combination_limit".
5542 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5543 (Fset_window_nest): Rename to Fset_window_combination_limit.
5544 (Vwindow_nest): Rename to Vwindow_combination_limit.
5545 (recombine_windows, make_parent_window, make_window)
5546 (Fsplit_window_internal, saved_window)
5547 (Fset_window_configuration, save_window_save): Rename all
5548 occurrences of window_nest to window_combination_limit.
5549
c7015153
JB
55502011-11-15 Juanma Barranquero <lekktu@gmail.com>
5551
5552 * image.c (imagemagick_load_image): Fix typo.
5553
322ad6ec
EZ
55542011-11-14 Eli Zaretskii <eliz@gnu.org>
5555
5556 * xdisp.c (display_line): Move the call to
5557 highlight_trailing_whitespace before the call to
5558 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5559 faces of all the glyphs to compute ROW's hash value.
5560 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5561
f067b8ec
JB
55622011-11-14 Juanma Barranquero <lekktu@gmail.com>
5563
5564 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5565 just return (bug#10044).
5566
1e5b2111
EZ
55672011-11-12 Eli Zaretskii <eliz@gnu.org>
5568
7ef3cbd5
EZ
5569 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5570 with user-defined heap size. Bump the default size of the temacs
5571 heap to 27MB, to avoid memory warning when running temacs.
5572 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5573
1e5b2111
EZ
5574 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5575 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5576 (verify_row_hash) [XASSERTS]: New function.
5577 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5578 that the hash value of glyph rows is correct.
1e5b2111 5579
89d61221
MR
55802011-11-12 Martin Rudalics <rudalics@gmx.at>
5581
5582 * window.h (window): Remove splits slot.
5583 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5584 (Fdelete_other_windows_internal, make_parent_window)
5585 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5586 (Fset_window_configuration, save_window_save): Don't deal with
5587 split status of windows.
5588 (saved_window): Remove splits slot.
5589 (Vwindow_splits): Rewrite doc-string.
5590
97f18cc8
JD
55912011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5592
5593 * xfns.c (unwind_create_frame):
5594 * nsfns.m (unwind_create_frame):
5595 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5596 Vframe_list (Bug#9999).
5597
22a648b4
DA
55982011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5599
0b381c7e 5600 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5601
659afede
KH
56022011-11-11 Kenichi Handa <handa@m17n.org>
5603
5604 * callproc.c (Fcall_process): Set the member dst_multibyte of
5605 process_coding.
5606
9ac0394b
KH
56072011-11-11 Johan Bockgård <bojohan@gnu.org>
5608
5609 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5610 avoid a crash (bug#9496).
5611
2fbdc249
CY
56122011-11-09 Chong Yidong <cyd@gnu.org>
5613
5614 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5615 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5616
ac6b1f81
PE
56172011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5618
5619 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5620
09db192c
PE
56212011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5622
5623 Avoid some portability problems by eschewing 'extern inline' functions.
5624 The trivial performance wins aren't worth the portability hassles; see
5625 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5626 et seq.
5627 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5628 (window_box_width, window_box_left, window_box_left_offset)
5629 (window_box_right, window_box_right_offset): Undo previous change,
5630 by removing the "extern"s.
5631 * intervals.c (adjust_intervals_for_insertion)
5632 (adjust_intervals_for_deletion): Undo previous change,
5633 making these static again.
5634 (offset_intervals, temp_set_point_both, temp_set_point)
5635 (copy_intervals_to_string): No longer inline.
5636 * xdisp.c (window_text_bottom_y, window_box_width)
5637 (window_box_height, window_box_left_offset)
5638 (window_box_right_offset, window_box_left, window_box_right)
5639 (window_box): No longer inline.
5640
105216ed
CY
56412011-11-08 Chong Yidong <cyd@gnu.org>
5642
5643 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5644 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5645 Signal an error if not a live window.
105216ed
CY
5646 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5647 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5648
ae9e237f
JB
56492011-11-07 Juanma Barranquero <lekktu@gmail.com>
5650
5651 * lisp.h (syms_of_abbrev): Remove declaration.
5652 Reported by CHENG Gao <chenggao@royau.me>.
5653
c7aa8333
EZ
56542011-11-07 Eli Zaretskii <eliz@gnu.org>
5655
5656 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5657 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5658 of temacs in GUI mode.
5659
be7f5545
MR
56602011-11-07 Martin Rudalics <rudalics@gmx.at>
5661
5662 * window.h: Declare delete_all_child_windows instead of
5663 delete_all_subwindows.
5664 * window.c (Fwindow_nest, Fset_window_nest)
5665 (Fset_window_new_total, Fset_window_new_normal)
5666 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5667 (delete_all_subwindows): Rename to delete_all_child_windows.
5668 (Fdelete_other_windows_internal, Fset_window_configuration):
5669 Call delete_all_child_windows instead of delete_all_subwindows.
5670 * frame.c (delete_frame): Call delete_all_child_windows instead
5671 of delete_all_subwindows.
5672
ca78dc43
PE
56732011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5674
5675 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5676 This is also needed for porting to any host where GC_MARK_STACK is
5677 not GC_MAKE_GCPROS_NOOPS.
5678 (which_symbols): Use it.
5679
a0241d01
KH
56802011-11-07 Kenichi Handa <handa@m17n.org>
5681
5682 * coding.c (coding_set_destination): Check coding->src_pos only
5683 when coding->src_object is a buffer (bug#9910).
5684
5685 * process.c (send_process): Set the member src_multibyte of coding
5686 to 0 (bug#9911) when sending a unibyte text.
5687
5688 * callproc.c (Fcall_process): Set the member src_multibyte of
5689 process_coding to 0 (bug#9912).
5690
a64bfdfa 56912011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5692
5693 * xmenu.c (cleanup_widget_value_tree): New function.
5694 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5695 calling free_menubar_widget_value_tree directly (Bug#9830).
5696
cb41b32a
PE
56972011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5698
5699 Fix some portability problems with 'inline'.
5700 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5701 (window_box_width, window_box_left, window_box_left_offset)
5702 (window_box_right, window_box_right_offset): Declare extern.
5703 Otherwise, these inline functions do not conform to C99 and
5704 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5705 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5706 * intervals.c (adjust_intervals_for_insertion)
5707 (adjust_intervals_for_deletion): Now extern, because otherwise the
5708 extern inline functions 'offset_intervals' couldn't refer to it.
5709 (static_offset_intervals): Remove.
5710 (offset_intervals): Rewrite using the old contents of
5711 static_offset_intervals. The old version didn't conform to C99
5712 because an extern inline function contained a reference to an
5713 identifier with static linkage.
5714
b7041366
AS
57152011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5716
5717 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5718 GC.
5719
88a37c4d
EZ
57202011-11-06 Eli Zaretskii <eliz@gnu.org>
5721
5722 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5723 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5724 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5725 return Qleft_to_right.
5726
49745b39
CY
57272011-11-06 Chong Yidong <cyd@gnu.org>
5728
5729 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5730 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5731 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5732 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5733 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5734 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5735 (Fwindow_vscroll): Doc fix.
5736 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5737 argument, since it makes no sense to pass a live window and for
5738 consistency with window-child.
5739
1f05cd82
CS
57402011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5741
5742 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5743 support MSVC.
5744
22610910
JR
57452011-11-05 Jason Rumney <jasonr@gnu.org>
5746
5747 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5748 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5749 fonts (Bug#6029).
5750 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5751 bitwise arithmetic preventing use of unicode-sip and non-truetype
5752 opentype fonts.
5753
a06776b2
EZ
57542011-11-05 Eli Zaretskii <eliz@gnu.org>
5755
3ad924ba
EZ
5756 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5757 "emacs"-only part.
5758
a06776b2
EZ
5759 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5760 initialization code to keep similarity to xfns.c after changes
5761 from 2011-11-05.
5762
c9e7db78
JD
57632011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5764
a97f8f3f
JD
5765 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5766 (unwind_create_frame): New function (Bug#9943).
5767 (Fx_create_frame): Restructure code to be more similar to the one in
5768 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5769 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5770 Move terminal->reference_count++ just before making the frame official
5771 (Bug#9943).
5772
5773 * nsterm.m (x_free_frame_resources): New function.
5774 (x_destroy_window): Move code to x_free_frame_resources.
5775
c9e7db78 5776 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5777 (Fx_create_frame, x_create_tip_frame):
5778 Move terminal->reference_count++ just before making the frame
75f1671a 5779 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5780 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5781
a6fc3b5c
EZ
57822011-11-05 Eli Zaretskii <eliz@gnu.org>
5783
5784 Support MSVC build with newer versions of Visual Studio.
5785 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5786 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5787 nt/gmake.defs.
5788
5789 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5790 which are not supported by MSVC.
5791 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5792 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5793 bitfields.
5794 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5795 types in bitfields.
5796 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5797
5798 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5799
58179cce 58002011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5801
5802 Support MSVC build with newer versions of Visual Studio.
5803 * w32.c: Don't include w32api.h for MSVC.
5804 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5805
5806 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5807 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5808 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5809 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5810 e_* cousins.
5811 (alloca) [_MSC_VER]: Define to _alloca.
5812
5813 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5814
5815 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5816
a58c13ed
EZ
58172011-11-04 Eli Zaretskii <eliz@gnu.org>
5818
5819 * xdisp.c (note_mouse_highlight): If either of
5820 previous/next-single-property-change returns nil, treat that as
5821 the beginning or the end of the buffer. (Bug#9955)
5822
fe0b6370
JD
58232011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5824
a58c13ed 5825 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5826 label is not null (Bug#9951).
5827 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5828 may be NULL.
5829
89bd5ee1
EZ
58302011-11-04 Eli Zaretskii <eliz@gnu.org>
5831
5832 * window.c (Fwindow_body_size): Mention in the doc string that the
5833 return value is in frame's canonical units. (Bug#9949)
5834
84c3edb9
EZ
58352011-11-03 Eli Zaretskii <eliz@gnu.org>
5836
4e2fb5c7
EZ
5837 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5838
84c3edb9 5839 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5840 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5841 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5842
bc17a887
EZ
58432011-11-01 Eli Zaretskii <eliz@gnu.org>
5844
5845 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5846 Don't stop backward scan on the continuation glyph, even though
5847 its CHARPOS is positive.
6d5eb5b0
SM
5848 (mouse_face_from_buffer_pos, note_mouse_highlight):
5849 Rename cover_string to disp_string.
bc17a887 5850
4ee88440
MR
58512011-11-01 Martin Rudalics <rudalics@gmx.at>
5852
5853 * window.c (temp_output_buffer_show): Don't use
5854 Vtemp_buffer_show_specifiers.
5855 (Vtemp_buffer_show_specifiers): Remove unused variable.
5856
c2ff3c02
EZ
58572011-10-30 Eli Zaretskii <eliz@gnu.org>
5858
5859 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5860 past the beginning of the current glyph matrix.
5861
58179cce 58622011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5863
5864 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5865 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5866 HAVE_GTK3 (Bug#9869).
b77a6a7f 5867
3b574623
JD
5868 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5869 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5870
b77a6a7f
JD
5871 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5872
5873 * xterm.c: Declare x_handle_net_wm_state to return int.
5874 (handle_one_xevent): Check if we are iconified but don't have
5875 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5876 (get_current_wm_state): Return non-zero if not hidden,
5877 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5878 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5879 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5880 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5881
196e41e4
PE
58822011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5883
5884 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5885 so that this new function doesn't get optimized away by a
5886 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5887
021f2e1a
AS
58882011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5889
5890 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5891
8b058d44
EZ
58922011-10-29 Eli Zaretskii <eliz@gnu.org>
5893
5894 Fix the `xbytecode' command.
5895 * .gdbinit (xprintbytestr): New command.
b50a28de 5896 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5897 (xbytecode): Print the byte-code string as well.
5898
4452fb80
EZ
58992011-10-29 Kim Storm <storm@cua.dk>
5900
8b058d44
EZ
5901 * alloc.c (which_symbols): New function.
5902
21b72067
AS
59032011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5904
5905 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5906 line. (Bug#9903)
5907
83ed7b5c
GM
59082011-10-29 Glenn Morris <rgm@gnu.org>
5909
5910 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5911 Not clear what it was for, and it causes various bugs. (Bug#9839)
5912
5a7a728b
EZ
59132011-10-28 Eli Zaretskii <eliz@gnu.org>
5914
5915 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5916 possible random value that matches one of those tested as
5917 condition to clear the mouse face.
5918
d3d0842f
CY
59192011-10-28 Chong Yidong <cyd@gnu.org>
5920
5921 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5922
31b39d13
DN
59232011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5924
5925 * window.c (make_window): Initialize phys_cursor_on_p.
5926
9aba6043
SM
59272011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5928
5929 * lisp.h (struct Lisp_Symbol): Update comments.
5930
c20992f4
JB
59312011-10-28 Juanma Barranquero <lekktu@gmail.com>
5932
5933 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5934
db4f02f2
EZ
59352011-10-28 Eli Zaretskii <eliz@gnu.org>
5936
5937 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5938 <oslsachem@gmail.com> for helping to debug this.
5939
5940 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5941 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5942 (g_b_init_get_glyph_outline_w): New static variables.
5943 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5944 (GetGlyphOutlineW_Proc): New typedefs.
5945 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5946 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5947 New functions.
5948 (w32font_open_internal, compute_metrics):
5949 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5950 instead of calling the "wide" APIs directly.
5951
5952 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5953
5954 * w32.h (syms_of_w32font): Add prototype.
5955
87e68db4
JB
59562011-10-27 Juanma Barranquero <lekktu@gmail.com>
5957
5958 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5959 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5960 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5961 (Fmove_to_window_line): Doc fix.
5962
435c1d67
CY
59632011-10-27 Chong Yidong <cyd@gnu.org>
5964
5965 * process.c (make_process): Set gnutls_state to NULL.
5966
5967 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5968 non-NULL, regardless of GNUTLS_INITSTAGE.
5969 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5970 an error. Set process slots as soon as we allocate them.
5971
5972 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5973
9c6c6f49
CY
59742011-10-27 Chong Yidong <cyd@gnu.org>
5975
9aba6043
SM
5976 * gnutls.c (emacs_gnutls_deinit): New function.
5977 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5978 (Fgnutls_deinit, Fgnutls_boot): Use it.
5979
5980 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5981 (deactivate_process): Call emacs_gnutls_deinit.
5982
657d08d3
JB
59832011-10-27 Juanma Barranquero <lekktu@gmail.com>
5984
5985 * image.c (x_create_x_image_and_pixmap):
5986 * w32.c (sys_rename, w32_delayed_load):
5987 * w32font.c (fill_in_logfont):
5988 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5989
5430d399
JB
59902011-10-26 Juanma Barranquero <lekktu@gmail.com>
5991
5992 * w32fns.c (w32_default_color_map): New function,
5993 extracted from Fw32_default_color_map.
a7ef684b 5994 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5995
fe0055fa
PE
59962011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5997
5998 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5999
e6346438
SM
60002011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
6001
6002 * keyboard.c (test_undefined): New function (bug#9751).
6003 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
6004
e112cc37
ET
60052011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
6006
6007 * sysdep.c (init_sys_modes): Fix the check for the controlling
6008 terminal (Bug#6649).
6009
7b5d6677
EZ
60102011-10-20 Eli Zaretskii <eliz@gnu.org>
6011
6012 * dispextern.h (struct bidi_it): New member next_en_type.
6013
6014 * bidi.c (bidi_line_init): Initialize the next_en_type member.
6015 (bidi_resolve_explicit_1): When next_en_pos is valid for the
6016 current character, check also for next_en_type being WEAK_EN.
6017 (bidi_resolve_weak): Don't enter the expensive loop if the current
6018 position is before next_en_pos. Record the bidi type of the first
6019 non-ET, non-BN character we find, in addition to its position.
6020 (bidi_level_of_next_char): Invalidate next_en_type when
6021 next_en_pos is over-stepped.
6022
7da0b018
PE
60232011-10-20 Paul Eggert <eggert@cs.ucla.edu>
6024
6025 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
6026 * editfns.c: Rewrite current-time-zone so that it invokes
6027 the equivalent of (format-time-string "%Z") to get the time zone name.
6028 This fixes a bug when the time zone name contains characters that
6029 need converting from the system time locale to Emacs internal format.
6030 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
6031 that patch fixed format-time-string to do the conversion, but
6032 I forgot to fix current-time-zone.
6033 (format_time_string): New function, containing most of
6034 what Fformat_time_string used to contain.
6035 (Fformat_time_string): Rewrite in terms of format_time_string.
6036 This doesn't change this function's behavior.
6037 (current-time-zone): Rewrite to use format_time_string.
6038 This fixes the bug reported by Michael Schierl in
6039 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
6040 Jason Rumney's 2007-06-07 change worked around this bug, but
6041 didn't fix it.
6042 * systime.h (tzname, timezone): Remove no-longer-used declarations.
6043
8547b010
EZ
60442011-10-19 Eli Zaretskii <eliz@gnu.org>
6045
6046 * xdisp.c (start_display): If the character at POS is displayed
6047 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
6048 (try_window_reusing_current_matrix): If a line ends in a display
6049 vector or the next line starts in a display vector, continue
6050 redrawing the window even though the character position of
6051 start_row was reached.
8547b010
EZ
6052 (Bug#9771, part 2)
6053
4e948d15
CY
60542011-10-18 Chong Yidong <cyd@gnu.org>
6055
6056 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
6057 with nobreak-char-display too.
6058
4787455f
EZ
60592011-10-18 Eli Zaretskii <eliz@gnu.org>
6060
6061 Fix part 3 of bug#9771.
6062 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
6063 (bidi_resolve_neutral): Don't enter the expensive loop looking for
6064 non-neutral characters if the current character is a paragraph
6065 separator (a.k.a. Newline). This avoids running the same
6066 expensive loop twice, once when we consume the preceding newline
6067 and the other time when the line actually needs to be displayed.
6068 Avoid the loop when we see neutrals on the base embedding level
6069 following a character whose directionality is the same as the
6070 paragraph's. This avoids running the expensive loop when a line
6071 ends in a long sequence of neutrals, like control characters.
6072 Add assertion against STRONG_AL type. Slightly rearrange code
6073 that determines the type of a neutral given the first non-neutral
6074 that follows it.
6075 (bidi_level_of_next_char): Set next_en_pos to zero when
6076 invalidating its info.
6077
2c91f553
EZ
60782011-10-17 Eli Zaretskii <eliz@gnu.org>
6079
6080 * xdisp.c (push_display_prop): Determine whether to record string
6081 or buffer position by IT->string, not by IT->method. Allow
6082 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
6083 (move_it_vertically_backward): Don't look for character position
6084 immediately after the newline when in a continuation line.
6085 (Bug#9771, part 1)
2c91f553 6086
c7b08b0d
MR
60872011-10-15 Martin Rudalics <rudalics@gmx.at>
6088
6089 * window.c (coordinates_in_window): Rewrite and delabelize
6090 vertical border check. (Bug#5357) (Bug#9618)
6091
6b02f655
SM
60922011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
6093
6094 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
6095 errors in XSetWindowBorder (bug#9310).
6096
81d40c92
DA
60972011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
6098
6099 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
6100 avoid crash when xmalloc overrun checking is enabled.
6101
d4172c3b
EZ
61022011-10-13 Eli Zaretskii <eliz@gnu.org>
6103
6104 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
6105 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
6106 cursor motion with <left> and <right> arrow keys.
6107
6108 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
6109 some callers set that themselves.
6110
b00eea75
EZ
61112011-10-12 Eli Zaretskii <eliz@gnu.org>
6112
6113 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
6114 display string and the previous row comes from the same string and
6115 is empty. (Bug#9739) (Bug#9738)
6116
8fe012c4
SM
61172011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
6118
6119 * doc.c (get_doc_string): Encode file name (bug#9735).
6120
0074aef2
EZ
61212011-10-12 Eli Zaretskii <eliz@gnu.org>
6122
79beb178
EZ
6123 * bidi.c (bidi_level_of_next_char):
6124 * xdisp.c (get_visually_first_element): Remove old incorrect
6125 comments regarding the Unicode Line Separator character.
6126
0074aef2
EZ
6127 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
6128
6e4b3fbe
DA
61292011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
6130
6131 * alloc.c (Fgc_status): Do not access beyond zombies array
6132 boundary if nzombies > MAX_ZOMBIES.
6133 * alloc.c (dump_zombies): Add missing format specifier.
6134
0324f3af
PE
61352011-10-12 Paul Eggert <eggert@cs.ucla.edu>
6136
b5525cac
PE
6137 * xdisp.c (set_cursor_from_row): Simplify conditionals,
6138 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
6139
0324f3af
PE
6140 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
6141 Some packages use them to denote characters with modifiers.
6142
e9b5f888
AS
61432011-10-11 Andreas Schwab <schwab@linux-m68k.org>
6144
6145 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
6146 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
6147 matching a pp-number. Rename parameter var to var1.
6148
127827c0
SM
61492011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
6150
6151 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
6152
c8fd3bd0
GM
61532011-10-08 Glenn Morris <rgm@gnu.org>
6154
6155 * callint.c (Fcall_interactively): Give a more explicit error for the
6156 'c' case with a non-character input. (Bug#8479)
6157
352ec8ff
EZ
61582011-10-08 Eli Zaretskii <eliz@gnu.org>
6159
03669ccb
EZ
6160 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
6161 lines.
7061c986
EZ
6162 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
6163 lines that are hscrolled on the left.
03669ccb 6164
352ec8ff
EZ
6165 * dispnew.c (buffer_posn_from_coords): Account for a possible
6166 presence of header-line. (Bug#4426)
6167
a66cfb1c
SM
61682011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
6169
6b02f655
SM
6170 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
6171 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 6172
7c5ee88e
PE
61732011-10-07 Paul Eggert <eggert@cs.ucla.edu>
6174
6175 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
6176 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
6177 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
6178 this makes Emacs dump core during garbage collection on rare
6179 occasions. sizeof is obviously inferior to offsetof here, so
6180 stick with offsetof.
6181 (GC_POINTER_ALIGNMENT): New macro.
6182 (mark_memory): Omit 3rd (offset) arg; caller changed.
6183 Don't assume EMACS_INT alignment is the same as pointer alignment.
6184
df1bbe5b
SM
61852011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
6186
6187 * keyboard.c (read_key_sequence_remapped): New var.
6188 (read_key_sequence): Compute remapping in the right buffer.
6189 (command_loop_1): Use read_key_sequence's remapping directly.
6190
51553db6
SM
61912011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6192
32c1fffd
SM
6193 * dired.c (file_name_completion): Don't expand file name.
6194 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
6195 before checking file name handler.
6196
51553db6
SM
6197 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
6198 they've been requested explicitly (bug#9591).
6199
b6bd1599 62002011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
6201
6202 * keymap.c (Fsingle_key_description): Use make_specified_string
6203 instead of build_string to build string from push_key_description.
6204 (Bug#5193)
6205
f701dc2a
PE
62062011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6207
4222c55d
PE
6208 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
6209 This fixes a Y2038 bug on 64-bit hosts.
6210 * buffer.c (reset_buffer):
6211 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
6212 (Fclear_buffer_auto_save_failure):
6213 Use 0, not -1, to represent an unset failure time, since time_t
6214 might not be signed.
6215
f701dc2a
PE
6216 Remove dependency on glibc malloc internals.
6217 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6218 Move back here from lisp.h, but with their new implementations.
6219 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6220 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
6221 * charset.c (charset_table_init): New static var.
6222 (syms_of_charset): Use it instead of xmalloc. This removes a
6223 dependency on glibc malloc internals. See Eli Zaretskii's comment in
6224 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
6225 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6226 Move back to alloc.c.
6227 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6228 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
6229
9ceebf39
JD
62302011-09-30 Jan Djärv <jan.h.d@swipnet.se>
6231
6232 * nsterm.m (windowDidResize): Call x_set_window_size only when
6233 ns_in_resize is true. Otherwise set pixelwidth/height and
6234 call change_frame_size (Bug#9628).
6235
cb993c58
PE
62362011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6237
3930c88b
PE
6238 Port --enable-checking=all to Fedora 14 x86-64.
6239 * charset.c (syms_of_charset): Also account for glibc malloc's
6240 internal overhead when calculating the initial malloc maximum.
6241
cb993c58
PE
6242 Port --enable-checking=all to Fedora 14 x86.
6243 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6244 Move to lisp.h.
6245 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
6246 (overrun_check_realloc, overrun_check_free):
6247 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
6248 That way, xmalloc returns a properly-aligned pointer even if
6249 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
6250 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
6251 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
6252 into account when calculating the initial malloc maximum.
6253 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6254 Move here from alloc.c, so that charset.c can use it too.
6255 Properly align; the old code wasn't right for common 32-bit hosts
6256 when configured with --enable-checking=all.
6257 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6258 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
6259
31bed486
EZ
62602011-09-29 Eli Zaretskii <eliz@gnu.org>
6261
04c70788 6262 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
6263 use EDOM.
6264
fbcaa2f3
EZ
62652011-09-28 Eli Zaretskii <eliz@gnu.org>
6266
6267 * xdisp.c (compute_display_string_end): If there's no display
6268 string at CHARPOS, return -1.
6269
6270 * bidi.c (bidi_fetch_char): When compute_display_string_end
6271 returns a negative value, treat the character as a normal
6272 character not covered by a display string. (Bug#9624)
6273
a239d4e9
JB
62742011-09-28 Juanma Barranquero <lekktu@gmail.com>
6275
6276 * lread.c (Fread_from_string): Fix typo in docstring.
6277
88652fd5
EZ
62782011-09-27 Eli Zaretskii <eliz@gnu.org>
6279
6280 * xdisp.c (handle_invisible_prop): If invisible text ends on a
6281 newline, reseat the iterator instead of bidi-iterating there one
6282 character at a time. (Bug#9610)
32c1fffd
SM
6283 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
6284 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 6285
ed497dd4
AS
62862011-09-27 Andreas Schwab <schwab@linux-m68k.org>
6287
6288 * lread.c (readevalloop): Use correct code for NBSP.
6289 (read1): Likewise. (Bug#9608)
6290
b2bf61aa
MA
62912011-09-25 Michael Albinus <michael.albinus@gmx.de>
6292
6293 * dbusbind.c (Fdbus_register_signal): When service is not
6294 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
6295
32bbb17c
GM
62962011-09-25 Glenn Morris <rgm@gnu.org>
6297
6298 * buffer.c (truncate-lines): Doc fix.
6299
94e0933e
CY
63002011-09-24 Chong Yidong <cyd@stupidchicken.com>
6301
6302 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6303 (Fset_window_next_buffers): Doc fix.
6304
cddde921
GM
63052011-09-24 Glenn Morris <rgm@gnu.org>
6306
6307 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6308
1260aef1
PE
63092011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6310
25b4bfa0
PE
6311 Fix minor problems found by static checking.
6312 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
6313 * indent.c (Fvertical_motion): Fix == vs = typo.
6314
e3cbd34b
EZ
63152011-09-24 Eli Zaretskii <eliz@gnu.org>
6316
a66cfb1c
SM
6317 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6318 Default value is now t. Doc fix.
6bf7006f 6319
e3cbd34b 6320 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 6321 logic when moving up, not only when moving down. Fix the
e3cbd34b 6322 confusing name and values of the it_overshoot_expected variable;
32c1fffd 6323 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
6324
6325 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6326 CHARPOS is covered by a display string which includes newlines.
6327 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6328 is covered by a display string with embedded newlines.
6329
a3de0cbd
MA
63302011-09-24 Michael Albinus <michael.albinus@gmx.de>
6331
6332 * dbusbind.c (Fdbus_register_signal): Add match rule to
6333 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
6334 (Fdbus_register_method, Vdbus_registered_objects_table):
6335 Fix docstring.
a3de0cbd 6336
b260039d
JM
63372011-09-24 Jim Meyering <meyering@redhat.com>
6338
32c1fffd 6339 do not ignore write error for any output size
b260039d
JM
6340 The previous change was incomplete.
6341 While it makes emacs --batch detect the vast majority of stdout
6342 write failures, errors were still ignored whenever the output size is
6343 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6344 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6345 && echo FAIL: ignored write error
6346 FAIL: ignored write error
6347 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6348 && echo FAIL: ignored write error
6349 FAIL: ignored write error
6350 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6351
8eca8a7c
AS
63522011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6353
6354 * emacs.c (Fkill_emacs): In noninteractive mode exit
6355 non-successfully if a write error occurred on stdout. (Bug#9574)
6356
3341db62
EZ
63572011-09-21 Eli Zaretskii <eliz@gnu.org>
6358
6359 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6360 the xassert test.
6361
6362 * dispextern.h (struct it): Update the comment documenting what
6363 can it->OBJECT be.
6364
8c203dbf
EZ
63652011-09-20 Eli Zaretskii <eliz@gnu.org>
6366
6367 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6368 a display string, extend search for cursor position to end of row.
6369 (find_row_edges): If the row ends in a newline from a display
6370 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6371 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
6372 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6373 non-empty line. Fixes confusing cursor motion with arrow keys at
6374 the beginning of a line that starts with whitespace.
8c203dbf 6375
a4824228
LMI
63762011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6377
6378 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
6379 (bug#9493).
6380
33ed493b
CY
63812011-09-18 Chong Yidong <cyd@stupidchicken.com>
6382
6383 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
6384 boolean (Bug#9154).
6385
56cd55c8
EZ
63862011-09-18 Eli Zaretskii <eliz@gnu.org>
6387
6388 * xdisp.c (display_line): Record maximum and minimum buffer
6389 positions even if no glyphs were produced (e.g., by a zero-width
6390 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6391 buffer positions that will be removed from the glyph row because
6392 they don't fit.
c02dcedf
EZ
6393 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6394 column is beyond frame width: don't subtract 1 "pixel" when
6395 computing width of the stretch.
3e62b7e0
EZ
6396 (reseat_at_next_visible_line_start): Undo the change made on
6397 2011-09-17 that saved paragraph information and restored it after
6398 the call to `reseat'. (Bug#9545)
56cd55c8 6399
5ed99d36 64002011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6401
6402 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6403 and turn window cursor on if cleared (Bug#9415).
6404
5ed99d36 64052011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6406
6407 * search.c (boyer_moore): Take unibyte characters from pattern
6408 literally. (Bug#9458)
6409
9bade7b2
EZ
64102011-09-18 Eli Zaretskii <eliz@gnu.org>
6411
6412 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6413
e5e9d610
PE
64142011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6415
87e4427a
PE
6416 Fix minor problem found by static checking.
6417 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6418 initialized, to pacify gcc -Wuninitialized.
6419
e5e9d610
PE
6420 * fileio.c: Report proper errno when syscall falls.
6421 (Finsert_file_contents): Save and restore errno,
6422 so that report_file_error outputs the correct diagnostic.
6423 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6424
a1674f0b
EZ
64252011-09-18 Eli Zaretskii <eliz@gnu.org>
6426
6427 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6428
fbfb6dd4
EZ
64292011-09-17 Eli Zaretskii <eliz@gnu.org>
6430
6431 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6432 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6433
bb187662
EZ
64342011-09-17 Eli Zaretskii <eliz@gnu.org>
6435
1137e8b8 6436 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6437 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6438
6439 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6440 (bidi_find_paragraph_start): Search back for paragraph beginning
6441 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6442 (bidi_move_to_visually_next): Only trigger paragraph-related
6443 computations when the last character is a newline or at EOB, not
6444 just any NEUTRAL_B. (Bug#9470)
6445
bb187662
EZ
6446 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6447 truncated lines if point is covered by a display string. (Bug#9524)
6448
2e621251
PE
64492011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6450
6451 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6452 (cons_to_x_long): New function.
6453 (lisp_data_to_selection_data): Use it. Correct the test for
6454 short-versus-long data; it was negated. Break out of vector
6455 loop, for efficiency, when a long datum is discovered.
6456
91a15bc6
SM
64572011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6458
6459 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6460
b41c3a35
EZ
64612011-09-16 Eli Zaretskii <eliz@gnu.org>
6462
6463 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6464 GCC PR/17406) by declaring this function with external scope.
6465
7812ba2d
PE
64662011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6467
6468 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6469 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6470
cf7edc2a
AS
64712011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6472
6473 * editfns.c (Fformat): Correctly handle text properties on "%%".
6474
bd01620e
EZ
64752011-09-15 Eli Zaretskii <eliz@gnu.org>
6476
6477 * xterm.c (x_draw_composite_glyph_string_foreground):
6478 * w32term.c (x_draw_composite_glyph_string_foreground):
6479 * term.c (encode_terminal_code):
6480 * composite.c (composition_update_it, get_composition_id):
6481 * xdisp.c (get_next_display_element)
6482 (fill_composite_glyph_string): Add comments about special meaning
6483 of TAB characters in a composition.
6484
a02719a3
PE
64852011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6486
6487 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6488 This occurs when processing a multibyte format.
6489 Problem reported by Wolfgang Jenker.
a02719a3 6490
72589a3c
JB
64912011-09-15 Johan Bockgård <bojohan@gnu.org>
6492
6493 * xdisp.c (try_cursor_movement): Only check for exact match if
6494 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6495
1c14176c
PE
64962011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6497
6498 Remove unused external symbols.
6499 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6500 * xdisp.c (calc_pixel_width_or_height): Now static.
6501 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6502 * indent.c (check_display_width):
6503 * w32term.c: Fix comment to match code.
6504 * xterm.c, xterm.h (x_catching_errors): Remove.
6505
d2eea5b5
PE
65062011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6507
6508 * xselect.c: Use signed conversions more consistently (Bug#9498).
6509 (selection_data_to_lisp_data): Assume incoming selection data are
6510 signed integers, not unsigned. This is to be consistent with
6511 outgoing selection data, which was modified to use signed integers
6512 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6513 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6514 expects long, not unsigned long.
6515
46888499
EZ
65162011-09-14 Eli Zaretskii <eliz@gnu.org>
6517
6518 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6519 computation of loop end. Reported by Johan Bockgård
6520 <bojohan@gnu.org>.
6521
ef8ef9fb
CY
65222011-09-13 Chong Yidong <cyd@stupidchicken.com>
6523
6524 * frame.c (Fother_visible_frames_p): Function deleted.
6525
fa819fed
EZ
65262011-09-12 Eli Zaretskii <eliz@gnu.org>
6527
6528 * indent.c (compute_motion): Process display vector front to back
6529 rather than the other way around. (Bug#2496)
6530
2ba8e008
SM
65312011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6532
6533 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6534
20f53c69
CY
65352011-09-11 Chong Yidong <cyd@stupidchicken.com>
6536
6537 * minibuf.c (Fread_from_minibuffer): Doc fix.
6538
d562d7a4
EZ
65392011-09-11 Eli Zaretskii <eliz@gnu.org>
6540
6541 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6542 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6543
1c4d7f3d
LMI
65442011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6545
6546 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6547 value for non-existent files.
6548
b885bf36
EZ
65492011-09-11 Eli Zaretskii <eliz@gnu.org>
6550
6551 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6552 set its "size" to -1. This will set the modtime_size field of
6553 the corresponding buffer to -1, which is what
6554 verify-visited-file-modtime expects for files that do not exist.
6555 (Bug#9139)
6556
6612f0bf
PE
65572011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6558
6559 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6560 here ...
6561 * lisp.h: ... from here. push_key_description is no longer
6562 defined in keyboard.c, so its declaration should not be in
6563 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6564 logically belongs with push_key_description.
6565
dfb3f755
PE
65662011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6567
6568 * buffer.h: Include <sys/types.h> instead of <time.h>.
6569 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6570 Problem reported by Herbert J. Skuhra.
6571
3134906c
LMI
65722011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6573
6574 * xml.c (parse_region): Make the parsing work for
6575 non-comment-starting XML files again (bug#9144).
6576
8d903f4e
AS
65772011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6578
6579 * image.c (gif_load): Fix calculation of bottom and right corner.
6580 (Bug#9468)
6581
80ad64f4
EZ
65822011-09-10 Eli Zaretskii <eliz@gnu.org>
6583
6584 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6585 redisplay in small windows.
6586
208a048d
EZ
65872011-09-09 Eli Zaretskii <eliz@gnu.org>
6588
6589 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6590
9b1c252e
MR
65912011-09-08 Martin Rudalics <rudalics@gmx.at>
6592
6593 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6594 Operate on live windows only.
6595
2949f33b
JB
65962011-09-08 Juanma Barranquero <lekktu@gmail.com>
6597
6598 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6599
e08dcafd
EZ
66002011-09-07 Eli Zaretskii <eliz@gnu.org>
6601
6602 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6603 only under bidi iteration.
6604
115b96bd
JD
66052011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6606
6607 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6608
c8199d0f
PE
66092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6612 Without this fix, the command to link temacs failed due to an
6613 undefined symbol __builtin_isnan. This is because
6614 /usr/include/iso/math_c99.h #defines isnan(x) to
6615 __builtin_isnan(x), but the bundled gcc, which identifies itself
6616 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6617 a __builtin_isnan.
6618 * floatfns.c (isnan): #undef, and then #define to a clone of
6619 what's in data.c.
6620 (Fisnan): Always define, since it's always available now.
6621 (syms_of_floatfns): Always define isnan at the Lisp level.
6622
e39b275c 66232011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6624
6625 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6626
b2db44d9 66272011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6628
f4af5137 6629 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6630 The previous code assumed that file offsets (off_t values) fit in
6631 EMACS_INT variables, which is not true on typical 32-bit hosts.
6632 The code messed up by falsely reporting buffer overflow in cases
6633 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6634 when "big" contains more than 2**29 bytes, even though this
6635 inserts just one byte and does not overflow the buffer.
6636 (Finsert_file_contents): Store file offsets as off_t
6637 values, not as EMACS_INT values. Check for overflow when
6638 converting between EMACS_INT and off_t. When checking for
6639 buffer overflow or for overlap, take the offsets into account.
6640 Don't use EMACS_INT for small values where int suffices.
6641 When checking for overlap, fix a typo: ZV was used where
6642 ZV_BYTE was intended.
6643 (Fwrite_region): Don't assume off_t fits into 'long'.
6644 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6645
ecfc0a49
MA
66462011-09-05 Michael Albinus <michael.albinus@gmx.de>
6647
6648 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6649
6511acf2 66502011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6651
0999621a 6652 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6653
6654 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6655 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6656 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6657 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6658 (modify_event_symbol): Do not assume that the length of
6659 name_alist_or_stem is safe to alloca and fits in int.
6660 (Fexecute_extended_command): Likewise for function name and binding.
6661 (Frecursion_depth): Wrap around reliably on integer overflow.
6662 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6663 since some callers pass EMACS_INT values.
6664 (Fsingle_key_description): Don't crash if symbol name contains more
6665 than MAX_ALLOCA bytes.
6666 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6667 (get_minibuffer): Arg is now EMACS_INT, not int.
6668 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6669 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6670 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6671
2be7d702
PE
6672 * dbusbind.c (signature_cat): New function.
6673 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6674 Do not overrun buffer; instead, report string overflow.
6675
9d1df220
PE
6676 * dispnew.c (add_window_display_history): Don't overrun buffer.
6677 Truncate instead; this is OK since it's just a log.
6678
33ef5c64
PE
6679 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6680 even if the time zone offset is outlandishly large.
6681 Don't mishandle offset == INT_MIN.
6682
66c6fdd5
PE
6683 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6684 when creating daemon; the previous buffer-overflow check was incorrect.
6685
d749b01b
PE
6686 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6687 which has the guts of the old verror function.
6688
b5cd1905
PE
6689 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6690 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6691
6e1a67fb
PE
6692 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6693 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6694 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6695 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6696 length of string rather than counting it via multiple sprintfs;
6697 that's simpler and more reliable.
c21721cc
PE
6698 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6699 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6700 sprintf, in case result does not fit in int.
6701
c57b67fc
PE
6702 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6703 (fontset_from_font): Print it.
6704
8a401434
PE
6705 * frame.c (tty_frame_count): Now printmax_t, not int.
6706 (make_terminal_frame, set_term_frame_name): Print it.
6707 (x_report_frame_params): In X, window IDs are unsigned long,
6708 not signed long, so print them as unsigned.
6709 (validate_x_resource_name): Check for implausibly long names,
6710 and don't assume name length fits in 'int'.
6711 (x_get_resource_string): Don't blindly alloca invocation name;
6712 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6713 not fit in int.
6714
6e1a67fb
PE
6715 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6716 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6717 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6718
0df02bf3
PE
6719 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6720 Use esprintf, not sprintf, in case result does not fit in int.
6721
48e30793
PE
6722 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6723 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6724 it as a large positive number.
6725 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6726 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6727
a66ff6d8
PE
6728 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6729 in case result does not fit in int.
6730
aca216ff
PE
6731 * print.c (float_to_string): Detect width overflow more reliably.
6732 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6733 buffer overrun. Don't assume list length fits in 'int'. Treat
6734 print length of 0 as 0, not as infinity; to be consistent with other
6735 uses of print length in this function. Don't overflow print length
6736 index. Don't assume hash table size fits in 'long', or that
6737 vectorlike size fits in 'unsigned long'.
6738
31c286f7
PE
6739 * process.c (make_process): Use printmax_t, not int, to format
6740 process-name gensyms.
6741
55e5faa1
PE
6742 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6743
80f2e268
PE
6744 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6745 to avoid potential buffer overrun.
6746
670741ab
PE
6747 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6748 if X resource line is longer than 512 bytes.
6749
b7163a50
PE
6750 * xfns.c (x_window): Make sprintf buffer a bit bigger
6751 to avoid potential buffer overrun.
6752
ae58ff1f
PE
6753 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6754
c43c8a6a
PE
6755 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6756
3f8236f4
PE
67572011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6758
53e9fe90 6759 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6760 Without these, Emacs silently mishandles large integers sometimes.
6761 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6762 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6763
6511acf2
PE
6764 * xdisp.c (try_window_id): Check Emacs fixnum range before
6765 converting to 'int'.
806add1d 6766
6511acf2 6767 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6768 Check that an Emacs fixnum is in range before assigning it to 'int'.
6769 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6770 values converted from Emacs fixnums.
6771 (Frecenter): Don't wrap around a line count if it is out of 'int'
6772 range; instead, treat it as an extreme value.
6773 (Fset_window_configuration, compare_window_configurations):
6774 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6775
6511acf2
PE
6776 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6777 that can exceed INT_MAX. Check that EMACS_INT value is in range
6778 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6779 (match_limit): Don't assume that a fixnum can fit in 'int'.
6780
6511acf2 6781 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6782 exceed INT_MAX.
6783
6511acf2 6784 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6785 (Fvertical_motion): Don't wrap around LINES values that don't fit
6786 in 'int'. Instead, treat them as extreme values. This is good
6787 enough for windows, which can't have more than INT_MAX lines anyway.
6788
fcb901a7
LMI
67892011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6790
0f2f6b6d
LMI
6791 * Require libxml/parser.h to avoid compilation warning.
6792
fcb901a7
LMI
6793 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6794
6795 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6796 since this reportedly can destroy thread storage.
6797
6e20a0d4
CY
67982011-08-30 Chong Yidong <cyd@stupidchicken.com>
6799
6800 * syntax.c (find_defun_start): Update all cache variables if
6801 exiting early (Bug#9401).
6802
148ae00e
EZ
68032011-08-30 Eli Zaretskii <eliz@gnu.org>
6804
f6cfbd8f
EZ
6805 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6806
148ae00e
EZ
6807 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6808 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6809 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6810
6811 * term.c (tty_append_glyph): New function.
6812 (produce_stretch_glyph): Static function and its prototype deleted.
6813
a66cfb1c
SM
6814 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6815 Add prototypes.
148ae00e 6816
c4a07a4c
PE
68172011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6818
6819 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6820 when checking :margin (Bug#9390).
6821 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6822 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6823 so that the name doesn't mislead. All uses changed.
6824
6bc8cd65
JB
68252011-08-28 Johan Bockgård <bojohan@gnu.org>
6826
6827 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6828 set_tty_hooks.
6829
dca4927e
EZ
68302011-08-27 Eli Zaretskii <eliz@gnu.org>
6831
6832 * xdisp.c (move_it_to): Don't bail out early when reaching
6833 position beyond to_charpos, if we are scanning backwards.
6834 (move_it_vertically_backward): When DY == 0, make sure we get to
6835 the first character in the line after the newline.
6836
f2cad773
PE
68372011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6840 (ccl_driver): Do not generate an out-of-range pointer.
6841 (Fccl_execute_on_string): Remove unnecessary check for
6842 integer overflow, noted by Stefan Monnier in
6843 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6844 Remove a FIXME that didn't need fixing.
6845 Simplify the newly-introduced buffer reallocation code.
6846
0cae2cdb
JB
68472011-08-27 Juanma Barranquero <lekktu@gmail.com>
6848
6849 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6850
5fc295a4 68512011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6852
70c60eb2 6853 Integer and memory overflow issues (Bug#9196).
726e0ab1 6854
d31850da
PE
6855 * doc.c (get_doc_string): Rework so that
6856 get_doc_string_buffer_size is the actual buffer size, rather than
6857 being 1 less than the actual buffer size; this makes xpalloc more
6858 convenient.
6859
a69fbedb
PE
6860 * image.c (x_allocate_bitmap_record, cache_image):
6861 * xselect.c (Fx_register_dnd_atom):
6862 Simplify previous changes by using xpalloc.
6863
fe5c5d37
PE
6864 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6865 since either will do and ptrdiff_t is convenient with xpalloc.
6866
0065d054
PE
6867 * charset.c (charset_table_size)
6868 (struct charset_sort_data.priority): Now ptrdiff_t.
6869 (charset_compare): Don't overflow if priorities differ greatly.
6870 (Fsort_charsets): Don't assume list length fits in int.
6871 Check for size-calculation overflow when allocating sort data.
6872 (syms_of_charset): Allocate an initial charset table that is
6873 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6874
6875 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6876
6877 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6878 The actual value is always <= INT_MAX, and leaving it unsigned made
6879 overflow checking harder.
6880
6881 * dispextern.h (struct glyph_matrix.rows_allocated)
6882 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6883 with xpalloc. The values are still always <= INT_MAX.
6884
6885 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6886
6887 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6888 (SAFE_NALLOCA): New macro.
6889
6890 * region-cache.c (struct boundary.pos, find_cache_boundary)
6891 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6892 (set_cache_region, invalidate_region_cache)
6893 (revalidate_region_cache, know_region_cache, region_cache_forward)
6894 (region_cache_backward, pp_cache):
6895 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6896 so that ptrdiff_t * can be passed to xpalloc.
6897 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6898 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6899 (pp_cache): Don't assume cache_len fits in int.
6900 * region-cache.h: Adjust extern decls to match.
6901
6902 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6903 EMACS_INT, since either will do, for xpalloc.
6904
6905 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6906 (xnmalloc, xnrealloc, xpalloc): New functions.
6907
726e0ab1
PE
6908 * bidi.c (bidi_shelve_header_size): New constant.
6909 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6910 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6911
51f30bc5 6912 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6913 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6914 (overlay_strings):
6915 Don't update size of array until after memory allocation succeeds,
6916 because xmalloc/xrealloc may not return.
0065d054
PE
6917 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6918 now that we have proper integer overflow checking.
6919 (record_overlay_string, overlay_strings): Catch overflows when
6920 calculating size of overlay_str_buf.
726e0ab1 6921
0065d054
PE
6922 * callproc.c (Fcall_process): Check for size overflow when
6923 calculating size of args2.
6924 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6925 Normally we prefer signed values, but sticking with ptrdiff_t would
6926 require adding more-complicated checks.
726e0ab1
PE
6927
6928 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6929 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6930 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6931 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6932
6933 * character.c (Fstring): Check for size-calculation overflow.
6934
6935 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6936 unnecessary integer overflow. Check for size overflow.
6937 (encode_coding_object): Don't update size until xmalloc succeeds.
6938
6939 * composite.c (get_composition_id): Check for overflow in glyph
6940 length calculations.
6941
6942 Integer and memory overflow fixes for display code.
6943 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6944 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6945 (scrolling_window): Check for overflow in size calculations.
6946 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6947 Don't assume glyph table len fits in int.
6948 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6949 (row_table_size): Now ptrdiff_t, not int.
6950 (scrolling_window): Avoid overflow in size calculations.
6951 Don't update size until allocation succeeds.
6952 * fns.c (concat): Check for overflow in size calculations.
6953 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6954 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6955 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6956
6957 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6958 (get_doc_string): Check for size calculation overflow.
6959 Don't update size until allocation succeeds.
6960 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6961 EMACS_INT, where ptrdiff_t will do.
6962 (Fsubstitute_command_keys): Check for string overflow.
6963
6964 * editfns.c (set_time_zone_rule): Don't assume environment length
6965 fits in int.
6966 (message_length): Now ptrdiff_t, not int.
6967 (Fmessage_box): Don't update size until allocation succeeds.
6968 Don't assume message length fits in int.
6969 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6970
0065d054
PE
6971 * emacs.c (main): Do not reallocate argv, since there is a null at
6972 the end that can be overwritten, and this way there's no need to
6973 worry about size-calculation overflow.
6974 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6975
6976 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6977 alloc succeeds.
6978 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6979
6980 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6981 (x_set_scroll_bar_width, x_figure_window_size):
6982 Check for integer overflow.
6983 (x_set_alpha): Do not assume XINT fits in int.
6984
6985 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6986 This is for the members text_lines, text_cols, total_lines, total_cols,
6987 where the system imposes an 'int' limit.
6988
6989 * fringe.c (Fdefine_fringe_bitmap):
6990 Don't update size until alloc works.
6991
6992 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6993 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6994
6995 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6996 Check for size-calculation overflow.
6997 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6998 do, as we prefer signed integers.
6999 (id_to_widget.max_size, id_to_widget.used)
7000 (xg_store_widget_in_map, xg_remove_widget_from_map)
7001 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
7002 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
7003 Use and return ptrdiff_t, not int.
7004 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
7005 * gtkutil.h: Change prototypes to match the above.
7006
7007 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
7008 are duplicate now that they've been promoted to lisp.h.
7009 (x_allocate_bitmap_record, x_alloc_image_color)
7010 (make_image_cache, cache_image, xpm_load):
7011 Don't update size until alloc is done.
7012 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
7013 (x_detect_edges):
3256efce 7014 Check for size calculation overflow.
726e0ab1
PE
7015 (ct_colors_allocated_max): New constant.
7016 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
7017 overflow.
3256efce 7018
726e0ab1
PE
7019 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
7020 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
7021 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
7022 Use ptrdiff_t, not int, to count maps.
7023 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
7024 calculations. Don't update size until allocation succeeds.
7025 Redo calculations to avoid overflow.
726e0ab1
PE
7026 * keyboard.h: Change prototypes to match the above.
7027
7028 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
7029 to count maps.
7030 (current_minor_maps): Check for size calculation overflow.
7031 * keymap.h: Change prototypes to match the above.
7032
7033 * lread.c (read1, init_obarray): Don't update size until alloc done.
7034
7035 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
7036 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
7037
726e0ab1
PE
7038 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
7039 Now ptrdiff_t, not int.
7040 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
7041 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
7042
7043 * process.c (Fnetwork_interface_list): Check for overflow
7044 in size calculation.
7045
7046 * region-cache.c (move_cache_gap): Check for size calculation overflow.
7047
7048 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
7049 overflow. Don't bother calling xmalloc when xrealloc will do.
7050
7051 * search.c (Freplace_match): Check for size calculation overflow.
7052 (Fset_match_data): Don't assume list lengths fit in 'int'.
7053
7054 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
7055 for command line length. Do not attempt to address one before the
7056 beginning of an array, as that's not portable.
7057
7058 * term.c (max_frame_lines): Remove; unused.
7059 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
7060 not int.
7061 (encode_terminal_code, calculate_costs): Check for size
7062 calculation overflow.
7063 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
7064 table lengths and related sizes. Don't update size until alloc
7065 done. Redo calculations to avoid overflow.
7066 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
7067
7068 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
7069 subtracting pointers.
7070 (gobble_line): Check for overflow more carefully. Don't update size
7071 until alloc done.
7072
7073 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
7074 Don't update size until alloc done.
7075 Redo size calculations to avoid overflow.
7076 Check for size calculation overflow.
0065d054 7077 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
7078
7079 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
7080 Use ptrdiff_t, not int, for sizes.
7081 (store_mode_line_noprop_char): Don't update size until alloc done.
7082
0065d054
PE
7083 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
7084 Use ptrdiff_t, not int, for sizes.
7085 (Finternal_make_lisp_face, cache_face):
7086 Check for size calculation overflow.
7087 (cache_face): Treat size calculation overflows as if they were
7088 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
7089
7090 * xfns.c (x_encode_text, x_set_name_internal)
7091 (Fx_change_window_property): Use ptrdiff_t, not int, to count
7092 sizes, since they can exceed INT_MAX in size. Check for size
7093 calculation overflow.
7094
0065d054
PE
7095 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
7096 (xg_select): Check for size calculation overflow.
726e0ab1
PE
7097 Don't update size until alloc done.
7098
0065d054 7099 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 7100 as sprintf is limited to int lengths.
1d526e2f 7101
252c5ee1
PE
7102 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
7103 (X_LONG_MIN): New macros.
864d7ce7
PE
7104 Use them to make the following changes clearer.
7105 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
7106 This change doesn't affect the value now, but it may help remind
7107 future maintainers not to raise the value too much later.
7108 (SELECTION_QUANTUM): Remove, replacing with ...
7109 (selection_quantum): ... new function, which avoids overflow.
7110 All uses changed.
7111 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
7112 assumption that selection length fits in 'int'.
7113 (x_reply_selection_request, x_handle_selection_request)
7114 (x_get_window_property, receive_incremental_selection)
7115 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
7116 (lisp_data_to_selection_data, clean_local_selection_data):
7117 Use ptrdiff_t, not int, to record length of selection.
7118 (x_reply_selection_request, x_get_window_property)
7119 (receive_incremental_selection, x_property_data_to_lisp):
7120 Redo calculations to avoid overflow.
7121 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 7122 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
7123 something.
7124 (x_get_window_property, receive_incremental_selection)
7125 (lisp_data_to_selection_data, x_property_data_to_lisp):
7126 Check for size-calculation overflow.
7127 (x_get_window_property, receive_incremental_selection)
7128 (lisp_data_to_selection_data, Fx_register_dnd_atom):
7129 Don't store size until memory allocation succeeds.
7130 (x_get_window_property): Plug memory leak on memory exhaustion.
7131 Don't double-block input; malloc is safe here. Don't assume 2**34
7132 - 4 fits in unsigned long. Add an xassert to check
7133 XGetWindowProperty overflow. Be more careful about overflow
7134 calculations, and distinguish size from memory overflow better.
7135 (receive_incremental_selection): When tracing, don't assume
7136 unsigned int is less than INT_MAX.
7137 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
7138 harmful) conversions of unsigned short to int.
7139 (lisp_data_to_selection_data): Don't assume that integers
7140 in the range -65535 through -1 fit in an X unsigned short.
7141 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
7142 result parameters unless successful. Rely on cons_to_unsigned
7143 to report problems with elements; the old code wasn't right anyway.
7144 (x_check_property_data): Check for int overflow; we cannot use
7145 a wider type due to X limits.
7146 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
7147
726e0ab1 7148 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 7149
0065d054
PE
7150 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
7151 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
7152 (x_color_cells): Don't store size until memory allocation succeeds.
7153 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 7154 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
7155 (x_term_init): Don't assume length fits in int (sprintf is limited
7156 to int size).
bc18e09d 7157
ebfa62c0
PE
7158 Use ptrdiff_t for composition IDs.
7159 * character.c (lisp_string_width):
7160 * composite.c (composition_table_size, n_compositions)
7161 (get_composition_id, composition_gstring_from_id):
7162 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
7163 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
7164 * window.c (Frecenter):
7165 Use ptrdiff_t, not int, for composition IDs.
7166 * composite.c (get_composition_id): Check for integer overflow.
7167 * composite.h: Adjust prototypes to match the above changes.
7168
d3411f89
PE
7169 Use ptrdiff_t for hash table indexes.
7170 * category.c (hash_get_category_set):
7171 * ccl.c (ccl_driver):
7172 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
7173 * coding.c (coding_system_charset_list, detect_coding_system):
7174 * coding.h (struct coding_system.id):
7175 * composite.c (get_composition_id, gstring_lookup_cache):
7176 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
7177 * image.c (xpm_get_color_table_h):
7178 * lisp.h (hash_lookup, hash_put):
7179 * minibuf.c (Ftest_completion):
7180 Use ptrdiff_t for hash table indexes, not int (which is too
7181 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
7182 32-bit --with-wide-int hosts).
7183
e097a6fa
PE
7184 * charset.c (Fdefine_charset_internal): Check for integer overflow.
7185 Add a FIXME comment about memory leaks.
7186 (syms_of_charset): Don't assume xmalloc returns.
7187
5637687f
PE
7188 Don't assume that stated character widths fit in int.
7189 * character.c (Fchar_width, c_string_width, lisp_string_width):
7190 * character.h (CHAR_WIDTH):
7191 * indent.c (MULTIBYTE_BYTES_WIDTH):
7192 Use sanitize_char_width to avoid undefined and/or bad behavior
7193 with outlandish widths.
a66cfb1c 7194 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
7195 now that we have two such functions. All uses changed.
7196 (sanitize_char_width): New inline function.
7197
a2271ba2
PE
7198 Don't assume that tab-width fits in int.
7199 * character.h (sanitize_width): New inline function.
7200 (SANE_TAB_WIDTH): New macro.
7201 (ASCII_CHAR_WIDTH): Use it.
7202 * indent.c (sane_tab_width): Remove. All uses replaced by
7203 SANE_TAB_WIDTH (current_buffer).
7204 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
7205
18c52557
PE
7206 * fileio.c: Integer overflow issues with file modes.
7207 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
7208
caeeedc1
PE
7209 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
7210 Remove unreachable code.
7211 (read_hex, load_charset_map_from_file): Check for integer overflow.
7212
6df6ae42 7213 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
7214 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
7215 (x_send_scroll_bar_event): Likewise. Check that the size does not
7216 exceed limits imposed by XClientMessageEvent, as well as the usual
7217 ptrdiff_t and size_t limits.
7218
b13995db
PE
7219 * keyboard.c: Overflow, signedness and related fixes.
7220 (make_lispy_movement): Use same integer type in forward decl
7221 that is used in the definition.
7222 (read_key_sequence, keyremap_step):
7223 Change bufsize argument back to int, undoing my 2011-03-30 change.
7224 We prefer signed types, and int is wide enough here.
7225 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
7226 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
7227 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
7228 length, not size_t. Use ptrdiff_t for index, not int.
7229 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
7230 possibility of integer overflow.
7231
13464394
PE
7232 Overflow, signedness and related fixes for images.
7233
7234 * dispextern.h (struct it.stack[0].u.image.image_id)
7235 (struct_it.image_id, struct image.id, struct image_cache.size)
7236 (struct image_cache.used, struct image_cache.ref_count):
7237 * gtkutil.c (update_frame_tool_bar):
7238 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
7239 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
7240 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
7241 * nsmenu.m (update_frame_tool_bar):
7242 * xdisp.c (calc_pixel_width_or_height):
7243 * xfns.c (image_cache_refcount):
7244 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
7245 on typical 64-bit hosts.
7246
7247 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7248 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
7249 Omit unnecessary casts to int.
7250 (parse_image_spec): Check that integers fall into 'int' range
7251 when the callers expect that.
7252 (image_ascent): Redo ascent calculation to avoid int overflow.
7253 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
7254 (lookup_image): Remove unnecessary tests.
7255 (xbm_image_p): Locals are now of int, not EMACS_INT,
7256 since parse_image_check makes sure they fit into int.
7257 (png_load, gif_load, svg_load_image):
7258 Prefer int to unsigned where either will do.
7259 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
7260 old tiff_error_handler and tiff_warning_handler.
7261 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
7262 stack buffer overflows. It uses only the features of vsnprintf
7263 that are common to both POSIX and native Microsoft.
7264 (tiff_error_handler, tiff_warning_handler): Use it.
7265 (tiff_load, gif_load, imagemagick_load_image):
7266 Don't assume :index value fits in 'int'.
7267 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
7268 (imagemagick_load_image): Check that crop parameters fit into
7269 the integer types that MagickCropImage accepts. Don't assume
7270 Vimagemagick_render_type has a nonnegative value. Don't assume
7271 size_t fits in 'long'.
7272 (gs_load): Use printmax_t to print the widest integers possible.
7273 Check for integer overflow when computing image height and width.
7274
c11821d4
EZ
72752011-08-26 Eli Zaretskii <eliz@gnu.org>
7276
7277 * xdisp.c (redisplay_window): Don't force window start if point
7278 will be invisible in the resulting window. (Bug#9324)
7279
0c95fcf7
EZ
72802011-08-25 Eli Zaretskii <eliz@gnu.org>
7281
7282 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
7283 the display spec is of the form `(space ...)'.
7284 (handle_display_spec): Return the value returned by
7285 handle_single_display_spec, not just 1 or zero.
7286 (handle_single_display_spec): If the display spec is of the form
7287 `(space ...)', and specifies display in the text area, return 2
7288 rather than 1.
fee65a97 7289 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
7290 accurately, and prefer exact match for point under bidi.
7291 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
7292
7293 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
7294 into disp_prop; all users changed.
7295
7296 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
7297 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
7298 for the text covered by the display property.
7299
e4ed06f1
CY
73002011-08-25 Chong Yidong <cyd@stupidchicken.com>
7301
7302 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7303 Change return value to nil.
7304 (Frecord_buffer): Delete unused function.
7305
f67cdd7f
EZ
73062011-08-24 Eli Zaretskii <eliz@gnu.org>
7307
5980d4c6
EZ
7308 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7309 buffers, return left-to-right.
8610fe8b
EZ
7310 (set_cursor_from_row): Consider candidate row a win if its glyph
7311 represents a newline and point is on that newline. Fixes cursor
7312 positioning on the newline at EOL of R2L text within L2R
7313 paragraph, and vice versa.
7314 (try_cursor_movement): Check continued rows, in addition to
7315 continuation rows. Fixes unwarranted scroll when point enters a
7316 continued line of R2L text within an L2R paragraph, or vice versa.
7317 (cursor_row_p): Consider the case of point being equal to
7318 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7319 from the end of a short line to the beginning of a continued line
7320 of R2L text within L2R paragraph.
7321 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7322 composed characters.
5980d4c6 7323
f67cdd7f
EZ
7324 * bidi.c (bidi_check_type): Use xassert.
7325 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7326 members.
7327
bca633fb
EZ
73282011-08-23 Eli Zaretskii <eliz@gnu.org>
7329
7330 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7331 a character.
7332
4a5885a7
CY
73332011-08-23 Chong Yidong <cyd@stupidchicken.com>
7334
7335 * nsfont.m (ns_otf_to_script): Fix typo.
7336
0902a04e
KH
73372011-08-22 Kenichi Handa <handa@m17n.org>
7338
7339 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7340 extra slot even if the purpose is char-code-property-table.
7341
1a2e6670
EZ
73422011-08-23 Eli Zaretskii <eliz@gnu.org>
7343
8ddde651
EZ
7344 * xdisp.c (redisplay_window): When computing centering_position,
7345 account for the height of the header line. (Bug#8874)
7346
425cc014
EZ
7347 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7348 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7349 candidate is selected by the mouse, and that candidate has a
7350 composed character under the mouse.
7351
1a2e6670
EZ
7352 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7353 coordinates reported by pos-visible-in-window-p for a composed
7354 character in column zero.
7355
8b76d6f8
SM
73562011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7357
7358 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7359
dac347dd
EZ
73602011-08-22 Eli Zaretskii <eliz@gnu.org>
7361
7362 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7363 consider it a hit if to_charpos is anywhere in the range of the
7364 composed buffer positions.
7365
e013fb34
CY
73662011-08-22 Chong Yidong <cyd@stupidchicken.com>
7367
7368 * image.c (gif_load): Don't assume that each subimage has the same
7369 dimensions as the base image. Handle disposal method that is
7370 "undefined" by the gif spec (Bug#9335).
7371
bd1ba3e8
CY
73722011-08-20 Chong Yidong <cyd@stupidchicken.com>
7373
7374 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 7375 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 7376
54a1215b
EZ
73772011-08-19 Eli Zaretskii <eliz@gnu.org>
7378
823564e5
EZ
7379 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
7380 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
7381 from an Org mode buffer to a Speedbar frame.
7382
54a1215b
EZ
7383 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
7384 a composition, take its buffer position from IT->cmp_it.charpos.
7385 Fixes cursor positioning at the beginning of a line that begins
7386 with a composed character.
7387
9778ebcc
EZ
73882011-08-18 Eli Zaretskii <eliz@gnu.org>
7389
0be6ee06
EZ
7390 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7391 character bidirectional type, use STRONG_L instead. Fixes crashes
7392 in a buffer produced by `describe-categories'.
7393
9778ebcc
EZ
7394 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7395 members before the level stack, so they would be saved and
7396 restored when copying iterator state. Fixes incorrect reordering
7397 around TABs covered by display properties.
7398
156bffbe
AS
73992011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7400
6b02f655 7401 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7402
72ad093b
CY
74032011-08-17 Chong Yidong <cyd@stupidchicken.com>
7404
7405 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7406 (internal_condition_case_2, internal_condition_case_n):
7407 Remove unnecessary aborts (Bug#9081).
72ad093b 7408
35774242
EZ
74092011-08-17 Eli Zaretskii <eliz@gnu.org>
7410
7411 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7412 has no `load' handler, try opening the file locally. (Bug#9311)
7413
db76dd85
KB
74142011-08-16 Ken Brown <kbrown@cornell.edu>
7415
7416 * gmalloc.c: Expand comment.
7417
b215eee5
EZ
74182011-08-16 Eli Zaretskii <eliz@gnu.org>
7419
7420 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7421 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7422
a4579d33
KB
74232011-08-16 Ken Brown <kbrown@cornell.edu>
7424
7425 Fix memory allocation problems in Cygwin build (Bug#9273).
7426
7427 * unexcw.c ( __malloc_initialized): Declare external variable.
7428 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7429
8b76d6f8
SM
7430 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7431 New variables.
a4579d33
KB
7432 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7433 dumped emacs.
7434 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7435 in the static heap.
7436 [CYGWIN] (special_realloc): New function.
7437 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7438 requests to realloc storage in the static heap.
7439
3ebec551
PE
74402011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7441
7442 * bidi.c (bidi_initialize): Remove unused local.
7443
9fd8be00
EZ
74442011-08-15 Eli Zaretskii <eliz@gnu.org>
7445
6b02f655
SM
7446 * bidimirror.h:
7447 * biditype.h: Remove file.
7448 * makefile.w32-in ($(BLD)/bidi.$(O)):
7449 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7450
7451 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7452
7453 * chartab.c: Improve commentary for the uniprop_table API.
7454
32413314
EZ
7455 * bidi.c (bidi_paragraph_init): Support zero value of
7456 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7457 (bidi_initialize): Use uniprop_table instead of including
7458 biditype.h and bidimirror.h.
32413314 7459
9fd8be00
EZ
7460 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7461 coordinates of the iterator when restoring from ppos_it.
7462 (Bug#9296)
7463
5cf2b69b
KH
74642011-08-14 Kenichi Handa <handa@m17n.org>
7465
7466 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7467 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7468
daf17d00
EZ
74692011-08-14 Eli Zaretskii <eliz@gnu.org>
7470
7471 * xdisp.c (move_it_in_display_line_to): Don't invoke
7472 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7473 ppos_it. Fixes vertical cursor motion when line beginning is
7474 covered by an image. (Bug#9296)
7475
08e3161a
JD
74762011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7477
7478 * nsterm.h (ns_run_ascript): Declare.
7479 (NSAPP_DATA2_RUNASSCRIPT): Define.
7480
7481 * nsfns.m (as_script, as_result, as_status): New static variables.
7482 (ns_run_ascript): New function.
5e617bc2 7483 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7484 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7485 the event loop. Get status from as_status (Bug#7276).
7486
7487 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7488 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7489 the event loop (Bug#7276).
7490
a3720aa2
AS
74912011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7492
7493 * gnutls.c (QCgnutls_bootprop_priority)
7494 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7495 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7496 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7497 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7498 (QCgnutls_bootprop_verify_hostname_error)
7499 (QCgnutls_bootprop_callbacks_verify): Rename from
7500 Qgnutls_bootprop_..., all uses changed.
7501
7502 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7503 uses changed.
7504
0a0d27fb
PE
75052011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7506
19d5c50c
PE
7507 * xfaces.c (Qframe_set_background_mode): Now static.
7508 * dispextern.h (Qframe_set_background_mode): Remove decl.
7509
0a0d27fb
PE
7510 * process.c (Fnetwork_interface_info): Declare local only if needed.
7511
377538cb
JD
75122011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7513
7514 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7515 (Fnetwork_interface_list): Allocate in increments of bytes instead
7516 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7517 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7518 sockaddr.
7519 (struct ifflag_def): notrailers is smart on OSX.
7520 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7521 Get hardware address with getifaddrs if available.
7522
08fff70c
EZ
75232011-08-12 Eli Zaretskii <eliz@gnu.org>
7524
7525 * xdisp.c (iterate_out_of_display_property): xassert that
7526 IT->position is set to within IT->object's boundaries. Break from
7527 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7528 when IT->position is set up wrongly due to some bug.
7529 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7530 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7531 entry. Force push_it to save on the stack the current
7532 buffer/string position, to be restored by pop_it. Fix flags in
7533 the iterator structure wrt the object coming from a display
7534 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7535 properties. (Bug#9284)
7536
7be1c708 75372011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7538
7be1c708
CY
7539 * fontset.c (fontset_get_font_group): Add proper type checks.
7540 (Bug#9172)
aac0c6e3 7541
7be1c708 75422011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7543
7be1c708
CY
7544 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7545 and LC_VERSION_MIN_MACOSX.
7546 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7547 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7548
97bb72a6
EZ
75492011-08-08 Eli Zaretskii <eliz@gnu.org>
7550
7551 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7552 no-display-properties-and-no-overlays under bidi display.
7553 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7554 properties and overlays.
97bb72a6 7555
d5617611
CY
75562011-08-08 Chong Yidong <cyd@stupidchicken.com>
7557
37e11a63
CY
7558 * editfns.c (Fset_time_zone_rule): Document relationship with the
7559 setenv function.
7560
d5617611
CY
7561 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7562 the font entity extracted from the cache (Bug#8109).
7563
58872834
CY
75642011-08-07 Chong Yidong <cyd@stupidchicken.com>
7565
7566 * composite.c (autocmp_chars): Don't reset point. That is done by
7567 restore_point_unwind (Bug#5984).
7568
75bfc667
JL
75692011-08-07 Juri Linkov <juri@jurta.org>
7570
7571 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7572 to show the arg `TIME' instead of `TIMEVAL'.
7573
d1410150
EZ
75742011-08-06 Eli Zaretskii <eliz@gnu.org>
7575
7576 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7577 display property strides EOL and includes a newline, as in
7578 longlines-mode. (Bug#9254)
75b771e4
EZ
7579 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7580 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7581
7582 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7583 is non-zero, even if the data buffer is NULL. Fixes a crash in
7584 vertical-motion with longlines-mode. (Bug#9254)
7585
35928349
EZ
75862011-08-05 Eli Zaretskii <eliz@gnu.org>
7587
ec7cc85b
EZ
7588 * bidi.c <bidi_cache_total_alloc>: Now static.
7589 (bidi_initialize): Initialize bidi_cache_total_alloc.
7590
8b76d6f8 7591 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7592 cache. (Bug#9221)
7593
7594 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7595 amount allocated this far in `bidi_cache_total_alloc'.
7596 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7597 non-zero, only free the data buffer without restoring the cache
7598 contents. All callers changed.
7599
7600 * dispextern.h (bidi_unshelve_cache): Update prototype.
7601
7602 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7603 (move_it_in_display_line, move_it_to)
7604 (move_it_vertically_backward, move_it_by_lines): Replace the call
7605 to xfree to an equivalent call to bidi_unshelve_cache.
7606 (move_it_in_display_line_to): Fix logic of returning
412b6358 7607 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7608
e2e2423b
EZ
76092011-08-05 Eli Zaretskii <eliz@gnu.org>
7610
7611 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7612 came from a string character with a `cursor' property. (Bug#9229)
7613
ae9e757a
JD
76142011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7615
7616 * Makefile.in (LIB_PTHREAD): New variable.
7617 (LIBES): Add LIB_PTHREAD (Bug#9216).
7618
7619 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7620 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7621
213bd7f2
AS
76222011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7623
6b02f655 7624 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7625
99aaf75f
JD
76262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7627
7628 * xterm.c (x_find_topmost_parent): New function.
7629 (x_set_frame_alpha): Find topmost parent window with
7630 x_find_topmost_parent and set the property there also (bug#9181).
7631 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7632
c74e9d86
PE
76332011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * callproc.c (Fcall_process): Avoid vfork clobbering
7636 the local vars buffer, coding_systems, current_dir.
7637
640c8776
SM
76382011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7639
7640 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7641
f26d0e4c
PE
76422011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7643
8a10d76c
PE
7644 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7645 so that it is not optimized away.
7646
f26d0e4c
PE
7647 * xdisp.c (compute_display_string_pos): Remove unused local.
7648
55439c61
EZ
76492011-08-02 Eli Zaretskii <eliz@gnu.org>
7650
7651 Fix slow cursor motion and scrolling in large buffers with
7652 selective display, like Org Mode buffers. (Bug#9218)
7653
7654 * dispextern.h (struct bidi_it): New member disp_prop_p.
7655
7656 * xdisp.c: Remove one-slot cache of display string positions.
7657 (compute_display_string_pos): Accept an additional argument
5e617bc2 7658 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7659 for a display string or property. If found, set DISP_PROP_P
7660 non-zero.
7661
7662 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7663 DISP_PROP_P, and pass it to compute_display_string_pos.
7664 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7665 non-zero. All callers of bidi_fetch_char changed.
7666
fb33fa43
SM
76672011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7668
7669 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7670
b099e063
DM
76712010-12-03 Don March <don@ohspite.net>
7672
7673 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7674 last character M-[char] is translated to ESC [char] (bug#7541).
7675
5cc7f7af
KH
76762011-08-02 Kenichi Handa <handa@m17n.org>
7677
d0fffa3f 7678 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7679
7680 * chartab.c (uniprop_table): Make it non-static.
7681
525d5e6e
EZ
76822011-08-01 Eli Zaretskii <eliz@gnu.org>
7683
7684 * xdisp.c (forward_to_next_line_start): Accept additional argument
7685 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7686 on the newline.
7687 (reseat_at_next_visible_line_start): Use the bidi iterator state
7688 returned by forward_to_next_line_start to restore the state of
7689 it->bidi_it after backing up to previous newline. (Bug#9212)
7690
31011111
AS
76912011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7692
7693 * regex.c (re_comp): Protoize.
7694 (re_exec): Fix return type.
7695 (regexec): Fix type of `ret'. (Bug#9203)
7696
476371c4
PE
76972011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7698
e5d76069
PE
7699 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7700 This is needed if max-image-size is a floating-point number.
7701
9a79b20c
AS
77022011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7703
7704 * print.c (print_object): Print empty symbol as ##.
7705
7706 * lread.c (read1): Read ## as empty symbol.
7707
d8c2fa78
AA
77082011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7709
7710 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7711 setting frame foreground color (Bug#9175).
7712 (x_set_background_color): Likewise.
7713
ffe57a7a
AA
7714 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7715 contents (Bug#9176).
7716 (EmacsTooltip -init): Remove bezels and add shadows to
7717 tooltip windows.
7718
bf3492a5
AA
7719 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7720 or scroll bar (Bug#8470).
7721
d55e9c53
AA
7722 * nsfont.m (nsfont_open): Remove assignment to voffset and
7723 unnecessary vars hshink, expand, hd, full_height, min_height.
7724 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7725
7726 * nsterm.h (nsfont_info): Remove voffset field.
7727
d8c2fa78 77282011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7729
7730 Implement strike-through and overline on NextStep (Bug#8863).
7731
7732 * nsfont.m (nsfont_open): Use underline position provided by font,
7733 instead of hard-coded value of 2.
7734 (nsfont_draw): Call ns_draw_text_decoration instead.
7735
7736 * nsterm.h: Add declaration for ns_draw_text_decoration.
7737
7738 * nsterm.m (ns_draw_text_decoration): New function for drawing
7739 underline, overline, and strike-through.
7740 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7741 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7742 accommodate underlining, etc.
4843aac3 7743
4cc60b9b
EZ
77442011-07-28 Eli Zaretskii <eliz@gnu.org>
7745
bc7ece87
EZ
7746 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7747 default.
4cc60b9b 7748
476371c4
PE
77492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7750
66606eea
PE
7751 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7752 Without this fix, if a signal arrives just after memory fills up,
7753 'malloc' might be invoked reentrantly.
7754
476371c4
PE
7755 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7756 In other words, assume that every image size is allowed, on non-X
7757 hosts. This assumption is probably wrong, but it lets Emacs compile.
7758
f3fcc40d
AS
77592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7760
7761 * regex.c (re_iswctype): Convert return values to boolean.
7762
350c992f
EZ
77632011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7764
7765 * xdisp.c (compute_display_string_pos): Don't use cached display
7766 string position if the buffer had its restriction changed.
7767 (Bug#9184)
7768
5266b4bb
PE
77692011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7770
7771 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7772
2573a837 77732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7774
41f55ccd 7775 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7776
39e378da
PE
7777 * bidi.c: Integer size and overflow fixes.
7778 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7779 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7780 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7781 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7782 (bidi_find_other_level_edge):
7783 Use ptrdiff_t instead of EMACS_INT where either will do.
7784 This works better on 32-bit hosts configured --with-wide-int.
7785 (bidi_cache_ensure_space): Check for size-calculation overflow.
7786 Use % rather than repeated addition, for better worst-case speed.
7787 Don't set bidi_cache_size until after xrealloc returns, because it
7788 might not return.
7789 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7790 (bidi_cache_ensure_space): Also check that the bidi cache size
7791 does not exceed that of the largest Lisp string or buffer. See Eli
7792 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7793
5e927815
PE
7794 * alloc.c (__malloc_size_t): Remove.
7795 All uses replaced by size_t. See Andreas Schwab's note
7796 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7797
ca4aa935
PE
7798 * image.c: Improve checking for integer overflow.
7799 (check_image_size): Assume that f is nonnull, since
7800 it is always nonnull in practice. This is one less thing to
7801 worry about when checking for integer overflow later.
7802 (x_check_image_size): New function, which checks for integer
7803 overflow issues inside X.
7804 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7805 This removes the need for a memory_full check.
7806 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7807 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7808 (xbm_read_bitmap_data): Change locals back to 'int', since
7809 their values must fit in 'int'.
7810 (xpm_load_image, png_load, tiff_load):
7811 Invoke x_create_x_image_and_pixmap earlier,
7812 to avoid much needless work if the image is too large.
7813 (tiff_load): Treat overly large images as if
7814 x_create_x_image_and_pixmap failed, not as malloc failures.
7815 (gs_load): Use x_check_image_size.
7816
5f8f9cc2
PE
7817 * gtkutil.c: Omit integer casts.
7818 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7819 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7820
5adf60bc
PE
7821 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7822
c8907a93
PE
7823 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7824 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7825 would wrongly return t on a 64-bit host.
7826
e3c25c68
PE
7827 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7828 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7829 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7830 and therefore cause GCC to emit a bogus diagnostic in some cases.
7831
3f791afe
PE
7832 * image.c: Integer signedness and overflow and related fixes.
7833 This is not an exhaustive set of fixes, but it's time to
7834 record what I've got.
7835 (lookup_pixel_color, check_image_size): Remove redundant decls.
7836 (check_image_size): Don't assume that arbitrary EMACS_INT values
7837 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7838 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7839 (tiff_load, imagemagick_load_image):
7840 Check for overflow in size calculations.
7841 (x_create_x_image_and_pixmap): Remove unnecessary test for
7842 xmalloc returning NULL; that can't happen.
7843 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7844 (xpm_color_bucket): Use better integer hashing function.
7845 (xpm_cache_color): Don't possibly over-allocate memory.
7846 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7847 (gif_memory_source):
7848 Use ptrdiff_t, not int or size_t, to record sizes.
7849 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7850 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7851 either works, as we prefer signed integers.
7852 (tiff_read_from_memory, tiff_write_from_memory):
7853 Return tsize_t, not size_t, since that's what the TIFF API wants.
7854 (tiff_read_from_memory): Don't fail simply because the read would
7855 go past EOF; instead, return a short read.
7856 (tiff_load): Omit no-longer-needed casts.
7857 (Fimagemagick_types): Don't assume size fits into 'int'.
7858
3cc5a532
PE
7859 Improve hashing quality when configured --with-wide-int.
7860 * fns.c (hash_string): New function, taken from sxhash_string.
7861 Do not discard information about ASCII character case; this
7862 discarding is no longer needed.
7863 (sxhash-string): Use it. Change sig to match it. Caller changed.
7864 * lisp.h: Declare it.
7865 * lread.c (hash_string): Remove, since we now use fns.c's version.
7866 The fns.c version returns a wider integer if --with-wide-int is
7867 specified, so this should help the quality of the hashing a bit.
7868
b312a492
PE
7869 * emacs.c: Integer overflow minor fix.
7870 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7871 Define only if GNU_LINUX.
7872 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7873
dfd153ae
PE
7874 * dispnew.c: Integer signedness and overflow fixes.
7875 Remove unnecessary forward decls, that were a maintenance hassle.
7876 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7877 All uses changed.
7878 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7879 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7880 (prepare_desired_row, line_draw_cost):
7881 Use int, not unsigned, where either works.
7882 (save_current_matrix, restore_current_matrix):
7883 Use ptrdiff_t, not size_t, where either works.
7884 (init_display): Check for overflow more accurately, and without
7885 relying on undefined behavior.
7886
a81d11a3
PE
7887 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7888 Remove, replacing with the new symbols in lisp.h. All uses changed.
7889 * fileio.c (make_temp_name):
7890 * filelock.c (lock_file_1, lock_file):
7891 * xdisp.c (message_dolog):
7892 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7893 Use pMd etc. instead.
7894 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7895 replacing the pWIDE etc. symbols removed from editfns.c.
7896
3300e6fd
PE
7897 * keyboard.h (num_input_events): Now uintmax_t.
7898 This is (very slightly) less likely to mess up due to wraparound.
7899 All uses changed.
7900
fd05c7e9
PE
7901 * buffer.c: Integer signedness fixes.
7902 (alloc_buffer_text, enlarge_buffer_text):
7903 Use ptrdiff_t rather than size_t when either will do, as we prefer
7904 signed integers.
7905
903fe15d
PE
7906 * alloc.c: Integer signedness and overflow fixes.
7907 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7908 (__malloc_size_t): Default to size_t, not to int.
7909 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7910 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7911 Prefer ptrdiff_t to size_t when either would do, as we prefer
7912 signed integers.
7913 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7914 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7915 Now const. Initialize with values that are in range even if char
7916 is signed.
7917 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7918 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7919 These functions do the right thing with sizes > 2**32.
7920 (check_depth): Now ptrdiff_t, not int.
7921 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7922 Adjust to new way of storing sizes. Check for size overflow bugs
7923 in rest of code.
7924 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7925 slightly wrong anyway, as it missed one instance of
7926 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7927 (refill_memory_reserve): Omit needless cast to size_t.
7928 (mark_object_loop_halt): Mark as externally visible.
7929
ac82cc6a
PE
7930 * xselect.c: Integer signedness and overflow fixes.
7931 (Fx_register_dnd_atom, x_handle_dnd_message):
7932 Use ptrdiff_t, not size_t, since we prefer signed.
7933 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7934 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7935 x_dnd_atoms_size and x_dnd_atoms_length.
7936
c2d1e36d
PE
7937 * doprnt.c: Prefer signed to unsigned when either works.
7938 * eval.c (verror):
7939 * doprnt.c (doprnt):
7940 * lisp.h (doprnt):
7941 * xdisp.c (vmessage):
7942 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7943 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7944 prefer signed arithmetic to avoid comparison confusion.
7945 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7946 but is a bit tricky.
7947
0e926e56
PE
7948 Assume freestanding C89 headers, string.h, stdlib.h.
7949 * data.c, doprnt.c, floatfns.c, print.c:
7950 Include float.h unconditionally.
7951 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7952 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7953 * regex.c: Likewise for stddef.h, string.h.
7954 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7955 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7956 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7957 (STDC_HEADERS): Remove obsolete defines.
7958 * sysdep.c: Include limits.h unconditionally.
7959
9cfdb3ec
PE
7960 Assume support for memcmp, memcpy, memmove, memset.
7961 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7962 * regex.c (memcmp, memcpy):
7963 Remove; we assume C89 now.
7964
7965 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7966 (__malloc_safe_bcopy): Remove; no longer needed.
7967
cf950e6b 7968 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7969 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7970 well either way, and we prefer signed to unsigned.
7971
dbf38e02
LMI
79722011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7973
7974 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7975 closes the connection while we're reading (bug#9182).
7976
d6f0886c 79772011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7978
d6f0886c
JD
7979 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7980 are specified (Bug#9168).
24e0f6b1 7981
2eb1f9e6
PE
79822011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7983
7984 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7985 Found by GCC static checking and --with-wide-int on a 32-bit host.
7986
22381272 79872011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7988
7989 * xdisp.c (compute_display_string_pos): Fix logic of caching
7990 previous display string position. Initialize cached_prev_pos to
7991 -1. Fixes slow-down at the beginning of a buffer.
7992
f25e39b4
EZ
79932011-07-24 Eli Zaretskii <eliz@gnu.org>
7994
7995 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7996 for attrs[LFACE_FONTSET_INDEX].
7997
04c4b52e
PE
79982011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7999
8000 * xml.c (parse_region): Remove unused local
8001 that was recently introduced.
8002
c1734fbd
EZ
80032011-07-23 Eli Zaretskii <eliz@gnu.org>
8004
be18c5a5
EZ
8005 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
8006 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
8007
c1734fbd
EZ
8008 * xdisp.c (move_it_in_display_line_to): Record the best matching
8009 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
8010 exit if none of the characters scanned was an exact match.
8011 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
8012 when exact match is impossible due to invisible text, and the
8013 lines are truncated.
8014
a258d627
JD
80152011-07-23 Jan Djärv <jan.h.d@swipnet.se>
8016
8017 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
8018 for OSX >= 10.7.
8019
b6d5a689
EZ
80202011-07-22 Eli Zaretskii <eliz@gnu.org>
8021
0f74f785
EZ
8022 Fix a significant slow-down of cursor motion with C-n, C-p,
8023 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
8024 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 8025 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
8026 (next_element_from_buffer): Call compute_stop_pos_backwards to
8027 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
8028 base_level_stop.
8029 (reseat): Don't look for prev_stop, as that could mean a very long
8030 run.
8031 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
8032 <cached_disp_overlay_modiff>: Cache for last found display string
8033 position.
551918c1 8034 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
8035 about the same buffer in the same area of character positions, and
8036 the buffer wasn't changed since the time the display string
8037 position was cached.
551918c1 8038
b2d0c91a
EZ
80392011-07-22 Eli Zaretskii <eliz@gnu.org>
8040
8041 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
8042 is an integer, which is important for empty lines. (Bug#9149)
8043
043604ee
CY
80442011-07-22 Chong Yidong <cyd@stupidchicken.com>
8045
8046 * frame.c (Fmodify_frame_parameters): In tty case, update the
8047 default face if necessary (Bug#4238).
8048
da4adb04
CY
80492011-07-21 Chong Yidong <cyd@stupidchicken.com>
8050
8051 * editfns.c (Fstring_to_char): No need to explain what a character
8052 is in the docstring (Bug#6576).
8053
9abd0532
LMI
80542011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8055
8056 * xml.c (parse_region): Make sure we always return a tree.
8057
36881d16
HK
80582011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
8059
8060 * xml.c (parse_region): If a document contains only comments,
8061 return that, too.
8062
1e98674d
LMI
80632011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8064
8065 * xml.c (make_dom): Return comments, too.
8066
590bd467
PE
80672011-07-19 Paul Eggert <eggert@cs.ucla.edu>
8068
8069 Port to OpenBSD.
8070 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
8071 and the surrounding thread.
8072 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
8073 rather than fgets, and retry after EINTR. Otherwise, 'emacs
8074 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
8075 timer goes off.
8076 * s/openbsd.h (BROKEN_SIGIO): Define.
8077 * unexelf.c (unexec) [__OpenBSD__]:
8078 Don't update the .mdebug section of the Alpha COFF symbol table.
8079
f41628b2
LMI
80802011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8081
8082 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
8083 (bug#8460).
8084
b59b67c5
PE
80852011-07-18 Paul Eggert <eggert@cs.ucla.edu>
8086
15e3a074
PE
8087 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
8088 This fixes some race conditions on the permissions of any newly
8089 created file.
8090
41bed37d
PE
8091 * alloc.c (valid_pointer_p): Use pipe, not open.
8092 This fixes some permissions issues when debugging.
8093
b59b67c5
PE
8094 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
8095 If fchown fails to set both uid and gid, try to set just gid,
8096 as that is sometimes allowed. Adjust the file's mode to eliminate
8097 setuid or setgid bits that are inappropriate if fchown fails.
8098
925a6be7
SM
80992011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8100
8101 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
8102 to compare Lisp_Objects.
8103 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
8104 global_gnutls_log_level, don't mistake it for a Lisp_Object.
8105 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
8106
52968808
AS
81072011-07-17 Andreas Schwab <schwab@linux-m68k.org>
8108
0a6a104b
AS
8109 * lread.c (read_integer): Unread even EOF character.
8110 (read1): Likewise. Properly record start position of symbol.
8111
52968808
AS
8112 * lread.c (read1): Read `#:' as empty uninterned symbol if no
8113 symbol character follows.
8114
9e381cdd
PE
81152011-07-17 Paul Eggert <eggert@cs.ucla.edu>
8116
8117 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
8118 This works around a problem with the previous change to Fcopy_file.
8119 Recent glibc declares fchown with __attribute__((warn_unused_result)),
8120 and without this change, GCC might complain about discarding
8121 fchown's return value.
8122
b5641435
JB
81232011-07-16 Juanma Barranquero <lekktu@gmail.com>
8124
8125 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
8126
a8031457
PE
81272011-07-16 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
8130
dd889327
LMI
81312011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
8132
750c33f7
LMI
8133 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
8134 it's used from the C level.
8135
dd889327
LMI
8136 * process.c: Use the same condition for POLL_FOR_INPUT in both
8137 keyboard.c and process.c (bug#1858).
8138
87e86684
LM
81392011-07-09 Lawrence Mitchell <wence@gmx.li>
8140
8141 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
8142 (Fgnutls_boot): Use it.
8143
64348f40
AS
81442011-07-15 Andreas Schwab <schwab@linux-m68k.org>
8145
8146 * doc.c (Fsubstitute_command_keys): Revert last change.
8147
1d698799
LMI
81482011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
8149
f863868c
LMI
8150 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
8151 quotes the next character, and doesn't affect other longer
8152 sequences (bug#8935).
8153
1d698799
LMI
8154 * lread.c (syms_of_lread): Clarify that is isn't only
8155 `eval-buffer' and `eval-defun' that's affected by
8156 `lexical-binding' (bug#8460).
8157
aa4b6df6
EZ
81582011-07-15 Eli Zaretskii <eliz@gnu.org>
8159
8160 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 8161 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 8162
5d856da6
PE
81632011-07-14 Paul Eggert <eggert@cs.ucla.edu>
8164
ad6042bb
PE
8165 Fix minor problems found by static checking.
8166 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
8167 (elsz): Now a signed constant, not a size_t var. We prefer signed
8168 types to unsigned, to avoid integer comparison confusion. Without
8169 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
8170 "cannot optimize loop, the loop counter may overflow", a symptom
8171 of the confusion.
f00bbb22 8172 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
8173 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
8174
6468f31c
LMI
81752011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8176
49080b10
LMI
8177 * search.c (Fre_search_backward): Mention `case-fold-search' in
8178 all the re_search_* functions (bug#8138).
8179
6468f31c
LMI
8180 * keyboard.c (Fopen_dribble_file): Document when the file is
8181 closed (bug#8056).
8182
c965adc5
EZ
81832011-07-14 Eli Zaretskii <eliz@gnu.org>
8184
df9733bf
EZ
8185 * bidi.c (bidi_dump_cached_states): Fix format of displaying
8186 bidi_cache_idx.
8187
0bb23927
EZ
8188 Support bidi reordering of display and overlay strings.
8189 * xdisp.c (compute_display_string_pos)
8190 (compute_display_string_end): Accept additional argument STRING.
8191 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
8192 (reseat_to_string): Initialize bidi_it->string.s and
8193 bidi_it->string.schars.
8194 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
8195 NULL (avoids a crash in bidi_paragraph_init).
8196 Initialize itb.string.lstring.
0bb23927
EZ
8197 (init_iterator): Call bidi_init_it only of a valid
8198 buffer position was specified. Initialize paragraph_embedding to
8199 L2R.
8200 (reseat_to_string): Initialize the bidi iterator.
8201 (display_string): If we need to ignore text properties of
8202 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
8203 original value of -1 will not work with bidi.)
8204 (compute_display_string_pos): First arg is now struct
8205 `text_pos *'; all callers changed. Support display properties on
8206 Lisp strings.
8207 (compute_display_string_end): Support display properties on Lisp
8208 strings.
8209 (init_iterator, reseat_1, reseat_to_string): Initialize the
8210 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
8211 when iterating on a string not from display properties).
640c8776
SM
8212 (compute_display_string_pos, compute_display_string_end):
8213 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
8214 arrow keys.
8215 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
8216 base_level_stop; instead, set base_level_stop to BEGV.
8217 Fixes crashes in vertical-motion.
0bb23927
EZ
8218 (next_element_from_buffer): Improve commentary for when
8219 the iterator is before prev_stop.
8220 (init_iterator): Initialize bidi_p from the default value of
8221 bidi-display-reordering, not from buffer-local value. Use the
8222 buffer-local value only if initializing for buffer iteration.
8223 (handle_invisible_prop): Support invisible properties on strings
8224 that are being bidi-reordered.
8225 (set_iterator_to_next): Support bidi reordering of C strings and
8226 Lisp strings.
8227 (next_element_from_string): Support bidi reordering of Lisp
8228 strings.
8229 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
8230 (display_string): Support display of R2L glyph rows.
8231 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
8232 (init_iterator): Don't initialize it->bidi_p for strings
8233 here.
8234 (reseat_to_string): Initialize it->bidi_p for strings here.
8235 (next_element_from_string, next_element_from_c_string)
8236 (next_element_from_buffer): Add xassert's for correspondence
8237 between IT's object being iterated and it->bidi_it.string
8238 structure.
8239 (face_before_or_after_it_pos): Support bidi iteration.
8240 (next_element_from_c_string): Handle the case of the first string
8241 character that is not the first one in the visual order.
8242 (get_visually_first_element): New function, refactored from common
8243 parts of next_element_from_buffer, next_element_from_string, and
8244 next_element_from_c_string.
8245 (tool_bar_lines_needed, redisplay_tool_bar)
8246 (display_menu_bar): Force left-to-right direction. Add a FIXME
8247 comment for making that be controlled by a user option.
8248 (push_it, pop_it): Save and restore the state of the
8249 bidi iterator. Save and restore the bidi_p flag.
8250 (pop_it): Iterate out of display property for string iteration as
8251 well.
8252 (iterate_out_of_display_property): Support iteration over strings.
8253 (handle_single_display_spec): Set up it->bidi_it for iteration
8254 over a display string, and call bidi_init_it.
8255 (handle_single_display_spec, next_overlay_string)
8256 (get_overlay_strings_1, push_display_prop): Set up the bidi
8257 iterator for displaying display or overlay strings.
8258 (forward_to_next_line_start): Don't use the shortcut if
8259 bidi-iterating.
8260 (back_to_previous_visible_line_start): If handle_display_prop
8261 pushed the iterator stack, restore the internal state of the bidi
8262 iterator by calling bidi_pop_it same number of times.
8263 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
8264 and we are bidi-iterating, don't decrement the iterator position;
8265 instead, set the first_elt flag in the bidi iterator, to produce
8266 the same effect.
8267 (reseat_1): Remove redundant setting of string_from_display_prop_p.
8268 (push_display_prop): xassert that we are iterating a buffer.
8269 (push_it, pop_it): Save and restore paragraph_embedding member.
8270 (handle_single_display_spec, next_overlay_string)
8271 (get_overlay_strings_1, reseat_1, reseat_to_string)
8272 (push_display_prop): Set up the `unibyte' member of bidi_it.string
8273 correctly. Don't assume unibyte strings are not bidi-reordered.
8274 (compute_display_string_pos)
8275 (compute_display_string_end): Fix handling the case of C string.
8276 (push_it, pop_it): Save and restore from_disp_prop_p.
8277 (handle_single_display_spec, push_display_prop): Set the
8278 from_disp_prop_p flag.
8279 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
8280 (pop_it): Call iterate_out_of_display_property only if we are
8281 popping after iteration over a string that came from a display
8282 property. Fix a typo in popping stretch info. Add an assertion
8283 for verifying that the iterator position is in sync with the bidi
8284 iterator.
8285 (handle_single_display_spec, get_overlay_strings_1)
8286 (push_display_prop): Fix initialization of paragraph direction for
8287 string when that of the parent object is not yet determined.
8288 (reseat_1): Call bidi_init_it to resync the bidi
8289 iterator with IT's position. (Bug#7616)
8290 (find_row_edges): If ROW->start.pos gives position
8291 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
8292 (handle_stop, back_to_previous_visible_line_start, reseat_1):
8293 Reset the from_disp_prop_p flag.
8294 (SAVE_IT, RESTORE_IT): New macros.
8295 (pos_visible_p, face_before_or_after_it_pos)
8296 (back_to_previous_visible_line_start)
8297 (move_it_in_display_line_to, move_it_in_display_line)
8298 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8299 (try_scrolling, redisplay_window, display_line): Use them when
8300 saving a temporary copy of the iterator and restoring it back.
8301 (back_to_previous_visible_line_start, reseat_1)
8302 (init_iterator): Empty the bidi cache "stack".
8303 (move_it_in_display_line_to): If iterator ended up at
8304 EOL, but we never saw any buffer positions smaller than
8305 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8306 motion in bidi-reordered lines.
8307 (move_it_in_display_line_to): Record prev_method and prev_pos
8308 immediately before the call to set_iterator_to_next. Fixes cursor
8309 motion in bidi-reordered lines with stretch glyphs and strings
8310 displayed in margins. (Bug#8133) (Bug#8867)
8311 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8312 TO_CHARPOS.
640c8776
SM
8313 (pos_visible_p): Support positions in bidi-reordered lines.
8314 Save and restore bidi cache.
0bb23927
EZ
8315
8316 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8317 (bidi_paragraph_info): Delete unused struct.
8318 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8319 (bidi_cache_start): New variable.
8320 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8321 to zero.
8322 (bidi_cache_fetch_state, bidi_cache_search)
8323 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8324 (bidi_cache_find, bidi_peek_at_next_level)
8325 (bidi_level_of_next_char, bidi_find_other_level_edge)
8326 (bidi_move_to_visually_next): Compare cache index with
8327 bidi_cache_start rather than with zero.
8328 (bidi_fetch_char): Accept new argument STRING; all callers
8329 changed. Support iteration over a string. Support strings with
8330 display properties. Support unibyte strings. Fix the type of
8331 `len' according to what STRING_CHAR_AND_LENGTH expects.
8332 (bidi_paragraph_init, bidi_resolve_explicit_1)
8333 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
8334 (bidi_level_of_next_char, bidi_move_to_visually_next):
8335 Support iteration over a string.
0bb23927
EZ
8336 (bidi_set_sor_type, bidi_resolve_explicit_1)
8337 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8338 can now be zero (for strings); special values 0 and -1 were
8339 changed to -1 and -2, respectively.
8340 (bidi_char_at_pos): New function.
8341 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8342 Call it instead of FETCH_MULTIBYTE_CHAR.
8343 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8344 initialized to valid values.
8345 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8346 values.
8347 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8348 the test for valid cached positions. Fix the logic for looking up
8349 the sentinel state in the cache. GCPRO the Lisp string we are
8350 iterating.
8351 (bidi_push_it, bidi_pop_it): New functions.
8352 (bidi_initialize): Initialize the bidi cache start stack pointer.
8353 (bidi_cache_ensure_space): New function, refactored from part of
8354 bidi_cache_iterator_state. Don't assume the required size is just
8355 one BIDI_CACHE_CHUNK away.
8356 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8357 (bidi_count_bytes, bidi_char_at_pos): New functions.
8358 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8359 always valid if bidi_cache_idx is valid.
8360 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8361 is valid if it's going to be used.
8362 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8363 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
8364 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8365 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
8366 (bidi_find_other_level_edge, bidi_cache_start_stack):
8367 All variables related to cache indices are now EMACS_INT.
c965adc5 8368
0bb23927
EZ
8369 * dispextern.h (struct bidi_string_data): New structure.
8370 (struct bidi_it): New member `string'. Make flag members be 1-bit
8371 fields, and put them last in the struct.
640c8776
SM
8372 (compute_display_string_pos, compute_display_string_end):
8373 Update prototypes.
0bb23927
EZ
8374 (bidi_push_it, bidi_pop_it): Add prototypes.
8375 (struct iterator_stack_entry): New members bidi_p,
8376 paragraph_embedding, and from_disp_prop_p.
8377 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
8378 (bidi_shelve_cache, bidi_unshelve_cache):
8379 Declare prototypes.
0bb23927
EZ
8380
8381 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
8382 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
8383 and vector-like objects.
8384
8385 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
8386 cache around display iteration.
8387
8388 * window.c (Fwindow_end, window_scroll_pixel_based)
8389 (displayed_window_lines, Frecenter): Save and restore the bidi
8390 cache around display iteration.
8391
3bbd2265
LMI
83922011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8393
8394 * editfns.c (Fdelete_region): Clarify the use of the named
8395 parameters (bug#6788).
8396
adc47434
MR
83972011-07-14 Martin Rudalics <rudalics@gmx.at>
8398
8399 * indent.c (Fvertical_motion): Set and restore w->pointm when
8400 saving and restoring the window's buffer (Bug#9006).
8401
837c31f8
LMI
84022011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8403
8404 * editfns.c (Fstring_to_char): Clarify just what is returned
8405 (bug#6576). Text by Eli Zaretskii.
8406
ac389d0c
JB
84072011-07-13 Juanma Barranquero <lekktu@gmail.com>
8408
8409 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8410
0be0ce47
EZ
84112011-07-13 Eli Zaretskii <eliz@gnu.org>
8412
8413 * buffer.c (mmap_find): Fix a typo.
8414
cd18e7e3
JB
84152011-07-13 Johan Bockgård <bojohan@gnu.org>
8416
8417 Fix execution of x selection hooks.
8418 * xselect.c (Qx_lost_selection_functions)
8419 (Qx_sent_selection_functions): New vars.
8420 (syms_of_xselect): DEFSYM them.
8421 (x_handle_selection_request): Pass Qx_sent_selection_functions
8422 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8423 (x_handle_selection_clear,x_clear_frame_selections):
8424 Pass Qx_lost_selection_functions rather than
8425 Vx_lost_selection_functions to Frun_hook_with_args.
8426
47ea7f44
PE
84272011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8428
ac389d0c 8429 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8430 The old code sometimes used this field without initializing it.
8431
47ea7f44
PE
8432 * alloc.c (gc_sweep): Don't read past end of array.
8433 In theory, the old code could also have corrupted Emacs internals,
8434 though it'd be very unlikely.
8435
bc985c87
AS
84362011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8437
8438 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8439 argument. (Bug#4026)
bc985c87 8440
0cf34688
LMI
84412011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8442
b3dadd76
LMI
8443 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8444 key" (bug#4257).
8445
0cf34688
LMI
8446 * window.c (Fset_window_start): Doc fix (bug#4199).
8447 (Fset_window_hscroll): Ditto.
8448
270768cd
PE
84492011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8450
077e3dda 8451 Fix minor new problems caught by GCC 4.6.1.
270768cd 8452 * term.c (init_tty): Remove unused local.
490011a6 8453 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8454 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8455 not used otherwise.
270768cd 8456
b1f58454
CY
84572011-07-12 Chong Yidong <cyd@stupidchicken.com>
8458
8459 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8460
22b9578d
LMI
84612011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8462
6e70ab07
LMI
8463 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8464 are the mini-buffer and the echo area (bug#3320).
8465
22b9578d
LMI
8466 * term.c (init_tty): Remove support for supdup, c10 and perq
8467 terminals, which are no longer supported (bug#1482).
8468
8974cc9f
JB
84692011-07-10 Johan Bockgård <bojohan@gnu.org>
8470
8471 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8472
a560d974
JD
84732011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8474
8475 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8476 for non-popups (Bug#3642).
8477
1dae0f0a
AS
84782011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8479
268c2c36 8480 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8481 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8482 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8483 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8484 * data.c (fmod): Likewise.
8485 * dispnew.c (swap_glyphs_in_rows): Likewise.
8486 * emacs.c (memory_warning_signal): Likewise.
8487 * floatfns.c (float_error): Likewise.
8488 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8489 (otf_open, font_otf_capability, generate_otf_features)
8490 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8491 Likewise.
8492 * image.c (pbm_read_file): Likewise.
8493 * indent.c (string_display_width): Likewise.
8494 * intervals.c (check_for_interval, search_for_interval)
8495 (inc_interval_count, count_intervals, root_interval)
8496 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8497 * lread.c (defalias): Likewise.
268c2c36 8498 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8499 * regex.c (set_image_of_range_1, set_image_of_range)
8500 (regex_grow_registers): Likewise.
8501 * sysdep.c (strerror): Likewise.
8502 * termcap.c (valid_filename_p, tprint, main): Likewise.
8503 * tparam.c (main): Likewise.
8504 * unexhp9k800.c (run_time_remap, save_data_space)
8505 (update_file_ptrs, read_header, write_header, calculate_checksum)
8506 (copy_file, copy_rest, display_header): Likewise.
8507 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8508 Likewise.
8509 * xdisp.c (check_it): Likewise.
8510 * xfaces.c (register_color, unregister_color, unregister_colors):
8511 Likewise.
8512 * xfns.c (print_fontset_result): Likewise.
8513 * xrdb.c (member, fatal, main): Likewise.
8514
99033785
PE
85152011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8516
8517 Fix minor problems found by static checking (Bug#9031).
8518 * chartab.c (char_table_set_range, map_sub_char_table):
8519 Remove unused locals.
8520 (uniprop_table): Now static.
8521 * composite.c (_work_char): Remove unused static var.
8522
9cb2ac56
JB
85232011-07-09 Juanma Barranquero <lekktu@gmail.com>
8524
8525 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8526
f25661f0
JD
85272011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8528
8529 * gtkutil.c (qttip_cb): Remove code without function.
8530
8278c4fe
EZ
85312011-07-09 Eli Zaretskii <eliz@gnu.org>
8532
8533 * w32.c (pthread_sigmask): New stub.
8534
1692ae2d 85352011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8536
8a6ebd58 8537 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8538 sigprocmask is portable only for single-threaded applications, and
8539 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8540 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8541 (LIBES): Use it.
8542 * callproc.c (Fcall_process):
8543 * process.c (create_process):
8544 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8545 Use pthread_sigmask, not sigprocmask.
123403e4 8546
1b854618
JD
85472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8548
8549 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8550 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8551 wrong (Bug#8591).
8552
3fe4b549
JD
85532011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8554
0ce7e563
JD
8555 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8556 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8557 (xg_hide_tooltip): Fix comment.
8558
3fe4b549
JD
8559 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8560 in registerServicesMenuSendTypes.
8561 (validRequestorForSendType): Don't check ns_return_types.
8562
8563 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8564 ns_return_type.
8565
5df75e47
JR
85662011-07-08 Jason Rumney <jasonr@gnu.org>
8567
22610910
JR
8568 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8569 SH_SHOW for hidden windows (Bug#5482).
8570
5df75e47
JR
8571 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8572 frame struct members of non-existent frames (Bug#6284).
8573
699c10bd
JD
85742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8575
4393663b
JD
8576 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8577 variable firstTime not needed on OSX >= 10.6.
8578 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8579 >= 10.5. Use setKnobProportion, setDoubleValue.
8580
8581 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8582 (MAC_OS_X_VERSION_10_5): Define if not defined.
8583 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8584 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8585 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8586
8587 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8588 cString and lossyCString on OSX >= 10.4.
4393663b 8589
58179cce 8590 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8591 sizeToFit on OSX >= 10.2.
8592
8593 * nsimage.m (allocInitFromFile): Don't use deprecated method
8594 bestRepresentationForDevice on OSX >= 10.6.
8595
8596 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8597 to avoid warning.
8598
8599 * emacs.c: Declare unexec_init_emacs_zone.
8600
a63e0781
JD
8601 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8602
699c10bd
JD
8603 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8604
8605 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8606 on svcsMenu (Bug#8842).
8607
8608 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8609 ns_return_types.
8610 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8611
8612 * nsterm.m (QUTF8_STRING): Declare.
8613 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8614 (validRequestorForSendType): Return type is (id).
8615 Change indexOfObjectIdenticalTo to indexOfObject.
8616 Check if we have local selection before returning self (Bug#8842).
8617 (writeSelectionToPasteboard): Put local selection into paste board
8618 if we have a local selection (Bug#8842).
8619 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8620
8621 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8622 (ns_get_local_selection): Declare.
8623
54e10184
LMI
86242011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8625
9888ff71
LMI
8626 * keymap.c (describe_map_tree): Don't insert a double newline at
8627 the end of the buffer (bug#1169) and return whether we inserted
8628 something.
8629
54e10184
LMI
8630 * callint.c (Fcall_interactively): Change "reading args" to
8631 "providing args" to try to clarify what it does (bug#1010).
8632
15fa4783
KH
86332011-07-07 Kenichi Handa <handa@m17n.org>
8634
8635 * composite.c (composition_compute_stop_pos): Ignore a static
8636 composition starting before CHARPOS (Bug#8915).
8637
8638 * xdisp.c (handle_composition_prop): Likewise.
8639
a8815b00
EZ
86402011-07-07 Eli Zaretskii <eliz@gnu.org>
8641
8642 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8643 (Bug#9015)
8644
ef7b981d 86452011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8646
8647 * character.h (unicode_category_t): New enum type.
8648
8649 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8650 (Qchar_code_property_table): New variable.
8651 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8652 (UNIPROP_COMPRESSED_FORM_P): New macros.
8653 (char_table_ascii): Uncompress the compressed values.
8654 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8655 Uncompress the compressed values.
ac389d0c 8656 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8657 (char_table_ref_and_range): Uncompress the compressed values.
8658 (sub_char_table_set): New arg is_uniprop. Callers changed.
8659 Uncompress the compressed values.
8660 (sub_char_table_set_range): Args changed. Callers changed.
8661 (char_table_set_range): Adjuted for the above change.
8662 (map_sub_char_table): Delete args default_val and parent. Add arg
8663 top. Give decoded values to a Lisp function.
640c8776 8664 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8665 values to a Lisp function. Gcpro more variables.
8666 (uniprop_table_uncompress)
8667 (uniprop_decode_value_run_length): New functions.
8668 (uniprop_decoder, uniprop_decoder_count): New variables.
8669 (uniprop_get_decoder, uniprop_encode_value_character)
8670 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8671 New functions.
8672 (uniprop_encoder, uniprop_encoder_count): New variables.
8673 (uniprop_get_encoder, uniprop_table)
8674 (Funicode_property_table_internal, Fget_unicode_property_internal)
8675 (Fput_unicode_property_internal): New functions.
8676 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8677 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8678 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8679 char-code-property-alist.
8680
640c8776 8681 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8682 Vunicode_category_table.
8683
640c8776 8684 * font.c (font_range): Adjust for the change of
c805dec0
KH
8685 Vunicode_category_table.
8686
76b397fb
DN
86872011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8688
8689 * m/iris4d.h: Remove file, move contents ...
8690 * s/irix6-5.h: ... here.
8691
22b4128e
PE
86922011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8693
8694 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8695 * alloc.c (mark_buffer):
8696 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8697 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8698 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8699 This isn't true in general, and it's particularly not true
8700 if Emacs is configured with --with-wide-int.
8701 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8702 New macros, used in the buffer.c change.
8703
869795d6
JD
87042011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8705
8706 * xsettings.c: Use both GConf and GSettings if both are available.
8707 (store_config_changed_event): Add comment.
8708 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8709 (store_tool_bar_style_changed): New functions.
5e617bc2 8710 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8711 (struct xsettings): Move font inside HAVE_XFT.
8712 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8713 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8714 Move inside HAVE_XFT.
640c8776 8715 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8716 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8717 also.
8718 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8719 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8720 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8721 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8722 (parse_settings): Move check for font inside HAVE_XFT.
8723 (read_settings, apply_xft_settings): Add comment.
8724 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8725 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8726 call store_font_name_changed.
8727 (xft_settings_event): Add comment.
8728 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8729 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8730 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8731 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8732 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8733 (xsettings_get_system_font, xsettings_get_system_normal_font):
8734 Add comment.
869795d6 8735
d8ed26bd
PE
87362011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8737
8738 Random fixes. E.g., (random) never returned negative values.
8739 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8740 subseconds part to the entropy, as that's a bit more random.
8741 Prefer signed to unsigned, since the signedness doesn't matter and
8742 in general we prefer signed. When given a limit, use a
8743 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8744 latter isn't right if USE_2_TAGS_FOR_INTS.
8745 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8746 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8747
cabf1cac
SM
87482011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8749
8750 * textprop.c (text_property_stickiness):
8751 Obey Vtext_property_default_nonsticky.
8752 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8753 * w32fns.c (syms_of_w32fns):
8754 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8755
6e9b2be9
PE
87562011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8757
8758 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8759 This is more efficient than Ffile_directory_p and avoids a minor race.
8760
90186c68
LMI
87612011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8762
7c301272
LMI
8763 * buffer.c (Foverlay_put): Say what the return value is
8764 (bug#7835).
8765
c4f2d8d4
LMI
8766 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8767 is a directory before asking whether to use the file name
8768 (bug#7564).
ad637907
LMI
8769 (barf_or_query_if_file_exists): Make the "File is a directory"
8770 error be more correct.
c4f2d8d4 8771
90186c68
LMI
8772 * fns.c (Frequire): Remove the mention of the .gz files, since
8773 that's installation-specific, but keep the mention of
8774 `get-load-suffixes'.
8775
da64016e
PE
87762011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8777
8778 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8779 Report string overflow if the output is too long.
8780
7d47b580
JB
87812011-07-04 Juanma Barranquero <lekktu@gmail.com>
8782
a555cb87
JB
8783 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8784 (syms_of_gnutls): Remove duplicate DEFSYM for
8785 Qgnutls_bootprop_verify_hostname_error, an error for
8786 Qgnutls_bootprop_verify_error (which is no longer used).
8787
7d47b580
JB
8788 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8789 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8790 Also (re)move comments that are misplaced or no longer relevant.
8791
1e49bfab
LMI
87922011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8793
8794 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8795
1485f4c0
CY
87962011-07-03 Chong Yidong <cyd@stupidchicken.com>
8797
8798 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8799 and background color parameters if they have been changed.
8800
a9ab721e
LMI
88012011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8802
8803 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8804
cf7cff57
PE
88052011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8806
2e13213d
PE
8807 * xsettings.c (SYSTEM_FONT): Define only when used.
8808 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8809
cf7cff57
PE
8810 * keymap.c (access_keymap_1): Now static.
8811
7a8e04f7
CY
88122011-07-02 Chong Yidong <cyd@stupidchicken.com>
8813
8814 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8815 leave any prefix arg for the up event (Bug#1586).
8816
61352f62
LMI
88172011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8818
69bb1ef7
LMI
8819 * lread.c (syms_of_lread): Mention single symbols defined by
8820 `defvar' or `defconst' (bug#7154).
8821
61352f62 8822 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8823 (Frequire): Mention get-load-suffixes.
61352f62 8824
28545e04
MR
88252011-07-02 Martin Rudalics <rudalics@gmx.at>
8826
8827 * window.h (window): Remove clone_number slot.
8828 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8829 Remove.
8830 (make_parent_window, make_window, saved_window)
8831 (Fset_window_configuration, save_window_save): Don't deal with
8832 clone numbers.
8833 * buffer.c (Qclone_number): Remove declaration.
8834 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8835
3349e122
SM
88362011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8837
8838 Add multiple inheritance to keymaps.
8839 * keymap.c (Fmake_composed_keymap): New function.
8840 (Fset_keymap_parent): Simplify.
8841 (fix_submap_inheritance): Remove.
8842 (access_keymap_1): New function extracted from access_keymap to handle
8843 embedded parents and handle lists of maps.
8844 (access_keymap): Use it.
8845 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8846 (Fcopy_keymap): Handle embedded parents.
8847 (Fcommand_remapping, define_as_prefix): Simplify.
8848 (Fkey_binding): Simplify.
8849 (syms_of_keymap): Move minibuffer-local-completion-map,
8850 minibuffer-local-filename-completion-map,
8851 minibuffer-local-must-match-map, and
8852 minibuffer-local-filename-must-match-map to Elisp.
8853 (syms_of_keymap): Defsubr make-composed-keymap.
8854 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8855 (parse_menu_item): Trivial simplification.
8856
3279eb87
GM
88572011-07-01 Glenn Morris <rgm@gnu.org>
8858
8859 * Makefile.in (SETTINGS_LIBS): Fix typo.
8860
4550efdf
KI
88612011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8862
8863 * coding.c (Fencode_coding_string): Record the last coding system
8864 used, as the function doc string says (bug#8738).
8865
0949d2b6
JD
88662011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8867
8868 * xsettings.c (store_monospaced_changed): Take new font as arg and
8869 check for change against current_mono_font.
8870 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8871 (emacs_settings_constructor, emacs_settings_get_property)
8872 (emacs_settings_set_property, emacs_settings_class_init)
8873 (emacs_settings_init, gsettings_obj): Remove.
8874 (something_changedCB): New function for HAVE_GSETTINGS.
8875 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8876 with value as argument.
8877 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8878 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8879 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8880 "changed".
8881
8882 * xgselect.c: Add defined (HAVE_GSETTINGS).
8883 (xgselect_initialize): Ditto.
8884
8885 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8886 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8887 xg_select.
8888
bbc6b304
PE
88892011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8890
8891 * eval.c (struct backtrace): Simplify and port the data structure.
8892 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8893 signed bit field, as this assumption is not portable and it makes
8894 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8895 "char debug_on_exit : 1" as this is not portable either; instead,
8896 use the portable "unsigned int debug_on_exit : 1". Remove unused
8897 member evalargs. Remove obsolete comments about cc bombing out.
8898
9851bfc5
JD
88992011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8900
51bb811f 8901 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8902 Let HAVE_GSETTINGS override HAVE_GCONF.
8903 (store_monospaced_changed): New function.
8904 (EMACS_SETTINGS): A new type derived from GObject to handle
8905 GSettings notifications.
8906 (emacs_settings_constructor, emacs_settings_get_property)
8907 (emacs_settings_set_property, emacs_settings_class_init):
8908 New functions.
8909 (gsettings_client, gsettings_obj): New variables.
8910 (GSETTINGS_SCHEMA): New define.
8911 (something_changedCB): Call store_monospaced_changed.
8912 (init_gsettings): New function.
8913 (xsettings_initialize): Call init_gsettings.
8914 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8915 to NULL.
8916
640c8776 8917 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8918 GCONF_CFLAGS/LIBS.
8919
5386012d
MR
89202011-06-29 Martin Rudalics <rudalics@gmx.at>
8921
8922 * window.c (resize_root_window, grow_mini_window)
8923 (shrink_mini_window): Rename Qresize_root_window to
8924 Qwindow_resize_root_window and Qresize_root_window_vertically to
8925 Qwindow_resize_root_window_vertically.
8926
f13e0b08
PE
89272011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8928
8929 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8930
94515237
JB
89312011-06-27 Juanma Barranquero <lekktu@gmail.com>
8932
8933 * makefile.w32-in: Redesign dependencies so they reflect more
8934 clearly which files are directly included by each source file,
8935 and not through other includes.
8936
e43b6e43
MR
89372011-06-27 Martin Rudalics <rudalics@gmx.at>
8938
8939 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8940 (sort_overlays, overlay_strings): When an overlay's clone number
8941 matches the window's clone number process the overlay even if
8942 the overlay's window property doesn't match the current window.
8943
d68443dc
MR
8944 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8945 (Fwindow_hchild): Rename to Fwindow_left_child.
8946 (Fwindow_next): Rename to Fwindow_next_sibling.
8947 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8948 (resize_window_check): Rename to window_resize_check.
8949 (resize_window_apply): Rename to window_resize_apply.
8950 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8951 (Fdelete_other_windows_internal, resize_frame_windows)
8952 (Fsplit_window_internal, Fdelete_window_internal)
8953 (grow_mini_window, shrink_mini_window)
8954 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8955
c7e73be5
JD
89562011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8957
8958 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8959 (emacs_fixed_set_min_size): Remove.
8960 (emacs_fixed_new): Take frame as argument.
8961
8962 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8963 (_EmacsFixedPrivate): Remove minwidth/height.
8964 Add struct frame *f.
8965 (emacs_fixed_init): Initialize priv->f.
8966 (get_parent_class, emacs_fixed_set_min_size): Remove.
8967 (emacs_fixed_new): Set priv->f to argument.
8968 (emacs_fixed_get_preferred_width)
8969 (emacs_fixed_get_preferred_height): Use min_width/height from
8970 frames size_hint to set minimum and natural (Bug#8919).
8971 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8972 and use min_width/height from frames size_hint to set
8973 min_width/height (Bug#8919).
8974
8975 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8976 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8977 Fix indentation.
c7e73be5 8978
cf99dcf8
EZ
89792011-06-26 Eli Zaretskii <eliz@gnu.org>
8980
8981 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8982 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8983 called at ZV.
8984
029529ac
CY
89852011-06-26 Chong Yidong <cyd@stupidchicken.com>
8986
8987 * process.c (wait_reading_process_output): Bypass select if
8988 waiting for a cell while ignoring keyboard input, and input is
8989 pending. Suggested by Jan Djärv (Bug#8869).
8990
7a7ef429
PE
89912011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8992
8993 Use gnulib's dup2 module instead of rolling our own.
8994 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8995
11fdef7d 89962011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8997
8998 * dispnew.c (scrolling_window): Before scrolling, turn off a
8999 mouse-highlight in the window being scrolled.
9000
cd3520a4
JB
90012011-06-24 Juanma Barranquero <lekktu@gmail.com>
9002
9003 Move DEFSYM to lisp.h and use everywhere.
9004
9005 * character.h (DEFSYM): Move declaration...
9006 * lisp.h (DEFSYM): ...here.
9007
9008 * gnutls.c:
9009 * minibuf.c:
9010 * w32menu.c:
9011 * w32proc.c:
9012 * w32select.c: Don't include character.h.
9013
9014 * alloc.c (syms_of_alloc):
9015 * buffer.c (syms_of_buffer):
9016 * bytecode.c (syms_of_bytecode):
9017 * callint.c (syms_of_callint):
9018 * casefiddle.c (syms_of_casefiddle):
9019 * casetab.c (init_casetab_once):
9020 * category.c (init_category_once, syms_of_category):
9021 * ccl.c (syms_of_ccl):
9022 * cmds.c (syms_of_cmds):
9023 * composite.c (syms_of_composite):
9024 * dbusbind.c (syms_of_dbusbind):
9025 * dired.c (syms_of_dired):
9026 * dispnew.c (syms_of_display):
9027 * doc.c (syms_of_doc):
9028 * editfns.c (syms_of_editfns):
9029 * emacs.c (syms_of_emacs):
9030 * eval.c (syms_of_eval):
9031 * fileio.c (syms_of_fileio):
9032 * fns.c (syms_of_fns):
9033 * frame.c (syms_of_frame):
9034 * fringe.c (syms_of_fringe):
9035 * insdel.c (syms_of_insdel):
9036 * keymap.c (syms_of_keymap):
9037 * lread.c (init_obarray, syms_of_lread):
9038 * macros.c (syms_of_macros):
9039 * msdos.c (syms_of_msdos):
9040 * print.c (syms_of_print):
9041 * process.c (syms_of_process):
9042 * search.c (syms_of_search):
9043 * sound.c (syms_of_sound):
9044 * syntax.c (init_syntax_once, syms_of_syntax):
9045 * terminal.c (syms_of_terminal):
9046 * textprop.c (syms_of_textprop):
9047 * undo.c (syms_of_undo):
9048 * w32.c (globals_of_w32):
9049 * window.c (syms_of_window):
9050 * xdisp.c (syms_of_xdisp):
9051 * xfaces.c (syms_of_xfaces):
9052 * xfns.c (syms_of_xfns):
9053 * xmenu.c (syms_of_xmenu):
9054 * xsettings.c (syms_of_xsettings):
9055 * xterm.c (syms_of_xterm): Use DEFSYM.
9056
4228cf16
TZ
90572011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
9058
cd3520a4 9059 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 9060
7fcccf1e
PE
90612011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9062
7efb4e0e
PE
9063 Integer and buffer overflow fixes (Bug#8873).
9064
ff5844ad
PE
9065 * print.c (printchar, strout): Check for string overflow.
9066 (PRINTPREPARE, printchar, strout):
9067 Don't set size unless allocation succeeds.
9068
90532f02
PE
9069 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
9070 for sizes. Check for string overflow more accurately.
9071 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
9072
6d84508d
PE
9073 * macros.c: Integer and buffer overflow fixes.
9074 * keyboard.h (struct keyboard.kbd_macro_bufsize):
9075 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
9076 Use ptrdiff_t, not int, for sizes.
9077 Don't increment bufsize until after realloc succeeds.
9078 Check for size-calculation overflow.
9079 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
9080
437b2cb4
PE
9081 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
9082
8b9ac8b4
PE
9083 * lread.c: Integer overflow fixes.
9084 (read_integer): Radix is now EMACS_INT, not int,
9085 to improve quality of diagnostics for out-of-range radices.
9086 Calculate buffer size correctly for out-of-range radices.
9087 (read1): Check for integer overflow in radices, and in
9088 read-circle numbers.
82cb60d3
PE
9089 (read_escape): Avoid int overflow.
9090 (Fload, openp, read_buffer_size, read1)
9091 (substitute_object_recurse, read_vector, read_list, map_obarray):
9092 Use ptrdiff_t, not int, for sizes.
9093 (read1): Use EMACS_INT, not int, for sizes.
20270765 9094 Check for size overflow.
8b9ac8b4 9095
7fcccf1e
PE
9096 * image.c (cache_image): Check for size arithmetic overflow.
9097
bfbbd7e7
PE
9098 * lread.c: Integer overflow issues.
9099 (saved_doc_string_size, saved_doc_string_length)
9100 (prev_saved_doc_string_size, prev_saved_doc_string_length):
9101 Now ptrdiff_t, not int.
9102 (read1): Don't assume doc string length fits in int. Check for
9103 out-of-range doc string lengths.
9104 (read_list): Don't assume file position fits in int.
39019e54 9105 (read_escape): Check for hex character overflow.
bfbbd7e7 9106
4e323265
LL
91072011-06-22 Leo Liu <sdl.web@gmail.com>
9108
9109 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
9110 Move to minibuffer.el.
9111
85fece3e
PE
91122011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9113
20b84ce9 9114 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
9115 The following patches are for when GLYPH_DEBUG && !XASSERT.
9116 * dispextern.h (trace_redisplay_p, dump_glyph_string):
9117 * dispnew.c (flush_stdout):
9118 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
9119 Mark as externally visible.
9120 * dispnew.c (check_window_matrix_pointers): Now static.
9121 * dispnew.c (window_to_frame_vpos):
9122 * xfns.c (unwind_create_frame):
9123 * xterm.c (x_check_font): Remove unused local.
9124 * scroll.c (CHECK_BOUNDS):
9125 * xfaces.c (cache_fache): Rename local to avoid shadowing.
9126 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
9127 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
9128 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
9129 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
9130 Now static.
9131 (debug_method_add): Use va_list and vsprintf rather than relying
9132 on undefined behavior with wrong number of arguments.
9133 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
9134 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
9135 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
9136 since we're not interested in debugging glyphs with old libraries.
9137 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
9138 GCC 4.6.0's static checking.
9139
0766b489
PE
91402011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9141
31fd4b32
PE
9142 Integer overflow and signedness fixes (Bug#8873).
9143 A few related buffer overrun fixes, too.
9144
b79e8648
PE
9145 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
9146
0766b489
PE
9147 * dispextern.h (struct face.stipple):
9148 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
9149 (x_bitmap_mask, x_allocate_bitmap_record)
9150 (x_create_bitmap_from_data, x_create_bitmap_from_file)
9151 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
9152 (x_create_bitmap_from_xpm_data):
9153 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
9154 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
9155 (.bitmaps_last):
9156 * xfaces.c (load_pixmap):
9157 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
9158 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
9159 (.bitmaps_last, struct x_output.icon_bitmap):
9160 Use ptrdiff_t, not int, for bitmap indexes.
9161 (x_allocate_bitmap_record): Check for size overflow.
9162 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
9163
b081724f
PE
9164 Use ptrdiff_t, not int, for overlay counts.
9165 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
9166 * editfns.c (overlays_around, get_pos_property):
9167 * textprop.c (get_char_property_and_overlay):
9168 * xdisp.c (next_overlay_change, note_mouse_highlight):
9169 * xfaces.c (face_at_buffer_position):
21514da7
PE
9170 * buffer.c (OVERLAY_COUNT_MAX): New macro.
9171 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
9172 (Fnext_overlay_change, Fprevious_overlay_change)
9173 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 9174 Use ptrdiff_t, not int, for sizes.
21514da7 9175 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 9176
3de73e5e
PE
9177 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
9178
2606c57b
PE
9179 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
9180 (x_session_initialize): Do not assume string length fits in int.
9181
aaafe47a
PE
9182 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
9183 This is unlikely, but can occur if DPI is outlandish.
9184
2674ddc8 9185 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
9186 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
9187
28154962
PE
9188 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
9189 * xrdb.c (magic_file_p, search_magic_path):
9190 Omit last arg SUFFIX; it was always 0. All callers changed.
9191 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
9192
7de51af5
PE
9193 * xfont.c (xfont_match): Avoid need for strlen.
9194
25ed6cc3
PE
9195 * xfns.c: Don't assume strlen fits in int.
9196 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
9197
4eab31dd
PE
9198 * xdisp.c (message_log_check_duplicate): Return intmax_t,
9199 not unsigned long, as we prefer signed integers. All callers changed.
9200 Detect integer overflow in repeat count.
9201 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 9202 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 9203
171e2a58
PE
9204 * termcap.c: Don't assume sizes fit in int and never overflow.
9205 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
9206 (gobble_line): Check for size-calculation overflow.
9207
ad39faca 9208 * minibuf.c (Fread_buffer):
6e5bb2dc 9209 * lread.c (intern, intern_c_string):
74ca2eb3
PE
9210 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
9211 Don't assume string length fits in int.
9212
52c61c22 9213 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
9214 * gtkutil.c (style_changed_cb): Avoid need for strlen.
9215
b5b8c9e5
PE
9216 * font.c: Don't assume string length fits in int.
9217 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
9218 Use ptrdiff_t, not int.
ccd6111c
PE
9219 (font_intern_prop): Don't assume string length fits in int.
9220 Don't assume integer property fits in fixnum.
9221 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 9222
882f0d81 9223 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 9224 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
9225 Reformulate so as not to need the command string.
9226 Invoke gzip -cd rather than gunzip, as it's more portable.
9227 (lock_info_type, lock_file_1, lock_file):
9228 Don't assume pid_t and time_t fit in unsigned long.
9229 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
9230 (current_lock_owner): Prefer signed type for sizes.
9231 Use memcpy, not strncpy, where memcpy is what is really wanted.
9232 Don't assume (via atoi) that time_t and pid_t fit in int.
9233 Check for time_t and/or pid_t out of range, e.g., via a network share.
9234 Don't alloca where an auto var works fine.
9235
93f4cf88
PE
9236 * fileio.c: Fix some integer overflow issues.
9237 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
9238 Don't assume string length fits in int.
9239 (directory_file_name): Don't assume string length fits in long.
9240 (make_temp_name): Don't assume pid fits in int, or that its print
9241 length is less than 20.
9242
f3e92b69
PE
9243 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
9244
1bfdaf10
PE
9245 * coding.c (make_subsidiaries): Don't assume string length fits in int.
9246
35016e9a
PE
9247 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
9248
3d1e65a1
PE
9249 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
9250 We prefer signed integers, even for size calculations.
9251
0b963a93
PE
9252 * emacs.c: Don't assume string length fits in 'int'.
9253 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
9254 (main): Don't invoke strlen when not needed.
9255
573f4b54
PE
9256 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
9257 (XD_DEBUG_MESSAGE): Don't waste a byte.
9258
989f33ba
PE
9259 * callproc.c (getenv_internal_1, getenv_internal)
9260 (Fgetenv_internal):
965d34eb
PE
9261 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
9262
e4d29b33
PE
9263 * lread.c (invalid_syntax): Omit length argument.
9264 All uses changed. This doesn't fix a bug, but it simplifies the
9265 code away from its former Hollerith-constant appearance, and it's
9266 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 9267 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 9268
eb49b136
PE
9269 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
9270 This didn't break anything, but it didn't help either.
9271 It's confusing to put a bogus integer in a place where the actual
9272 value does not matter.
9f62aeb1 9273 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 9274 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 9275
15375a22
PE
9276 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
9277 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
9278 implementation.
b61cc01c
PE
9279 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
9280 We prefer signed types, and the value cannot exceed the EMACS_INT
9281 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
9282 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
9283 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
9284 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 9285
53b2623d
PE
9286 * indent.c (sane_tab_width): New function.
9287 (current_column, scan_for_column, Findent_to, position_indentation)
9288 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 9289 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 9290
51cab52b 9291 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 9292
f2ed8a70
PE
9293 * lisp.h (lint_assume): New macro.
9294 * composite.c (composition_gstring_put_cache):
9295 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
9296
abe80cc6
PE
9297 * editfns.c, insdel.c:
9298 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 9299
b02c740e
PE
9300 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9301
ebc96716
PE
9302 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9303
b4e50fa0 9304 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 9305 Use much-faster test for byte-length change.
311d5d7c 9306 Don't assume string byte-length fits in 'int'.
a4cf38e4 9307 Check that character arg fits in 'int'.
85461888 9308 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 9309
c0c1ee9f
PE
9310 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9311
a498d7f4
PE
9312 * fns.c (concat): Catch string overflow earlier.
9313 Do not rely on integer wraparound.
9314
51cab52b
PE
9315 * dispextern.h (struct it.overlay_strings_charpos)
9316 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
9317 * xdisp.c (forward_to_next_line_start)
9318 (back_to_previous_visible_line_start)
9319 (reseat_at_next_visible_line_start, next_element_from_buffer):
9320 Don't arbitrarily truncate the value of 'selective' to int.
9321
76031fad
PE
9322 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9323
5eb55db9
PE
9324 * composite.c: Don't truncate sizes to 'int'.
9325 (composition_gstring_p, composition_reseat_it)
9326 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
9327 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9328 not EMACS_UINT, for indexes.
5eb55db9 9329
0703a717
PE
9330 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9331
d6202519
PE
9332 * buffer.c: Include <verify.h>.
9333 (struct sortvec.priority, struct sortstr.priority):
8961a454 9334 Now EMACS_INT, not int.
c20998a7 9335 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
9336 (struct sortstr.size, record_overlay_string)
9337 (struct sortstrlist.size, struct sortlist.used):
9338 Don't truncate size to int.
9339 (record_overlay_string): Check for size-calculation overflow.
d6202519 9340 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 9341
d5a19415
JM
93422011-06-22 Jim Meyering <meyering@redhat.com>
9343
029529ac 9344 Don't leak an XBM-image-sized buffer
d5a19415
JM
9345 * image.c (xbm_load): Free the image buffer after using it.
9346
a9041e6c
PE
93472011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9348
9349 Port to Sun C.
9350 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9351 that Sun C diagnosed.
9352 * fns.c (secure_hash): Fix pointer signedness issue.
9353 * intervals.c (static_offset_intervals): New function.
9354 (offset_intervals): Use it.
9355
7f3f739f
LL
93562011-06-21 Leo Liu <sdl.web@gmail.com>
9357
9358 * deps.mk (fns.o):
9359 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9360 sha512.h.
9361
9362 * fns.c (secure_hash): Rename from crypto_hash_function and change
9363 the first arg to accept symbols.
5b66d427 9364 (Fsecure_hash): New primitive.
7f3f739f
LL
9365 (syms_of_fns): New symbols.
9366
76147d94
DD
93672011-06-20 Deniz Dogan <deniz@dogan.se>
9368
9369 * process.c (Fset_process_buffer): Clarify return value in
9370 docstring.
9371
7d7d0045
CY
93722011-06-18 Chong Yidong <cyd@stupidchicken.com>
9373
9374 * dispnew.c (add_window_display_history): Use BVAR.
9375
9376 * xdisp.c (debug_method_add): Use BVAR.
9377 (check_window_end, dump_glyph_matrix, dump_glyph)
9378 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
9379
9380 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
9381 Likewise.
9382
9383 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
9384 check till after the cache is created in init_frame_faces.
9385
ff2bc410
SM
93862011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
9387
9388 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9389
28177add
PE
93902011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9391
dd3482fe
PE
9392 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9393 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9394 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9395
393d71f3 9396 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9397 * fileio.c (Finsert_file_contents):
9398 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9399 Remove the old (too-loose) buffer overflow checks.
9400 They weren't needed, since make_gap checks for buffer overflow.
9401 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9402 The old code merely checked for Emacs fixnum overflow, and relied
9403 on undefined (wraparound) behavior. The new code avoids undefined
9404 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9405
2e6813b0 9406 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9407 Tune. Don't use wider integers than needed. Don't use alloca.
9408 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9409
599a9e4f
PE
9410 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9411
99561444
PE
9412 * insdel.c, lisp.h (buffer_overflow): New function.
9413 (insert_from_buffer_1, replace_range, replace_range_2):
9414 * insdel.c (make_gap_larger):
9415 * editfns.c (Finsert_char):
9416 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9417
28177add
PE
9418 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9419
e69dafad
PE
94202011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9421
4baa020d 9422 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9423
b1c46f02
PE
9424 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9425 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9426
e69dafad
PE
9427 * fileio.c: Don't assume EMACS_INT fits in off_t.
9428 (emacs_lseek): New static function.
9429 (Finsert_file_contents, Fwrite_region): Use it.
9430 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9431
566684ea
PE
9432 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9433
e6966cd6
PE
9434 * fns.c: Don't overflow int when computing a list length.
9435 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9436 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9437 truncation on 64-bit hosts. Check for QUIT every
9438 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9439 faster and is responsive enough.
9440 (Flength): Report an error instead of overflowing an integer.
9441 (Fsafe_length): Return a float if the value is not representable
9442 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9443 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9444 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9445
dd0b0efb
PE
9446 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9447 (header_size, word_size): New constants.
9448 (allocate_vectorlike): Don't check size overflow here.
9449 (allocate_vector): Check it here instead, since this is the only
9450 caller of allocate_vectorlike that could cause overflow.
9451 Check that the new vector's length is representable as a fixnum.
9452
86fe5cfe
PE
9453 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9454 The previous code was bogus. For example, next_almost_prime (32)
9455 returned 39, which is undesirable as it is a multiple of 3; and
9456 next_almost_prime (24) returned 25, which is a multiple of 5 so
9457 why was the code bothering to check for multiples of 7?
9458
80e88859
PE
9459 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9460
4a2f0ad6
PE
9461 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9462
f66c7cf8
PE
9463 Variadic C functions now count arguments with ptrdiff_t.
9464 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9465 Back then I didn't know that the Emacs coding style prefers signed int.
9466 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9467 were being counted with int, which may truncate counts on 64-bit
9468 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9469 * lisp.h (struct Lisp_Subr.function.aMANY)
9470 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9471 Arg counts are now ptrdiff_t, not size_t.
9472 All variadic functions and their callers changed accordingly.
9473 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9474 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9475 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9476 * callint.c (Fcall_interactively): Check arg count for overflow,
9477 to avoid potential buffer overrun. Use signed char, not 'int',
9478 for 'varies' array, so that we needn't bother to check its size
9479 calculation for overflow.
9480 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9481 * eval.c (apply_lambda):
9482 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9483 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9484 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9485
a1759b76
PE
9486 * callint.c (Fcall_interactively): Don't use index var as event count.
9487
d96be9fc
PE
9488 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9489 * mem-limits.h (SIZE): Remove; no longer used.
9490
a690a978 9491 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9492
578c21e6
PE
9493 Remove unnecessary casts.
9494 * xterm.c (x_term_init):
9495 * xfns.c (x_set_border_pixel):
9496 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9497 These aren't needed now that we assume ANSI C.
9498
96f53c6c
PE
9499 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9500 It's more likely to cause problems (due to unsigned overflow)
9501 than to cure them.
9502
83c77d31
PE
9503 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9504
ee2079f1
PE
9505 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9506
6da65536
PE
9507 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9508
7147c4a4
PE
9509 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9510
193e32d9
PE
9511 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9512
e5533da6
PE
9513 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9514
9910e595
PE
9515 GLYPH_CODE_FACE returns EMACS_INT, not int.
9516 * dispextern.h (merge_faces):
9517 * xfaces.c (merge_faces):
01103c44
PE
9518 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9519 Don't assume EMACS_INT fits in int.
9910e595 9520
2638320e
PE
9521 * character.h (CHAR_VALID_P): Remove unused parameter.
9522 * fontset.c, lisp.h, xdisp.c: All uses changed.
9523
045eb8d9
PE
9524 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9525
c1f134b5
PE
9526 * fns.c (concat): Minor tuning based on overflow analysis.
9527 This doesn't fix any bugs. Use int to hold character, instead
9528 of constantly refetching from Emacs object. Use XFASTINT, not
9529 XINT, for value known to be a character. Don't bother comparing
9530 a single byte to 0400, as it's always less.
9531
395fcb93 9532 * floatfns.c (Fexpt):
327eeec8
PE
9533 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9534
abbd3d23
PE
9535 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9536 for characters.
9537
684a03ef
PE
9538 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9539
0fed43f3
PE
9540 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9541 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9542 incorrectly succeed when S was a string, because 4294967386 was
9543 truncated before it was used.
9544
8fd02eb7
PE
9545 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9546 Otherwise, an out-of-range integer could cause undefined behavior
9547 on a 64-bit host.
9548
f8c86b69
PE
9549 * composite.c: Use int, not EMACS_INT, for characters.
9550 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9551 EMACS_INT, for values that are known to be in character range.
9552 This doesn't fix any bugs but is the usual style inside Emacs and
9553 may generate better code on 32-bit machines.
9554
34206dd2
PE
9555 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9556 This is for reasons similar to the recent CHAR_STRING fix.
9557 * charset.c (Fencode_char): Check that character arg is actually
9558 a character. Pass an int to ENCODE_CHAR.
9559 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9560 wider than 'int', as a compile-time check to prevent future regressions
9561 in this area.
9562
c5958d4c 9563 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9564
9565 Make sure a 64-bit char is never passed to CHAR_STRING.
9566 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9567 by silently ignoring the top 32 bits, allowing some values
9568 that were far too large to be valid characters.
9569 * character.h: Include <verify.h>.
9570 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9571 arguments are no wider than unsigned, as a compile-time check
9572 to prevent future regressions in this area.
9573 * data.c (Faset):
01103c44 9574 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9575 (Fsubst_char_in_region):
9576 * fns.c (concat):
9577 * xdisp.c (decode_mode_spec_coding):
9578 Adjust to CHAR_STRING's new requirement.
9579 * editfns.c (Finsert_char, Fsubst_char_in_region):
9580 * fns.c (concat): Check that character args are actually
9581 characters. Without this test, these functions did the wrong
9582 thing with wildly out-of-range values on 64-bit hosts.
9583
d37ca623
PE
9584 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9585 These casts should not be needed on 32-bit hosts, either.
9586 * keyboard.c (read_char):
9587 * lread.c (Fload): Remove casts to unsigned.
9588
ea204efb
PE
9589 * lisp.h (UNSIGNED_CMP): New macro.
9590 This fixes comparison bugs on 64-bit hosts.
9591 (ASCII_CHAR_P): Use it.
9592 * casefiddle.c (casify_object):
01103c44 9593 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9594 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9595 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9596 * dispextern.h (FACE_FROM_ID):
9597 * keyboard.c (read_char): Use UNSIGNED_CMP.
9598
41cb286c
PE
9599 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9600 not to EMACS_INT, to avoid GCC warning.
9601
4a1b9832
PE
9602 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9603
55daad71
PE
9604 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9605 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9606 isn't needed on 32-bit machines.
8f95c75c 9607
01103c44
PE
9608 * buffer.c (Fgenerate_new_buffer_name):
9609 Use EMACS_INT for count, not int.
0ceccced 9610 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9611
9612 * data.c (Qcompiled_function): Now static.
9613
c6f072e7
PE
9614 * window.c (window_body_lines): Now static.
9615
20ce5912
PE
9616 * image.c (gif_load): Rename local to avoid shadowing.
9617
9c4c5f81
PE
9618 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9619 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9620 * alloc.c (make_save_value): Integer argument is now of type
9621 ptrdiff_t, not int.
9622 (mark_object): Use ptrdiff_t, not int.
9623 * lisp.h (pD): New macro.
9624 * print.c (print_object): Use it.
9625
c0c5c8ae
PE
9626 * alloc.c: Use EMACS_INT, not int, to count objects.
9627 (total_conses, total_markers, total_symbols, total_vector_size)
9628 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9629 (total_free_floats, total_floats, total_free_intervals)
9630 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9631 Now EMACS_INT, not int. All uses changed.
9632 (Fgarbage_collect): Compute overall total using a double, so that
9633 integer overflow is less likely to be a problem. Check for overflow
9634 when converting back to an integer.
5a25e253
PE
9635 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9636 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9637 These were 'int' variables that could overflow on 64-bit hosts;
9638 they were never used, so remove them instead of repairing them.
211a0b2a 9639 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9640 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9641 Previously, this ceilinged at INT_MAX, but that doesn't work on
9642 64-bit machines.
e46bb31a 9643 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9644
c78baabf 9645 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9646 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9647 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9648 when a (possibly-narrower) signed value would do just as well.
9649 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9650
c9d624c6
PE
9651 * alloc.c: Catch some string size overflows that we were missing.
9652 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9653 for convenience in STRING_BYTES_MAX.
9654 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9655 The definition here is exact; the one in lisp.h was approximate.
9656 (allocate_string_data): Check for string overflow. This catches
9657 some instances we weren't catching before. Also, it catches
9658 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9659 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9660 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9661
c9d624c6
PE
9662 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9663 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9664 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9665
353032ce
PE
9666 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9667
2bccce07
PE
9668 * alloc.c (Fmake_string): Check for out-of-range init.
9669
0ac30604
SM
96702011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9671
9672 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9673
c195f2de
JD
96742011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9675
9676 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9677 xg_get_default_scrollbar_width.
9678
9679 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9680 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9681 (style_changed_cb): Call update_theme_scrollbar_width and call
9682 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9683 all frames (Bug#8505).
9684 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9685 Call gtk_window_set_resizable if HAVE_GTK3.
9686 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9687 and height if HAVE_GTK3 (Bug#8505).
9688 (scroll_bar_width_for_theme): New variable.
9689 (update_theme_scrollbar_width): New function.
9690 (xg_get_default_scrollbar_width): Move code to
9691 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9692 (xg_initialize): Call update_theme_scrollbar_width.
9693
9694 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9695
9696 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9697
e10ac9f1
MR
96982011-06-12 Martin Rudalics <rudalics@gmx.at>
9699
9700 * frame.c (make_frame): Call other_buffer_safely instead of
9701 other_buffer.
9702
9703 * window.c (temp_output_buffer_show): Call display_buffer with
9704 second argument Vtemp_buffer_show_specifiers and reset latter
9705 immediately after the call.
9706 (Vtemp_buffer_show_specifiers): New variable.
9707 (auto_window_vscroll_p, next_screen_context_lines)
9708 (Vscroll_preserve_screen_position): Remove leading asterisks from
9709 doc-strings.
9710
2d3c217e 97112011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9712
7b7f97e8 9713 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9714 * buffer.c (Qclone_number): Remove for now, as it's unused.
9715 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9716 (record_buffer): Remove unused local.
9717 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9718 (set_frame_buffer_list): Remove; unused.
9719 * frame.h (other_visible_frames): Remove decl.
9720 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9721 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9722 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9723 if HAVE_GPM.
9724 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9725 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9726 Define only if HAVE_GPM.
9727 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9728 (update_hints_inhibit): Remove; never set. All uses removed.
9729 * widgetprv.h (emacsFrameClassRec): Remove decl.
9730 * window.c (delete_deletable_window): Now returns void, since it
9731 wasn't returning anything.
9732 (compare_window_configurations): Remove unused locals.
9733 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9734 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9735 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9736 the same widths as pointers. This follows up on the 2011-05-06 patch.
9737 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9738 * xterm.h: Likewise.
9739 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9740
1384b89e
JB
97412011-06-12 Juanma Barranquero <lekktu@gmail.com>
9742
9743 * makefile.w32-in: Update dependencies.
9744 (LISP_H): Add lib/intprops.h.
9745
1100a63c
CY
97462011-06-11 Chong Yidong <cyd@stupidchicken.com>
9747
9748 * image.c (gif_load): Add animation frame delay to the metadata.
9749 (syms_of_image): Use DEFSYM. New symbol `delay'.
9750
6198ccd0
MR
97512011-06-11 Martin Rudalics <rudalics@gmx.at>
9752
9753 * window.c (delete_deletable_window): Re-add.
9754 (Fset_window_configuration): Rewrite to handle dead buffers and
9755 consequently deletable windows.
9756 (window_tree, Fwindow_tree): Remove. Supply functionality in
9757 window.el.
9758 (compare_window_configurations): Simplify code.
9759
b6e3633c
AS
97602011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9761
1ab0dee5
AS
9762 * image.c (imagemagick_load_image): Fix type mismatch.
9763 (Fimagemagick_types): Likewise.
9764
b6e3633c
AS
9765 * window.h (replace_buffer_in_windows): Declare.
9766
9397e56f
MR
97672011-06-11 Martin Rudalics <rudalics@gmx.at>
9768
9769 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9770 Qclone_number. Remove external declaration of Qdelete_window.
9771 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9772 code.
640c8776
SM
9773 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9774 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9775 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9776 buffer list implementation.
9777 (other_buffer_safely): New function.
9778 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9779 calls to replace_buffer_in_windows and
9780 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9781 if allowed.
9782 (record_buffer): Inhibit quitting and rewrite using quittable
9783 functions. Run Qbuffer_list_update_hook if allowed.
9784 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9785 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9786 Move switch-to-buffer to window.el.
9397e56f
MR
9787 (bury-buffer): Move to window.el.
9788 (Vbuffer_list_update_hook): New variable.
9789
9790 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9791 section.
9792
9793 * window.h (resize_frame_windows): Move up in code.
9794 (Fwindow_frame): Remove EXFUN.
9795 (replace_buffer_in_all_windows): Remove prototype.
9796 (replace_buffer_in_windows_safely): Add prototype.
9797
9798 * window.c: Declare Qdelete_window static again. Move down
9799 declaration of select_count.
9800 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9801 (Fother_window): Move to window.el.
9802 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9803 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9804 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9805 window.el.
9806 (replace_buffer_in_windows): Implement by calling
9807 Qreplace_buffer_in_windows.
9808 (replace_buffer_in_all_windows): Remove with some functionality
9809 moved into replace_buffer_in_windows_safely.
9810 (replace_buffer_in_windows_safely): New function.
9811 (select_window_norecord, select_frame_norecord): Move in front
9812 of run_window_configuration_change_hook. Remove now obsolete
9813 declarations.
640c8776
SM
9814 (Fset_window_buffer): Rewrite doc-string.
9815 Call Qrecord_window_buffer.
9397e56f
MR
9816 (keys_of_window): Move binding for other-window to window.el.
9817
b50691aa
CY
98182011-06-11 Chong Yidong <cyd@stupidchicken.com>
9819
9820 * dispextern.h (struct image): Replace data member, whose int_val
9821 and ptr_val fields were not used by anything, with a single
9822 lisp_val object.
9823
9824 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9825 (gif_clear_image, gif_load, imagemagick_load_image)
9826 (gs_clear_image, gs_load): Callers changed.
9827
3f754b86
PE
98282011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9829
cca69397
PE
9830 * buffer.h: Include <time.h>, for time_t.
9831 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9832
109e28d0
PE
9833 Fix minor problems found by static checking.
9834
60737f02
PE
9835 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9836
4b66faf3
PE
9837 Make identifiers static if they are not used in other modules.
9838 * data.c (Qcompiled_function, Qframe, Qvector):
9839 * image.c (QimageMagick, Qsvg):
9840 * minibuf.c (Qmetadata):
9841 * window.c (resize_window_check, resize_root_window): Now static.
9842 * window.h (resize_window_check, resize_root_window): Remove decls.
9843
109e28d0
PE
9844 * window.c (window_deletion_count, delete_deletable_window):
9845 Remove; unused.
46a4ce9e
PE
9846 (window_body_lines): Now static.
9847 (Fdelete_other_windows_internal): Mark vars as initialized.
9848 Make sure 'resize_failed' is initialized.
9849 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9850 (resize_window_apply): Remove unused local.
9851 * window.h (delete_deletable_window): Remove decl.
9852
109e28d0 9853 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9854 (imagemagick_load_image): Fix pointer signedness problem by changing
9855 last arg from unsigned char * to char *. All uses changed.
9856 Also, fix a local for similar reasons.
9857 Remove unused locals. Remove locals to avoid shadowing.
9858 (fn_rsvg_handle_free): Remove; unused.
9859 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9860 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9861
3f754b86
PE
9862 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9863
2547adb1
CY
98642011-06-10 Chong Yidong <cyd@stupidchicken.com>
9865
9866 * image.c (gif_load): Fix omitted cast error introduced by
9867 2011-06-06 change.
9868
2c8e37d4
MR
98692011-06-10 Martin Rudalics <rudalics@gmx.at>
9870
9871 * window.h (resize_proportionally, orig_total_lines)
9872 (orig_top_line): Remove from window structure.
9873 (set_window_height, set_window_width, change_window_heights)
9874 (Fdelete_window): Remove prototypes.
9875 (resize_frame_windows): Remove duplicate declaration.
9876
440a42e3
EZ
98772011-06-10 Eli Zaretskii <eliz@gnu.org>
9878
9879 * window.h (resize_frame_windows, resize_window_check)
9880 (delete_deletable_window, resize_root_window)
9881 (resize_frame_windows): Declare prototypes.
9882
9883 * window.c (resize_window_apply): Make definition be "static" to
9884 match the prototype.
9885
562dd5e9
MR
98862011-06-10 Martin Rudalics <rudalics@gmx.at>
9887
9888 * window.c: Remove declarations of Qwindow_size_fixed,
9889 window_min_size_1, window_min_size_2, window_min_size,
9890 size_window, window_fixed_size_p, enlarge_window, delete_window.
9891 Remove static from declaration of Qdelete_window, it's
9892 temporarily needed by Fbury_buffer.
9893 (replace_window): Don't assign orig_top_line and
9894 orig_total_lines.
9895 (Fdelete_window, delete_window): Remove. Window deletion is
9896 handled by window.el.
640c8776
SM
9897 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9898 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9899 (Fdelete_other_windows): Remove. Deleting other windows is
9900 handled by window.el.
9901 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9902 handled in window.el.
9903 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9904 Window minimum sizes are handled in window.el.
9905 (shrink_windows, size_window, set_window_height)
9906 (set_window_width, change_window_heights, window_height)
9907 (window_width, CURBEG, CURSIZE, enlarge_window)
9908 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9909 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9910 handled in window.el.
9911 (make_dummy_parent): Rename to make_parent_window and give it a
9912 second argument horflag.
9913 (make_window): Don't set resize_proportionally any more.
9914 (Fsplit_window): Remove. Windows are split in window.el.
9915 (save_restore_action, save_restore_orig_size)
9916 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9917 Resize mini windows in window.el.
9918 (grow_mini_window, shrink_mini_window): Implement by calling
9919 Qresize_root_window_vertically, resize_window_check and
9920 resize_window_apply.
640c8776
SM
9921 (saved_window, Fset_window_configuration, save_window_save):
9922 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9923 resize_proportionally.
9924 (window_min_height, window_min_width): Move to window.el.
9925 (keys_of_window): Move bindings for delete-other-windows,
9926 split-window, delete-window and enlarge-window to window.el.
9927
9928 * buffer.c: Temporarily extern Qdelete_window.
9929 (Fbury_buffer): Temporarily call Qdelete_window instead of
9930 Fdelete_window (Fbury_buffer will move to window.el soon).
9931
9932 * frame.c (set_menu_bar_lines_1): Remove code handling
9933 orig_top_line and orig_total_lines.
9934
9935 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9936 set_window_height but set heights directly.
9937 (change_frame_size_1): Use resize_frame_windows.
9938
9939 * xdisp.c (init_xdisp): Don't use set_window_height but set
9940 heights directly.
9941
640c8776
SM
9942 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9943 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9944 run_window_configuration_change_hook.
9945
9946 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9947 instead of change_window_heights and run
9948 run_window_configuration_change_hook.
9949
1a13852e
MR
99502011-06-09 Martin Rudalics <rudalics@gmx.at>
9951
9952 * window.c (replace_window): Rename second argument REPLACEMENT to
9953 NEW. New third argument SETFLAG. Rewrite.
9954 (delete_window, make_dummy_parent): Call replace_window with
9955 third argument 1.
9956 (window_list_1): Move down in code.
9957 (run_window_configuration_change_hook): Move set_buffer part
9958 before select_frame_norecord part in order to unwind correctly.
9959 Rename count1 to count.
9960 (recombine_windows, delete_deletable_window, resize_root_window)
9961 (Fdelete_other_windows_internal)
9962 (Frun_window_configuration_change_hook, make_parent_window)
9963 (resize_window_check, resize_window_apply, Fresize_window_apply)
9964 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9965 (Fdelete_window_internal, Fresize_mini_window_internal):
9966 New functions.
1a13852e
MR
9967 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9968
f3d1777e
MR
99692011-06-08 Martin Rudalics <rudalics@gmx.at>
9970
496e208e
MR
9971 * window.h (window): Add some new members to window structure -
9972 normal_lines, normal_cols, new_total, new_normal, clone_number,
9973 splits, nest, prev_buffers, next_buffers.
9974 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9975 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9976
f3d1777e
MR
9977 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9978 Remove.
496e208e
MR
9979 (make_dummy_parent): Set new members of windows structure.
9980 (make_window): Move down in code. Handle new members of window
9981 structure.
9982 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9983 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9984 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9985 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9986 (Fset_window_next_buffers, Fset_window_clone_number):
9987 New functions.
496e208e
MR
9988 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9989 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9990 Doc-string fixes.
9991 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9992 Argument WINDOW can be now internal window too.
9993 (Fwindow_use_time): Move up in code.
9994 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9995 Rewrite doc-string.
9996 (Fset_window_configuration, saved_window)
9997 (Fcurrent_window_configuration, save_window_save): Handle new
9998 members of window structure.
b9e809c2
MR
9999 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
10000 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
10001 (syms_of_window): New Lisp objects Qrecord_window_buffer,
10002 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
10003 Qget_mru_window, Qresize_root_window,
10004 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
10005 Qauto_buffer_name; staticpro them.
f3d1777e 10006
abde8f8c
MR
100072011-06-07 Martin Rudalics <rudalics@gmx.at>
10008
10009 * window.c (Fwindow_total_size, Fwindow_left_column)
10010 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
10011 (Fwindow_list_1): New functions.
10012 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
10013 (Fwindow_width, Fscroll_left, Fscroll_right):
10014 Use window_body_cols instead of window_box_text_cols.
10015 (delete_window, Fset_window_configuration):
10016 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
10017 (delete_all_subwindows): Take a window as argument and not a
10018 structure. Rewrite.
190b47e6
MR
10019 (window_loop): Remove handling of GET_LRU_WINDOW and
10020 GET_LARGEST_WINDOW.
10021 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
10022
10023 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
10024 window_box_text_cols. delete_all_subwindows now takes a
10025 Lisp_Object as argument.
abde8f8c 10026
640c8776
SM
10027 * indent.c (compute_motion, Fcompute_motion):
10028 Use window_body_cols instead of window_box_text_cols.
abde8f8c 10029
fa8a67e6
MR
10030 * frame.c (delete_frame): Call delete_all_subwindows with root
10031 window as argument.
10032
a54e3482
DC
100332011-06-07 Daniel Colascione <dan.colascione@gmail.com>
10034
10035 * fns.c (Fputhash): Document return value.
10036
60002bf5
CY
100372011-06-06 Chong Yidong <cyd@stupidchicken.com>
10038
10039 * image.c (gif_load): Implement gif89a spec "no disposal" method.
10040
0c671da6 100412011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 10042
b862a52a 10043 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 10044
be44ca6c
PE
10045 Check for overflow when converting integer to cons and back.
10046 * charset.c (Fdefine_charset_internal, Fdecode_char):
10047 Use cons_to_unsigned to catch overflow.
10048 (Fencode_char): Use INTEGER_TO_CONS.
10049 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
10050 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
10051 * data.c (long_to_cons, cons_to_long): Remove.
10052 (cons_to_unsigned, cons_to_signed): New functions.
10053 These signal an error for invalid or out-of-range values.
10054 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
10055 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
10056 * font.c (Ffont_variation_glyphs):
10057 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
10058 * lisp.h: Include <intprops.h>.
10059 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
10060 (cons_to_signed, cons_to_unsigned): New decls.
10061 (long_to_cons, cons_to_long): Remove decls.
10062 * undo.c (record_first_change): Use INTEGER_TO_CONS.
10063 (Fprimitive_undo): Use CONS_TO_INTEGER.
10064 * xfns.c (Fx_window_property): Likewise.
10065 * xselect.c: Include <limits.h>.
10066 (x_own_selection, selection_data_to_lisp_data):
10067 Use INTEGER_TO_CONS.
10068 (x_handle_selection_request, x_handle_selection_clear)
10069 (x_get_foreign_selection, Fx_disown_selection_internal)
10070 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
10071 (lisp_data_to_selection_data): Use cons_to_unsigned.
10072 (x_fill_property_data): Use cons_to_signed.
10073 Report values out of range.
10074
d1f3d2af
PE
10075 Check for buffer and string overflow more precisely.
10076 * buffer.h (BUF_BYTES_MAX): New macro.
10077 * lisp.h (STRING_BYTES_MAX): New macro.
10078 * alloc.c (Fmake_string):
10079 * character.c (string_escape_byte8):
10080 * coding.c (coding_alloc_by_realloc):
10081 * doprnt.c (doprnt):
10082 * editfns.c (Fformat):
10083 * eval.c (verror):
10084 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
10085 since they may not be the same number.
10086 * editfns.c (Finsert_char):
10087 * fileio.c (Finsert_file_contents):
10088 Likewise for BUF_BYTES_MAX.
10089
dd52fcea
PE
10090 * image.c: Use ptrdiff_t, not int, for sizes.
10091 (slurp_file): Switch from int to ptrdiff_t.
10092 All uses changed.
10093 (slurp_file): Check that file size fits in both size_t (for
10094 malloc) and ptrdiff_t (for sanity and safety).
10095
7f9bbdbb
PE
10096 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
10097 if b->modtime has its maximal value.
10098
dfe18f82
PE
10099 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
10100
84acfcf0
PE
10101 Don't assume time_t can fit into int.
10102 * buffer.h (struct buffer.modtime): Now time_t, not int.
10103 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
10104 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
10105
ccd9a01a
PE
10106 Minor fixes for signed vs unsigned integers.
10107 * character.h (MAYBE_UNIFY_CHAR):
10108 * charset.c (maybe_unify_char):
10109 * keyboard.c (read_char, reorder_modifiers):
10110 XINT -> XFASTINT, since the integer must be nonnegative.
10111 * ftfont.c (ftfont_spec_pattern):
10112 * keymap.c (access_keymap, silly_event_symbol_error):
10113 XUINT -> XFASTINT, since the integer must be nonnegative.
10114 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
10115 since it makes no difference and we prefer signed.
10116 * keyboard.c (record_char): Use XUINT when all the neighbors do.
10117 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
10118 nonnegative.
10119
d6d100dd
SM
101202011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
10121
10122 * window.h (Fwindow_frame): Declare.
10123
2b6148e4
PE
101242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10125
10126 * alloc.c: Simplify handling of large-request failures (Bug#8800).
10127 (SPARE_MEMORY): Always define.
10128 (LARGE_REQUEST): Remove.
10129 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
10130
f230ecc9
MR
101312011-06-06 Martin Rudalics <rudalics@gmx.at>
10132
727e958e
MR
10133 * lisp.h: Move EXFUNS for Fframe_root_window,
10134 Fframe_first_window and Fset_frame_selected_window to window.h.
10135
10136 * window.h: Move EXFUNS for Fframe_root_window,
10137 Fframe_first_window and Fset_frame_selected_window here from
10138 lisp.h.
10139
10140 * frame.c (Fwindow_frame, Fframe_first_window)
10141 (Fframe_root_window, Fframe_selected_window)
10142 (Fset_frame_selected_window): Move to window.c.
10143 (Factive_minibuffer_window): Move to minibuf.c.
10144 (Fother_visible_frames_p): New function.
10145
10146 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
10147
f230ecc9
MR
10148 * window.c (decode_window, decode_any_window): Move up in code.
10149 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
10150 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
10151 (Fwindow_buffer): Move up and rewrite doc-string.
10152 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
10153 (Fwindow_prev): New functions.
727e958e
MR
10154 (Fwindow_frame): Move here from frame.c. Accept any window as
10155 argument.
10156 (Fframe_root_window, Fframe_first_window)
10157 (Fframe_selected_window): Move here from frame.c. Accept frame
10158 or arbitrary window as argument. Update doc-strings.
10159 (Fminibuffer_window): Move up in code.
10160 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
10161 (Fset_frame_selected_window): Move here from frame.c.
10162 Marginal rewrite.
727e958e
MR
10163 (Fselected_window, select_window, Fselect_window): Move up in
10164 code. Minor doc-string fixes.
f230ecc9 10165
4d09bcf6
PE
101662011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10167
10168 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
10169 Do not assume that spare memory exists; that assumption is valid
10170 only if SYSTEM_MALLOC.
10171 (LARGE_REQUEST): New macro, so that the issue of large requests
10172 is separated from the issue of spare memory.
10173
810928a2
AS
101742011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10175
172418ad
AS
10176 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
10177 format. (Bug#8806)
10178
43f862f7
AS
10179 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
10180
810928a2
AS
10181 * xfns.c (x_set_scroll_bar_default_width): Move declarations
10182 before statements.
10183
a059fe24
JD
101842011-06-05 Jan Djärv <jan.h.d@swipnet.se>
10185
10186 * gtkutil.c (xg_get_default_scrollbar_width): New function.
10187
10188 * gtkutil.h: Declare xg_get_default_scrollbar_width.
10189
10190 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
10191 min width by calling x_set_scroll_bar_default_width (Bug#8505).
10192
989bf368
JB
101932011-06-05 Juanma Barranquero <lekktu@gmail.com>
10194
10195 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
10196
4b80f674
CY
101972011-06-04 Chong Yidong <cyd@stupidchicken.com>
10198
10199 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
10200 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
10201 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
10202 New error handlers.
4b80f674
CY
10203 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
10204 Obey Vx_select_enable_clipboard_manager. Catch errors in
10205 x_clipboard_manager_save (Bug#8779).
10206 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 10207 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 10208
99a33b77 102092011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
10210
10211 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
10212
99a33b77 102132011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
10214
10215 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
10216 in the current matrix if keep_current_p is non-zero.
10217
8264569d
EZ
102182011-06-04 Eli Zaretskii <eliz@gnu.org>
10219
10220 * bidi.c (bidi_level_of_next_char): Fix last change.
10221
57f97249
EZ
102222011-06-03 Eli Zaretskii <eliz@gnu.org>
10223
fec2107c 10224 Support bidi reordering of text covered by display properties.
57f97249 10225
fec2107c
EZ
10226 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
10227 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
10228 (bidi_cache_search, bidi_cache_iterator_state)
10229 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
10230 (bidi_level_of_next_char, bidi_move_to_visually_next):
10231 Support character positions inside a run of characters covered by a
fec2107c
EZ
10232 display string.
10233 (bidi_paragraph_init, bidi_resolve_explicit_1)
10234 (bidi_level_of_next_char): Call bidi_fetch_char and
10235 bidi_fetch_char_advance instead of FETCH_CHAR and
10236 FETCH_CHAR_ADVANCE.
10237 (bidi_init_it): Initialize new members.
10238 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
10239 definitions.
10240 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
10241 instead of using explicit *_CHAR codes.
d6d100dd
SM
10242 (bidi_resolve_explicit, bidi_resolve_weak):
10243 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
10244 bidirectional text is supported only in multibyte buffers.
10245 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
10246 it to initialize the frame_window_p member of struct bidi_it.
10247 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
10248 (bidi_resolve_explicit, bidi_resolve_weak)
10249 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
10250 bidi_it->nchars is non-positive.
10251 (bidi_level_of_next_char): Don't try to lookup the cache for the
10252 next/previous character if nothing is cached there yet, or if we
10253 were just reseat()'ed to a new position.
c40e2fb2 10254
0e14fe90
EZ
10255 * xdisp.c (set_cursor_from_row): Set start and stop points
10256 according to the row's direction when priming the loop that looks
10257 for the glyph on which to display cursor.
10258 (single_display_spec_intangible_p): Function deleted.
10259 (display_prop_intangible_p): Reimplement to call
10260 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
10261 Accept 3 additional arguments needed by handle_display_spec.
10262 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
10263 values: lists, `(when COND...)' forms, etc.
10264 (single_display_spec_string_p): Support property values that are
10265 lists with the argument STRING its top-level element.
10266 (display_prop_string_p): Fix the condition for processing a
10267 property that is a list to be consistent with handle_display_spec.
fec2107c 10268 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
10269 last portion of handle_display_prop.
10270 (compute_display_string_pos): Accept additional argument
10271 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
10272 value of a `display' property is a "replacing spec".
10273 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
10274 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
10275 the display property, but just return a value indicating whether
10276 the display property will replace the characters it covers.
10277 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
10278 frame_window_p members of struct bidi_it.
d6d100dd
SM
10279 (compute_display_string_pos, compute_display_string_end):
10280 New functions.
fec2107c
EZ
10281 (push_it): Accept second argument POSITION, where pop_it should
10282 jump to continue iteration.
10283 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 10284
fec2107c
EZ
10285 * keyboard.c (adjust_point_for_property): Adjust the call to
10286 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
10287
10288 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
10289 (bidi_init_it): Update prototypes.
10290 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
10291 (compute_display_string_pos, compute_display_string_end):
10292 Declare prototypes.
fec2107c
EZ
10293 (struct bidi_it): New members nchars and disp_pos. ch_len is now
10294 EMACS_INT.
fc6f18ce 10295
40087514 102962011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 10297
57f53182
PE
10298 Malloc failure behavior now depends on size of allocation.
10299 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10300 * lisp.h: Change signatures accordingly.
10301 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10302 All callers changed. (Bug#8762)
10303
10304 * gnutls.c: Use Emacs's memory allocators.
10305 Without this change, the gnutls library would invoke malloc etc.
10306 directly, which causes problems on non-SYNC_INPUT hosts, and which
10307 runs afoul of improving memory_full behavior. (Bug#8761)
10308 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10309 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10310 xfree instead of the default malloc, realloc, free.
10311 (Fgnutls_boot): No need to check for memory allocation failure,
10312 since xmalloc does that for us.
10313
ac32cd99 10314 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
10315 * category.c (hash_get_category_set):
10316 * ccl.c (ccl_driver):
10317 * charset.c (Fdefine_charset_internal):
10318 * charset.h (struct charset.hash_index):
10319 * composite.c (get_composition_id, gstring_lookup_cache)
10320 (composition_gstring_put_cache):
10321 * composite.h (struct composition.hash_index):
10322 * dispextern.h (struct image.hash):
10323 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10324 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10325 (hashfn_equal, hashfn_user_defined, make_hash_table)
10326 (maybe_resize_hash_table, hash_lookup, hash_put)
10327 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10328 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10329 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10330 * image.c (make_image, search_image_cache, lookup_image)
10331 (xpm_put_color_table_h):
10332 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 10333 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 10334 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 10335 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
10336 * alloc.c (allocate_vectorlike):
10337 Check for overflow in vector size calculations.
10338 * ccl.c (ccl_driver):
10339 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
10340 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10341 need to be updated by these changes.
40087514
PE
10342 * fns.c (make_hash_table, maybe_resize_hash_table):
10343 Check for integer overflow with large hash tables.
0de4bb68
PE
10344 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10345 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10346 (SXHASH_REDUCE): New macro.
10347 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10348 Use it instead of discarding useful hash info with large hash values.
10349 (sxhash_float): New function.
10350 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10351 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
10352 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10353 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
10354 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10355 Adjust signatures to match updated version of code.
10356 (consing_since_gc): Now EMACS_INT, since a single hash table can
10357 use more than INT_MAX bytes.
10358
698d32e2
DN
103592011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10360
10361 Make it possible to build with GCC-4.6+ -O2 -flto.
10362
10363 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10364
fd6fa53f
SM
103652011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10366
10367 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10368 Call minibuffer-inactive-mode.
10369
864db017
JB
103702011-05-31 Juanma Barranquero <lekktu@gmail.com>
10371
10372 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10373 Update dependencies.
10374
2ad0baf4
DN
103752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10376
10377 * data.c (init_data): Remove code for UTS, this system is not
10378 supported anymore.
10379
4fcc2638
DN
103802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10381
10382 Don't force ./temacs to start in terminal mode.
10383
10384 * frame.c (make_initial_frame): Initialize faces in all cases, not
10385 only when CANNOT_DUMP is defined.
10386 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
10387
c56e0fd5
DN
103882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10389
10390 * dispnew.c (add_window_display_history): Use const for the string
10391 pointer. Remove declaration, not needed.
10392
333d54da 103932011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10394
55d4c1b2 10395 Use 'inline', not 'INLINE'.
333d54da 10396 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10397 * alloc.c, fontset.c (INLINE): Remove.
10398 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10399 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10400 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10401 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10402 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10403
738db178
DN
104042011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10405
10406 Make it possible to run ./temacs.
10407
10408 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10409 syms_of_callproc does the same thing. Remove test for
10410 "initialized", do it in the caller.
10411 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10412
620c53a6
SM
104132011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10414
10415 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10416 (read_minibuf): Use get_minibuffer.
10417 (syms_of_minibuf): Use DEFSYM.
10418 (Qmetadata): New var.
10419 * data.c (Qbuffer): Don't make it static.
10420 (syms_of_data): Use DEFSYM.
10421
e003a292
PE
104222011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10423
10424 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10425 (CCL_CODE_MIN): New macro.
10426
ed008a6d
PE
104272011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10428
3687c2ef
PE
10429 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10430
ed008a6d
PE
10431 * eval.c (Qdebug): Now static.
10432 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10433 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10434 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10435
d66c4c7c
CY
104362011-05-29 Chong Yidong <cyd@stupidchicken.com>
10437
10438 * image.c: Various fixes to ImageMagick code comments.
10439 (Fimagemagick_types): Doc fix.
10440
5fbc2025
PE
104412011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10442
0196f88a
PE
10443 Minor fixes prompted by GCC 4.6.0 warnings.
10444
10445 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10446
5fbc2025
PE
10447 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10448 (x_clipboard_manager_save_all): Move extern decl to ...
10449 * xterm.h: ... here, so that it can be checked for consistency.
10450
1dd3c2d9
CY
104512011-05-29 Chong Yidong <cyd@stupidchicken.com>
10452
10453 * xselect.c (x_clipboard_manager_save_frame)
10454 (x_clipboard_manager_save_all): New functions.
10455 (Fx_clipboard_manager_save): Lisp function deleted.
10456
10457 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10458 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10459
10460 * xterm.h: Update prototype.
10461
5ba6571d
WX
104622011-05-28 William Xu <william.xwl@gmail.com>
10463
10464 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10465 exiting (Bug#8239).
10466
3eaff834
JM
104672011-05-28 Jim Meyering <meyering@redhat.com>
10468
e1900994 10469 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10470 * fns.c (to_uchar): Define.
10471 (crypto_hash_function): Use it to convert some newly-signed
10472 variables to unsigned, to avoid sign-extension bugs. For example,
10473 without this change, (md5 "truc") would evaluate to
10474 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10475 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10476 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10477
0f6990a7
PE
104782011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10479
10480 Integer overflow fixes.
c8a9ca5a 10481
08686060
PE
10482 * dbusbind.c: Serial number integer overflow fixes.
10483 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10484 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10485 to hold a serial number that is too large for a fixnum.
10486 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10487 Check for serial numbers out of range. Decode any serial number
59568bf0 10488 that was so large that it became a float. (Bug#8722)
08686060 10489
2d1fc3c7
PE
10490 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10491 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10492 Use XFASTINT rather than XUINT when numbers are nonnegative.
10493 (xd_append_arg, Fdbus_method_return_internal):
10494 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10495 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10496 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10497 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10498 (Bug#8722)
2d1fc3c7 10499
c8a9ca5a
PE
10500 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10501
519e1d69
PE
10502 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10503
6df6ae42 10504 ccl: Add integer overflow checks.
30569699
PE
10505 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10506 (IN_INT_RANGE): New macros.
10507 (ccl_driver): Use them to check for integer overflow when
10508 decoding a CCL program. Many of the new checks are whether XINT (x)
10509 fits in int; it doesn't always, on 64-bit hosts. The new version
10510 doesn't catch all possible integer overflows, but it's an
847044ea 10511 improvement. (Bug#8719)
30569699 10512
c11285dc
PE
10513 * alloc.c (make_event_array): Use XINT, not XUINT.
10514 There's no need for unsigned here.
10515
fdccd48e
PE
10516 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10517 This follows up to the 2011-05-06 change that substituted uintptr_t
10518 for EMACS_INT. This case wasn't caught back then.
10519
37910ab2
PE
10520 Rework Fformat to avoid integer overflow issues.
10521 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10522 now (part of C89). Include <verify.h>.
10523 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10524 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10525 (Fformat): Avoid the prepass trying to compute sizes; it was only
10526 approximate and thus did not catch overflow reliably. Instead, walk
10527 through the format just once, formatting and computing sizes as we go,
10528 checking for integer overflow at every step, and allocating a larger
10529 buffer as needed. Keep track separately whether the format is
10530 multibyte. Keep only the most-recently calculated precision, rather
10531 than them all. Record whether each argument has been converted to
10532 string. Use EMACS_INT, not int, for byte and char and arg counts.
10533 Support field widths and precisions larger than INT_MAX. Avoid
10534 sprintf's undefined behavior with conversion specifications such as %#d
10535 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10536 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10537 formatting out-of-range floating point numbers with int
9173deec 10538 formats. (Bug#8668)
37910ab2 10539
2e6578fb
PE
10540 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10541
0ae6bdee
PE
10542 * data.c: Avoid integer truncation in expressions involving floats.
10543 * data.c: Include <intprops.h>.
10544 (arith_driver): When there's an integer overflow in an expression
10545 involving floating point, convert the integers to floating point
10546 so that the resulting value does not suffer from catastrophic
10547 integer truncation. For example, on a 64-bit host (* 4
10548 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10549 Do not rely on undefined behavior after integer overflow.
10550
de883a70
PE
10551 merge count_size_as_multibyte, parse_str_to_multibyte
10552 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10553 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10554 Check for integer overflow.
10555 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10556 since it's now a duplicate of the other. This is more of
10557 a character than a buffer op, so better that it's in character.c.
10558 * fns.c, print.c: Adjust to above changes.
10559
2ff916cb
PE
105602011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10561
10562 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10563
f1b54466
PE
105642011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10565
fb1ac845
PE
10566 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10567 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10568 (x_clipboard_manager_save): Now static.
10569 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10570
f1b54466
PE
10571 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10572 (crypto_hash_function): Now static.
10573 Fix pointer signedness problems. Avoid unnecessary initializations.
10574
a9f737ee
CY
105752011-05-27 Chong Yidong <cyd@stupidchicken.com>
10576
10577 * termhooks.h (Vselection_alist): Make it terminal-local.
10578
10579 * terminal.c (create_terminal): Initialize it.
10580
10581 * xselect.c: Support for clipboard managers.
10582 (Vselection_alist): Move to termhooks.h as terminal-local var.
10583 (LOCAL_SELECTION): New macro.
10584 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10585 (symbol_to_x_atom): Remove gratuitous arg.
10586 (x_handle_selection_request, lisp_data_to_selection_data)
10587 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10588 (x_own_selection, x_get_local_selection, x_convert_selection):
10589 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10590 (some_frame_on_display): Delete unused function.
10591 (Fx_own_selection_internal, Fx_get_selection_internal)
10592 (Fx_disown_selection_internal, Fx_selection_owner_p)
10593 (Fx_selection_exists_p): New optional frame arg.
10594 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10595 (x_handle_selection_clear): Don't treat other terminals with the
10596 same keyboard specially. Use the terminal-local Vselection_alist.
10597 (x_clear_frame_selections): Use Frun_hook_with_args.
10598
10599 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10600
10601 * xterm.h: Add support for those atoms.
10602
e067f0c1
CY
106032011-05-26 Chong Yidong <cyd@stupidchicken.com>
10604
10605 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10606 (converted_selections, conversion_fail_tag): New global variables.
10607 (x_selection_request_lisp_error): Free the above.
10608 (x_get_local_selection): Remove unnecessary code.
10609 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10610 of converted selections stored in converted_selections.
10611 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10612 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10613 (x_convert_selection): New function.
10614 (x_handle_selection_event): Simplify.
10615 (x_get_foreign_selection): Don't ignore incoming requests while
10616 waiting for an answer; this will fail when we implement
10617 SAVE_TARGETS, and seems unnecessary anyway.
10618 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10619 (Vx_sent_selection_functions): Doc fix.
10620
0f4aebc0
LL
106212011-05-26 Leo Liu <sdl.web@gmail.com>
10622
10623 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10624
e61124cd
YM
106252011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10626
10627 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10628
10629 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10630 for fringe update if it has periodic bitmap.
ac389d0c 10631 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10632 and fringe_bitmap_periodic_p.
10633
10634 * fringe.c (get_fringe_bitmap_data): New function.
10635 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10636 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10637 row. Mark glyph row for fringe update if periodicity changed.
10638
10639 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10640 for fringe update unless it has periodic bitmap.
10641
f16d9837
KH
106422011-05-25 Kenichi Handa <handa@m17n.org>
10643
10644 * xdisp.c (get_next_display_element): Set correct it->face_id for
10645 a static composition.
10646
e1b90ef6
LL
106472011-05-24 Leo Liu <sdl.web@gmail.com>
10648
10649 * deps.mk (fns.o):
10650 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10651
10652 * fns.c (crypto_hash_function, Fsha1): New function.
10653 (Fmd5): Use crypto_hash_function.
10654 (syms_of_fns): Add Ssha1.
10655
7400048f
PE
106562011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10657
10658 * gnutls.c: Remove unused macros.
10659 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10660 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10661 Remove macros that are defined and never used.
10662 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10663
abb71cf4
CY
106642011-05-22 Chong Yidong <cyd@stupidchicken.com>
10665
10666 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10667 (Fx_get_selection_internal): Minor cleanup.
10668 (Fx_own_selection_internal): Rename arguments for consistency with
10669 select.el.
10670
6307db39
PE
106712011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10672
10673 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10674
f3d4e0a4
CY
106752011-05-22 Chong Yidong <cyd@stupidchicken.com>
10676
10677 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10678
4d8ade89
YM
106792011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10680
10681 * dispnew.c (scrolling_window): Don't exclude the case that the
10682 last enabled row in the desired matrix touches the bottom boundary.
10683
32078c8d
GM
106842011-05-21 Glenn Morris <rgm@gnu.org>
10685
10686 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10687 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10688 and add some more files.
32078c8d 10689
7285dc67
EZ
106902011-05-20 Eli Zaretskii <eliz@gnu.org>
10691
10692 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10693 report_file_error introduced by the change from 2011-05-07.
10694
89d1bd22
PE
106952011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10696
10697 * systime.h (Time): Define only if emacs is defined.
10698 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10699 where the include path doesn't have X11/X.h by default. See
10700 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10701
cd394be1 107022011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10703
10704 * composite.c (find_automatic_composition): Fix previous change.
10705
b9704ad9
GM
107062011-05-20 Glenn Morris <rgm@gnu.org>
10707
10708 * lisp.mk: New file, split from Makefile.in.
10709 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10710 (shortlisp): Remove.
10711 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10712
4a720484
GM
107132011-05-19 Glenn Morris <rgm@gnu.org>
10714
10715 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10716 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10717 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10718 (lisp): Set the order to that of loadup.el.
10719 (shortlisp): Make it a copy of $lisp.
10720 (SOME_MACHINE_LISP): Remove.
10721 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10722 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10723
a28d4396
KH
107242011-05-18 Kenichi Handa <handa@m17n.org>
10725
10726 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10727 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10728 (find_automatic_composition): Mostly rewrite for efficiency.
10729
a2b1fa8e
JB
107302011-05-18 Juanma Barranquero <lekktu@gmail.com>
10731
10732 * makefile.w32-in: Update dependencies.
10733
8e1f5610
CS
107342011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10735
10736 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10737 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10738
7025ee00 107392011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10740
cdfa6eab
PE
10741 Fix some integer overflow issues, such as string length overflow.
10742
06d6db33
PE
10743 * insdel.c (count_size_as_multibyte): Check for string overflow.
10744
2b4560a8
PE
10745 * character.c (lisp_string_width): Check for string overflow.
10746 Use EMACS_INT, not int, for string indexes and lengths; in
10747 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10748 the resulting string length overflows an EMACS_INT; instead,
10749 report a string overflow if no precision given. When checking for
10750 precision exhaustion, use a check that cannot possibly have
10751 integer overflow. (Bug#8675)
10752 * character.h (lisp_string_width): Adjust to new signature.
10753
cb93f9be
PE
10754 * alloc.c (string_overflow): New function.
10755 (Fmake_string): Use it. This doesn't change behavior, but saves
10756 a few bytes and will simplify future changes.
10757 * character.c (string_escape_byte8): Likewise.
10758 * lisp.h (string_overflow): New decl.
10759
1a1f3366
PE
10760 Fixups, following up to the user-interface timestamp change.
10761 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10762 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10763 * msdos.c (mouse_get_pos): Likewise.
10764 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10765 * w32gui.h (Time): Define by including "systime.h" rather than by
10766 declaring it ourselves. (Bug#8664)
10767
d4e3e4d3
PE
10768 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10769 * image.c (clear_image_cache): Likewise.
10770
f6a24d19
PE
10771 * term.c (term_mouse_position): Don't assume time_t wraparound.
10772
08dc5ae6
PE
10773 Be more systematic about user-interface timestamps.
10774 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10775 and sometimes 'EMACS_UINT', to represent these timestamps.
10776 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10777 This makes the code easier to follow, and makes it easier to catch
10778 integer overflow bugs such as Bug#8664.
10779 * frame.c (Fmouse_position, Fmouse_pixel_position):
10780 Use Time, not unsigned long, for user-interface timestamps.
10781 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10782 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10783 * keyboard.h (last_event_timestamp): Likewise.
10784 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10785 * menu.h (xmenu_show): Likewise.
10786 * term.c (term_mouse_position): Likewise.
10787 * termhooks.h (struct input_event.timestamp): Likewise.
10788 (struct terminal.mouse_position_hook): Likewise.
10789 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10790 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10791 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10792 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10793 what it was before.
10794 * menu.h, termhooks.h: Include "systime.h", for Time.
10795
8e55734a
PE
10796 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10797 Don't assume that the difference between two unsigned long values
10798 can fit into an integer. At this point, we know button_down_time
10799 <= event->timestamp, so the difference must be nonnegative, so
10800 there's no need to cast the result if double-click-time is
10801 nonnegative, as it should be; check that it's nonnegative, just in
10802 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10803 apart (about 25 days). (Bug#8664)
8e55734a 10804
841f1b75 10805 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10806 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10807
3e26f69c
PE
10808 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10809 that always fit in int. Use a sentinel instead of a counter, to
10810 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10811 * frame.h (struct frame): Use int for menu_bar_items_used
10812 instead of EMACS_INT, since it always fits in int.
3e26f69c 10813
5cc152c0
PE
10814 * menu.c (grow_menu_items): Check for int overflow.
10815
d89eb65e
PE
10816 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10817
5235bd3e
PE
10818 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10819 Before, the code was not consistent. These values cannot exceed
10820 2**31 - 1 so there's no need to make them unsigned.
10821 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10822 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10823 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10824 as modifiers.
10825 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10826
bc827e23
PE
10827 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10828 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10829 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10830 presumably because the widths might not match.
10831
78eb494e
PE
10832 * window.c (size_window): Avoid needless test at loop start.
10833
04f2d78b
CB
108342011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10835
10836 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10837
d2fc7e3d 108382011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10839
10840 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10841
d2fc7e3d 108422011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10843
10844 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10845 `width' to `bar_area_x' and `bar_area_width', respectively.
10846 (x_scroll_run): Take account of fringe background extension.
10847
04f2d78b
CB
10848 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10849 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10850 `bar_area_width', respectively.
10851 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10852 background extension.
10853
79b70037
GM
108542011-05-10 Jim Meyering <meyering@redhat.com>
10855
10856 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10857
2f142cc5
JB
108582011-05-10 Juanma Barranquero <lekktu@gmail.com>
10859
10860 * image.c (Finit_image_library): Return t for built-in image types,
10861 like pbm and xbm. (Bug#8640)
10862
57679c86
AS
108632011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10864
10865 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10866
888c9e86
EZ
108672011-05-07 Eli Zaretskii <eliz@gnu.org>
10868
b0512a1d
EZ
10869 * w32console.c (Fset_screen_color): Doc fix.
10870 (Fget_screen_color): New function.
10871 (syms_of_ntterm): Defsubr it.
10872
7285dc67
EZ
10873 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10874 unlink the temporary file if Fcall_process didn't create it in the
10875 first place.
10876 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10877 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10878 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10879 cue to call_process_cleanup not to close that handle.
10880
4d3fcc8e
BK
108812011-05-07 Ben Key <bkey76@gmail.com>
10882
10883 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10884 one of two shell specific rules, either bootstrap-temacs-CMD or
10885 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10886 to the previous implementation of the bootstrap-temacs rule.
10887 The bootstrap-temacs-CMD rule is similar to the previous
10888 implementation of the bootstrap-temacs rule except that it
10889 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10890 variable.
10891
10892 These changes, along with some changes to nt/configure.bat,
10893 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10894 earlier fix to add support for --cflags and --ldflags options
10895 that include quotes so that it works whether make uses cmd or
10896 sh as the shell.
10897
b4289b64
MA
108982011-05-06 Michael Albinus <michael.albinus@gmx.de>
10899
10900 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10901 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10902 is a constant.
10903 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10904 a string. Handle both cases.
10905 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10906 (Fdbus_register_method): Use Qinvalid_function.
10907
af4c0e28
JB
109082011-05-06 Juanma Barranquero <lekktu@gmail.com>
10909
10910 * makefile.w32-in: Update dependencies.
10911 (LISP_H): Add inttypes.h and stdin.h.
10912 (PROCESS_H): Add unistd.h.
10913
c51453d9
EZ
109142011-05-06 Eli Zaretskii <eliz@gnu.org>
10915
10916 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10917 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10918
8ff0ac3c 109192011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10920
4c4b566b
PE
10921 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10922
aab2b9b5
PE
10923 * term.c (vfatal): Remove stray call to va_end.
10924 It's not needed and the C Standard doesn't allow it here anyway.
10925
c378da0b
PE
10926 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10927 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10928
288b08c7
PE
10929 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10930 bytes.
10931
e3601888
PE
10932 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10933
db6c0e74
PE
10934 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10935
dd5963ea
PE
10936 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10937
88c9450f
PE
10938 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10939
2f9442b8
PE
10940 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10941
c032b5f8
PE
10942 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10943 * charset.c (Fdefine_charset_internal): Don't initialize
10944 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10945 32-bit int (Bug#8600).
a108c10b
PE
10946
10947 * lread.c (read_integer): Be more consistent with string-to-number.
10948 Use string_to_number to do the actual conversion; this avoids
10949 rounding errors and fixes some other screwups. Without this fix,
10950 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10951 (digit_to_number): Move earlier, for benefit of read_integer.
10952 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10953 not a digit in any supported base. (Bug#8602)
a108c10b 10954
ad5f9eea
PE
10955 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10956
aec1708a
PE
10957 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10958 to match comment at start of function. This also removes a
10959 GCC warning about overflow in a 32+64-bit port.
10960
47be4ab5
PE
10961 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10962
371cac43
PE
10963 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10964 Reported by Stefan Monnier in
10965 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10966 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10967 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10968
d01a7826
PE
10969 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10970 (EMACS_UINTPTR): Likewise, with uintptr_t.
10971
7fd47d5c
PE
10972 * lisp.h: Prefer 64-bit EMACS_INT if available.
10973 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10974 on 32-bit hosts that have 64-bit int, so that they can access
10975 large files.
122b0c86
PE
10976 However, temporarily disable this change unless the temporary
10977 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10978
8727937b
PE
10979 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10980
8ac068ac
PE
10981 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10982 This removes an assumption that EMACS_INT and long are the same
10983 width as pointers. The assumption is true for Emacs porting targets
10984 now, but we want to make other targets possible.
10985 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10986 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10987 In the rest of the code, change types of integers that hold casted
10988 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10989 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10990 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10991 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10992 No need to cast type when ORing.
10993 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10994 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10995 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10996 assume EMACS_INT is the same width as char *.
10997 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10998 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10999 Remove no-longer-needed casts.
11000 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
11001 (xg_tool_bar_help_callback, xg_make_tool_item):
11002 Use EMACS_INTPTR to hold an integer
11003 that will be cast to void *; this can avoid a GCC warning
11004 if EMACS_INT is not the same width as void *.
11005 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
11006 * xdisp.c (display_echo_area_1, resize_mini_window_1):
11007 (current_message_1, set_message_1):
11008 Use a local to convert to proper width without a cast.
11009 * xmenu.c (dialog_selection_callback): Likewise.
11010
ede49d71
PE
11011 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
11012 Also, don't assume VALBITS / RAND_BITS is less than 5,
11013 and don't rely on undefined behavior when shifting a 1 left into
11014 the sign bit.
11015 * lisp.h (get_random): Change signature to match.
11016
2f30ecd0
PE
11017 * lread.c (hash_string): Use size_t, not int, for hash computation.
11018 Normally we prefer signed values; but hashing is special, because
11019 it's better to use unsigned division on hash table sizes so that
11020 the remainder is nonnegative. Also, size_t is the natural width
11021 for hashing into memory. The previous code used 'int', which doesn't
11022 retain enough info to hash well into very large tables.
11023 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
11024
2a866e7b
PE
11025 * dbusbind.c: Don't possibly lose pointer info when converting.
11026 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11027 Use XPNTR rather than XHASH, so that the high-order bits of
11028 the pointer aren't lost when converting through void *.
11029
51639eac
PE
11030 * eval.c (Fautoload): Don't double-shift a pointer.
11031
92394119
PE
11032 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
11033
dbdb9a7c
JB
110342011-05-06 Juanma Barranquero <lekktu@gmail.com>
11035
11036 * gnutls.c (DEF_GNUTLS_FN):
11037 * image.c (DEF_IMGLIB_FN): Make function pointers static.
11038
db7a0b4f
AS
110392011-05-05 Andreas Schwab <schwab@linux-m68k.org>
11040
11041 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
11042 marker. (Bug#8610)
11043
cd394be1 110442011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
11045
11046 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
11047 New version that can reserve upto 2GB of heap space.
11048
f7ff1b0f 110492011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
11050
11051 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
11052
639c109b
TZ
110532011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
11054
11055 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
11056 `gnutls_certificate_set_x509_key_file'.
11057
d2127135
JB
110582011-05-05 Juanma Barranquero <lekktu@gmail.com>
11059
11060 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
11061 Update dependencies.
11062
e968f4f3
JB
110632011-05-04 Juanma Barranquero <lekktu@gmail.com>
11064
11065 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
11066 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11067 Remove unused parameter `fildes'.
11068 * process.c (read_process_output, send_process): Don't pass it.
11069
84d358f0
JB
110702011-05-04 Juanma Barranquero <lekktu@gmail.com>
11071
11072 Fix previous change: the library cache is defined in w32.c.
11073 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
11074 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
11075
0898ca10
JB
110762011-05-04 Juanma Barranquero <lekktu@gmail.com>
11077
11078 Implement dynamic loading of GnuTLS on Windows.
11079
11080 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
11081 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
11082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11083 Declare.
11084
11085 * gnutls.c (Qgnutls_dll): Define.
11086 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
11087 (gnutls_*): Declare function pointers.
11088 (init_gnutls_functions): New function to initialize function pointers.
11089 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
11090 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
11091 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11092 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
11093 (emacs_gnutls_write, emacs_gnutls_read)
11094 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
11095 (Fgnutls_available_p): New function.
11096 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
11097 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
11098 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
11099
11100 * image.c: Include w32.h.
11101 (Vimage_type_cache): Delete.
11102 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
11103 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
11104 (w32_delayed_load): Move to w32.c.
11105
11106 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
11107
11108 * w32.c (QCloaded_from, Vlibrary_cache): Define.
11109 (w32_delayed_load): Move from image.c. When loading a library, record
11110 its filename in the :loaded-from property of the library id.
11111 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
11112 Initialize and staticpro them.
11113 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
11114
11115 * process.c: Include lisp.h before w32.h, not after.
11116 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
11117 instead of gnutls_record_check_pending.
11118
11119 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
11120
ff4de4aa
TZ
111212011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
11122
11123 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
11124 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
11125 as passed in.
11126
abe95abb
JD
111272011-05-03 Jan Djärv <jan.h.d@swipnet.se>
11128
11129 * xterm.c (x_set_frame_alpha): Do not set property on anything
11130 else than FRAME_X_OUTER_WINDOW (Bug#8608).
11131
e16e55d4
JB
111322011-05-02 Juanma Barranquero <lekktu@gmail.com>
11133
11134 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
11135
bafcf6a5
JB
111362011-05-02 Juanma Barranquero <lekktu@gmail.com>
11137
11138 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
11139 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
11140 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
11141 (gnutls_global_initialized, Qgnutls_bootprop_priority)
11142 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
11143 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
11144 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
11145 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
11146 (Qgnutls_bootprop_callbacks_verify): Make static.
11147
e7a6747f
AS
111482011-05-01 Andreas Schwab <schwab@linux-m68k.org>
11149
19ed11ba
AS
11150 * callproc.c: Indentation fixup.
11151
e7a6747f 11152 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
11153 (wait_for_termination, interruptible_wait_for_termination):
11154 Move after wait_for_termination_1.
e7a6747f 11155
1ef14cb4
LMI
111562011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
11157
11158 * sysdep.c (interruptible_wait_for_termination): New function
11159 which is like wait_for_termination, but allows keyboard
11160 interruptions.
11161
11162 * callproc.c (Fcall_process): Add (:file "file") as an option for
11163 the STDOUT buffer.
11164 (Fcall_process_region): Ditto.
11165
330d880c
EZ
111662011-04-30 Eli Zaretskii <eliz@gnu.org>
11167
8db90b73
EZ
11168 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
11169 rather than `XVECTOR (FOO)->size'.
11170
330d880c
EZ
11171 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
11172 inttypes.h, as a gnulib replacement is used if it not available in
11173 system headers.
11174
15cbd324
EZ
111752011-04-21 Eli Zaretskii <eliz@gnu.org>
11176
11177 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
11178 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
11179 of MOST_POSITIVE_FIXNUM. (Bug#8528)
11180
11181 * coding.c (coding_alloc_by_realloc): Error out if destination
11182 will grow beyond MOST_POSITIVE_FIXNUM.
11183 (decode_coding_emacs_mule): Abort if there isn't enough place in
11184 charbuf for the composition carryover bytes. Reserve an extra
11185 space for up to 2 characters produced in a loop.
11186 (decode_coding_iso_2022): Abort if there isn't enough place in
11187 charbuf for the composition carryover bytes.
11188
111892011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 11190
ae940cca
EZ
11191 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
11192 aborting when %lld or %lll format is passed.
11193 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
11194 %llo or %llx format is passed. (Bug#8545)
11195
03ab8921
EZ
11196 * window.c (window_scroll_line_based): Use a marker instead of
11197 simple variables to record original value of point. (Bug#7952)
11198
afda1437
EZ
11199 * doprnt.c (doprnt): Fix the case where a multibyte sequence
11200 produced by %s or %c overflows available buffer space. (Bug#8545)
11201
f76dee0c
PE
112022011-04-28 Paul Eggert <eggert@cs.ucla.edu>
11203
11204 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 11205 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 11206
fdc5744d
JB
112072011-04-28 Juanma Barranquero <lekktu@gmail.com>
11208
11209 * w32.c (init_environment): Warn about defaulting HOME to C:\.
11210
638f053a
JB
112112011-04-28 Juanma Barranquero <lekktu@gmail.com>
11212
11213 * keyboard.c (Qdelayed_warnings_hook): Define.
11214 (command_loop_1): Run `delayed-warnings-hook'
11215 if Vdelayed_warnings_list is non-nil.
11216 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
11217 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
11218
d178f871
EZ
112192011-04-28 Eli Zaretskii <eliz@gnu.org>
11220
11221 * doprnt.c (doprnt): Don't return value smaller than the buffer
11222 size if the message was truncated. (Bug#8545).
11223
b124fd93
JB
112242011-04-28 Juanma Barranquero <lekktu@gmail.com>
11225
11226 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
11227 (Fx_window_property): #if-0 the whole functions, not just the bodies.
11228
e810457d
PE
112292011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11230
11231 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
11232
ea51cceb
JB
112332011-04-27 Juanma Barranquero <lekktu@gmail.com>
11234
11235 * makefile.w32-in: Update dependencies.
11236
94dcfacf
EZ
112372011-04-27 Eli Zaretskii <eliz@gnu.org>
11238
11239 Improve `doprnt' and its usage. (Bug#8545)
11240 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
11241 `format_end'. Remove support for %l as a conversion specifier.
11242 Don't use xrealloc. Improve diagnostics when the %l size modifier
11243 is used. Update the commentary.
11244
11245 * eval.c (verror): Simplify calculation of size_t.
11246
11247 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
11248 messages.
11249
f61f41d7
PE
112502011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
11251
11252 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
11253 change.
11254
96fb4434
PE
112552011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11256
11257 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
11258 This makes this file independent of the recent pseudovector change.
11259
671875da 112602011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 11261
69e9b5a3
PE
11262 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
11263
b5f869a7 11264 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 11265 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 11266 Remove unused local.
c8926152 11267 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 11268
841a1577 11269 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
11270 GCC 4.6.0 optimizes based on type-based alias analysis.
11271 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
11272 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
11273 != &v->size, and therefore "v->size = 1; b->size = 2; return
11274 v->size;" must therefore return 1. This assumption is incorrect
11275 for Emacs, since it type-puns struct Lisp_Vector * with many other
11276 types. To fix this problem, this patch adds a new type struct
f904488f 11277 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
11278 and pseudovectors, and helps optimizing compilers not get fooled
11279 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
11280 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
11281 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
11282 the size member.
eab3844f
PE
11283 (XSETPVECTYPE): Rewrite in terms of new macro.
11284 (XSETPVECTYPESIZE): New macro, specifying both type and size.
11285 This is a bit clearer, and further avoids the possibility of
11286 undesirable aliasing.
11287 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 11288 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
11289 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
11290 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
11291 (ASIZE): Now uses header.size rather than size.
11292 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
11293 to avoid the hassle of writing XVECTOR (foo)->header.size.
11294 (struct vectorlike_header): New type.
eab3844f
PE
11295 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
11296 object, to help avoid aliasing.
11297 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
11298 (SUBRP): Likewise, since Lisp_Subr is a special case.
11299 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11300 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11301 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 11302 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
11303 changed to be "header.size" and "header.next".
11304 * buffer.h (struct buffer): Likewise.
11305 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11306 * frame.h (struct frame): Likewise.
11307 * process.h (struct Lisp_Process): Likewise.
11308 * termhooks.h (struct terminal): Likewise.
11309 * window.c (struct save_window_data, struct saved_window): Likewise.
11310 * window.h (struct window): Likewise.
11311 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11312 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11313 * buffer.c (init_buffer_once): Likewise.
11314 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11315 special case.
11316 * process.c (Fformat_network_address): Use local var for size,
11317 for brevity.
11318
0df1eac5
PE
11319 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11320
847ab9d1 11321 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
11322 * data.c (atof): Remove decl; no longer used or needed.
11323 (digit_to_number): Move to lread.c.
11324 (Fstring_to_number): Use new string_to_number function, to be
11325 consistent with how the Lisp reader treats infinities and NaNs.
11326 Do not assume that floating-point numbers represent EMACS_INT
11327 without losing information; this is not true on most 64-bit hosts.
11328 Avoid double-rounding errors, by insisting on integers when
11329 parsing non-base-10 numbers, as the documentation specifies.
11330 * lisp.h (string_to_number): New decl, replacing ...
11331 (isfloat_string): Remove.
bc0a5c13 11332 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 11333 (read1): Do not accept +. and -. as integers; this
452f4150
PE
11334 appears to have been a coding error. Similarly, do not accept
11335 strings like +-1e0 as floating point numbers. Do not report
11336 overflow for integer overflows unless the base is not 10 which
11337 means we have no simple and reliable way to continue.
11338 Break out the floating-point parsing into a new
11339 function string_to_number, so that Fstring_to_number parses
11340 floating point numbers consistently with the Lisp reader.
04f2d78b 11341 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
11342 (E_CHAR, EXP_INT): Remove, replacing with ...
11343 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11344 (string_to_number): New function, replacing isfloat_string.
11345 This function checks for valid syntax and produces the resulting
11346 Lisp float number too. Rework it so that string-to-number
bc0a5c13 11347 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
11348 so that overflow for non-base-10 numbers is reported only when
11349 there's no portable and simple way to convert to floating point.
452f4150 11350
67769ffc
PE
11351 * textprop.c (set_text_properties_1): Rewrite for clarity,
11352 and to avoid GCC warning about integer overflow.
11353
c20db43f
PE
11354 * intervals.h (struct interval): Use EMACS_INT for members
11355 where EMACS_UINT might cause problems. See
11356 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11357 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11358 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11359 All uses changed.
37aa2f85
PE
11360 (offset_intervals): Tell GCC not to worry about length overflow
11361 when negating a negative length.
c20db43f 11362
2538aa2f
PE
11363 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11364 (overrun_check_free): Likewise.
11365
f2d3008d
PE
11366 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11367 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11368 word size.
11369
ec8df744
PE
11370 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11371 (gnutls_make_error): Rename local to avoid shadowing.
11372 (gnutls_emacs_global_deinit): ifdef out; not used.
11373 (Fgnutls_boot): Use const for pointer to readonly storage.
11374 Comment out unused local. Fix pointer signedness problems.
11375
640ee02d
PE
11376 * lread.c (openp): Don't stuff size_t into an 'int'.
11377 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11378 about possible signed overflow.
11379
6048fb2a
PE
11380 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11381 (GDK_KEY_g): Don't define if already defined.
11382 (xg_prepare_tooltip): Avoid pointer signedness problem.
11383 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
11384
fa3c87e1
PE
11385 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
11386 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
11387
2172544b
PE
11388 * xfns.c (Fx_window_property): Simplify a bit,
11389 to make a bit faster and to avoid GCC 4.6.0 warning.
11390 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11391
9b821a21
PE
11392 * fns.c (internal_equal): Don't assume size_t fits in int.
11393
3c616cfa
PE
11394 * alloc.c (compact_small_strings): Tighten assertion a little.
11395
c2982e87
PE
11396 Replace pEd with more-general pI, and fix some printf arg casts.
11397 * lisp.h (pI): New macro, generalizing old pEd macro to other
11398 conversion specifiers. For example, use "...%"pI"d..." rather
11399 than "...%"pEd"...".
11400 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11401 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11402 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11403 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11404 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11405 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11406 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11407 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11408 64-bit hosts.
11409 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11410 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11411 * print.c (safe_debug_print, print_object): Likewise.
11412 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11413 to int.
6f04d126
PE
11414 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11415 avoiding the 0 flag, which is not portable.
c2982e87
PE
11416 * process.c (Fmake_network_process): Use pI to avoid cast.
11417 * region-cache.c (pp_cache): Likewise.
11418 * xdisp.c (decode_mode_spec): Likewise.
11419 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11420 behavior on 64-bit hosts with printf arg.
6f04d126 11421 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11422 (x_stop_queuing_selection_requests): Likewise.
11423 (x_get_window_property): Don't truncate byte count to an 'int'
11424 when tracing.
0b432f21 11425
5e073ec7
PE
11426 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11427 here, since it parses constructs like leading '-' and spaces,
11428 which are not wanted; and it overflows with large numbers.
11429 Instead, simply match F[0-9]+, which is what is wanted anyway.
11430
36372bf9
PE
11431 * alloc.c: Remove unportable assumptions about struct layout.
11432 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11433 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11434 (allocate_vectorlike, make_pure_vector): Use the new macros,
11435 plus offsetof, to remove unportable assumptions about struct layout.
11436 These assumptions hold on all porting targets that I know of, but
11437 they are not guaranteed, they're easy to remove, and removing them
11438 makes further changes easier.
11439
0b432f21
PE
11440 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11441 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11442 (string_overrun_cookie): Now const. Use initializers that
11443 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11444 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11445 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11446 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11447 multiple of sizeof (EMACS_INT); it need not be, if
11448 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11449 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11450
895009e1
JB
114512011-04-26 Juanma Barranquero <lekktu@gmail.com>
11452
11453 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11454
6a7a1b0b
TZ
114552011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11456
11457 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11458 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11459 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11460
841a1577 114612011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11462
11463 * lisp.h (Qdebug): List symbol.
895009e1 11464 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11465 * keyboard.c (debug-on-event): New variable.
11466 (handle_user_signal): Break into debugger when debug-on-event
11467 matches the current signal symbol.
11468
f2d3ba6f
DN
114692011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11470
11471 * alloc.c (check_sblock, check_string_bytes)
11472 (check_string_free_list): Convert to standard C.
11473
42ce4c63
TZ
114742011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11475
11476 * w32.c (emacs_gnutls_push): Fix typo.
11477
825cd63c
EZ
114782011-04-25 Eli Zaretskii <eliz@gnu.org>
11479
fb11d64d
EZ
11480 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11481 "cast to pointer from integer of different size".
11482
825cd63c
EZ
11483 Improve doprnt and its use in verror. (Bug#8545)
11484 * doprnt.c (doprnt): Document the set of format control sequences
11485 supported by the function. Use SAFE_ALLOCA instead of always
11486 using `alloca'.
11487
11488 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11489 is one byte too soon. Don't use xrealloc; instead xfree and
11490 xmalloc anew.
11491
e061a11b
TZ
114922011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11493
11494 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11495 callbacks stage.
11496
11497 * gnutls.c: Renamed global_initialized to
11498 gnutls_global_initialized. Added internals for the
11499 :verify-hostname-error, :verify-error, and :verify-flags
11500 parameters of `gnutls-boot' and documented those parameters in the
11501 docstring. Start callback support.
9173deec
JB
11502 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11503 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11504 on error. Return error code.
e061a11b
TZ
11505 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11506 (emacs_gnutls_read): Likewise.
11507 (Fgnutls_boot): Return handshake error code.
11508 (emacs_gnutls_handle_error): New function.
11509 (wsaerror_to_errno): Likewise.
11510
11511 * w32.h (emacs_gnutls_pull): Add prototype.
11512 (emacs_gnutls_push): Likewise.
11513
11514 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11515 (emacs_gnutls_push): Likewise.
11516
115172011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11518
11519 * process.c (wait_reading_process_output): Check if GnuTLS
11520 buffered some data internally if no FDs are set for TLS
11521 connections.
11522
11523 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11524 (LIBS): Link to USER_LIBS.
11525 ($(BLD)/gnutls.$(0)): New target.
11526
fa6996bc
EZ
115272011-04-24 Eli Zaretskii <eliz@gnu.org>
11528
eb35682e
EZ
11529 * xdisp.c (handle_single_display_spec): Rename the
11530 display_replaced_before_p argument into display_replaced_p, to
11531 make it consistent with the commentary. Fix typos in the
11532 commentary.
11533
e2ad650c
EZ
11534 * textprop.c (syms_of_textprop): Remove dead code.
11535 (copy_text_properties): Delete obsolete commentary about an
11536 interface that was deleted long ago. Fix typos in the description
11537 of arguments.
11538
1b2de274
EZ
11539 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11540 to changes in oldXMenu/XMenu.h from 2011-04-16.
11541 <menu_help_message, prev_menu_help_message>: Constify.
11542 (IT_menu_make_room): menu->help_text is now `const char **';
11543 adjust.
11544
11545 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11546 to changes in oldXMenu/XMenu.h from 2011-04-16.
11547 (struct XMenu): Declare `help_text' `const char **'.
11548
11549 * xfaces.c <Qunspecified>: Make extern again.
11550
11551 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11552 required by POSIX.
1b2de274 11553
762b15be
EZ
11554 * doc.c (get_doc_string): Improve the format passed to `error'.
11555
11556 * doprnt.c (doprnt): Improve commentary.
11557
11558 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11559
11560 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11561 them with etags.
11562
f1052e5d
EZ
11563 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11564 changes in globals.h immediately force recompilation.
762b15be
EZ
11565 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11566 $(CURDIR)/s/ms-w32.h.
11567 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11568
fa6996bc
EZ
11569 * character.c (Fchar_direction): Function deleted.
11570 (syms_of_character): Don't defsubr it.
11571 <char-direction-table>: Deleted.
11572
e6c3da20
EZ
115732011-04-23 Eli Zaretskii <eliz@gnu.org>
11574
11575 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11576 * doprnt.c: Include limits.h.
11577 (SIZE_MAX): New macro.
04f2d78b
CB
11578 (doprnt): Return a size_t value. 2nd arg is now size_t.
11579 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11580 Improve overflow protection. Support `l' modifier for integer
11581 conversions. Support %l conversion. Don't assume an EMACS_INT
11582 argument for integer conversions and for %c.
11583
11584 * lisp.h (doprnt): Restore prototype.
11585
11586 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11587 $(SRC)/character.h.
11588
11589 * Makefile.in (base_obj): Add back doprnt.o.
11590
11591 * deps.mk (doprnt.o): Add back prerequisites.
11592 (callint.o): Depend on character.h.
11593
11594 * eval.c (internal_lisp_condition_case): Include the handler
11595 representation in the error message.
11596 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11597 when breaking from the loop.
11598
11599 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11600
11601 * callint.c (Fcall_interactively): When displaying error message
11602 about invalid control letter, pass the character's codepoint, not
11603 a pointer to its multibyte form. Improve display of the character
11604 in octal and display also its hex code.
11605
11606 * character.c (char_string): Use %x to display the (unsigned)
11607 codepoint of an invalid character, to avoid displaying a bogus
11608 negative value.
11609
11610 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11611 `error', not SYMBOL_NAME itself.
11612
11613 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11614 character arguments to `error'.
11615
11616 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11617 to `error' in error message about FINAL_CHAR argument. Make sure
11618 FINAL_CHAR is a character, and use %c when it is passed as
11619 argument to `error'.
11620
4ffd0d6b 116212011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11622
11623 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11624
11625 * w32.c: Include <time.h>.
11626 (sys_localtime): New function.
11627
4ffd0d6b 116282011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11629
11630 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11631
4ffd0d6b 11632 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11633
4ffd0d6b 116342011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11635
4ffd0d6b
GM
11636 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11637 zombies (Bug#8467).
aac0c6e3 11638
04c56954
EZ
116392011-04-19 Eli Zaretskii <eliz@gnu.org>
11640
11641 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11642 gl_state.e_property when gl_state.object is Qt.
11643
11644 * insdel.c (make_gap_larger): Remove limitation of buffer size
11645 to <= INT_MAX.
11646
16a43933
CY
116472011-04-18 Chong Yidong <cyd@stupidchicken.com>
11648
11649 * xdisp.c (lookup_glyphless_char_display)
11650 (produce_glyphless_glyph): Handle cons cell entry in
11651 glyphless-char-display.
11652 (Vglyphless_char_display): Document it.
11653
11654 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11655 glyphless-char-display.
11656
4581706e
CY
116572011-04-17 Chong Yidong <cyd@stupidchicken.com>
11658
11659 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11660
11661 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11662
11663 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11664 definition for no-X builds.
11665
4887c6e2 116662011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11667
fd35b6f9
PE
11668 Static checks with GCC 4.6.0 and non-default toolkits.
11669
5c1ccb01
PE
11670 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11671
006c5daa
PE
11672 * process.c (keyboard_bit_set): Define only if SIGIO.
11673 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11674 (send_process): Repair possible setjmp clobbering.
11675
efc736d3
PE
11676 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11677
4e2fe2e6
PE
11678 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11679
f97334a2
PE
11680 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11681
4e75f29d
PE
11682 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11683 Define only if needed.
11684
90efadd1
PE
11685 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11686 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11687 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11688
3c647824
PE
11689 * dispextern.h (struct redisplay_interface): Rename param
11690 to avoid shadowing.
e264f262 11691 * termhooks.h (struct terminal): Likewise.
761383f4 11692 * xterm.c (xembed_send_message): Likewise.
3c647824 11693
b58c5c4a
PE
11694 * insdel.c (make_gap_smaller): Define only if
11695 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11696
cad59032
PE
11697 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11698 it.
11699
c339dc2e
PE
11700 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11701 so that we aren't warned about unused symbols.
11702
91a3e27b
PE
11703 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11704
399c71d3 11705 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11706
8ffc96f5
PE
11707 * xfns.c (x_real_positions): Mark locals as initialized.
11708
eef9bc79
PE
11709 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11710
098db9dd
PE
11711 * xterm.c: Fix problems found by static analysis with other toolkits.
11712 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11713 (x_dispatch_event): Declare static if USE_GTK, and
11714 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11715 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11716 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11717 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11718 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11719
eb18f6cc
PE
11720 * xmenu.c (menu_help_callback): Pointer type fixes.
11721 Use const pointers when pointing at readonly data. Avoid pointer
11722 signedness clashes.
11723 (FALSE): Remove unused macro.
11724 (update_frame_menubar): Remove unused decl.
11725
1fe72bf8
PE
11726 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11727
60d9e1db
PE
11728 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11729 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11730 (single_menu_item): Rename local to avoid shadowing.
11731
39261c26
PE
11732 * keyboard.c (make_lispy_event): Remove unused local var.
11733
018c5e19
PE
11734 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11735 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11736
63d2b86e
PE
11737 * bitmaps: Change bitmaps from unsigned char back to the X11
11738 compatible char. Avoid the old compiler warnings about
11739 out-of-range initializers by using, for example, '\xab' rather
11740 than 0xab.
11741
aefd87e1
PE
11742 * xgselect.c (xgselect_initialize): Check vs interface
11743 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11744
bf501fb9
PE
11745 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11746
e9829fdf
PE
11747 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11748 to read-only memory.
11749
1086c095
PE
11750 * fns.c (vector): Remove; this old hack is no longer needed.
11751
2baccd04 11752 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11753 Remove unused var.
dde42981 11754 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11755
72391843 11756 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11757
436c16df 11758 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11759 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11760 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11761
92bb796d 11762 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11763 (x_term_init): Remove local to avoid shadowing.
92bb796d 11764
764430a3 11765 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11766
11767 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11768 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11769
d1dfb56c
EZ
117702011-04-16 Eli Zaretskii <eliz@gnu.org>
11771
c4354cb4
EZ
11772 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11773
d1dfb56c
EZ
11774 Fix regex.c, syntax.c and friends for buffers > 2GB.
11775 * syntax.h (struct gl_state_s): Declare character position members
11776 EMACS_INT.
11777
11778 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11779
04f2d78b
CB
11780 * textprop.c (verify_interval_modification, interval_of):
11781 Declare arguments EMACS_INT.
d1dfb56c
EZ
11782
11783 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11784 EMACS_INT.
11785
11786 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11787
11788 * indent.c (Fvertical_motion): Local variable it_start is now
11789 EMACS_INT.
11790
11791 * regex.c (re_match, re_match_2, re_match_2_internal)
11792 (bcmp_translate, regcomp, regexec, print_double_string)
11793 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11794 (re_compile_pattern, re_exec): Declare arguments and local
11795 variables `size_t' and `ssize_t' and return values `regoff_t', as
11796 appropriate.
11797 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11798 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11799 <compile_stack_type>: `size' and `avail' are now `size_t'.
11800
11801 * regex.h <regoff_t>: Use ssize_t, not int.
11802 (re_search, re_search_2, re_match, re_match_2): Arguments that
11803 specify buffer/string position and length are now ssize_t and
11804 size_t. Return type is regoff_t.
11805
613052cd
BK
118062011-04-16 Ben Key <bkey76@gmail.com>
11807
11808 * nsfont.m: Fixed bugs in ns_get_family and
11809 ns_descriptor_to_entity that were caused by using free to
11810 deallocate memory blocks that were allocated by xmalloc (via
11811 xstrdup). This caused Emacs to crash when compiled with
11812 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11813 --enable-checking=xmallocoverrun). xfree is now used to
11814 deallocate these memory blocks.
11815
4170f62f 118162011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11817
71b41406
PE
11818 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11819
9587a89d
PE
11820 emacs_write: Accept and return EMACS_INT for sizes.
11821 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11822 et seq.
11823 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11824 Accept and return EMACS_INT.
11825 (emacs_gnutls_write): Return the number of bytes written on
11826 partial writes.
11827 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11828 (emacs_read, emacs_write): Remove check for negative size, as the
11829 Emacs source code has been audited now.
9587a89d
PE
11830 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11831 (emacs_read, emacs_write): Use it.
273a5f82
PE
11832 * process.c (send_process): Adjust to the new signatures of
11833 emacs_write and emacs_gnutls_write. Do not attempt to store
11834 a byte offset into an 'int'; it might overflow.
9587a89d 11835 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11836
3e047f51
PE
11837 * sound.c: Don't assume sizes fit in 'int'.
11838 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11839 Return EMACS_INT, not int.
3e047f51 11840 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11841 Accept EMACS_INT, not int.
11842 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11843 record read return values.
11844
cc39a9db
BK
118452011-04-15 Ben Key <bkey76@gmail.com>
11846
c9d0ec6d
JB
11847 * keyboard.c (Qundefined): Don't declare static since it is used
11848 in nsfns.m.
11849 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11850 static since they are used in nsfont.m.
cc39a9db 11851
6c60eb9f
SM
118522011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11853
11854 * process.c (Qprocessp): Don't declare static.
11855 * lisp.h (Qprocessp): Declare again.
11856
7990b61a
JB
118572011-04-15 Juanma Barranquero <lekktu@gmail.com>
11858
11859 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11860
5d4cb038
PE
118612011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11862
8bd7b830 11863 Improve C-level modularity by making more things 'static'.
cd64ea1d 11864
e3b27b31
PE
11865 Don't publish debugger-only interfaces to other modules.
11866 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11867 (verify_bytepos, count_markers): Move decls to the only modules
11868 that need them.
11869 * region-cache.h (pp_cache): Likewise.
11870 * window.h (check_all_windows): Likewise.
11871 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11872
5d4cb038
PE
11873 * sysdep.c (croak): Now static, if
11874 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11875 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11876
11877 * alloc.c (refill_memory_reserve): Now static if
11878 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11879 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11880
e87b6180
PE
11881 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11882 Define only if USE_LUCID.
11883
ac64929e
PE
11884 * xrdb.c (x_customization_string, x_rm_string): Now static.
11885
6f37259d
PE
11886 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11887 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11888
1683e3ab
PE
11889 * xdisp.c (draw_row_with_mouse_face): Now static.
11890 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11891
de9c2632
PE
11892 * window.h (check_all_windows): Mark externally visible.
11893
2b96acb7
PE
11894 * window.c (window_deletion_count): Now static.
11895
11896 * undo.c: Make symbols static if they're not exported.
11897 (last_undo_buffer, last_boundary_position, pending_boundary):
11898 Now static.
11899
50436f33
PE
11900 * textprop.c (interval_insert_behind_hooks): Now static.
11901 (interval_insert_in_front_hooks): Likewise.
11902
64520e5c
PE
11903 * term.c: Make symbols static if they're not exported.
11904 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11905 (max_frame_lines, tty_set_terminal_modes):
11906 (tty_reset_terminal_modes, tty_turn_off_highlight):
11907 (get_tty_terminal): Now static.
11908 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11909 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11910 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11911 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11912 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11913
1fa53021
PE
11914 * sysdep.c: Make symbols static if they're not exported.
11915 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11916 Now static.
11917 (sigprocmask_set, full_mask): Remove; unused.
11918 (wait_debugging): Mark as visible.
11919 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11920 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11921
d4b43b22
PE
11922 * syntax.c (syntax_temp): Define only if !__GNUC__.
11923
b7c513d0
PE
11924 * sound.c (current_sound_device, current_sound): Now static.
11925
989b29ad
PE
11926 * search.c (searchbufs, searchbuf_head): Now static.
11927
13a55a78
PE
11928 * scroll.c (scroll_cost): Remove; unused.
11929 * dispextern.h (scroll_cost): Remove decl.
11930
de68a1fc
PE
11931 * region-cache.h (pp_cache): Mark as externally visible.
11932
40ccffa6
PE
11933 * process.c: Make symbols static if they're not exported.
11934 (process_tick, update_tick, create_process, chan_process):
11935 (Vprocess_alist, proc_buffered_char, datagram_access):
11936 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11937 (deactivate_process): Mark defn as static, as well as decl.
11938 * lisp.h (create_process): Remove decl.
11939 * process.h (chan_process, Vprocess_alist): Remove decls.
11940
ad64fc97
PE
11941 * print.c: Make symbols static if they're not exported.
11942 (print_depth, new_backquote_output, being_printed, print_buffer):
11943 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11944 (print_interval, print_number_index, initial_stderr_stream):
11945 Now static.
11946 * lisp.h (Fprinc): Remove decl.
11947 (debug_output_compilation_hack): Mark as externally visible.
11948
adddb265
PE
11949 * sysdep.c (croak): Move decl from here to syssignal.h.
11950 * syssignal.h (croak): Put it here, so the API can be checked when
11951 'croak' is called from dissociate_if_controlling_tty.
11952
1717ede2
PE
11953 * minibuf.c: Make symbols static if they're not exported.
11954 (minibuf_save_list, choose_minibuf_frame): Now static.
11955 * lisp.h (choose_minibuf_frame): Remove decl.
11956
fa5fb2bc
PE
11957 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11958
1e3890d1
PE
11959 * lread.c: Make symbols static if they're not exported.
11960 (read_objects, initial_obarray, oblookup_last_bucket_number):
11961 Now static.
11962 (make_symbol): Remove; unused.
11963 * lisp.h (initial_obarray, make_symbol): Remove decls.
11964
8a1414fa
PE
11965 * keyboard.c: Make symbols static if they're not exported.
11966 (single_kboard, recent_keys_index, total_keys, recent_keys):
11967 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11968 (this_single_command_key_start, echoing, last_auto_save):
11969 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11970 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11971 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11972 (Vlispy_mouse_stem, double_click_count):
11973 Now static.
11974 (force_auto_save_soon): Define only if SIGDANGER.
11975 (ignore_mouse_drag_p): Now static if
11976 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11977 (print_help): Remove; unused.
11978 (stop_character, last_timer_event): Mark as externally visible.
11979 * keyboard.h (ignore_mouse_drag_p): Declare only if
11980 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11981 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11982 * lisp.h (echoing): Remove decl.
11983 (force_auto_save_soon): Declare only if SIGDANGER.
11984 * xdisp.c (redisplay_window): Simplify code, to make it more
11985 obvious that ignore_mouse_drag_p is not accessed if !defined
11986 USE_GTK && !defined HAVE_NS.
11987
93ea6e8f
PE
11988 * intervals.c: Make symbols static if they're not exported.
11989 (merge_properties_sticky, merge_interval_right, delete_interval):
11990 Now static.
11991 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11992
77382fcc
PE
11993 * insdel.c: Make symbols static if they're not exported.
11994 However, leave prepare_to_modify_buffer alone. It's never
11995 called from outside this function, but that appears to be a bug.
11996 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11997 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11998 (adjust_after_replace_noundo): Remove; unused.
11999 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 12000 (signal_before_change): Remove decls.
77382fcc 12001
9306c32e
PE
12002 * indent.c (val_compute_motion, val_vmotion): Now static.
12003
cd44d2eb
PE
12004 * image.c: Make symbols static if they're not exported.
12005 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
12006 if USE_GTK.
12007 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
12008 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
12009
ad9a7a06
PE
12010 * fringe.c (standard_bitmaps): Now static.
12011 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
12012
81626931
PE
12013 * frame.c: Make symbols static if they're not exported.
12014 (x_report_frame_params, make_terminal_frame): Now static.
12015 (get_frame_param): Now static, unless HAVE_NS.
12016 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
12017 (x_get_resource_string): Remove; not used.
12018 * frame.h (make_terminal_frame, x_report_frame_params):
12019 (x_get_resource_string); Remove decls.
12020 (x_fullscreen_adjust): Declare only if WINDOWSNT.
12021 * lisp.h (get_frame_param): Declare only if HAVE_NS.
12022
239f9db9
PE
12023 * font.c, fontset.c: Make symbols static if they're not exported.
12024 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
12025 (FACE_SUITABLE_FOR_CHAR_P): Use it.
12026 * font.c (font_close_object): Now static.
12027 * font.h (font_close_object): Remove.
12028 * fontset.c (FONTSET_OBJLIST): Remove.
12029 (free_realized_fontset) #if-0 the body, which does nothing.
12030 (face_suitable_for_char_p): #if-0, as it's never called.
12031 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
12032 * xfaces.c (face_at_string_position):
12033 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
12034 since 0 is always ASCII.
12035
dfcf3579
PE
12036 * fns.c (weak_hash_tables): Now static.
12037
5045092b
PE
12038 * fileio.c: Make symbols static if they're not exported.
12039 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
12040 (Vwrite_region_annotation_buffers): Now static.
12041
57a96f5c
PE
12042 * eval.c: Make symbols static if they're not exported.
12043 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
12044 * lisp.h (backtrace_list): Remove decl.
12045
35f08c38
PE
12046 * emacs.c: Make symbols static if they're not exported.
12047 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
12048 (fatal_error_code, fatal_error_signal_hook, standard_args):
12049 Now static.
12050 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
12051 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
12052 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
12053 * lisp.h (fatal_error_signal_hook): Remove decl.
12054 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
12055
f44bd759
PE
12056 * editfns.c: Move a (normally-unused) function to its only use.
12057 * editfns.c, lisp.h (get_operating_system_release): Remove.
12058 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
12059 worth the hassle of breaking this out.
12060
b532497d
PE
12061 * xterm.c: Make symbols static if they're not exported.
12062 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
12063 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
12064 (x_destroy_window, x_delete_display):
12065 Now static.
12066 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
12067 (x_mouse_leave): Remove; unused.
12068 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
12069 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
12070 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
12071 Remove decls.
12072 (x_mouse_leave): Declare only if WINDOWSNT.
12073 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
12074 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
12075 USE_X_TOOLKIT.
12076
1675728f
PE
12077 * ftxfont.c: Make symbols static if they're not exported.
12078 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
12079 HAVE_FREETYPE.
12080 * font.h (ftxfont_driver): Likewise.
12081
e4cebfca
PE
12082 * xfns.c: Make symbols static if they're not exported.
12083 (x_last_font_name, x_display_info_for_name):
12084 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
12085 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
12086 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
12087 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
12088 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
12089 (last_show_tip_args): Now static.
12090 (xic_defaut_fontset, xic_create_fontsetname): Define only if
12091 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
12092 (x_screen_planes): Remove; unused.
12093 * dispextern.h (x_screen_planes): Remove decl.
12094
5bf46f05
PE
12095 * dispnew.c: Make symbols static if they're not exported.
12096 * dispextern.h (redraw_garbaged_frames, scrolling):
12097 (increment_row_positions): Remove.
12098 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
12099 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
12100 Now static.
12101 (redraw_garbaged_frames): Remove; unused.
12102
435f4c28
PE
12103 * xfaces.c: Make symbols static if they're not exported.
12104 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
12105 Remove decls.
12106 * xterm.h (defined_color): Remove decls.
12107 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
12108 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
12109 (menu_face_changed_default, defined_color, free_realized_face):
12110 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
12111 (ascii_face_of_lisp_face): Remove; unused.
12112
8524aef3
PE
12113 * xdisp.c: Make symbols static if they're not exported.
12114 * dispextern.h (scratch_glyph_row, window_box_edges):
12115 (glyph_to_pixel_coords, set_cursor_from_row):
12116 (get_next_display_element, set_iterator_to_next):
12117 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
12118 (show_mouse_face): Remove decls
12119 * frame.h (message_buf_print): Likewise.
12120 * lisp.h (pop_message, set_message, check_point_in_composition):
12121 Likewise.
12122 * xterm.h (set_vertical_scroll_bar): Likewise.
12123 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
12124 (message_buf_print, scratch_glyph_row, displayed_buffer):
12125 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
12126 (get_next_display_element, show_mouse_face, window_box_edges):
12127 (frame_to_window_pixel_xy, check_point_in_composition):
12128 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
12129 (glyph_to_pixel_coords): Remove; unused.
12130
16390cd2
PE
12131 * dired.c (file_name_completion): Now static.
12132
12133 * dbusbind.c (xd_in_read_queued_messages): Now static.
12134
a25f4dfa
PE
12135 * lisp.h (circular_list_error, FOREACH): Remove; unused.
12136 * data.c (circular_list_error): Remove.
12137
14a9c8df
PE
12138 * commands.h (last_point_position, last_point_position_buffer):
12139 (last_point_position_window): Remove decls.
12140 * keyboard.c: Make these variables static.
12141
04f2d78b
CB
12142 * coding.h (coding, code_convert_region, encode_coding_gap):
12143 Remove decls.
74ab6df5
PE
12144 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
12145 (iso_code_class, detect_coding, code_convert_region): Now static.
12146 (encode_coding_gap): Remove; unused.
12147
38dfbee1
PE
12148 * chartab.c (chartab_chars, chartab_bits): Now static.
12149
a2cb4e63
PE
12150 * charset.h (charset_iso_8859_1): Remove decl.
12151 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
12152 Now static.
12153
127198fd
PE
12154 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
12155 * ccl.c (Vccl_program_table): Now static.
12156 (check_ccl_update): Remove; unused.
12157
d85b608f
PE
12158 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
12159 * category.h: ... from here.
12160 * category.c (check_category_table, set_category_set): Now static.
12161
31cd66f3
PE
12162 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
12163 * lisp.h: Remove these decls.
12164
c358e587
PE
12165 * buffer.c (buffer_count): Remove unused var.
12166
e78aecca
PE
12167 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
12168 so that it's not optimized away.
12169 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
12170 * dispextern.h (bidi_dump_cached_states): Remove, since it's
12171 exported only to the debugger.
12172
e192d7d3 12173 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 12174 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 12175
92470028
PE
12176 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
12177 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
12178 was inaccessible from Lisp.
12179 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
12180 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
12181
244ed907
PE
12182 alloc.c: Import and export fewer symbols, and remove unused items.
12183 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
12184 is defined.
12185 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
12186 it's not optimized away by whole-program optimization.
12187 (message_enable_multibyte, free_misc): Remove.
12188 (catchlist, handlerlist, mark_backtrace):
12189 Declare only if BYTE_MARK_STACK.
12190 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12191 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
12192 (message_enable_multibyte): Remove decl.
12193 (free_misc, interval_free_list, float_block, float_block_index):
12194 (n_float_blocks, float_free_list, cons_block, cons_block_index):
12195 (cons_free_list, last_marked_index):
12196 Now static.
12197 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
12198 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
12199 (mark_backtrace): Define only if BYTE_MARK_STACK.
12200 * xdisp.c (message_enable_multibyte): Now static.
12201
61c2b50e 12202 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
12203 This makes it easier for human readers (and static analyzers)
12204 to see whether these variables are used from other modules.
12205 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
12206 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
12207 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
12208 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
12209 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
12210 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
12211 * xmenu.c, xselect.c:
12212 Declare Q* vars static if they are not used in other modules.
12213 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
12214 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
12215 Remove decls of unexported vars.
12216 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
12217
95c82688
PE
12218 * lisp.h (DEFINE_FUNC): Make sname 'static'.
12219
16a97296
PE
12220 Make Emacs functions such as Fatom 'static' by default.
12221 This makes it easier for human readers (and static analyzers)
12222 to see whether these functions can be called from other modules.
12223 DEFUN now defines a static function. To make the function external
12224 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
12225 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
12226 (Finit_image_library):
16a97296
PE
12227 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
12228 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
12229 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
12230 Remove decls, since these functions are now static.
12231 (Funintern, Fget_internal_run_time): New decls, since these functions
12232 were already external.
95c82688 12233
16a97296
PE
12234 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
12235 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
12236 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
12237 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
12238 * keyboard.c, keymap.c, lread.c:
12239 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
12240 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
12241 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
12242 Mark functions with DEFUE instead of DEFUN,
12243 if they are used in other modules.
12244 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
12245 decls for now-static functions.
12246 * buffer.h (Fdelete_overlay): Remove decl.
12247 * callproc.c (Fgetenv_internal): Mark as internal.
12248 * composite.c (Fremove_list_of_text_properties): Remove decl.
12249 (Fcomposition_get_gstring): New forward static decl.
12250 * composite.h (Fcomposite_get_gstring): Remove decl.
12251 * dired.c (Ffile_attributes): New forward static decl.
12252 * doc.c (Fdocumntation_property): New forward static decl.
12253 * eval.c (Ffetch_bytecode): New forward static decl.
12254 (Funintern): Remove extern decl; now in .h file where it belongs.
12255 * fileio.c (Fmake_symbolic_link): New forward static decl.
12256 * image.c (Finit_image_library): New forward static decl.
12257 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
12258 * intervals.h (Fprevious_property_change):
12259 (Fremove_list_of_text_properties): Remove decls.
12260 * keyboard.c (Fthis_command_keys): Remove decl.
12261 (Fcommand_execute): New forward static decl.
12262 * keymap.c (Flookup_key): New forward static decl.
12263 (Fcopy_keymap): Now static.
12264 * keymap.h (Flookup_key): Remove decl.
12265 * process.c (Fget_process): New forward static decl.
12266 (Fprocess_datagram_address): Mark as internal.
12267 * syntax.c (Fsyntax_table_p): New forward static decl.
12268 (skip_chars): Remove duplicate decl.
12269 * textprop.c (Fprevious_property_change): New forward static decl.
12270 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
12271 Now internal.
12272 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
12273 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
12274
785bbd42
PE
12275 * editfns.c (Fformat): Remove unreachable code.
12276
8b913b57
AS
122772011-04-14 Andreas Schwab <schwab@linux-m68k.org>
12278
12279 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
12280 change. (Bug#8496)
12281
a6744a35
EZ
122822011-04-13 Eli Zaretskii <eliz@gnu.org>
12283
12284 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
12285 when at ZV. (Bug#8487)
12286
e7974947
AS
122872011-04-12 Andreas Schwab <schwab@linux-m68k.org>
12288
baad03f0
AS
12289 * charset.c (Fclear_charset_maps): Use xfree instead of free.
12290 (Bug#8437)
12291 * keyboard.c (parse_tool_bar_item): Likewise.
12292 * sound.c (sound_cleanup, alsa_close): Likewise.
12293 * termcap.c (tgetent): Likewise.
12294 * xfns.c (x_default_font_parameter): Likewise.
12295 * xsettings.c (read_and_apply_settings): Likewise.
12296
e7974947
AS
12297 * alloc.c (overrun_check_malloc, overrun_check_realloc)
12298 (overrun_check_free): Protoize.
12299
28272684
PE
123002011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12301
12302 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12303 since callers should never pass a negative size.
12304 Change the signature to match that of plain 'read' and 'write'; see
12305 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12306 * lisp.h: Update prototypes of emacs_write and emacs_read.
12307
11997c76
EZ
123082011-04-11 Eli Zaretskii <eliz@gnu.org>
12309
12310 * xdisp.c (redisplay_window): Don't try to determine the character
12311 position of the scroll margin if the window start point w->startp
e896f03c 12312 is outside the buffer's accessible region. (Bug#8468)
11997c76 12313
8a2cbd72
EZ
123142011-04-10 Eli Zaretskii <eliz@gnu.org>
12315
12316 Fix write-region and its subroutines for buffers > 2GB.
12317 * fileio.c (a_write, e_write): Modify declaration of arguments and
12318 local variables to support buffers larger than 2GB.
12319 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12320
12321 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12322 argument, local variables, and return value.
12323
12324 * lisp.h: Update prototypes of emacs_write and emacs_read.
12325
12326 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12327
4073e537 123282011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 12329
1ebfdcb6
PE
12330 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12331
b2ded58d
PE
12332 Fix more problems found by GCC 4.6.0's static checks.
12333
7d66342c
PE
12334 * xdisp.c (vmessage): Use a better test for character truncation.
12335
bbf47d44
PE
12336 * charset.c (load_charset_map): <, not <=, for optimization,
12337 and to avoid potential problems with integer overflow.
9248994d 12338 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 12339 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 12340 * editfns.c (Fformat): Likewise.
1e69125e 12341 * syntax.c (skip_chars): Likewise.
3befa583 12342
e3019616
PE
12343 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12344 This also lets GCC 4.6.0 generate slightly better loop code.
12345
becfa255
PE
12346 * callint.c (Fcall_interactively): <, not <=, for optimization.
12347 (Fcall_interactively): Count the number of arguments produced,
12348 not the number of arguments given. This is simpler and lets GCC
12349 4.6.0 generate slightly better code.
12350
dae0cd48
PE
12351 * ftfont.c: Distingish more carefully between FcChar8 and char.
12352 The previous code passed unsigned char * to a functions like
12353 strlen and xstrcasecmp that expect char *, which does not
12354 conform to the C standard.
12355 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12356 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12357 char * when the C standard requires it.
12358
76032d70
PE
12359 * keyboard.c (read_char): Remove unused var.
12360
eb3f1cc8
PE
12361 * eval.c: Port to Windows vsnprintf (Bug#8435).
12362 Include <limits.h>.
12363 (SIZE_MAX): Define if the headers do not.
12364 (verror): Do not give up if vsnprintf returns a negative count.
12365 Instead, grow the buffer. This ports to Windows vsnprintf, which
12366 does not conform to C99. Problem reported by Eli Zaretskii.
12367 Also, simplify the allocation scheme, by avoiding the need for
12368 calling realloc, and removing the ALLOCATED variable.
12369
70476b54
PE
12370 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12371
12020a9e
PE
12372 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12373 But keep the doprint source code for now, as we might revamp it
12374 and use it again (Bug#8435).
ea6c7ae6
PE
12375 * lisp.h (doprnt): Remove.
12376 * Makefile.in (base_obj): Remove doprnt.o.
12377 * deps.mk (doprnt.o): Remove.
12378
5fdb398c
PE
12379 error: Print 32- and 64-bit integers portably (Bug#8435).
12380 Without this change, on typical 64-bit hosts error ("...%d...", N)
12381 was used to print both 32- and 64-bit integers N, which relied on
12382 undefined behavior.
61bdb816 12383 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
12384 * lisp.h (error, verror): Mark as printf-like functions.
12385 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
12386 Report overflow in size calculations when allocating printf buffer.
12387 Do not truncate output string at its first null byte.
12388 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12389 Truncate the output at a character boundary, since vsnprintf does not
12390 do that.
12391 * charset.c (check_iso_charset_parameter): Convert internal
12392 character to string before calling 'error', since %c now has the
12393 printf meaning.
12394 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12395 overflow when computing char to be passed to 'error'. Do not
12396 pass Lisp_Object to 'error'; pass the integer instead.
12397 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12398 formatted with plain %d.
12399
b189fa66
PE
12400 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12401
bff87ef0
PE
12402 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12403
7e2cac20
PE
12404 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12405
ce4d90b5
PE
12406 * xterm.c (x_catch_errors): Remove duplicate declaration.
12407
266c9547
PE
12408 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12409
79c49ad2
PE
12410 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12411
368f4090
JM
124122011-04-10 Jim Meyering <meyering@redhat.com>
12413
12414 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12415 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12416 return ssize_t not "int", and use size_t as the buffer length.
12417 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12418 * gnutls.h: Update declarations.
12419 * process.c (read_process_output): Use ssize_t, to match.
12420 (send_process): Likewise.
12421
a32d4040
CY
124222011-04-09 Chong Yidong <cyd@stupidchicken.com>
12423
12424 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12425
8546720e 124262011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12427
04f2d78b
CB
12428 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12429 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12430
8546720e
GM
12431 * xterm.c (handle_one_xevent):
12432 * xmenu.c (create_and_show_popup_menu):
12433 * xselect.c (x_decline_selection_request)
12434 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12435
0a2f5c1a 124362011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12437
12438 Fix some uses of `int' instead of EMACS_INT.
12439 * search.c (string_match_1, fast_string_match)
12440 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12441 (scan_buffer, find_next_newline_no_quit)
12442 (find_before_next_newline, search_command, Freplace_match)
12443 (Fmatch_data): Make some `int' variables be EMACS_INT.
12444
12445 * xdisp.c (display_count_lines): 3rd argument and return value now
12446 EMACS_INT. All callers changed.
12447 (pint2hrstr): Last argument is now EMACS_INT.
12448
12449 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12450 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12451 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12452 (decode_coding_utf_16, decode_coding_emacs_mule)
12453 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12454 (decode_coding_ccl, decode_coding_charset)
12455 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12456 (decode_coding_iso_2022, decode_coding_emacs_mule)
12457 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12458 <char_offset, last_offset>: Declare EMACS_INT.
12459 (encode_coding_utf_8, encode_coding_utf_16)
12460 (encode_coding_emacs_mule, encode_invocation_designation)
12461 (encode_designation_at_bol, encode_coding_iso_2022)
12462 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12463 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12464 Declare EMACS_INT.
12465 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12466 (encode_invocation_designation): Last argument P_NCHARS is now
12467 EMACS_INT.
12468 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12469 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12470
12471 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12472 All users changed.
12473
12474 * ccl.c (Fccl_execute_on_string): Declare some variables
12475 EMACS_INT.
12476
8546720e 124772011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12478
12479 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12480
4e19a977
CS
124812011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12482
12483 * process.c (Fformat_network_address): Doc fix.
12484
87302331
R
124852011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12486
ee7683eb 12487 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12488
cbb59342
CY
124892011-04-08 Chong Yidong <cyd@stupidchicken.com>
12490
12491 * keyboard.c (read_char): Call Lisp function help-form-show,
12492 instead of using internal_with_output_to_temp_buffer.
12493 (Qhelp_form_show): New var.
e0d38eeb 12494 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12495
12496 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12497
12498 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12499
e67a13ab
CY
125002011-04-06 Chong Yidong <cyd@stupidchicken.com>
12501
04f2d78b
CB
12502 * process.c (Flist_processes): Remove to Lisp.
12503 (list_processes_1): Delete.
e67a13ab 12504
973f782d
EZ
125052011-04-06 Eli Zaretskii <eliz@gnu.org>
12506
7c106b1e
EZ
12507 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12508
973f782d
EZ
12509 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12510
41cf7d1a 125112011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12512
ca23cc88
PE
12513 Fix more problems found by GCC 4.6.0's static checks.
12514
f390e2d5
PE
12515 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12516
42eea0d0
PE
12517 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12518
b69769da 12519 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12520
f9541e84
PE
12521 * xdisp.c (vmessage): Mark as a printf-like function.
12522
13841b55
PE
12523 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12524
c136c10f
PE
12525 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12526
5e2d4a30
PE
12527 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12528 printf-like functions.
12529 (tiff_load): Add casts to remove these marks before passing them
12530 to system-supplied API.
12531
583f48b9
PE
12532 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12533
b25d760e
PE
12534 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12535 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12536 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12537 directly, rather than having caller test rule sign. This avoids
12538 some unnecessary tests.
12539 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12540 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12541 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12542
bc7b6697 12543 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12544 (xfont_open): Avoid unnecessary tests.
bc7b6697 12545
27ccc379
PE
12546 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12547
dcd5c89a
PE
12548 * composite.h, composite.c (composition_gstring_put_cache):
12549 Use EMACS_INT, not int, for length.
12550
b13a45c6
PE
12551 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12552 breaking out part of COMPOSITION_DECODE_RULE.
12553 (COMPOSITION_DECODE_RULE): Use it.
12554 * composite.c (get_composition_id): Remove unused local vars,
12555 by using the new macro.
12556
1e792e4d
PE
12557 * textprop.c (set_text_properties_1): Change while to do-while,
12558 since the condition is always true at first.
12559
dc6c6455 12560 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12561 (interval_deletion_adjustment): Return unsigned value.
12562 All uses changed.
dc6c6455 12563
aba7731a
PE
12564 * process.c (list_processes_1, create_pty, read_process_output):
12565 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12566 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12567 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12568 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12569 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12570
fdfc4bf3
PE
12571 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12572
fca8fe46 12573 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12574 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12575
06a0259a 12576 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12577 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12578 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12579
e7b9e80f
PE
12580 * print.c (print_error_message): Avoid int overflow.
12581
56201685
PE
12582 * font.c (font_list_entities): Redo for clarity,
12583 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12584
78834453 12585 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12586 (font_score): Avoid potential overflow in diff calculation.
78834453 12587
0bc0b309 12588 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12589 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12590
e610eaca
PE
12591 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12592
b895abce
PE
12593 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12594 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12595 can always succeed if overflow has undefined behavior.
12596
1f1d9321 12597 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12598 (wordify): Omit three unnecessary tests.
1f1d9321 12599
c59478bc
PE
12600 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12601 All callers changed. This avoids the need for an unused var.
12602
79b73827
PE
12603 * casefiddle.c (casify_region): Remove var that is set but not used.
12604
a4db5dfe
PE
12605 * dired.c (file_name_completion): Remove var that is set but not used.
12606
43aae36e
PE
12607 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12608
2a47c44d 12609 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12610 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12611
a37c69bf
PE
12612 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12613 Check for integer overflow on size calculations.
12614
328ab8e7
PE
12615 * buffer.c (Fprevious_overlay_change): Remove var that is set
12616 but not used.
12617
e5a2a5cb
PE
12618 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12619 Remove vars that are set but not used.
8d84a6eb 12620 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12621 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12622
a60e5f68
PE
12623 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12624
f661cb61 12625 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12626 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12627
f0397f5a
PE
12628 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12629 that are set but not used.
12630
8664db06 12631 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12632 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12633
6abdaa4a
PE
12634 * xselect.c (x_get_local_selection, x_handle_property_notify):
12635 Remove vars that are set but not used.
12636
0ce7538d 12637 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12638 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12639
9ae848fc
PE
12640 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12641 Remove var that is set but not used.
0b918413
PE
12642 (scroll_bar_windows_size): Now size_t, not int.
12643 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12644 Check for overflow.
9ae848fc 12645
a5a62657
PE
12646 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12647 (map_tty_color) [!defined MSDOS]: Likewise.
12648
5c5cdd39
PE
12649 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12650
66ebf983
PE
12651 * coding.c: Remove vars that are set but not used.
12652 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12653 All callers changed.
12654 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12655 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12656 (decode_coding_charset): Remove vars that are set but not used.
12657
1be4d761
PE
12658 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12659 that is set but not used.
12660
47553fa8
PE
12661 * print.c (print_object): Remove var that is set but not used.
12662
1f7196bf 12663 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12664 The gnulib version avoids calling malloc in the usual case,
12665 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12666 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12667 * filelock.c (current_lock_owner): Likewise.
12668 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12669 * sysdep.c: Include allocator.h, careadlinkat.h.
12670 (emacs_no_realloc_allocator): New static constant.
12671 (emacs_readlink): New function.
fdb61804
PE
12672 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12673 ../lib/careadlinkat.h.
d1fdcab7 12674
f84c17c7
SM
126752011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12676
12677 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12678 first non-nil return value).
12679
ef3862ad
JD
126802011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12681
12682 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12683 if not defined (Bug#8403).
12684
376a7006
JB
126852011-04-02 Juanma Barranquero <lekktu@gmail.com>
12686
12687 * xdisp.c (display_count_lines): Remove parameter `start',
12688 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12689 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12690 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12691 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12692 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12693 and thereabouts. All callers changed.
12694 (get_per_char_metric): Remove parameter `f', unused since
12695 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12696
6ca3801d
JM
126972011-04-02 Jim Meyering <meyering@redhat.com>
12698
12699 do not dereference NULL upon failed strdup
12700 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12701 (ns_get_family): Likewise.
12702
d8e2b5ba
JB
127032011-04-02 Juanma Barranquero <lekktu@gmail.com>
12704
12705 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12706
8c74fcbd
JD
127072011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12708
12709 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12710 later (Bug#8403).
12711
7200d79c
SM
127122011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12713
03408648 12714 Add lexical binding.
7200d79c 12715
03408648
SM
12716 * window.c (Ftemp_output_buffer_show): New fun.
12717 (Fsave_window_excursion):
12718 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12719
12720 * lread.c (lisp_file_lexically_bound_p): New function.
12721 (Fload): Bind Qlexical_binding.
12722 (readevalloop): Remove `evalfun' arg.
12723 Bind Qinternal_interpreter_environment.
12724 (Feval_buffer): Bind Qlexical_binding.
12725 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12726 Mark as dynamic.
12727 (syms_of_lread): Declare `lexical-binding'.
12728
12729 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12730
12731 * keyboard.c (eval_dyn): New fun.
12732 (menu_item_eval_property): Use it.
ca105506
SM
12733
12734 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12735
03408648
SM
12736 * fns.c (concat, mapcar1): Accept byte-code-functions.
12737
12738 * eval.c (Fsetq): Handle lexical vars.
12739 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12740 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12741 (FletX, Flet): Obey lexical binding.
12742 (Fcommandp): Handle closures.
12743 (Feval): New `lexical' arg.
12744 (eval_sub): New function extracted from Feval. Use it almost
12745 everywhere where Feval was used. Look up vars in lexical env.
12746 Handle closures.
12747 (Ffunctionp): Move from subr.el.
12748 (Ffuncall): Handle closures.
12749 (apply_lambda): Remove `eval_flags'.
12750 (funcall_lambda): Handle closures and new byte-code-functions.
12751 (Fspecial_variable_p): New function.
12752 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12753 but without exporting it to Lisp.
23aba0ea 12754
23aba0ea 12755 * doc.c (Fdocumentation, store_function_docstring):
03408648 12756 * data.c (Finteractive_form): Handle closures.
23aba0ea 12757
03408648
SM
12758 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12759 interactive spec.
ba83908c 12760
04f2d78b
CB
12761 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12762 New byte-codes.
03408648
SM
12763 (exec_byte_code): New function extracted from Fbyte_code to handle new
12764 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12765
03408648 12766 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12767
03408648 12768 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12769
e2abce01
JB
127702011-03-31 Juanma Barranquero <lekktu@gmail.com>
12771
12772 * xdisp.c (redisplay_internal): Fix prototype.
12773
63696a73 127742011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12775
63696a73 12776 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12777 (try_scrolling): Use it when setting scroll_limit.
12778 Limit scrolling to 100 screen lines.
63696a73
EZ
12779 (redisplay_window): Even when falling back on "recentering",
12780 position point in the window according to scroll-conservatively,
12781 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12782
12783 (try_scrolling): When point is above the window, allow searching
12784 as far as scroll_max, or one screenful, to compute vertical
12785 distance from PT to the scroll margin position. This prevents
12786 try_scrolling from unnecessarily failing when
12787 scroll-conservatively is set to a value slightly larger than the
12788 window height. Clean up the case of PT below the margin at bottom
12789 of window: scroll_max can no longer be INT_MAX. When aggressive
12790 scrolling is in use, don't let point enter the opposite scroll
12791 margin as result of the scroll.
12792 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12793 threshold of 100 lines for never-recentering scrolling.
12794
e4cc2dfc
JB
127952011-03-31 Juanma Barranquero <lekktu@gmail.com>
12796
12797 * dispextern.h (move_it_by_lines):
12798 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12799 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12800 (message_log_check_duplicate): Remove parameters `prev_bol' and
12801 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12802 (redisplay_internal): Remove parameter `preserve_echo_area',
12803 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12804
12805 * indent.c (Fvertical_motion):
12806 * window.c (window_scroll_pixel_based, Frecenter):
12807 Don't pass `need_y_p' to `move_it_by_lines'.
12808
1c470562
SM
128092011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12810
44f230aa
SM
12811 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12812 steal a few bits to be more compact.
12813 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12814 Remove unneeded casts.
12815
1c470562
SM
12816 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12817
888adce9
ZK
128182011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12819
12820 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12821 binding" message (bug#7967).
12822
f838ed7b
PE
128232011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12824
77861b95
PE
12825 Fix more problems found by GCC 4.6.0's static checks.
12826
de6dbc14
PE
12827 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12828 Remove unused local var.
12829
f838ed7b
PE
12830 * editfns.c (Fmessage_box): Remove unused local var.
12831
792c7b2b
PE
12832 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12833 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12834 Omit unused local vars.
c499e557 12835 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12836 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12837 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12838 Omit unused local var.
12839
ba0165e1
PE
12840 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12841 Don't assume string length fits in int.
32ad8845 12842 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12843 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12844
3c59b4c9
PE
12845 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12846 instead of alloca (Bug#8344).
12847
a3eed478 12848 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12849 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12850
eb4d412d
PE
12851 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12852
1658b401
PE
12853 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12854 concerns.
12855
12856 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12857
12858 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12859
9a2c6e05
PE
12860 * keyboard.c (syms_of_keyboard): Use the same style as later
12861 in this function when indexing through an array. This also
12862 works around GCC bug 48267.
12863
03d0a109
PE
12864 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12865
44f730c8
PE
12866 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12867
fe75f926
PE
12868 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12869 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12870
ffa8c828
PE
12871 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12872 This avoids undefined behavior on integer overflow, and is a bit
12873 more convenient anyway since it is compared to a size_t variable.
12874
c5101a77
PE
12875 Variadic C functions now count arguments with size_t, not int.
12876 This avoids an unnecessary limitation on 64-bit machines, which
12877 caused (substring ...) to crash on large vectors (Bug#8344).
12878 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12879 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12880 All variadic functions and their callers changed accordingly.
c5101a77
PE
12881 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12882 * data.c (arith_driver, float_arith_driver): Likewise.
12883 * editfns.c (general_insert_function): Likewise.
12884 * eval.c (struct backtrace.nargs, interactive_p)
12885 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12886 (funcall_lambda, mark_backtrace): Likewise.
12887 * fns.c (concat): Likewise.
12888 * frame.c (x_set_frame_parameters): Likewise.
12889 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12890 0 if not found, not -1. All callers changed.
12891
dd3f25f7
PE
12892 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12893 (stack_copy_size): Now size_t, not int.
12894 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12895
461c2ab9
JB
128962011-03-28 Juanma Barranquero <lekktu@gmail.com>
12897
12898 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12899 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12900 All callers changed.
12901
12902 * lisp.h (multibyte_char_to_unibyte):
12903 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12904 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12905 * character.h (CHAR_TO_BYTE8):
12906 * cmds.c (internal_self_insert):
12907 * editfns.c (general_insert_function):
12908 * keymap.c (push_key_description):
12909 * search.c (Freplace_match):
12910 * xdisp.c (message_dolog, set_message_1): All callers changed.
12911
f6d62986
SM
129122011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12913
12914 * keyboard.c (safe_run_hook_funcall): New function.
12915 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12916 don't set the hook to nil, but remove the offending function instead.
12917 (Qcommand_hook_internal): Remove, unused.
12918 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12919 Vcommand_hook_internal.
12920
12921 * eval.c (enum run_hooks_condition): Remove.
12922 (funcall_nil, funcall_not): New functions.
12923 (run_hook_with_args): Call each function through a `funcall' argument.
12924 Remove `cond' argument, now redundant.
12925 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12926 (Frun_hook_with_args_until_failure): Adjust accordingly.
12927 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12928
1db5b1ad
JB
129292011-03-28 Juanma Barranquero <lekktu@gmail.com>
12930
12931 * dispextern.h (string_buffer_position): Remove declaration.
12932
12933 * print.c (strout): Remove parameter `multibyte', unused since
12934 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12935
12936 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12937 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12938 All callers changed.
12939
12940 * w32.c (_wsa_errlist): Use braces for struct initializers.
12941
12942 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12943 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12944 All callers changed.
12945 (string_buffer_position): Likewise. Also, make static (it's never
12946 used outside xdisp.c).
12947 (cursor_row_p): Remove parameter `w', unused since
12948 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12949 (decode_mode_spec): Remove parameter `precision', introduced during
12950 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12951 All callers changed.
12952
5ffb62aa
JD
129532011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12954
12955 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12956
461c2ab9 129572011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12958
12959 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12960 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12961 (ns_update_auto_hide_menu_bar): New functions.
12962 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12963 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12964 ns_constrain_all_frames.
12965 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12966 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12967
5c380ffb
JD
129682011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12969
12970 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12971
9af30bdf
GM
129722011-03-27 Glenn Morris <rgm@gnu.org>
12973
12974 * syssignal.h: Replace RETSIGTYPE with void.
12975 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12976 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12977 Replace SIGTYPE with void everywhere.
12978 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12979 * s/template.h (SIGTYPE): Remove commented out definition.
12980
e2abce01
JB
129812011-03-26 Eli Zaretskii <eliz@gnu.org>
12982
12983 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12984 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12985
f868cd8a
JB
129862011-03-26 Juanma Barranquero <lekktu@gmail.com>
12987
59eb0929
JB
12988 * w32.c (read_unc_volume): Use parameter `henum', instead of
12989 global variable `wget_enum_handle'.
12990
12991 * keymap.c (describe_vector): Remove parameters `indices' and
12992 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12993 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12994
f868cd8a
JB
12995 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12996
12997 * keyboard.c (timer_check): Remove parameter `do_it_now',
12998 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12999 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
13000 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
13001
13002 * keyboard.c (read_char):
13003 * w32menu.c (w32_menu_display_help):
13004 * xmenu.c (show_help_event, menu_help_callback):
13005 Adjust calls to `show_help_echo'.
13006
13007 * gtkutil.c (xg_maybe_add_timer):
13008 * keyboard.c (readable_events):
13009 * process.c (wait_reading_process_output):
13010 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
13011
13012 * insdel.c (adjust_markers_gap_motion):
13013 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
13014 (gap_left, gap_right): Don't call it.
13015
2ecf6fdb
CY
130162011-03-25 Chong Yidong <cyd@stupidchicken.com>
13017
13018 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
13019 incurred during fontification.
13020
6b1f9ba4
JB
130212011-03-25 Juanma Barranquero <lekktu@gmail.com>
13022
13023 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
13024 (DEFVAR_PER_BUFFER): Don't pass it.
13025
13026 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
13027 (scrolling_window): Don't pass it.
13028
0f4a96b5
JB
130292011-03-25 Juanma Barranquero <lekktu@gmail.com>
13030
13031 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
13032
13033 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
13034 and `suffix'.
13035 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
13036 of variables specific to SELinux and computation of `encoded_absname'.
13037
13038 * image.c (XPutPixel): Remove unused variable `height'.
13039
13040 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
13041
13042 * unexw32.c (get_section_info): Remove unused variable `section'.
13043
13044 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
13045 (system_process_attributes): Remove unused variable `sess'.
13046 (sys_read): Remove unused variable `err'.
13047
13048 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
13049 (w32_wnd_proc): Remove unused variable `isdead'.
13050 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
13051 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
13052 (x_create_tip_frame): Remove unused variable `tem'.
13053
13054 * w32inevt.c (w32_console_read_socket):
13055 Remove unused variable `no_events'.
13056
13057 * w32term.c (x_draw_composite_glyph_string_foreground):
13058 Remove unused variable `width'.
13059
1149507c
JB
130602011-03-24 Juanma Barranquero <lekktu@gmail.com>
13061
13062 * w32term.c (x_set_glyph_string_clipping):
13063 Don't pass uninitialized region to CombineRgn.
13064
9c88f339
JB
130652011-03-23 Juanma Barranquero <lekktu@gmail.com>
13066
13067 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
13068 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
13069 (Fx_close_connection): Remove unused variable `i'.
13070
13071 * w32font.c (w32font_draw): Return number of glyphs.
13072 (w32font_open_internal): Remove unused variable `i'.
13073 (w32font_driver): Add missing initializer.
13074
13075 * w32menu.c (utf8to16): Remove unused variable `utf16'.
13076 (fill_in_menu): Remove unused variable `items_added'.
13077
13078 * w32term.c (last_mouse_press_frame): Remove static global variable.
13079 (w32_clip_to_row): Remove unused variable `f'.
13080 (x_delete_terminal): Remove unused variable `i'.
13081
13082 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
13083 (NOTHING): Remove unused static global variable.
13084 (uniscribe_check_otf): Remove unused variable `table'.
13085 (uniscribe_font_driver): Add missing initializers.
13086
dee091a3
JD
130872011-03-23 Julien Danjou <julien@danjou.info>
13088
13089 * term.c (Fsuspend_tty, Fresume_tty):
13090 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
13091 * window.c (temp_output_buffer_show):
13092 * insdel.c (signal_before_change):
13093 * frame.c (Fhandle_switch_frame):
13094 * fileio.c (Fdo_auto_save):
13095 * emacs.c (Fkill_emacs):
13096 * editfns.c (save_excursion_restore):
13097 * cmds.c (internal_self_insert):
13098 * callint.c (Fcall_interactively):
13099 * buffer.c (Fkill_all_local_variables):
13100 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
13101 Use Frun_hooks.
0f4a96b5 13102 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 13103 unconditionally since it does the check itself.
dee091a3 13104
2c520ab5 131052011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 13106
c9c49752
PE
13107 Fix more problems found by GCC 4.5.2's static checks.
13108
8abc3f12
PE
13109 * coding.c (encode_coding_raw_text): Avoid unnecessary test
13110 the first time through the loop, since we know p0 < p1 then.
13111 This also avoids a gcc -Wstrict-overflow warning.
13112
a2d26660
PE
13113 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
13114 leading to a memory leak, possible in functions like
13115 load_charset_map_from_file that can allocate an unbounded number
b12ef411 13116 of objects (Bug#8318).
a2d26660 13117
916c72e9
PE
13118 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
13119 that could (at least in theory) be that large.
13120
19ab8a18
PE
13121 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
13122 This is less likely to overflow, and avoids undefined behavior if
13123 overflow does occur. All callers changed. Use strtoul to scan
13124 for the unsigned long integer.
b7cbbd6f
PE
13125 (pint2hrstr): Simplify and tune code slightly.
13126 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 13127
f0641eff
PE
13128 * scroll.c (do_scrolling): Work around GCC bug 48228.
13129 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
13130
7f650bb9
PE
13131 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
13132 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
13133 (validate_x_resource_name): Simplify count usage.
13134 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 13135
37dd57d1
PE
13136 * fileio.c (Fcopy_file): Report error if fchown or fchmod
13137 fail (Bug#8306).
81e56e61 13138
699979fc 13139 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 13140
401bf9b4
PE
13141 * process.c (Fmake_network_process): Use socklen_t, not int,
13142 where POSIX says socklen_t is required in portable programs.
13143 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 13144 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
13145 (Fmake_network_process, server_accept_connection):
13146 (wait_reading_process_output, read_process_output):
13147 Likewise.
13148
b93aacde
PE
13149 * process.c: Rename or move locals to avoid shadowing.
13150 (list_processes_1, Fmake_network_process):
13151 (read_process_output_error_handler, exec_sentinel_error_handler):
13152 Rename or move locals.
4dc343ee 13153 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 13154 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 13155 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 13156 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 13157 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 13158
af8a867c 13159 Make tparam.h and terminfo.c consistent.
44f230aa
SM
13160 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
13161 Include tparam.h instead, since it declares them.
af8a867c
PE
13162 * cm.h (PC): Remove extern decl; tparam.h now does this.
13163 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
13164 * terminfo.c: Include tparam.h, to check interfaces.
13165 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
13166 (tparam): Adjust signature to match interface in tparam.h;
13167 this removes some undefined behavior. Check that outstring and len
13168 are zero, which they always are with Emacs.
13169 * tparam.h (PC, BC, UP): New extern decls.
13170
0248044d 13171 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 13172 (xftfont_open): Rename locals to avoid shadowing.
0248044d 13173
8ff096c1 13174 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
13175 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
13176 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 13177 (ftfont_list): Remove unused local.
49eaafba
PE
13178 (get_adstyle_property, ftfont_pattern_entity):
13179 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
13180 Rename locals to avoid shadowing.
8ff096c1 13181
e2be39f6
PE
13182 * xfont.c (xfont_list_family): Mark var as initialized.
13183
c9735e30
PE
13184 * xml.c (make_dom): Now static.
13185
8f5201ae
PE
13186 * composite.c (composition_compute_stop_pos): Rename local to
13187 avoid shadowing.
b246f932
PE
13188 (composition_reseat_it): Remove unused locals.
13189 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 13190 (composition_update_it): Mark var as initialized.
11b61122
PE
13191 (find_automatic_composition): Mark vars as initialized,
13192 with a FIXME (Bug#8290).
8f5201ae 13193
760fbc2c
PE
13194 character.h: Rename locals to avoid shadowing.
13195 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
13196 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
13197 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
13198 (BUF_DEC_POS): Be more systematic about renaming local temporaries
13199 to avoid shadowing.
13200
ff08eb85
PE
13201 * textprop.c (property_change_between_p): Remove; unused.
13202
fc7bf025
PE
13203 * intervals.c (interval_start_pos): Now static.
13204
235d7abc
PE
13205 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
13206
44f230aa
SM
13207 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
13208 Rename locals to avoid shadowing.
3e7d6594 13209
50060332
PE
13210 * sound.c (wav_play, au_play, Fplay_sound_internal):
13211 Fix pointer signedness.
d01f234b 13212 (alsa_choose_format): Remove unused local var.
c83b8872
PE
13213 (wav_play): Initialize a variable to 0, to prevent undefined
13214 behavior (Bug#8278).
50060332 13215
c4fc4e30
PE
13216 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
13217
918436ed
PE
13218 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
13219
c939f91b
PE
13220 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
13221 clobbering (Bug#8298).
b9c7f648
PE
13222 * sysdep.c (sys_subshell): Likewise.
13223 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 13224
6bd8c144
PE
13225 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
13226 This should get cleaned up, so that child_setup has the
13227 same signature on all platforms.
13228
7710357c 13229 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 13230 (relocate_fd): Rename locals to avoid shadowing.
7710357c 13231
c59da222
CY
132322011-03-22 Chong Yidong <cyd@stupidchicken.com>
13233
13234 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
13235 not to be necessary, and produces flickering.
13236
66b87493
GM
132372011-03-20 Glenn Morris <rgm@gnu.org>
13238
13239 * config.in: Remove file.
13240
45b6f6d5
JB
132412011-03-20 Juanma Barranquero <lekktu@gmail.com>
13242
13243 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
13244 are now in src/globals.h.
13245 (syms_of_minibuf): Remove spurious & from previous change.
13246
cd394be1 132472011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
13248
13249 * minibuf.c (completing-read-function): New variable.
13250 (completing-read-default): Rename from completing-read.
13251 (completing-read): Call completing-read-function.
13252
b14e3e21
CY
132532011-03-19 Juanma Barranquero <lekktu@gmail.com>
13254
13255 * xfaces.c (Fx_load_color_file):
13256 Read color file from absolute filename (bug#8250).
13257
f2b726e6
JB
132582011-03-19 Juanma Barranquero <lekktu@gmail.com>
13259
13260 * makefile.w32-in: Update dependencies.
13261
09f6ff02
EZ
132622011-03-17 Eli Zaretskii <eliz@gnu.org>
13263
13264 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
13265
29a6015a
PE
132662011-03-17 Paul Eggert <eggert@cs.ucla.edu>
13267
a3a6c54e
PE
13268 Fix more problems found by GCC 4.5.2's static checks.
13269
b766f867
PE
13270 * process.c (make_serial_process_unwind, send_process_trap):
13271 (sigchld_handler): Now static.
13272
be02381c
PE
13273 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
13274 That way, the code declares only the vars that it needs.
13275 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
13276 * s/cygwin.h (PTY_ITERATION): Likewise.
13277 * s/darwin.h (PTY_ITERATION): Likewise.
13278 * s/gnu-linux.h (PTY_ITERATION): Likewise.
13279
57048744
PE
13280 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
13281 * process.c (allocate_pty): Don't declare stb unless it's needed.
13282
7914961c 13283 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
13284 (CONSTANTLIM): Remove; unused.
13285 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
13286 Define only if needed.
7914961c 13287
b3967b18
PE
13288 * unexelf.c (unexec): Name an expression,
13289 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
13290 Use a different way to cause a compilation error if anyone uses
13291 n rather than nn, a way that does not involve shadowing.
73366a00 13292 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 13293
29a6015a
PE
13294 * deps.mk (unexalpha.o): Remove; unused.
13295
43cfc33e 13296 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 13297 * unexec.h: New file.
ce701a33
PE
13298 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13299 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13300 Depend on unexec.h.
13301 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13302 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13303 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 13304 Change as necessary to match prototype in unexec.h.
ce701a33 13305
01f44d5a
PE
13306 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13307 shadowing.
4f63c6bb 13308 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 13309
a6670b0b
PE
13310 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13311 Rename locals to avoid shadowing.
13312
cef2010d 13313 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 13314 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 13315
d4d7173a
PE
13316 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13317
f08b802a
PE
13318 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13319 warning when compiling print.c.
13320
3ddb0639
PE
13321 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13322 instead of using an uninitialized var.
5ad03b97 13323 (font_sort_entities): Mark var as initialized.
3ddb0639 13324
170a2692
PE
13325 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13326
e663c700
PE
13327 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13328 pointers to constants.
89bc529a 13329 (font_parse_fcname): Remove unused vars.
7b81e2d0 13330 (font_delete_unmatched): Now static.
ea838e10 13331 (font_get_spec): Remove; unused.
13a547c6
PE
13332 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13333 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13334 Rename or move locals to avoid shadowing.
e663c700 13335
2a80c887 13336 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 13337 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 13338
1384fa33 13339 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 13340 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 13341
8b2c52e9
PE
13342 * alloc.c (mark_backtrace): Move decl from here ...
13343 * lisp.h: ... to here, so that it can be checked.
13344
475545b5 13345 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 13346 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
13347 (lisp_indirect_variable): Name an expression,
13348 to avoid gcc -Wbad-function-cast warning.
1faed8ae 13349 (Fdefvar): Rename locals to avoid shadowing.
475545b5 13350
b1349114 13351 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 13352 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 13353 Use const pointer when appropriate.
b1349114 13354
a2928364
PE
13355 * lisp.h (get_system_name, get_operating_system_release):
13356 Move decls here, to check interfaces.
13357 * process.c (get_operating_system_release): Move decl to lisp.h.
13358 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
13359 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13360 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13361 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
13362 (Fformat_time_string, Fencode_time, Finsert_char):
13363 (Ftranslate_region_internal, Fformat):
13364 Rename or remove local vars to avoid shadowing.
9710023e 13365 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 13366
a415e694
PE
13367 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13368 avoid shadowing.
13369
8ef4622d
PE
13370 * lisp.h (eassert): Check that the argument compiles, even if
13371 ENABLE_CHECKING is not defined.
13372
946f9a5b
PE
13373 * data.c (Findirect_variable): Name an expression, to avoid
13374 gcc -Wbad-function-cast warning.
112396d6 13375 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 13376 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
13377 (Fmake_variable_buffer_local, Fmake_local_variable):
13378 Mark variables as initialized.
52746918 13379 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 13380
e5aab7e7 13381 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
13382 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
13383 Rename locals to avoid shadowing.
dff45157
PE
13384 (mark_stack): Move local variables into the #ifdef region where
13385 they're used.
7bc26fdb
PE
13386 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
13387 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13388 needed otherwise.
13389 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13390 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13391 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13392
e5aab7e7
PE
13393 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13394 avoids undefined behavior in theory.
13395
4da60324
PE
13396 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13397
88043301
PE
13398 Use functions, not macros, for up- and down-casing (Bug#8254).
13399 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13400 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13401 to use the following functions instead of these macros.
13402 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13403 EMACS_INT, since callers assume the returned value fits in int.
13404 (upcase1): Likewise, for UPCASE_TABLE.
13405 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13406 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13407 the race-condition problem in the old DOWNCASE.
88043301 13408
19ed5445
PE
13409 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13410 Rename locals to avoid shadowing.
13411 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13412 (regex_compile, re_search_2, re_match_2_internal):
13413 Remove unused local vars.
952db0d7
PE
13414 (FREE_VAR): Rewrite so as not to use empty "else",
13415 which gcc can warn about.
da053e48 13416 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13417 (RETALLOC_IF): Define only if needed.
13418 (WORDCHAR_P): Likewise. This one is never needed, but is used
13419 only in a comment talking about a compiler bug, so put inside
13420 the #if 0 of that comment.
13421 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13422 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13423 Remove; unused.
19ed5445 13424
1f3561e4 13425 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13426 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13427 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13428
ded6f8f7
PE
13429 * search.c (simple_search): Remove unused var.
13430
dbd37a95
PE
13431 * dired.c (compile_pattern): Move decl from here ...
13432 * lisp.h: ... to here, so that it can be checked.
13433 (struct re_registers): New forward decl.
13434
7e47afad
PE
13435 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13436
85f24f61
PE
13437 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13438 All uses changed.
13439 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13440 Rename locals to avoid shadowing.
5671df8f 13441 (Fvertical_motion): Mark locals as initialized.
85f24f61 13442
181aa2be 13443 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13444 (casify_region): Mark local as initialized.
181aa2be 13445
930d429c
PE
13446 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13447
7082eac6
PE
13448 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13449 New macros, so that the caller can use some names other than
13450 gcpro1, gcpro2, etc.
13451 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13452 of the new macros.
13453 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13454 argument, for consistency with GCPRO2_VAR, etc: it is now the
13455 prefix of the variable, not the variable itself. All uses
13456 changed.
38b2c076
PE
13457 * dired.c (directory_files_internal, file_name_completion):
13458 Rename locals to avoid shadowing.
13459
15206ed9
PE
13460 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13461 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13462 dired.c's scmp function, had undefined behavior.
13463 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13464 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13465 * buffer.h: ... to here, because these macros use current_buffer,
13466 and the new implementation with inline functions needs to have
13467 current_buffer in scope now, rather than later when the macros
13468 are used.
13469 (downcase, upcase1): New static inline functions.
13470 (DOWNCASE, UPCASE1): Reimplement using these functions.
13471 This avoids undefined behavior in expressions like
13472 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13473 from race conditions in accessing the global variables
13474 case_temp1 and case_temp2.
13475 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13476 * lisp.h (case_temp1, case_temp2): Remove their decls.
13477 * character.h (ASCII_CHAR_P): Move from here ...
13478 * lisp.h: ... to here, so that the inline functions mentioned
13479 above can use them.
13480
4a6bea26
PE
13481 * dired.c (directory_files_internal_unwind): Now static.
13482
f14b7e14
PE
13483 * fileio.c (file_name_as_directory, directory_file_name):
13484 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13485 Now static.
2893f146
PE
13486 (file_name_as_directory): Use const pointers when appropriate.
13487 (Fexpand_file_name): Likewise. In particular, newdir might
13488 point at constant storage, so make it a const pointer.
fd4ead52 13489 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13490 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13491 signedness issues.
f839df0c
PE
13492 (Fset_file_times, Finsert_file_contents, auto_save_error):
13493 Rename locals to avoid shadowing.
f14b7e14 13494
5716756e 13495 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13496 (Ftry_completion, Fall_completions): Rename or remove locals
13497 to avoid shadowing.
5716756e 13498
b4c3046a
PE
13499 * marker.c (bytepos_to_charpos): Remove; unused.
13500
b45db522
PE
13501 * lisp.h (verify_bytepos, count_markers): New decls,
13502 so that gcc does not warn that these functions aren't declared.
13503
85876d07
PE
13504 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13505 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13506 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13507 (copy_text): Remove unused local var.
85876d07 13508
03d78a21 13509 * filelock.c (within_one_second): Now static.
b3dd38ab 13510 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13511
5df8f01b
PE
13512 * buffer.c (fix_overlays_before): Mark locals as initialized.
13513 (fix_start_end_in_overlays): Likewise. This function should be
13514 simplified by using pointers-to-pointers, but that's a different
13515 matter.
b1d876f1 13516 (switch_to_buffer_1): Now static.
8f54f30a
PE
13517 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13518 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13519
a70072c9 13520 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13521 Fix pointer signedness issue.
edced198
PE
13522 (sys_subshell): Mark local as volatile if checking for lint,
13523 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13524 (MAXPATHLEN): Define only if needed.
a70072c9 13525
a0977c44
PE
13526 * process.c (serial_open, serial_configure): Move decls from here ...
13527 * systty.h: ... to here, so that they can be checked.
13528
a884fdcc
PE
13529 * fns.c (get_random, seed_random): Move extern decls from here ...
13530 * lisp.h: ... to here, so that they can be checked.
13531
604efe86 13532 * sysdep.c (reset_io): Now static.
b8950c94 13533 (wait_for_termination_signal): Remove; unused.
604efe86 13534
38fc62d9
PE
13535 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13536 (copy_keymap_item, append_key, push_text_char_description):
13537 Now static.
1004a21a 13538 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13539 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13540 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13541 (describe_map_tree):
13542 Rename locals to avoid shadowing.
38fc62d9 13543
2f2650da
PE
13544 * keyboard.c: Declare functions static if they are not used elsewhere.
13545 (echo_char, echo_dash, cmd_error, top_level_2):
13546 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13547 (read_char, kbd_buffer_get_event, make_lispy_position):
13548 (make_lispy_event, make_lispy_movement, apply_modifiers):
13549 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13550 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13551 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13552 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13553 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13554
a053e86c 13555 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13556 (mark_kboards): Move decl here ...
13557 * alloc.c (mark_kboards): ... from here.
a053e86c 13558
4752793e
PE
13559 * lisp.h (force_auto_save_soon): New decl.
13560
74f10ca7 13561 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13562 (DEFINE_DUMMY_FUNCTION): New macro.
13563 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13564 Use it.
c03cd23f
PE
13565 (main): Add casts to avoid warnings
13566 if GCC considers string literals to be constants.
74f10ca7 13567
022e70d4
PE
13568 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13569
59d6fe83
PE
13570 * dbusbind.c: Pointer signedness fixes.
13571 (xd_signature, xd_append_arg, xd_initialize):
13572 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13573 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13574 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13575 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13576
78320123
PE
13577 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13578 if GCC considers string literals to be constants.
49cebcca 13579 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13580
35ac2a97
SM
135812011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13582
fb103ca9
SM
13583 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13584 (print_preprocess, print_object): New macro to fix last change.
13585
35ac2a97
SM
13586 * print.c (print_preprocess): Don't forget font objects.
13587
62973b41
JB
135882011-03-16 Juanma Barranquero <lekktu@gmail.com>
13589
13590 * emacs.c (USAGE3): Doc fixes.
13591
0e48bb22
AS
135922011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13593
13594 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13595 structure.
13596
7684e57b
JB
135972011-03-14 Juanma Barranquero <lekktu@gmail.com>
13598
13599 * lisp.h (VWindow_system, Qfile_name_history):
13600 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13601 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13602 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13603
13604 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13605 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13606
13607 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13608 * w32console.c (detect_input_pending, read_input_pending)
13609 (encode_terminal_code):
13610 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13611 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13612 (w32_system_caret_y, Qfile_name_history):
13613 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13614 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13615 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13616 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13617 * w32proc.c (Qlocal, report_file_error):
13618 * w32term.c (Vwindow_system, updating_frame):
13619 * w32uniscribe.c (initialized, uniscribe_font_driver):
13620 Remove unneeded extern declarations.
13621
2aa46d6c
CY
136222011-03-14 Chong Yidong <cyd@stupidchicken.com>
13623
c96bbc66 13624 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13625
cffc6f3b
CY
136262011-03-13 Chong Yidong <cyd@stupidchicken.com>
13627
13628 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13629 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13630 These macros can no longer be used for assignment.
13631
44f230aa
SM
13632 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13633 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13634 (record_buffer_markers, fetch_buffer_markers): New functions for
13635 recording and fetching special buffer markers.
13636 (set_buffer_internal_1, set_buffer_temp): Use them.
13637
13638 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13639
13640 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13641
13642 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13643 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13644
13645 * xdisp.c (hscroll_window_tree):
13646 (reconsider_clip_changes): Use PT instead of BUF_PT.
13647
d251f04b
EZ
136482011-03-13 Eli Zaretskii <eliz@gnu.org>
13649
13650 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13651 $(EMACS_ROOT)/lib/intprops.h.
13652
f0c77cd1
PE
136532011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13654
3eca4629
PE
13655 Fix more problems found by GCC 4.5.2's static checks.
13656
7c86ee98
PE
13657 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13658 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13659 (xg_free_frame_widgets): Make it clear that a local variable is
13660 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13661 (gdk_window_get_screen): Make it clear that this macro is needed
13662 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13663 (int_gtk_range_get_value): New function, which avoids a diagnostic
13664 from gcc -Wbad-function-cast.
13665 (xg_set_toolkit_scroll_bar_thumb): Use it.
13666 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13667 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13668 (get_utf8_string, xg_get_file_with_chooser):
13669 Rename locals to avoid shadowing.
13670 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13671
41729b81
PE
13672 * xgselect.c (xg_select): Remove unused var.
13673
f0c77cd1
PE
13674 * image.c (four_corners_best): Mark locals as initialized.
13675 (gif_load): Initialize transparent_p to zero (Bug#8238).
13676 Mark another local as initialized.
ec6cf4c6 13677 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13678
ce0ad53d 13679 * image.c (clear_image_cache): Now static.
d5d5a617 13680 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13681 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13682 (x_edge_detection): Remove unnecessary cast that
13683 gcc -Wbad-function-cast diagnoses.
2037898d 13684 (gif_load): Fix pointer signedness.
6ae141d6
PE
13685 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13686 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13687
33383987 136882011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13689
d32df629
PE
13690 Improve quality of tests for time stamp overflow.
13691 For example, without this patch (encode-time 0 0 0 1 1
13692 1152921504606846976) returns the obviously-bogus value (-948597
13693 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13694 reports time overflow. See
13695 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13696 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13697 * editfns.c: Include limits.h and intprops.h.
13698 (TIME_T_MIN, TIME_T_MAX): New macros.
13699 (time_overflow): Move earlier, to before first use.
13700 (hi_time, lo_time): New functions, for an accurate test for
13701 out-of-range times.
13702 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13703 (Fget_internal_run_time): Don't assume time_t fits in int.
13704 (make_time): Use list2 instead of Fcons twice.
13705 (Fdecode_time): More accurate test for out-of-range times.
13706 (check_tm_member): New function.
13707 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13708 (lisp_time_argument): Don't rely on undefined left-shift and
13709 right-shift behavior when checking for time stamp overflow.
8be6f318 13710
fe31d94c
PE
13711 * editfns.c (time_overflow): New function, refactoring common code.
13712 (Fformat_time_string, Fdecode_time, Fencode_time):
13713 (Fcurrent_time_string): Use it.
13714
8be6f318
PE
13715 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13716 * dired.c (make_time): Move to ...
13717 * editfns.c (make_time): ... here.
13718 * systime.h: Note the move.
13719
09d9db2c 137202011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13721
126bc0dc
YM
13722 * fringe.c (update_window_fringes): Remove unused variables.
13723
c47cbdfd
YM
13724 * unexmacosx.c (copy_data_segment): Also copy __got section.
13725 (Bug#8223)
13726
7ac80be9
EZ
137272011-03-12 Eli Zaretskii <eliz@gnu.org>
13728
c96bbc66 13729 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13730 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13731 Constify `char *' arguments and their references according to
13732 prototypes in tparam.h.
13733
ecb0f94d 13734 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13735
7ac80be9
EZ
13736 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13737 Adapt all references accordingly.
13738
13739 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13740
ef1fd07e
TT
137412011-03-11 Tom Tromey <tromey@redhat.com>
13742
13743 * buffer.c (syms_of_buffer): Remove obsolete comment.
13744
7ef4b50c
EZ
137452011-03-11 Eli Zaretskii <eliz@gnu.org>
13746
13747 * termhooks.h (encode_terminal_code): Declare prototype.
13748
13749 * msdos.c (encode_terminal_code): Don't declare prototype.
13750
13751 * term.c (encode_terminal_code): Now external again, used by
13752 w32console.c and msdos.c.
13753
44f230aa
SM
13754 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13755 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13756
4b1ec863 137572011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13758
1714f52b 13759 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13760
4b1ec863
PE
13761 * fringe.c (update_window_fringes): Mark locals as initialized
13762 (Bug#8227).
13763 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13764
524c7aa6
PE
13765 * alloc.c (mark_fringe_data): Move decl from here ...
13766 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13767 to check its interface.
13768 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13769
a5c0af81 13770 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13771 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13772 (fontset_font): Mark local as initialized.
a9a06e0b 13773 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13774
b4716021
PE
13775 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13776
811e9bac 13777 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13778 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13779 (x_own_selection, Fx_disown_selection_internal): Rename locals
13780 to avoid shadowing.
13781 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13782
7e3ab302
PE
13783 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13784 so that the caller can use some name other than gcpro1.
13785 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13786 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13787 (Fx_backspace_delete_keys_p):
13788 Use them to avoid shadowing, and rename vars to avoid shadowing.
13789 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13790 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13791 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13792 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13793 Remove unused locals.
7e3ab302
PE
13794 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13795 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13796 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13797 macros.
f78faa98 13798
e2b13473
PE
13799 * xterm.h (x_mouse_leave): New decl.
13800
77f23912
PE
13801 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13802 Remove unused functions.
cdf4ba58
PE
13803 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13804 (x_calc_absolute_position): Now static.
7411c686 13805 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13806 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13807 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13808 unless they are used.
38d0b34a
PE
13809 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13810 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13811 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13812 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13813 (x_error_catcher, x_connection_closed, x_error_handler):
13814 (x_error_quitter, xembed_send_message, x_iconify_frame):
13815 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13816 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13817 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13818
44f230aa
SM
13819 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13820 Rename or move locals to avoid shadowing.
6b463e58 13821 (tty_defined_color, merge_face_heights): Now static.
5967d051 13822 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13823 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13824 does not deduce is never used uninitialized.
73719eba
PE
13825 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13826 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13827
426994c3 13828 * terminal.c (store_terminal_param): Now static.
5489860b 13829
032f1620 13830 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13831 (set_frame_menubar): Remove unused local.
d4323972 13832 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13833 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13834 since they might point to immutable storage.
281585b0
PE
13835 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13836 since it's unused otherwise.
032f1620 13837
367c19e5 13838 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13839 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13840 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13841 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13842 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13843 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13844 does not deduce are never used uninitialized.
70739cbe 13845
07b48fa9
PE
13846 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13847
8868a238 13848 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13849 * window.c (window_loop, size_window):
13850 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13851
7e5cf297 13852 * window.c (display_buffer): Now static.
d6550a9f
PE
13853 (size_window): Mark variables that gcc -Wuninitialized
13854 does not deduce are never used uninitialized.
a586633d
PE
13855 * window.h (check_all_windows): New decl, to forestall
13856 gcc -Wmissing-prototypes diagnostic.
5b555da1 13857 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13858
f6095868
PE
13859 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13860 shadowing.
13861 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13862 Include <limits.h>.
13863 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13864 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13865 (load_charset_map): Mark variables that gcc -Wuninitialized
13866 does not deduce are never used uninitialized.
53df7c11 13867 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13868
f38b440c
PE
13869 * coding.c (coding_set_source, coding_set_destination):
13870 Use "else { /* comment */ }" rather than "else /* comment */;"
13871 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13872 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13873 a block, when the outer 'i' will do.
13874 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13875 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13876 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13877 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13878 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13879 Rename locals to avoid shadowing.
13880 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13881 * coding.c (emacs_mule_char, encode_invocation_designation):
13882 Now static, since they're not used elsewhere.
413bb2db 13883 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13884 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13885 (decode_coding_emacs_mule): Mark variables that gcc
13886 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13887 (detect_coding_iso_2022): Initialize a local variable that might
13888 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13889 this initialization is needed. (Bug#8211)
5f58e762
PE
13890 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13891 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13892 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13893 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13894 Remove unused macros.
f38b440c 13895
232b38b9 13896 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13897 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13898 * character.c (string_count_byte8): Likewise.
232b38b9 13899
fb90da1b
PE
13900 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13901 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13902
fb93dbc2
PE
13903 * chartab.c (copy_sub_char_table): Now static, since it's not used
13904 elsewhere.
5c156ace
PE
13905 (sub_char_table_ref_and_range, char_table_ref_and_range):
13906 Rename locals to avoid shadowing.
bbcd0949 13907 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13908
7d3b3862 13909 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13910 (BIDI_BOB): Remove unused macro.
7d3b3862 13911
6be7d3da
PE
13912 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13913 deduce are never used uninitialized.
c2ed9c8b 13914 * term.c (encode_terminal_code): Likewise.
6be7d3da 13915
75f8807f 13916 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13917
50938595
PE
13918 * tparam.h: New file.
13919 * term.c, tparam.h: Include it.
13920 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13921 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13922 Move these decls to tparam.h, and make them agree with what
13923 is actually in tparam.c. The previous trick of using incompatible
13924 decls in different modules does not conform to the C standard.
13925 All callers of tparam changed to use tparam's actual API.
13926 * tparam.c (tparam1, tparam, tgoto):
13927 Use const pointers where appropriate.
13928
fbceeba2
PE
13929 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13930 * cm.h (struct cm): Likewise.
13931 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13932 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13933 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13934 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13935 (turn_on_face, init_tty): Likewise.
13936 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13937
7f3f1250
PE
13938 * term.c (term_mouse_position): Rename local to avoid shadowing.
13939
e6ca6543
PE
13940 * alloc.c (mark_ttys): Move decl from here ...
13941 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13942
c40f8d15
AS
139432011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13944
13945 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13946
cfe0661d
JB
139472011-03-09 Juanma Barranquero <lekktu@gmail.com>
13948
13949 * search.c (compile_pattern_1): Remove argument regp, unused since
13950 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13951 (compile_pattern): Don't pass it.
13952
0afb4571
J
139532011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13954
13955 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13956 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13957 for ! HAVE_GTK3.
13958 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13959
13960 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13961
13962 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13963 gdk_window_get_screen, gdk_window_get_geometry,
13964 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13965 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13966 (xg_get_pixbuf_from_pixmap): New function.
13967 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13968 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13969 Call xg_get_pixbuf_from_pixmap instead of
13970 gdk_pixbuf_get_from_drawable.
13971 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13972 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13973 (xg_check_special_colors): Use GtkStyleContext and its functions
13974 for HAVE_GTK3.
13975 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13976 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13977 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13978 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13979 Call gtk_widget_get_preferred_size.
0afb4571
J
13980 (xg_frame_resized): gdk_window_get_geometry only takes 5
13981 parameters.
44f230aa
SM
13982 (xg_win_to_widget, xg_event_is_for_menubar):
13983 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13984 (xg_set_widget_bg): New function.
13985 (delete_cb): New function.
895009e1 13986 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13987 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13988 (xg_set_background_color): Call xg_set_widget_bg.
13989 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13990 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13991 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13992 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13993 if ! HAVE_GTK3.
13994 (update_frame_tool_bar): Call gtk_widget_hide.
13995 (xg_initialize): Use GDK_KEY_g.
13996
13997 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13998 if ! HAVE_GTK3
13999 (x_session_initialize): Call gdk_x11_set_sm_client_id.
14000
14001 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
14002 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
14003 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
14004
1c2cc4ef
JB
140052011-03-08 Juanma Barranquero <lekktu@gmail.com>
14006
14007 * w32xfns.c (select_palette): Check success of RealizePalette against
14008 GDI_ERROR, not zero.
14009
33383987 14010See ChangeLog.11 for earlier changes.
aac0c6e3
MR
14011
14012;; Local Variables:
14013;; coding: utf-8
aac0c6e3
MR
14014;; End:
14015
2f097256 14016 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
14017
14018 This file is part of GNU Emacs.
14019
14020 GNU Emacs is free software: you can redistribute it and/or modify
14021 it under the terms of the GNU General Public License as published by
14022 the Free Software Foundation, either version 3 of the License, or
14023 (at your option) any later version.
14024
14025 GNU Emacs is distributed in the hope that it will be useful,
14026 but WITHOUT ANY WARRANTY; without even the implied warranty of
14027 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14028 GNU General Public License for more details.
14029
14030 You should have received a copy of the GNU General Public License
14031 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.