nnir.el ("nnir"): Add 'virtual ability to nnir backend
[bpt/emacs.git] / src / ChangeLog
CommitLineData
372f8ffc
DA
12012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Swap buffer text indirection counters in Fbuffer_swap_text.
4 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5 This avoids crash reported by Christoph Scholtes at
6 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
7
9d7fa573
JD
82012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9
10 * nsmenu.m (Popdown_data): New struct.
11 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
12 free Popdown_data.
13 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
14 (initWithContentRect): Make imgView and contentView non-static
15 and autorelease them. Also autorelease img and matrix (Bug#12005).
16 (dealloc): Remove (Bug#12005).
17
0dd6d66d
DA
182012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
19
20 Adjust consing_since_gc when objects are explicitly freed.
21 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
22 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
23 (free_cons, free_misc): Subtract object size from consing_since_gc.
24
d36d71df
DA
252012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
26
27 Simplify and cleanup markers positioning code.
28 * marker.c (attach_marker): More useful eassert.
29 (live_buffer, set_marker_internal): New function.
30 (Fset_marker, set_marker_restricted): Use set_marker_internal.
31 (set_marker_both, set_marker_restricted_both): Use live_buffer.
32
fb9ea40f
PE
332012-07-22 Paul Eggert <eggert@cs.ucla.edu>
34
35 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
36 as it's limited by the amount of memory, not by INT_MAX.
37
2d5c5f7d
EZ
382012-07-21 Eli Zaretskii <eliz@gnu.org>
39
07fb592e
EZ
40 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
41 in special-event-map. See the discussion at
42 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
43 for the reasons.
44
37a9eac8 45 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2d5c5f7d
EZ
46 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
47 Fabrice Popineau <fabrice.popineau@supelec.fr>.
48
c4328746
JD
492012-07-21 Jan Djärv <jan.h.d@swipnet.se>
50
51 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 52 (conversationIdentifier): Return value is NSInteger.
784051c4 53 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 54
6e5d1c12
CY
552012-07-21 Chong Yidong <cyd@gnu.org>
56
57 * window.c (decode_any_window): Signal an error if the window is
58 on a dead frame (Bug#11984).
59
9928463d
DA
602012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
61
62 Add indirection counting to speed up Fkill_buffer.
63 * buffer.h (struct buffer): New member.
64 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
65 (Fmake_indirect_buffer): Set indirection counter to -1, increment
66 base buffer indirection counter.
67 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
68 (Fkill_buffer): Adjust indirection counters as needed, don't walk
69 through buffer list if indirection counter is 0.
70
f8643a6b
DA
712012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
72
73 Extend the value returned by Fgarbage_collect with heap statistics.
74 * alloc.c (Qheap): New symbol.
75 (syms_of_alloc): DEFSYM it.
76 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
77 (Fmemory_free): Remove.
78 (syms_of_alloc): Don't defsubr it.
79 * buffer.c (Fcompact_buffer): Remove.
80 (syms_of_buffer): Don't defsubr it.
81
dac616ff
DA
822012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
83
84 Make maybe_gc inline.
85 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
86 * lisp.h (consing_since_gc, gc_relative_threshold)
87 (memory_full_cons_threshold): Revert declaration.
88 (maybe_gc): Remove prototype, define as inline.
89 * alloc.c: Remove old commented-out code.
90 (consing_since_gc, gc_relative_threshold)
91 (memory_full_cons_threshold): Revert to global.
92 (maybe_gc): Remove.
93
d7ea76b4
DA
942012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
95
96 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
97 * lisp.h (build_unibyte_string): New function.
98 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
99 * sysdep.c, w32fns.c, xfns.c: Use it.
100 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
101 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
102 Adjust users accordingly.
103 * font.h (font_open_by_name): Adjust prototype.
104
765e61e3
DA
1052012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
106
107 Cleanup calls to Fgarbage_collect.
108 * lisp.h (maybe_gc): New prototype.
109 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
110 Remove declarations.
111 * alloc.c (maybe_gc): New function.
112 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
113 Make them static.
114 * bytecode.c (MAYBE_GC): Use maybe_gc.
115 * eval.c (eval_sub, Ffuncall): Likewise.
116 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
117 to avoid dependency from auto-save feature.
118
52b852c7
PE
1192012-07-19 Paul Eggert <eggert@cs.ucla.edu>
120
121 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
122 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
123 'for_each_per_buffer_object_at'.
124 All uses changed. It's better to use upper-case for macros that
125 cannot be implemented as functions, to give the reader a clue
126 that they're special.
127
5db81e33
SM
1282012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
129
130 * alloc.c (Fgarbage_collect): Tweak docstring.
131
5b835e1d
DA
1322012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
133
134 Tweak the value returned from Fgarbage_collect again.
135 * alloc.c (Fgarbage_collect): New return value, as confirmed in
136 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
137 Adjust documentation.
138 (total_vector_bytes): Rename to total_vector_slots, adjust
139 accounting.
140 (total_free_vector_bytes): Rename to total_free_vector_slots,
141 adjust accounting.
142 (Qstring_bytes, Qvector_slots): New symbols.
143 (syms_of_alloc): DEFSYM them.
144
9cd47b72
DA
1452012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
146
147 Buffer compaction primitive which may be used from Lisp.
148 * buffer.c (compact_buffer, Fcompact_buffer): New function.
149 (syms_of_buffer): Register Fcompact_buffer.
150 * alloc.c (Fgarbage_collect): Use compact_buffer.
151 * buffer.h (compact_buffer): New prototype.
152 (struct buffer_text): New member.
153
d17337e5
DA
1542012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
155
156 New macro to iterate over all buffers, miscellaneous cleanups.
157 * lisp.h (all_buffers): Remove declaration.
158 * buffer.h (all_buffers): Add declaration, with comment.
159 (for_each_buffer): New macro.
160 * alloc.c (Fgarbage_collect, mark_object): Use it.
161 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
162 (init_buffer): Likewise.
163 * data.c (Fset_default): Likewise.
164 * coding.c (code_conversion_restore): Remove redundant check
165 for dead buffer.
166 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
167
60cfd278
AS
1682012-07-18 Andreas Schwab <schwab@linux-m68k.org>
169
170 Fix bug that created negative-length intervals.
171 * intervals.c (merge_interval_right, merge_interval_left):
172 Do not zero out this interval if it is absorbed by its children,
173 as this interval's total length doesn't change in that case. See
174 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
175
d06714cb
PE
1762012-07-18 Paul Eggert <eggert@cs.ucla.edu>
177
83713154
PE
178 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
179 when invoking (make-bool-vector N t) and N is a positive
180 multiple of 8 -- the last 8 bits were mistakenly cleared.
181
d06714cb
PE
182 Remove some struct layout assumptions in bool vectors.
183 * alloc.c (bool_header_size): New constant.
184 (header_size, word_size): Move earlier, as they're now used earlier.
185 Use 'word_size' in a few more places, where it's appropriate.
186 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
187 padding before the data member of a bool vector.
188 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
189 than doing the check by hand with an abort ().
190
464d5a5e
SM
1912012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
192
5fbc0409
SM
193 * eval.c (Fdefvar): Don't check constants since we only set the var if
194 it's not yet defined anyway (bug#11904).
195
464d5a5e
SM
196 * lisp.h (last_undo_boundary): Declare new var.
197 * keyboard.c (command_loop_1): Set it.
198 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
199 were auto-added by the command loop (bug#11774).
200
8dc2e44a
AS
2012012-07-18 Andreas Schwab <schwab@linux-m68k.org>
202
203 * w32font.c (Qsymbol): Remove local definition.
204 (syms_of_w32font): Don't DEFSYM it.
205
169925ec
DA
2062012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
207
208 Fix sweep_vectors to handle large bool vectors correctly.
209 * alloc.c (sweep_vectors): Account total_vector_bytes for
210 bool vectors larger than VBLOCK_BYTES_MAX.
211
5fbfb018
CY
2122012-07-18 Chong Yidong <cyd@gnu.org>
213
214 * frame.c (x_set_frame_parameters): Revert bogus change introduced
215 in 2012-05-25 commit by Paul Eggert (Bug#11738).
216
3ab6e069
DA
2172012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
218
219 Return more descriptive data from Fgarbage_collect.
220 Suggested by Stefan Monnier in
221 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
222 * alloc.c (bounded_number): New function.
223 (total_buffers, total_vectors): New variable.
224 (total_string_size): Rename to total_string_bytes, adjust users.
225 (total_vector_size): Rename to total_vector_bytes, adjust users.
226 (sweep_vectors): Account total_vectors and total_vector_bytes.
227 (Fgarbage_collect): New return value. Adjust documentation.
228 (gc_sweep): Account total_buffers.
229 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
230 (VECTOR_SIZE): Remove.
231 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
232 (Qinterval, Qmisc): New symbols.
233 (syms_of_data): Initialize them.
234 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
235 (Qcons, Qbuffer): New declarations.
236
6d02fe5b
PE
2372012-07-17 Paul Eggert <eggert@cs.ucla.edu>
238
239 * alloc.c (Fmemory_free): Account for memory-free's own storage.
240 Round up, not down. Improve doc.
241
b7ffe040
DA
2422012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
243
244 Restore old code in allocate_string_data to avoid Faset breakage.
245 Reported by Julien Danjou <julien@danjou.info> in
246 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
247 * alloc.c (allocate_string_data): Restore old code with minor
248 adjustments, fix comment to explain this subtle issue.
249
4dc7c8d5
SM
2502012-07-17 Eli Zaretskii <eliz@gnu.org>
251
252 Remove FILE_SYSTEM_CASE.
253 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
254
255 * fileio.c (FILE_SYSTEM_CASE): Don't define.
256 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
257 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
258 call-process-region passes it through expand-file-name.
259
260 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
261
2622012-07-17 Andreas Schwab <schwab@linux-m68k.org>
263
264 Fix crash when creating indirect buffer (Bug#11917)
265 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
266 Don't handle unbound variables specially if non-zero.
267 (Fbuffer_local_variables): Pass zero.
268 (clone_per_buffer_values): Pass non-zero.
269
2702012-07-17 Andreas Schwab <schwab@linux-m68k.org>
271
272 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
273 to make the loop interruptible.
274
2752012-07-17 Andreas Schwab <schwab@linux-m68k.org>
276
277 * gnutls.c (emacs_gnutls_handshake): Only retry if
278 GNUTLS_E_INTERRUPTED.
279
cce7fefc
DA
2802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
281
282 Cleanup and convert miscellaneous checks to eassert.
283 * alloc.c (mark_interval): Fix comment, partially rephrase
284 old comment from intervals.h (see below).
285 * intervals.c (find_interval, adjust_intervals_for_insertion)
286 (delete_interval, adjust_intervals_for_deletion)
287 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
288 Convert to eassert.
289 (adjust_intervals_for_insertion, make_new_interval):
290 Remove obsolete and unused code.
291 * intervals.h (struct interval): Remove obsolete comment.
292 * textprotp.c (erase_properties): Remove unused code.
293 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
294 (Fremove_list_of_text_properties): Convert to eassert.
295
9ea10cc3
CY
2962012-07-17 Chong Yidong <cyd@gnu.org>
297
298 * editfns.c (Finsert_char): Doc fix.
299
3900d5de
DA
3002012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
301
302 Fix previous change to make Fmemory_free always accurate.
303 * alloc.c (make_interval): Update total_free_intervals.
304 (make_float): Likewise for total_free_floats.
305 (free_cons, Fcons): Likewise for total_free_conses.
306 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
307 Likewise for total_free_vector_bytes.
308 (Fmake_symbol): Likewise for total_free_symbols.
309 (bytes_free): Remove.
310
7098646f
DA
3112012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
312
313 Simple free memory accounting feature.
314 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
315 (sweep_vectors): Accumulate size of free vectors.
316 (Fgarbage_collect): Setup bytes_free.
317 (Fmemory_free): New function.
318 (syms_of_alloc): Register it.
319
22657b40
DA
3202012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
321
322 Cleanup overlays checking.
323 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
324 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
325 eassert and OVERLAYP.
326 (sort_overlays): Change to use OVERLAYP.
327
ddfc8813
RK
3282012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
329
330 * editfns.c (Finsert_char): Make it interactive, and make the
331 second arg optional. Copy interactive spec and docstring from
332 ucs-insert.
333
7c26cf3c
PE
3342012-07-17 Paul Eggert <eggert@cs.ucla.edu>
335
336 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
337 Unlike the other wrapped functions, fabs has an unspecified
338 effect on errno.
339
5d127af9
JD
3402012-07-16 Jan Djärv <jan.h.d@swipnet.se>
341
342 * nsterm.m (keyDown): Interpret flags without left/right bits
343 as the left key (Bug#11670).
344
6a0dd1d7
DA
3452012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
346
347 Remove empty and useless init functions.
348 * lisp.h (init_character_once, init_fns, init_image)
349 (init_filelock, init_sound): Remove prototype.
350 * character.c (init_character_once): Remove.
351 * filelock.c (init_filelock): Likewise.
352 * fns.c (init_fns): Likewise.
353 * image.c (init_image): Likewise.
354 * sound.c (init_sound): Likewise.
355 * emacs.c (main): Adjust accordingly.
356
7a6136fd
DA
3572012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
358
359 * gtkutil.h: Tiny cleanups.
360 (use_old_gtk_file_dialog): Remove useless declaration.
361 (xg_uses_old_file_dialog): Add suggested const attribute.
362
ce811ad9
EZ
3632012-07-15 Eli Zaretskii <eliz@gnu.org>
364
365 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
366 (bidi_paragraph_init): Use it to limit search forward for a strong
367 directional character in abnormally large paragraphs full of
368 neutral or weak characters. (Bug#11943)
369
c9adfeaa
SF
3702012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
371
372 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
373 the toolbar (Bug#9451).
374 (xg_make_tool_item): Give the widget event box a transparent
375 background.
376
fff62aa9
DA
3772012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
378
379 Cleanup basic allocation variables and functions.
380 * alloc.c (ignore_warnings, init_intervals, init_float)
381 (init_cons, init_symbol, init_marker): Remove.
382 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
383 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
384 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
385 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
386 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
387 (staticidx, init_alloc_once, init_strings, free_ablock):
388 Remove redundant initialization.
389 * fns.c (init_weak_hash_tables): Remove.
390 * lisp.h (init_weak_hash_tables): Remove prototype.
391
9730daca
DA
3922012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
393
394 Use zero_vector where appropriate.
395 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
396 accordingly.
397 * lisp.h (zero_vector): New declaration.
398 * font.c (null_vector): Remove.
399 (syms_of_font): Remove initialization and staticpro.
400 (font_list_entities, font_find_for_lface): Change to use zero_vector.
401 * keymap.c (Faccessible_keymaps): Likewise.
402
2e2d2a13
LL
4032012-07-15 Leo Liu <sdl.web@gmail.com>
404
405 * fringe.c: Fix typo in comments.
406
cd276f6e
LL
4072012-07-14 Leo Liu <sdl.web@gmail.com>
408
409 * fringe.c: Add a new bitmap exclamation-mark.
410
5a1131d9
EZ
4112012-07-14 Eli Zaretskii <eliz@gnu.org>
412
413 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
414
415 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
416 (HAVE_MENUS): Don't define, defined by editing config.in with
417 msdos/sed2v2.inp.
418 (GMALLOC_INHIBIT_VALLOC): Don't define.
419 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
420
22e983b7
JB
4212012-07-14 Juanma Barranquero <lekktu@gmail.com>
422
423 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
424
5b3f250f
GM
4252012-07-14 Glenn Morris <rgm@gnu.org>
426
427 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
428 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
429 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
430
33d63ff4
GM
4312012-07-13 Glenn Morris <rgm@gnu.org>
432
5b633342
GM
433 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
434
33d63ff4
GM
435 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
436 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
437
b55b9f85
JD
4382012-07-13 Jan Djärv <jan.h.d@swipnet.se>
439
0dc8cf50
JD
440 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
441 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
442 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
443 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
444 where appropriate.
445 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
446 as boolean expression.
447 (x_set_window_size): Remove unused variable toolbar.
448 (ns_get_color_default, ns_mod_to_lisp): Remove.
449 (ns_mouse_position): Remove unused variables xchar and ychar.
450 (ns_compute_glyph_string_overhangs): Remove unused variable face.
451 (ns_set_vertical_scroll_bar): Remove unused variable count.
452 (ns_delete_terminal): Remove unused variable i.
453 (ns_term_init): Remove unused variables r, g and b.
454 (mouseDown): Remove unused variable window.
455 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
456 (initFrameFromEmacs): Remove unused variable vbextra.
457 (mouseEntered): Remove unused variables p and dpyinfo.
458 (mouseExited): Remove unused variables p and r.
459 (ns_define_frame_cursor, ns_clear_frame_area)
460 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
461 (menuDown): Assign [sender tag] to variable and cast the variable.
462
463 * nsterm.h (menuDown): Add id as type to argument sender.
464 (ns_display_info_for_name): Add Lisp_Object argument.
465 (ns_term_init): Add Lisp_Object argument.
466 (ns_map_event_to_object): Add void argument.
467 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
468 prototype with arguments and only declare if __OBJC__.
469 (nxatoms_of_nsselect): Add void argument.
470 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
471 (ns_alloc_autorelease_pool): Add void argument.
472 (ns_release_autorelease_pool): Add void* argument.
473 (ns_get_defaults_value): Add const char* argument.
474
475 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
476 (initFromContents): Use SSDATA where appropriate.
477 (ns_update_menubar): Add braces to ambigous if-else.
478 (initWithTitle): Put () around assignment in if statement.
479 (ns_menu_show): Remove unused variables window and keymap.
480 (update_frame_tool_bar): Remove unused variable selected_p.
481 (initWithContentRect): Remove unused variable this_cmd_name.
482
483 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
484 appropriate.
485 (setXBMColor): Remove unused variable len.
486 (setPixmapData): Put () around assignment in loop statement.
487
488 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
489 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
490 where appropriate.
491 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
492 around assignment in loop statement.
493 (nsfont_open): Remove unused variable i.
494 (nsfont_open): Remove unused variable len.
495 (nsfont_draw): Remove unused variable cs.
496
497 * nsfns.m (x_set_icon_name, ns_set_name_internal)
498 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
499 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
500 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
501 (Fns_font_name, Fns_perform_service)
502 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
503 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
504 (ns_set_name): Remove unused variable view.
505 (x_set_menu_bar_lines): Remove unused variable olines.
506 (x_set_tool_bar_lines): Remove unused variable root_window.
507 (Fns_list_colors): Put () around assignment in while statement.
508 (Fns_perform_service): Remove unused variable len.
509 (Fns_display_usable_bounds): Remove unused variable top.
510 (syms_of_nsfns): Remove unused variable i.
511
b55b9f85
JD
512 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
513 memcpy (Bug#11907).
514
ed9265fc 5152012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
516
517 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
518 and free it with DestroyExceptionInfo (Bug#11558).
519
ef099b57
JB
5202012-07-13 Juanma Barranquero <lekktu@gmail.com>
521
522 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
523 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
524 Set here, not in nt/config.nt.
525
ea814a5d
EZ
5262012-07-13 Eli Zaretskii <eliz@gnu.org>
527
528 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
529 cursor overflow into the last glyph on display line when the right
530 fringe is off. (Bug#11832)
531
1a952767
PE
5322012-07-13 Paul Eggert <eggert@cs.ucla.edu>
533
534 * xdisp.c (produce_special_glyphs): Now static.
535 * dispextern.h (produce_special_glyphs): Remove decl.
536
983188fd
GM
5372012-07-13 Glenn Morris <rgm@gnu.org>
538
32fb4bb6
GM
539 * s/bsd-common, s/cygwin.h: Remove empty files.
540 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
541
983188fd
GM
542 * s/usg5-4-common.h (USG, USG5):
543 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
544 * s/sol2-6.h (SOLARIS2):
545 * s/irix6-5.h (IRIX6_5):
546 * s/hpux10-20.h (USG, USG5, HPUX):
547 * s/gnu-linux.h (USG, GNU_LINUX):
548 * s/freebsd.h (BSD_SYSTEM):
549 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
550 * s/cygwin.h (CYGWIN):
551 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
552 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
553
d1e68667 5542012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
555
556 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 557
6de0e799
GM
5582012-07-13 Glenn Morris <rgm@gnu.org>
559
739ae010
GM
560 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
561
dbee5793
GM
562 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
563
6de0e799
GM
564 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
565 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
566
b82da769
GM
5672012-07-12 Glenn Morris <rgm@gnu.org>
568
4fae5a7a 569 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
570
571 * process.c (init_process_emacs): Rename from init_process.
572 The old name is also the name of a Mach system call.
573 * lisp.h, emacs.c: Update for this name change.
574 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
575 longer needed.
576
5a979817
EZ
5772012-07-12 Eli Zaretskii <eliz@gnu.org>
578
579 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
580 memmove call that removes glyphs covered by the left truncation
581 glyph. Improve commentary.
582 (display_line): Fix display of continuation glyphs on GUI frames
583 when the right fringe is turned off and variable-size fonts are
584 used in the window. Move the code that appends a stretch glyph to
585 produce_special_glyphs, so that it could be used for truncation
586 and continuation glyphs alike.
587 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
588 glyph of a suitably computed width, to align the special glyphs at
589 the window margin. Code moved from display_line. (Bug#11832)
590
3e91a053
GM
5912012-07-12 Glenn Morris <rgm@gnu.org>
592
ba9e4b84
GM
593 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
594
595 * s/gnu-linux.h, s/hpux10-20.h:
596 Do not unconditionally define HAVE_XRMSETDATABASE.
597
3e91a053
GM
598 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
599
b300b1f4
PE
6002012-07-12 Paul Eggert <eggert@cs.ucla.edu>
601
602 Fix typos that broke OS X build.
603 Reported by Randal L. Schwartz in
604 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
605 * nsterm.m (ns_timeout): Add missing local decl.
606 (ns_get_color): snprintf -> sprintf, to fix typo.
607
6e777848
GM
6082012-07-12 Glenn Morris <rgm@gnu.org>
609
3f922c37
GM
610 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
611 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
612 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
613 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
614
0ab7b23a
GM
615 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
616 Move PTY_OPEN to configure.
617
6e777848
GM
618 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
619 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
620 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
621
4a7edc24
DA
6222012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
623
624 Use empty_unibyte_string where applicable.
625 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
626 * lread.c (read1): Likewise.
627 * xsettings.c (syms_of_xsettings): Likewise.
628
308aab79
GM
6292012-07-12 Glenn Morris <rgm@gnu.org>
630
42bd1719
GM
631 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
632 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
633 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
634 * s/hpux10-20.h (RUN_TIME_REMAP):
635 * s/bsd-common.h (TABDLY): Move to configure.
636
637 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
638
639 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
640
ea0bbd17 641 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 642 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
643
644 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 645
308aab79
GM
646 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
647 * s/template.h: Move NARROWPROTO to configure.
648
ee1cf5cf
GM
6492012-07-11 Glenn Morris <rgm@gnu.org>
650
30fe9bf4
GM
651 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
652 unused since 2011-01-17 change to systty.h.
653
ee1cf5cf
GM
654 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
655 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
656 Move HAVE_PTYS and HAVE_SOCKETS to configure.
657
63e47e07
PE
6582012-07-11 Paul Eggert <eggert@cs.ucla.edu>
659
660 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
661
c43fb4c3
GM
6622012-07-11 Glenn Morris <rgm@gnu.org>
663
664 * s/darwin.h, s/gnu-linux.h, s/template.h:
665 Move INTERRUPT_INPUT to configure.
666
e8df9267
DA
6672012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
668
669 Minor adjustments to interning code.
670 * lisp.h (intern, intern_c_string): Redefine as static inline
671 wrappers for intern_1 and intern_c_string_1, respectively.
672 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
673 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
674 Vobarray checking.
e8df9267
DA
675 * font.c (font_intern_prop): Likewise. Adjust comment.
676 * w32font.c (intern_font_name): Likewise.
677
34348bd4
AS
6782012-07-11 Andreas Schwab <schwab@linux-m68k.org>
679
d96a1e0c
AS
680 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
681
34348bd4
AS
682 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
683 of Fcar/Fcdr if possible.
684 * font.c (check_otf_features): Likewise.
685 * fontset.c (Fnew_fontset): Likewise.
686 * gnutls.c (Fgnutls_boot): Likewise.
687 * minibuf.c (read_minibuf): Likewise.
688 * msdos.c (IT_set_frame_parameters): Likewise.
689 * xmenu.c (Fx_popup_dialog): Likewise.
690 * w32menu.c (Fx_popup_dialog): Likewise.
691
c8add24e
GM
6922012-07-11 Glenn Morris <rgm@gnu.org>
693
4b575b3c
GM
694 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
695 since nothing has defined it on these platforms.
696
09f4e3b0
GM
697 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
698 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
699
172bedef
GM
700 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
701 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
702 Move CLASH_DETECTION to configure.
703
249685df
GM
704 * s/gnu.h: Remove file, which is now empty.
705
c8add24e
GM
706 * s/gnu.h, s/gnu-linux.h:
707 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
708
b41253a3
JW
7092012-07-11 John Wiegley <johnw@newartisans.com>
710
711 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
712 function attribute, so we only use it if it exists in the
713 compiler.
714
d923b542
DA
7152012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
716
717 Avoid call to strlen in fast_c_string_match_ignore_case.
718 * search.c (fast_c_string_match_ignore_case): Change to use
719 length argument. Adjust users accordingly.
720 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
721
5ebbef1d
PE
7222012-07-11 Paul Eggert <eggert@cs.ucla.edu>
723
bb352260
PE
724 Assume mkdir, rmdir.
725 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
726 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
727
57054ddd
PE
728 Assume rename.
729 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
730
b747d3f7
PE
731 Assume perror.
732 * s/hpux10-20.h (HAVE_PERROR): Remove.
733 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
734 Remove dummy definition, as this problem was obsolete long ago.
735
5ebbef1d
PE
736 Assume strerror.
737 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
738
984e7f30
DA
7392012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
740
741 Avoid calls to strlen in font processing functions.
742 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 743 (font_open_by_name): Change to use length argument. Adjust
984e7f30 744 users accordingly.
d923b542
DA
745 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
746 Adjust prototypes.
747 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
748 Change to return ptrdiff_t.
984e7f30
DA
749 (xfont_list_pattern, xfont_match): Use length returned by
750 xfont_decode_coding_xlfd.
751 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
752
20e94fdd
GM
7532012-07-11 Glenn Morris <rgm@gnu.org>
754
9d596af3
GM
755 * s/darwin.h, s/freebsd.h, s/netbsd.h:
756 Move DONT_REOPEN_PTY to configure.
757
20e94fdd
GM
758 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
759 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
760
e99a530f
PE
7612012-07-10 Paul Eggert <eggert@cs.ucla.edu>
762
22ffb973
PE
763 Remove "#define unix" that is no longer needed (Bug#11905).
764 * s/aix4-2.h (unix): Remove; no longer needed.
765
e9a9ae03
PE
766 EMACS_TIME simplification (Bug#11875).
767 This replaces macros (which typically do not work in GDB)
768 with functions, typedefs and enums, making the code easier to debug.
769 The functional style also makes code easier to read and maintain.
770 * systime.h: Include <sys/time.h> on all hosts, not just if
771 WINDOWSNT, since 'struct timeval' is needed in general.
772 (EMACS_TIME): Now a typedef, not a macro.
773 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
774 not macros.
775 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
776 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
777 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
778 (EMACS_TIME_LE): Now functions, not macros.
779 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
780 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
781 which are not functions. All uses rewritten to use:
782 (make_emacs_time): New function.
783 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
784 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
785 not functions. All uses rewritten to use the following, respectively:
786 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
787 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 788 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
789 * fileio.c (Fcopy_file):
790 * xterm.c (XTflash): Get the current time closer to when it's used.
791 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
792
ffacb126
PE
793 * bytecode.c (targets): Suppress -Woverride-init warnings.
794
e99a530f
PE
795 Simplify by avoiding confusing use of strncpy etc.
796 * doc.c (Fsnarf_documentation):
797 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
798 * frame.c (Fmake_terminal_frame):
799 * gtkutil.c (get_utf8_string):
800 * lread.c (openp):
801 * nsmenu.m (ns_update_menubar):
802 * regex.c (regerror):
803 Prefer memcpy to strncpy and strncat when either will do.
804 * fileio.c (Fsubstitute_in_file_name):
805 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
806 (menu_separator_name_p):
807 * nsmenu.m (ns_update_menubar):
808 Prefer memcmp to strncmp when either will do.
809 * nsterm.m: Include <ftoastr.h>.
810 (ns_get_color):
811 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
812 Prefer snprintf to strncpy.
813 * nsterm.m (ns_term_init):
814 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
815 * nsterm.m (ns_term_init):
816 Avoid the need for strncpy, by using build_string or
817 make_unibyte_string directly. Use dtoastr, not snprintf.
818 * process.c (Fmake_network_process): Diagnose service names that
819 are too long, rather than silently truncating them or creating
820 non-null-terminated names.
821 (Fnetwork_interface_info): Likewise, for interface names.
822 * sysdep.c (system_process_attributes) [GNU_LINUX]:
823 Prefer sprintf to strncat.
824 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
825 Prefer vsnprintf to vsprintf + strncpy.
826
c59592b3
GM
8272012-07-10 Glenn Morris <rgm@gnu.org>
828
829 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
830 Clarify fallback case.
831
7d7bbefd
DA
8322012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
833
834 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
835 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
836 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 837 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
838 where argument type is known to be a Lisp_Cons.
839
3a4c8000
TT
8402012-07-10 Tom Tromey <tromey@redhat.com>
841
842 * bytecode.c (BYTE_CODE_THREADED): New macro.
843 (BYTE_CODES): New macro. Replaces all old byte-code defines.
844 (enum byte_code_op): New type.
845 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
846 (exec_byte_code): Use them. Use token threading when applicable.
847
2a0213a6
DA
8482012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
849
850 Optimize pure C strings initialization.
851 * lisp.h (make_pure_string): Fix prototype.
852 (build_pure_c_string): New function, defined as static inline. This
853 provides a better opportunity to optimize away calls to strlen when
854 the function is called with compile-time constant argument.
855 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
856 argument, adjust users accordingly. Use build_pure_c_string where
857 appropriate.
858 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
859 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
860 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
861
cb1caeaf
DA
8622012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
863
864 Avoid calls to strlen in miscellaneous functions.
865 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
866 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
867 * lread.c (openp): Likewise.
868
c293e30c
DA
8692012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
870
871 Avoid calls to strlen in path processing functions.
872 * fileio.c (file_name_as_directory): Add comment. Change to add
873 srclen argument and return the length of result. Adjust users
874 accordingly.
875 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 876 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
877 users accordingly.
878 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
879
9e059e3f
GM
8802012-07-10 Glenn Morris <rgm@gnu.org>
881
d02eb359
GM
882 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
883 Move PENDING_OUTPUT_COUNT definition to configure.
884
882cf227
GM
885 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
886 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
887 * s/gnu.h (DATA_START): Move definitions to configure.
888
af6e839f
GM
889 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
890 We include usg5-4-common.h, which defines them both.
891
40289a12
GM
892 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
893 O_RDONLY already includes it).
894
9e059e3f
GM
895 Stop ns builds setting the EMACSLOADPATH environment variable.
896 * nsterm.m (ns_load_path): Rename from ns_init_paths.
897 Now it does not set EMACSLOADPATH, just returns the load-path string.
898 * nsterm.h: Update accordingly.
899 * lread.c [HAVE_NS]: Include nsterm.h.
900 (init_lread) [HAVE_NS]: Use ns_load_path.
901 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
902
7c4e8ec0
GM
9032012-07-09 Glenn Morris <rgm@gnu.org>
904
d4f600ff
GM
905 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
906 since the included bsd-common.h does so.
907
cbb31951
GM
908 Stop ns builds setting the EMACSPATH environment variable.
909 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
910 (ns_init_paths): Do not set EMACSPATH.
911 * nsterm.h (ns_exec_path): Add it.
912 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
913 Use ns_exec_path.
914
7c4e8ec0
GM
915 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
916
26bccfae
PE
9172012-07-09 Paul Eggert <eggert@cs.ucla.edu>
918
a0bee46f
PE
919 * process.c (wait_reading_process_output): 'waitchannels' was unset
920 when read_kbd || !NILP (wait_for_cell); fix this.
921
5994c183
PE
922 Add GCC-style 'const' attribute to functions that can use it.
923 * character.h (char_resolve_modifier_mask):
924 * keyboard.h (make_ctrl_char):
925 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
926 (init_character_once, next_almost_prime, init_fns, init_image)
927 (flush_pending_output, init_sound):
928 * mem-limits.h (start_of_data):
929 * menu.h (finish_menu_items):
930 Add ATTRIBUTE_CONST.
931 * emacs.c (DEFINE_DUMMY_FUNCTION):
932 Declare the dummy function with ATTRIBUTE_CONST.
933 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
934 Add decls with ATTRIBUTE_CONST.
935
26bccfae
PE
936 Minor improvements to make_formatted_string.
937 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
938 where int is good enough, as vsprintf returns an int.
939 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
940
a8290ec3
DA
9412012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
942
943 Use make_formatted_string to avoid double length calculation.
944 * lisp.h (make_formatted_string): New prototype.
945 * alloc.c (make_formatted_string): New function.
946 * buffer.c (Fgenerate_new_buffer_name): Use it.
947 * dbus.c (syms_of_dbusbind): Likewise.
948 * editfns.c (Fcurrent_time_zone): Likewise.
949 * filelock.c (get_boot_time): Likewise.
950 * frame.c (make_terminal_frame, set_term_frame_name)
951 (x_report_frame_params): Likewise.
952 * image.c (gs_load): Likewise.
953 * minibuf.c (get_minibuffer): Likewise.
954 * msdos.c (dos_set_window_size): Likewise.
955 * process.c (make_process): Likewise.
956 * xdisp.c (ensure_echo_area_buffers): Likewise.
957 * xsettings.c (apply_xft_settings): Likewise.
958
d01ba2f1
GM
9592012-07-09 Glenn Morris <rgm@gnu.org>
960
961 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
962 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
963 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
964 * nsterm.h (ns_etc_directory): Add it.
965 * callproc.c [HAVE_NS]: Include nsterm.h.
966 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
967
f1f924b6
DA
9682012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
969
970 Move marker debugging code under MARKER_DEBUG.
971 * marker.c (MARKER_DEBUG): Move marker debugging code under
972 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
973 for bootstrap with --enable-checking (~3x slowdown reported
974 by Juanma Barranquero <lekktu@gmail.com>).
975 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
976
ab531b66
PE
9772012-07-08 Paul Eggert <eggert@cs.ucla.edu>
978
979 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
980 See <http://bugs.gnu.org/11825#29>.
981
c4b3bc8a
EZ
9822012-07-08 Eli Zaretskii <eliz@gnu.org>
983
984 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
985 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
986 (display_line): Add commentary about displaying truncation glyphs
987 on GUI frames.
988 (produce_special_glyphs): Move here from term.c.
989
990 * term.c (produce_special_glyphs): Move to xdisp.c.
991
992 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
993 section.
c4b3bc8a 994
b676b881
AS
9952012-07-07 Andreas Schwab <schwab@linux-m68k.org>
996
f17c5273
AS
997 * xdisp.c (display_line): Avoid warning about implicit declaration
998 of FRAME_FONT.
999
298819b9
AS
1000 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1001
b676b881
AS
1002 * lisp.h: Remove empty conditional.
1003
6045c4fd
PE
10042012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1005
b3350bf9
PE
1006 * lread.c (load_path_check): Now static.
1007
6045c4fd
PE
1008 Fix some minor --with-ns problems found by static checking.
1009 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1010 (x_set_font) [!HAVE_X_WINDOWS]:
1011 * image.c (xpm_load_image) [HAVE_NS]:
1012 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1013 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1014 Remove unused local.
1015 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1016 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1017 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1018 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1019 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1020 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1021 Fix pointer signedness problem.
1022 * xfaces.c (FRAME_X_FONT_TABLE):
1023 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1024
929e7845
GM
10252012-07-07 Glenn Morris <rgm@gnu.org>
1026
1027 * lread.c (load_path_check): New function, split from init_lread.
1028 (init_lread): Reorganize. Motivation:
1029 If EMACSLOADPATH is set, check/warn about that rather than the
1030 defaults, which we are not going to use. Hence we can remove
1031 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1032 Don't warn if site-lisp directories are missing.
1033 If not installed, start from a blank load-path, since
1034 PATH_LOADSEARCH refers to the eventual installation directories.
1035
58dd0aa4
EZ
10362012-07-07 Eli Zaretskii <eliz@gnu.org>
1037
1038 Support truncation and continuation glyphs on GUI frames, when
1039 fringes are disabled. (Bug#11832)
1040 * xdisp.c (init_iterator): Get dimensions of truncation and
1041 continuation glyphs even if on GUI frames. Adjust
1042 it->last_visible_x on GUI frames when the left or right fringes,
1043 or both, are absent.
1044 (start_display, move_it_in_display_line_to): Handle the case of a
1045 GUI frame without a fringe to display continuation or truncation
1046 glyphs.
1047 (insert_left_trunc_glyphs): Support GUI frames: make sure
1048 truncation glyphs overwrite enough glyphs from the current line to
1049 have sufficient space in pixels.
1050 (display_line): Support truncation and continuation glyphs on GUI
1051 frames. If some spare pixels are left on the line after inserting
1052 the truncation glyphs, fill that space with a stretch glyph of a
1053 suitably computed width.
1054
1055 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1056 produce_glyphs, to support GUI sessions.
1057
31571fd7
PE
10582012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1059
5a16b9bc
PE
1060 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1061
f3047c75
PE
1062 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1063
31571fd7
PE
1064 Do not require float-time's arg to fit in time_t (Bug#11825).
1065 This works better on hosts where time_t is unsigned, and where
1066 float-time is applied to the (negative) difference between two times.
1067 * editfns.c (decode_time_components): Last arg is now double *,
1068 not int *, and means to store all the result as a double, without
1069 worrying about whether the seconds part fits in time_t.
1070 All callers changed.
1071 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1072 All callers changed.
1073 (Ffloat_time): Do not fail merely because the specified time falls
1074 outside of time_t range.
1075
4516fbef
GM
10762012-07-07 Glenn Morris <rgm@gnu.org>
1077
1078 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1079 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1080 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1081
07adc2c6
JB
10822012-07-07 Juanma Barranquero <lekktu@gmail.com>
1083
1084 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1085 Update dependencies.
1086
1087 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1088
fd573f31
PE
10892012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1090
fee5959d
PE
1091 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1092 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1093 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1094 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1095 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1096 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1097
fd573f31
PE
1098 * xfont.c (compare_font_names): Redo to omit the need for casts.
1099
ddadbc0e
AS
11002012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1101
fca8d6b6
AS
1102 * xfns.c (Fx_change_window_property): Doc fix.
1103 * w32fns.c (Fx_change_window_property): Doc fix.
1104
ddadbc0e
AS
1105 * w32fns.c (Fx_window_property): Accept the same arguments as the
1106 X Windows version. Doc fix.
1107 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1108
ed9265fc 11092012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
1110 Eli Zaretskii <eliz@gnu.org>
1111
1112 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1113 Windows-specific code from nt/config.nt moved here.
1114 Obsolete settings removed.
1115
216ee680
PE
11162012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1117
1118 * process.c: Avoid unnecessary calls to gettime.
1119 (wait_reading_process_output): Don't get the time of day
1120 when gobbling data immediately and not waiting, as there's no need
1121 for it in that case. This removes a FIXME.
1122
bdd091e4
JD
11232012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1124
1125 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
1126 is defined (Bug#11768).
1127
9d44f8ce
DA
11282012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1129
1130 Fix marker debugging code.
1131 * marker.c (byte_char_debug_check): Do not perform the check
1132 if buffer is not multibyte.
090bd7cb
JB
1133 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1134 Call byte_char_debug_check with correct arguments.
9d44f8ce 1135
90fc4786
DA
11362012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1137
1138 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
1139 * marker.c (byte_char_debug_check, count_markers):
1140 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
1141 (byte_debug_flag): Remove.
1142 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1143 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
1144
7b7ae965
DA
11452012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1146
4e57b342
DA
1147 Avoid code repetition in marker-related functions.
1148 * marker.c (attach_marker): New function.
1149 (Fset_marker, set_marker_restricted, set_marker_both)
1150 (set_marker_restricted_both): Use it.
1151 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
1152 Consistently rename charno to charpos.
1153 (marker_position): Add eassert.
1154 (marker_byte_position): Convert to eassert.
1155
11562012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1157
1158 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 1159 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 1160 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 1161
657924ff
DA
11622012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1163
1164 Introduce fast path for the widely used marker operation.
1165 * alloc.c (build_marker): New function.
1166 * lisp.h (build_marker): New prototype.
1167 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
1168 * composite.c (autocmp_chars): Likewise.
1169 * editfns.c (buildmark): Remove.
1170 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
1171 (save_restriction_save): Use build_marker.
1172 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
1173 * window.c (save_window_save): Likewise.
1174
041a49a6
DA
11752012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1176
1177 Do not use Fdelete_overlay in delete_all_overlays
1178 to avoid redundant calls to unchain_overlay.
1179 * buffer.c (drop_overlay): New function.
1180 (delete_all_overlays, Fdelete_overlay): Use it.
1181 * minibuf.c (get_minibuffer): Fix comment.
1182
7dca65a4
PE
11832012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1184
1185 Port to OpenBSD 5.1 amd64.
1186 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
1187 This is needed for OpenBSD, and should be harmless on all BSD systems.
1188 Also, include <sys/sysctl.h>, as it should be available on all
1189 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
1190 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
1191 use p_pid member, not kp_proc.pid.
1192
8eb876e2
GM
11932012-07-06 Glenn Morris <rgm@gnu.org>
1194
1195 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
1196
38182d90
PE
11972012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1198
1199 More xmalloc and related cleanup.
1200 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
1201 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
1202 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
1203 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
1204 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
1205 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
1206 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
1207 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
1208 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
1209 * xterm.c:
1210 Omit needless casts involving void * pointers and allocation.
1211 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
1212 as the former is more robust if P's type is changed.
1213 Prefer xzalloc to xmalloc + memset 0.
1214 Simplify malloc-or-realloc to realloc.
1215 Don't worry about xmalloc returning a null pointer.
1216 Prefer xstrdup to xmalloc + strcpy.
1217 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
1218 growing it.
1219 * keyboard.c (apply_modifiers_uncached): Prefer local array to
1220 alloca of a constant.
1221
6dd5a677
EZ
12222012-07-05 Eli Zaretskii <eliz@gnu.org>
1223
1224 * xdisp.c (display_line): Fix horizontal pixel coordinates when
1225 hscroll is larger than the line width. Fixes long and futile
1226 looping inside extend_face_to_end_of_line (on a TTY) producing
1227 glyphs that are not needed and thrown away.
1228
6b312f0f
DA
12292012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1230
1231 * marker.c (set_marker_restricted_both): Simplify by using
1232 clip_to_bounds.
1233
f520ef9b
PE
12342012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1235
1236 * editfns.c (region_limit): Simplify by using clip_to_bounds.
1237
383b7c95
JD
12382012-07-05 Jan Djärv <jan.h.d@swipnet.se>
1239
1240 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
1241 not defined (Bug#11768).
1242 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
1243 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
1244 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
1245 followed by gtk_box_set_homogeneous (Bug#11768).
1246 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
1247 (update_theme_scrollbar_width, xg_create_scroll_bar):
1248 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
1249 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
1250 (is_box_type): New function (Bug#11768).
1251 (xg_tool_item_stale_p): Call is_box_type.
5293d758 1252 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
1253 with default display (Bug#11768).
1254
d6e7bf45
EZ
12552012-07-05 Eli Zaretskii <eliz@gnu.org>
1256
1257 * xdisp.c (window_hscroll_limited): New function.
1258 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
1259 coordinates when window's hscroll is set to insanely large
1260 values. (Bug#11857)
1261
431391ec
JB
12622012-07-05 Juanma Barranquero <lekktu@gmail.com>
1263
1264 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
1265 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
1266
23f86fce
DA
12672012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1268
1269 Cleanup xmalloc.
1270 * lisp.h (xzalloc): New prototype. Omit needless casts.
1271 * alloc.c (xzalloc): New function. Omit needless casts.
1272 * charset.c: Omit needless casts. Convert all calls to
1273 xmalloc with following memset to xzalloc.
1274 * dispnew.c: Likewise.
1275 * fringe.c: Likewise.
1276 * image.c: Likewise.
1277 * sound.c: Likewise.
1278 * term.c: Likewise.
1279 * w32fns.c: Likewise.
1280 * w32font.c: Likewise.
1281 * w32term.c: Likewise.
1282 * xfaces.c: Likewise.
1283 * xfns.c: Likewise.
1284 * xterm.c: Likewise.
1285 * atimer.c: Omit needless casts.
1286 * buffer.c: Likewise.
1287 * callproc.c: Likewise.
1288 * ccl.c: Likewise.
1289 * coding.c: Likewise.
1290 * composite.c: Likewise.
1291 * doc.c: Likewise.
1292 * doprnt.c: Likewise.
1293 * editfns.c: Likewise.
1294 * emacs.c: Likewise.
1295 * eval.c: Likewise.
1296 * filelock.c: Likewise.
1297 * fns.c: Likewise.
1298 * gtkutil.c: Likewise.
1299 * keyboard.c: Likewise.
1300 * lisp.h: Likewise.
1301 * lread.c: Likewise.
1302 * minibuf.c: Likewise.
1303 * msdos.c: Likewise.
1304 * print.c: Likewise.
1305 * process.c: Likewise.
1306 * region-cache.c: Likewise.
1307 * search.c: Likewise.
1308 * sysdep.c: Likewise.
1309 * termcap.c: Likewise.
1310 * terminal.c: Likewise.
1311 * tparam.c: Likewise.
1312 * w16select.c: Likewise.
1313 * w32.c: Likewise.
1314 * w32reg.c: Likewise.
1315 * w32select.c: Likewise.
1316 * w32uniscribe.c: Likewise.
1317 * widget.c: Likewise.
1318 * xdisp.c: Likewise.
1319 * xmenu.c: Likewise.
1320 * xrdb.c: Likewise.
1321 * xselect.c: Likewise.
1322
0497dc44
PE
13232012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1324
1325 * fileio.c (time_error_value): Check the right error number.
1326 Problem reported by Troels Nielsen in
1327 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
1328
356e7178
PE
13292012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1330
4e71fd89
PE
1331 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
1332 This should be fixed in a better way; see Eli Zaretskii in
1333 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
1334 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
1335
f0941253
PE
1336 * fileio.c (time_error_value): Rename from special_mtime.
1337 The old name's problems were noted by Eli Zaretskii in
1338 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
1339
065c9eb4
PE
1340 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
1341 This variable's comment says Emacs needs at least one GDB-visible
1342 symbol of type enum pvec_type, to work around GDB problems.
1343 The symbol's value doesn't matter.
1344
356e7178
PE
1345 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
1346 that causes compilation to fail on pre-C99 compilers.
1347
ed9265fc 13482012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
1349
1350 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
1351 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
1352
3884d954
DA
13532012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1354
d209e2fb 1355 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
1356 headers for buffer_defaults and buffer_local_symbols.
1357 Reported by Juanma Barranquero <lekktu@gmail.com>.
1358
ee28be33
SM
13592012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1360
1361 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
1362 * lisp.h (enum pvec_type): Use fewer bits.
1363 (PSEUDOVECTOR_SIZE_BITS): New constant.
1364 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
1365 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
1366 change in pvec_type.
1367 (PSEUDOVECTOR_TYPEP): New macro.
1368 (TYPED_PSEUDOVECTORP): Use it.
1369 * fns.c (internal_equal): Adapt code to extract pvectype.
1370 * emacs.c (gdb_pvec_type): Update type.
1371 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
1372 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
1373 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
1374 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
1375 (sweep_vectors): Use it. Use local var `total_bytes' instead of
1376 abusing vector->header.next.nbytes.
1377 (live_vector_p): Use PVEC_TYPE.
1378 (mark_object): Adapt code to extract pvectype. Use switch.
1379
c7f2cd7f
PE
13802012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1381
1382 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
1383 Tighten new eassert a bit.
1384
8ce70ed2
DA
13852012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1386
1387 Fix compilation with --enable-gcc-warnings and -O1
1388 optimization level.
1389 * doprnt.c (doprnt): Change type of tem to int, initialize
1390 to avoid compiler warning. Add eassert.
1391 * search.c (simple_search): Initialize match_byte to avoid
1392 compiler warning. Add eassert.
1393
dea7f1e5
PE
13942012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1395
24a212eb
PE
1396 Avoid weird behavior with large horizontal scrolls.
1397 Without this change, for example, large hscroll values would
1398 mess up Emacs's display on Fedora 15 x86, presumably due to
1399 overflows in int calculations in the display code.
1400 Also, if buffers had long lines, Emacs would freeze.
1401 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
1402 (set_window_hscroll): New function, containing the old guts of
1403 Fset_window_hscroll. Return the clipped value.
1404 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
1405 This avoids the need to check against PTRDIFF_MAX.
1406
dea7f1e5
PE
1407 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
1408
76046526
DA
14092012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1410
1411 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
1412
39adff0d
PE
14132012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1414
63807d47
PE
1415 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
1416 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
1417 since GCC 4.4.6 issues a bogus warning for them.
1418
39adff0d
PE
1419 Fix bugs in file timestamp newness comparisons.
1420 * fileio.c (Ffile_newer_than_file_p):
1421 * lread.c (Fload): Use full timestamp resolution of files,
1422 not just the 1-second resolution, so that files that are only
1423 slightly newer still count as newer.
1424 * fileio.c (Ffile_newer_than_file_p): Don't assume file
1425 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
1426
dbeed9a6
PE
14272012-07-03 Paul Eggert <eggert@cs.ucla.edu>
1428
1429 * fileio.c: Improve handling of file time marker. (Bug#11852)
1430 (special_mtime): New function.
1431 (Finsert_file_contents, Fverify_visited_file_modtime):
1432 Use it to set special mtime values consistently.
1433
636334d6
AS
14342012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1435
1436 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1437 marker for non-existing file. (Bug#11852)
1438
e2017fe2
GM
14392012-07-03 Glenn Morris <rgm@gnu.org>
1440
1441 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1442 and did not make it into globals.h).
1443
404dbd37
TT
14442012-07-03 Tom Tromey <tromey@redhat.com>
1445
1446 * window.c (Fset_window_margins, Fset_window_fringes)
1447 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1448 * textprop.c (Fprevious_property_change): No longer static.
1449 * syntax.c (Fsyntax_table_p): No longer static.
1450 * process.c (Fget_process, Fprocess_datagram_address): No longer
1451 static.
1452 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1453 * keyboard.c (Fcommand_execute): No longer static.
1454 Remove EXFUN.
1455 * insdel.c (Fcombine_after_change_execute): No longer static.
1456 * image.c (Finit_image_library): No longer static.
1457 * fileio.c (Fmake_symbolic_link): No longer static.
1458 * eval.c (Ffetch_bytecode): No longer static.
1459 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
1460 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1461 No longer static.
404dbd37
TT
1462 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1463 static.
1464 * dired.c (Ffile_attributes): No longer static.
1465 * composite.c (Fcomposition_get_gstring): No longer static.
1466 * callproc.c (Fgetenv_internal): No longer static.
1467
1468 * ccl.h: Remove EXFUNs.
1469 * buffer.h: Remove EXFUNs.
1470 * dispextern.h: Remove EXFUNs.
1471 * intervals.h: Remove EXFUNs.
1472 * fontset.h: Remove EXFUN.
1473 * font.h: Remove EXFUNs.
1474 * dosfns.c (system_process_attributes): Remove EXFUN.
1475 * keymap.h: Remove EXFUNs.
1476 * lisp.h: Remove EXFUNs.
1477 * w32term.h: Remove EXFUNs.
1478 * window.h: Remove EXFUNs.
1479 * xsettings.h: Remove EXFUN.
1480 * xterm.h: Remove EXFUN.
1481
8e4fd1e1
GM
14822012-07-03 Glenn Morris <rgm@gnu.org>
1483
1484 * lisp.h (Frandom): Make it visible to C.
1485 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1486 buffer for invisible buffers. (Bug#1229)
1487
ca95b3eb
DA
14882012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1489
1490 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1491 values which aren't power of 2.
1492 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1493 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1494 accordingly.
1495
7555c33f
SM
14962012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1497
1498 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1499
1500 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1501
d12e8f5a
DA
15022012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1503
1504 * alloc.c (allocate_vector_block): Remove redundant
1505 calls to mallopt if DOUG_LEA_MALLOC is defined.
1506 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1507 avoid calls to mallopt if zero_vector is returned.
1508
296094c3
DA
15092012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1510
1511 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
1512 is enabled, avoid dereferencing NULL current_sblock if
1513 running undumped.
1514
36429c89
DA
15152012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1516
1517 Cleanup basic buffer management.
1518 * buffer.h (struct buffer): Change layout to use generic vector
1519 marking code. Fix some comments. Change type of 'clip_changed'
1520 to bitfield. Remove unused #ifndef old.
1521 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1522 (GET_OVERLAYS_AT): Fix indentation.
1523 (for_each_per_buffer_object_at): New macro.
1524 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1525 (Fbuffer_local_variables): Use it.
1526 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1527 * alloc.c (allocate_buffer): Adjust to match new layout of
1528 struct buffer. Fix comment.
1529 (mark_overlay): New function.
1530 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1531 Lisp area of struct buffer.
1532 (mark_object): Use it. Adjust marking of misc objects
1533 and related comments.
1534
3b3e4cac
PE
15352012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1536
1537 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1538 wrapper that is not needed because the wrapped code is a no-op (zero
1539 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1540 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1541
cf5c0175
DA
15422012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1543
1544 * alloc.c (mark_buffer): Simplify. Remove prototype.
1545 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1546 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1547 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1548 redundant calls to mark_vectorlike for bool vectors.
1549
ca26824c
GM
15502012-06-30 Glenn Morris <rgm@gnu.org>
1551
2e4c5312
GM
1552 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1553
ca26824c
GM
1554 * epaths.in (PATH_SITELOADSEARCH): New.
1555 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1556 This is rather than relying on --enable-locallisppath elements
1557 having "site-lisp" in their names. (Bug#10208#25, 11658)
1558
0d23c240
EZ
15592012-06-30 Eli Zaretskii <eliz@gnu.org>
1560
c9240d7a
EZ
1561 * w32proc.c (sys_select): Accept and ignore one more argument.
1562
1563 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1564
0d23c240 1565 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1566 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1567
1568 * sysdep.c: Don't include dos.h and dosfns.h.
1569
1570 * process.c (sys_select):
1571 * msdos.c (sys_select): Accept one more argument and ignore it.
1572
1573 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1574 adapt data types and code to that.
1575
1576 * dosfns.c:
1577 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1578 which clashes with the gnulib function of the same name.
1579
af5a5a98
AS
15802012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1581
c5e4379c
AS
1582 * font.c (font_style_to_value, font_style_symbolic)
1583 (font_prop_validate_style): Add type checks for values in
1584 font_style_table.
1585
af5a5a98
AS
1586 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1587 argument.
1588 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1589 uses.
1590
8d38f461
EZ
15912012-06-29 Eli Zaretskii <eliz@gnu.org>
1592
2e5a6631
EZ
1593 * xdisp.c (try_window_id): Undo last change.
1594
8d38f461
EZ
1595 * w32.c (getwd): Adjust commentary about startup_dir.
1596 (init_environment): Always call sys_access, even in non-MSVC
1597 builds. Don't chdir to the directory of the Emacs executable.
1598 This undoes code from 1997 which was justified by the need to
1599 "avoid conflicts when removing and renaming directories". But its
1600 downside was that every relative file name was being interpreted
1601 relative to the directory of the Emacs executable, which can never
1602 be TRT. In particular, it broke sys_access when called with
1603 relative file names.
1604 (sys_access): Map GetLastError to errno.
1605
2af3565e
DA
16062012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1607
1608 * window.h (struct window): Change type of 'fringes_outside_margins'
1609 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1610 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1611 Adjust comment.
1612 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1613 to ptrdiff_t.
1614
c8d3a25c 16152012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1616
c8d3a25c
GM
1617 * gnutls.c (emacs_gnutls_handshake):
1618 Add QUIT to make the loop interruptible.
57570cd3 1619
c8d3a25c 16202012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1621
c8d3a25c
GM
1622 * charset.c (init_charset): Make lack of etc/charsets fatal.
1623
3e984ee8
DA
16242012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1625
1626 * editfns.c (region_limit): Fix type mismatch.
1627
ef884f23
DA
16282012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1629
1630 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1631 undefined. Convert from xassert to eassert.
1632 * nsmenu.m: Convert from xassert to eassert.
1633 * nsterm.m: Likewise.
1634
7d7e0027
SM
16352012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1636
1637 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1638
aa754e6a
PE
16392012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1640
1641 Avoid integer overflow on scroll-left and scroll-right.
1642 * window.c (HSCROLL_MAX): New macro.
1643 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1644 overflow when requested scroll falls outside ptrdiff_t range.
1645
80b00b08
DA
16462012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1647
1648 * window.h (struct window): Change type of 'hscroll',
1649 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1650 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1651 Adjust users accordingly.
1652 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1653 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1654 from EMACS_INT to ptrdiff_t.
1655 (make_window): Omit redundant initialization.
1656
62b2bcf6
JB
16572012-06-28 Juanma Barranquero <lekktu@gmail.com>
1658
1659 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1660
45942c7d
DA
16612012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1662
1663 * window.h (struct window): Change type of 'use_time' and
1664 'sequence_number' from Lisp_Object to int.
1665 * frame.c (make_frame): Adjust users accordingly.
1666 * print.c (print_object): Likewise.
1667 * window.c (select_window, Fwindow_use_time, make_parent_window)
1668 (make_window): Likewise.
1669
e509cfa6
DA
16702012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1671
1672 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1673 enabled with --enable-checking=[all,glyphs] configure option.
1674 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1675 adjust comments accordingly.
1676 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1677 undefined, adjust comments accordingly.
1678 * image.c: Likewise.
1679 * scroll.c: Likewise.
1680 * w32fns.c: Likewise.
1681 * w32term.c: Likewise.
1682 * xdisp.c: Likewise.
1683 * xfaces.c: Likewise.
1684 * xfns.c: Likewise.
1685 * xterm.c: Likewise.
1686
a54e2c05
DA
16872012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1688
1689 Generalize run-time debugging checks.
1690 * dispextern.h (XASSERTS): Remove.
1691 * fontset.c (xassert): Remove.
1692 Convert from xassert to eassert.
1693 * alloc.c: Convert from xassert to eassert.
1694 * bidi.c: Likewise.
1695 * dispnew.c: Likewise.
1696 * fns.c: Likewise.
1697 * fringe.c: Likewise.
1698 * ftfont.c: Likewise.
1699 * gtkutil.c: Likewise.
1700 * image.c: Likewise.
1701 * keyboard.c: Likewise.
1702 * menu.c: Likewise.
1703 * process.c: Likewise.
1704 * scroll.c: Likewise.
1705 * sound.c: Likewise.
1706 * term.c: Likewise.
1707 * w32console.c: Likewise.
1708 * w32fns.c: Likewise.
1709 * w32term.c: Likewise.
1710 * window.c: Likewise.
1711 * xdisp.c: Likewise.
1712 * xfaces.c: Likewise.
1713 * xfns.c: Likewise.
1714 * xselect.c: Likewise.
1715 * xterm.c: Likewise.
1716
1ec4b7b2
SM
17172012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1718
1719 * fns.c (maybe_resize_hash_table): Output message when growing the
1720 purify-hashtable.
1721
2014308a
DA
17222012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1723
1724 * alloc.c (allocate_string_data): Remove dead code.
1725 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1726 avoid GCC warning about unused macro.
1727
246155eb
DA
17282012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1729
1730 * alloc.c (allocate_string): Omit intervals initialization.
1731 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1732 as in make_pure_string and make_pure_c_string.
1733
43184b7b
DA
17342012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1735
d209e2fb 1736 * alloc.c (allocate_string): Fix last change.
43184b7b 1737
3fe6dd74
DA
17382012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1739
d209e2fb 1740 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1741 to memset, add explicit initialization where appropriate.
1742
1ba6038a
GM
17432012-06-27 Glenn Morris <rgm@gnu.org>
1744
1745 * lisp.mk (lisp): Remove paths.elc.
1746
c89926a5
CY
17472012-06-27 Chong Yidong <cyd@gnu.org>
1748
1749 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1750
ed6b3510
JW
17512012-06-26 John Wiegley <johnw@newartisans.com>
1752
1ec4b7b2 1753 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1754 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1755
ed6b3510
JW
1756 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1757 when building with Clang.
1758
8edd4a2b
SM
17592012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1760
1761 * eval.c (Fapply): Allow calling it with a single argument.
1762
f6f62d1b
EZ
17632012-06-26 Eli Zaretskii <eliz@gnu.org>
1764
1765 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1766 _stricmp and _strnicmp.
1767 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1768
62efea5e
DA
17692012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1770
1771 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1772 allocated window.
1773 (allocate_process): Likewise for new process.
8edd4a2b 1774 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1775 (allocate_frame): Likewise.
1776 * frame.c (make_frame): Omit redundant initialization.
1777 * window.c (make_parent_window): Use memset.
1778 (make_window): Omit redundant initialization.
1779 * process.c (make_process): Omit redundant initialization.
1780 * terminal.c (create_terminal): Likewise.
1781
42997f4d
DA
17822012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 * term.c (delete_tty): Remove redundant call to memset.
1785
1130ecfc
DA
17862012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1787
1788 * alloc.c: Remove build_string.
1789 * lisp.h: Define build_string as static inline. This provides
1790 a better opportunity to optimize away calls to strlen when the
1791 function is called with compile-time constant argument.
1792 * image.c (imagemagick_error): Convert to build_string.
1793 * w32proc.c (sys_spawnve): Likewise.
1794 * xterm.c (x_term_init): Likewise.
1795
cf38a720
PE
17962012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1797
99027bdd
PE
1798 Use sprintf return value instead of invoking strlen on result.
1799 In the old days this wasn't portable, since some sprintf
1800 implementations returned char *. But they died out years ago and
1801 Emacs already assumes sprintf returns int.
1802 Similarly for float_to_string.
1803 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1804 * ccl.c (ccl_driver):
1805 * character.c (string_escape_byte8):
1806 * data.c (Fnumber_to_string):
1807 * doprnt.c (doprnt):
1808 * print.c (print_object):
1809 * xdisp.c (message_dolog):
1810 * xfns.c (syms_of_xfns):
1811 Use sprintf or float_to_string result to avoid need to call strlen.
1812 * data.c (Fnumber_to_string):
1813 Use make_unibyte_string, since the string must be ASCII.
1814 * lisp.h, print.c (float_to_string): Now returns int length.
1815 * term.c (produce_glyphless_glyph):
1816 Use sprintf result rather than recomputing it.
1817
cf38a720
PE
1818 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1819 * Makefile.in (ALL_CFLAGS):
1820 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1821 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1822
3511c784
DA
18232012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1824
0a08eb21 1825 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1826 strcasecmp if available.
1827 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1828
fb7da12e
AS
18292012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1830
1831 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1832 Avoid comma operator.
1833 * menu.c (push_submenu_start, push_submenu_end)
1834 (push_left_right_boundary, push_menu_pane): Likewise.
1835 * msdos.c (dos_rawgetc): Likewise.
1836
afa2ffd8
DA
18372012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1838
1839 * xfns.c (xic_create_fontsetname): Remove redundant calls
1840 to memset.
1841
b3b4476b
PE
18422012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1843
4495ff38
PE
1844 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1845 sprintf already null-terminates its output.
1846
b3b4476b
PE
1847 * xfns.c (x_window): Remove redundant cast.
1848
b00876c9
DA
18492012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1850
1851 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1852 `const char *' to `char *' to avoid compiler warning.
1853
d188e26b
PE
18542012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1855
885d1d74
PE
1856 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1857 instead of truncating it to 63 (admittedly a generous limit).
1858
d188e26b
PE
1859 * process.c: Fix spelling and caps in comments.
1860
e2f560b1
DN
18612012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1862
e86db54b 1863 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1864 * sysdep.c (setpgrp): Remove definition, not used in this file.
1865
7583a3a1
JB
18662012-06-24 Juanma Barranquero <lekktu@gmail.com>
1867
1868 * makefile.w32-in: Update dependencies.
1869
696056c2
EZ
18702012-06-24 Eli Zaretskii <eliz@gnu.org>
1871
1872 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1873 (SYSTIME_H): Add nt/inc/sys/time.h.
1874
1875 * systime.h [WINDOWSNT]: Include sys/time.h.
1876
1877 * s/ms-w32.h (struct timespec): Definition moved from
1878 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1879
845ca893
PE
18802012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1881
1882 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1883 * buffer.h (buffer_slot_type_mismatch):
1884 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1885 * eval.c (unwind_to_catch):
1886 * image.c (my_png_error, my_error_exit):
1887 * keyboard.c (quit_throw_to_read_char, user_error)
1888 (Fexit_recursive_edit, Fabort_recursive_edit):
1889 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1890 (wrong_type_argument, buffer_overflow, __executable_start)
1891 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1892 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1893 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1894 (fatal):
1895 (child_setup) [!DOS_NT]:
1896 * lread.c (end_of_file_error, invalid_syntax):
1897 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1898 * puresize.h (pure_write_error):
1899 * search.c (matcher_overflow):
1900 * sound.c (sound_perror, alsa_sound_perror):
1901 * sysdep.c, syssignal.h (croak):
1902 * term.c (maybe_fatal, vfatal):
1903 * textprop.c (text_read_only):
1904 * undo.c (user_error):
1905 * unexmacosx.c (unexec_error):
1906 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1907 Use _Noreturn rather than NO_RETURN.
1908 No need for separate decl merely because of _Noreturn.
1909 * sound.c (sound_warning, parse_sound):
1910 Remove unnecessary forward decls.
1911
f1dd8073
PE
19122012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1913
1914 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1915 * lisp.h (WAIT_READING_MAX): New macro.
1916 * dispnew.c (Fsleep_for, sit_for):
1917 * keyboard.c (kbd_buffer_get_event):
1918 * process.c (Faccept_process_output):
1919 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1920 This improves on the previous patch, which introduced a bug
1921 when time_t is unsigned and as wide as intmax_t.
1922 See <http://bugs.gnu.org/9000#51>.
1923
b82c1755
EZ
19242012-06-23 Eli Zaretskii <eliz@gnu.org>
1925
1926 * dispnew.c (sit_for, Fsleep_for):
1927 * keyboard.c (kbd_buffer_get_event):
1928 * process.c (Faccept_process_output): Avoid compiler warnings when
1929 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1930
ca300656
JB
19312012-06-23 Juanma Barranquero <lekktu@gmail.com>
1932
049ec95b
JB
1933 * makefile.w32-in: Update dependencies.
1934
ca300656
JB
1935 * w32.c (ltime): Add return type and declare static.
1936 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1937
db7b8d06
PE
19382012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1939
1940 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1941 Privately reported by Herbert J. Skuhra.
1942 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1943 All uses changed.
1944 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1945 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1946
0bd8297f
EZ
19472012-06-23 Eli Zaretskii <eliz@gnu.org>
1948
96512555
EZ
1949 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1950 last argument of make_unibyte_string.
1951
0bd8297f
EZ
1952 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1953 language ID in the event parameters.
1954
1955 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1956 event.code, not the obscure "character set ID".
1957
63def6b6
CY
19582012-06-23 Chong Yidong <cyd@gnu.org>
1959
1960 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1961
e8a02204
EZ
19622012-06-23 Eli Zaretskii <eliz@gnu.org>
1963
388cdec0
EZ
1964 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1965 * w32.c (fdutimens): New function.
1966
1967 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1968
1969 * s/ms-w32.h (pselect): Redirect to sys_select.
1970
1971 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1972
e8a02204
EZ
1973 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1974 in the logic of incrementing and decrementing the value of
1975 use_relocatable_buffers.
1976
d054f3fb
PE
19772012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1978
1979 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1980 Privately reported by Herbert J. Skuhra.
1981 [__FreeBSD__]: Remove "*/" typo after "#include".
1982 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1983 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1984 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1985 Don't assume EMACS_TIME and struct timeval are the same type.
1986
d35af63c
PE
19872012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1988
1989 Support higher-resolution time stamps (Bug#9000).
1990 The time stamps are only nanosecond-resolution at the C level,
1991 since that's the best that any real-world system supports now.
1992 But they are picosecond-resolution at the Lisp level, as that's
1993 easy, and leaves room for future OS improvements.
1994
1995 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1996 (LIBES): Use it.
1997
1998 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1999 Don't get current time unless it's needed.
2000
2001 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2002 now provides it if it's absent.
2003 (start_atimer): Port to higher-res time stamps.
2004 Check for time stamp overflow. Don't get current time more
2005 often than is needed.
2006
2007 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2008 Include systime.h, not time.h.
2009 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2010
2011 * dired.c: Include stat-time.h.
2012 (Ffile-attributes): File times now have higher resolution.
2013
2014 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2015 (struct image): Timestamp now has higher resolution.
2016
2017 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2018 has at least microseconds now. All uses removed.
2019 (update_frame, update_single_window, update_window, update_frame_1)
2020 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2021
2022 * editfns.c (time_overflow): Now extern.
2023 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2024 (float-time, Fformat_time_string, Fcurrent_time_string)
2025 (Fcurrent_time_zone): Accept and generate higher-resolution
2026 time stamps.
2027 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2028 (decode_time_components, lisp_seconds_argument): New functions.
2029 (make_time): Now static.
2030 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2031 Report an error if the time is invalid, rather than having the caller
2032 do that.
2033
2034 * fileio.c: Include <stat-time.h>
2035 (Fcopy_file): Copy higher-resolution time stamps.
2036 Prefer to set the time stamp via a file descriptor if that works.
2037 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2038 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2039 (Fvisited_file_modtime, Fset_visited_file_modtime):
2040 Support higher-resolution time stamps.
2041
2042 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2043
2044 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2045
2046 * image.c (prepare_image_for_display, clear_image_cache)
2047 (lookup_image): Port to higer-resolution time stamps.
2048
2049 * keyboard.c (start_polling, bind_polling_period):
2050 Check for time stamp overflow.
2051 (read_char, kbd_buffer_get_event, timer_start_idle)
2052 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2053 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2054 Port to higher-resolution time stamps. Do not assume time_t is signed.
2055 (decode_timer): New function. Timers are now vectors of length 9,
2056 not 8, to accommodate the picosecond component.
2057 (timer_check_2): Use it.
2058
2059 * nsterm.m (select_timeout, timeval_subtract): Remove.
2060 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2061 as they're a bit more accurate and handle overflow better.
2062 (ns_select): Change prototype to be compatible with pselect.
2063 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2064 * nsterm.h (ns_select): Adjust prototype.
2065
2066 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2067 us-resolution time stamps.
2068 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2069
2070 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2071
2072 * lisp.h (time_overflow): New decl.
2073 (wait_reading_process_output): First arg is now intmax_t, not int,
2074 to accommodate larger waits.
2075
2076 * process.h (struct Lisp_Process.read_output_delay):
2077 Now counts nanoseconds, not microseconds.
2078 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2079 EMACS_HAS_USECS.
2080 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2081 (wait_reading_process_output):
2082 Port to ns-resolution time stamps.
2083 (Faccept_process_output, wait_reading_process_output):
2084 Check for time stamp overflow. Do not assume time_t is signed.
2085 (select_wrapper): Remove; we now use pselect.
2086 (Fprocess_attributes): Now generates ns-resolution time stamps.
2087
2088 * sysdep.c: Include utimens.h. Don't include utime.h
2089 or worry about struct utimbuf; gnulib does that for us now.
2090 (gettimeofday): Remove; gnulib provides a substitute.
2091 (make_timeval): New function.
2092 (set_file_times): Now sets ns-resolution time stamps.
2093 New arg FD; all uses changed.
2094 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2095 (system_process_attributes):
2096 Now returns ns-resolution time stamp. All uses changed.
2097 Check for time stamp overflow.
2098
2099 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2100 provides a substitute now.
2101
2102 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2103 since it guarantees struct timespec.
2104 (EMACS_TIME): Now struct timespec, so that we can support
2105 ns-resolution time stamps.
2106 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2107 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2108 (EMACS_USECS): Remove.
2109 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2110 so multiply the arg by 1000 before storing it.
2111 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2112 New macros.
2113 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2114 Port to ns-resolution time stamps.
2115 (EMACS_TIME_NEG_P): Remove; replaced by....
2116 (EMACS_TIME_SIGN): New macro.
2117 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2118 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2119 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2120 (make_timeval, make_lisp_time, decode_time_components): New decls.
2121 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2122 that it mishandled time_t overflow. You can't compare by subtracting!
2123 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2124 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
2125
2126 * term.c: Include <sys/time.h>.
2127 (timeval_to_Time): New function, for proper overflow wraparound.
2128 (term_mouse_position, term_mouse_click): Use it.
2129
2130 * undo.c (record_first_change): Support higher-resolution time stamps
2131 in the undo buffer.
2132 (Fprimitive_undo): Use them when restoring time stamps.
2133
2134 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
2135 (w32_get_internal_run_time):
2136 Port to higher-resolution Emacs time stamps.
2137 (ltime): Now accepts single 64-bit integer, as that's more convenient
2138 for callers.
2139
2140 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
2141
2142 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
2143 for compatibility with pselect. Support ns-resolution time stamps.
2144
2145 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
2146
2147 * xselect.c (wait_for_property_change, x_get_foreign_selection):
2148 Check for time stamp overflow, and support ns-resolution time stamps.
2149
2150 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
2151 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
2152 (timeval_subtract): Remove; no longer needed.
2153 (XTflash, XTring_bell, x_wait_for_event):
2154 Port to ns-resolution time stamps. Don't assume time_t is signed.
2155
b6a92dfe
CY
21562012-06-22 Chong Yidong <cyd@gnu.org>
2157
2158 * xdisp.c (x_consider_frame_title): Revert last change.
2159
d251c37c
EZ
21602012-06-22 Eli Zaretskii <eliz@gnu.org>
2161
2162 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
2163 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
2164 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
2165 staticidx goes up to 1597 out of 1600 = 0x640.)
2166
f10deafb
PE
21672012-06-20 Paul Eggert <eggert@cs.ucla.edu>
2168
2169 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
2170 Otherwise, the umask might be mistakenly 0 while handling input signals.
2171
ec6de1e2
SM
21722012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
2173
2174 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
2175
28be1ada
DA
21762012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
2177
2178 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
2179 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
2180 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
2181 access to `contents' member of Lisp_Vector objects with AREF and ASET
2182 where appropriate.
2183
c6bf3022
CY
21842012-06-19 Chong Yidong <cyd@gnu.org>
2185
2186 * frame.c (delete_frame): When selecting a frame on a different
2187 text terminal, do not alter the terminal's top-frame.
2188
2189 * xdisp.c (format_mode_line_unwind_data): Record the target
2190 frame's selected window and its terminal's top-frame.
2191 (unwind_format_mode_line): Restore them.
2192 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
2193 Callers changed.
2194 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
2195 since tty frames can be explicitly named.
2196 (prepare_menu_bars): Likewise.
2197
2198 * term.c (Ftty_top_frame): New function.
2199
defd4196
PE
22002012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2201
2202 Port byte-code-meter to modern targets.
2203 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
2204 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 2205 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
2206 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
2207 (METER_1, METER_2): Simplify.
2208
1053a871
SM
22092012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2210
2211 * data.c (Fdefalias): Return `symbol' (bug#11686).
2212
b7e8d081
MR
22132012-06-18 Martin Rudalics <rudalics@gmx.at>
2214
2215 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
2216 gets killed during executing of this function (Bug#11665).
2217 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
2218 (Vkill_buffer_query_functions): In doc-string say that functions
2219 run by this hook should not change the current buffer.
2220
7ea2b339
PE
22212012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2222
2223 Fix recently-introduced process.c problems found by static checking.
2224 * process.c (write_queue_push, write_queue_pop, send_process):
2225 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
2226 (write_queue_pop): Fix pointer signedness problem.
2227 (send_process): Remove unused local.
2228
96a313a1
CY
22292012-06-17 Chong Yidong <cyd@gnu.org>
2230
2231 * xdisp.c (redisplay_internal): No need to redisplay terminal
2232 frames that are not on top.
2233
20ca2e94
TN
22342012-06-17 Troels Nielsen <bn.troels@gmail.com>
2235
2236 * process.c (make_process): Initialize write_queue.
2237 (write_queue_push, write_queue_pop): New functions.
2238 (send_process): Use them to maintain correct ordering of process
2239 writes (Bug#10815).
2240
9a900ca9
PE
22412012-06-17 Paul Eggert <eggert@cs.ucla.edu>
2242
310fbfa8
PE
2243 * lisp.h (eassert): Assume C89 or later.
2244 This removes the need for CHECK.
2245 (CHECK): Remove. Its comments about always evaluating its
2246 argument were confusing, as 'eassert' typically does not evaluate
2247 its argument.
2248
27bb1ca4
PE
2249 * coding.c (produce_chars): Use ptrdiff_t, not int.
2250
9a900ca9
PE
2251 * xterm.c (x_draw_underwave): Check for integer overflow.
2252 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
2253
41b7f8bc 22542012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
2255
2256 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
2257 referenced (Bug#11583).
2258
9b0e3eba
AA
22592012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
2260
2261 Implement wave-style variant of underlining.
2262 * dispextern.h (face_underline_type): New enum.
2263 (face): Add field for underline type.
2264 * nsterm.m (ns_draw_underwave): New function.
2265 (ns_draw_text_decoration): Use it.
2266 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
2267 New functions.
2268 (x_draw_glyph_string): Use them.
2269 * xfaces.c (Qline, Qwave): New Lisp objects.
2270 (check_lface_attrs, merge_face_ref)
1053a871
SM
2271 (Finternal_set_lisp_face_attribute, realize_x_face):
2272 Handle wave-style underline face attributes.
9b0e3eba
AA
2273 * xterm.c (x_draw_underwave): New function.
2274 (x_draw_glyph_string): Use it.
2275
0fb52f11
JB
22762012-06-16 Juanma Barranquero <lekktu@gmail.com>
2277
2278 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
2279 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
2280 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
2281 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
2282 ($(BLD)/w32select.$(O)): Update dependencies.
2283
e5560ff7
AS
22842012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2285
2286 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
2287 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
2288 * character.c (_fetch_multibyte_char_p): Remove.
2289 * alloc.c: Include "character.h" before "buffer.h".
2290 * bidi.c: Likewise.
2291 * buffer.c: Likewise.
2292 * bytecode.c: Likewise.
2293 * callint.c: Likewise.
2294 * callproc.c: Likewise.
2295 * casefiddle.c: Likewise.
2296 * casetab.c: Likewise.
2297 * category.c: Likewise.
2298 * cmds.c: Likewise.
2299 * coding.c: Likewise.
2300 * composite.c: Likewise.
2301 * dired.c: Likewise.
2302 * dispnew.c: Likewise.
2303 * doc.c: Likewise.
2304 * dosfns.c: Likewise.
2305 * editfns.c: Likewise.
2306 * emacs.c: Likewise.
2307 * fileio.c: Likewise.
2308 * filelock.c: Likewise.
2309 * font.c: Likewise.
2310 * fontset.c: Likewise.
2311 * fringe.c: Likewise.
2312 * indent.c: Likewise.
2313 * insdel.c: Likewise.
2314 * intervals.c: Likewise.
2315 * keyboard.c: Likewise.
2316 * keymap.c: Likewise.
2317 * lread.c: Likewise.
2318 * macros.c: Likewise.
2319 * marker.c: Likewise.
2320 * minibuf.c: Likewise.
2321 * nsfns.m: Likewise.
2322 * nsmenu.m: Likewise.
2323 * print.c: Likewise.
2324 * process.c: Likewise.
2325 * regex.c: Likewise.
2326 * region-cache.c: Likewise.
2327 * search.c: Likewise.
2328 * syntax.c: Likewise.
2329 * term.c: Likewise.
2330 * textprop.c: Likewise.
2331 * undo.c: Likewise.
2332 * unexsol.c: Likewise.
2333 * w16select.c: Likewise.
2334 * w32fns.c: Likewise.
2335 * w32menu.c: Likewise.
2336 * window.c: Likewise.
2337 * xdisp.c: Likewise.
2338 * xfns.c: Likewise.
2339 * xmenu.c: Likewise.
2340 * xml.c: Likewise.
2341 * xselect.c: Likewise.
2342
2f07e6af
EZ
23432012-06-16 Eli Zaretskii <eliz@gnu.org>
2344
1053a871
SM
2345 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
2346 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 2347 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
2348 row.
2349 (handle_face_prop): Use chunk-relative overlay string index when
2350 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
2351 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
2352 the rightmost. (Bug#11720)
2f07e6af 2353
29b83cec
AS
23542012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2355
2356 * category.h (CHAR_HAS_CATEGORY): Define as inline.
2357 (CATEGORY_MEMBER): Enforce 1/0 value.
2358 * category.c (_temp_category_set): Remove.
2359
4c5501e9
EZ
23602012-06-16 Eli Zaretskii <eliz@gnu.org>
2361
2362 * window.c (Fdelete_other_windows_internal)
2363 (Fdelete_window_internal): Don't access frame's mouse highlight
2364 info of the initial frame. (Bug#11677)
2365
2b570124
PE
23662012-06-14 Paul Eggert <eggert@cs.ucla.edu>
2367
e93864f9
PE
2368 * .gdbinit (xgetint): Fix recently-introduced paren typo.
2369 Assume USE_2_TAGS_FOR_INTS.
2370 (xreload): Adjust $tagmask width to match recent lisp.h change.
2371
2b570124
PE
2372 Simplify lisp.h in minor ways that should not affect code.
2373 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
2374 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
2375 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
2376 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
2377 (INTTYPEBITS): New macro, for clarity.
2378 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
2379 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
2380 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
2381 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
2382 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
2383
81755f69
JB
23842012-06-13 Juanma Barranquero <lekktu@gmail.com>
2385
2386 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
2387
16192a57
GM
23882012-06-13 Glenn Morris <rgm@gnu.org>
2389
2390 * s/bsd-common.h (BSD4_3):
2391 * s/usg5-4-common.h (USG5_4): No longer define; unused.
2392
646b5f55
AS
23932012-06-13 Andreas Schwab <schwab@linux-m68k.org>
2394
2395 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
2396 instead of union.
2397 (XLI, XIL): Define.
1053a871
SM
2398 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
2399 Use them.
2400 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 2401 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 2402 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
2403 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
2404 * frame.c (delete_frame): Remove outdated comment.
2405 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
2406 USE_LISP_UNION_TYPE.
2407 (Fw32_unregister_hot_key): Likewise.
2408 (Fw32_toggle_lock_key): Likewise.
2409 * w32menu.c (add_menu_item): Likewise.
2410 (w32_menu_display_help): Use XIL instead of checking
2411 USE_LISP_UNION_TYPE.
2412 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
2413 (init_heap): Likewise.
2414 * w32term.c (w32_read_socket): Update comment.
2415
1d3823c9
GM
24162012-06-13 Glenn Morris <rgm@gnu.org>
2417
c62ff706
GM
2418 * s/usg5-4-common.h, src/s/unixware.h:
2419 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
2420
1d3823c9
GM
2421 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
2422
bfe3e0a2
PE
24232012-06-13 Paul Eggert <eggert@cs.ucla.edu>
2424
2425 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
2426 * alloc.c (make_number) [!defined make_number]:
2427 Remove, as lisp.h always defines this now.
2428 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
2429 (roundup_size): Verify that it is a power of 2.
2430 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2431 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2432 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2433 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2434 USE_LSB_TAG now is always defined to be either 0 or 1.
2435 All uses changed.
2436 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2437 code works fine either way, and efficiency is not a concern here,
2438 as the union type is for debugging, not for production.
2439 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2440 Use an inline function on all platforms when using the union type,
2441 since this is simpler and 'static inline' can be used portably
2442 within Emacs now.
2443 (LISP_INITIALLY_ZERO): New macro.
2444 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2445 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2446
45fa9c0f
GM
24472012-06-12 Glenn Morris <rgm@gnu.org>
2448
b4492cba
GM
2449 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2450
2451 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 2452
45fa9c0f
GM
2453 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2454 Move BROKEN_SIGIO to configure.
2455
2456 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2457 Move NO_TERMIO to configure.
2458
0e25d334
CY
24592012-06-12 Chong Yidong <cyd@gnu.org>
2460
2461 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2462 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2463 MagickExportImagePixels is undefined.
2464
43682bb6
PE
24652012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2466
2467 * image.c (imagemagick_load_image): Remove unused label.
2468
a9be7d2b
GM
24692012-06-11 Glenn Morris <rgm@gnu.org>
2470
2471 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2472 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2473 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2474 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2475
3017f87f
SM
24762012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2477
2478 * alloc.c (make_byte_code): New function.
2479 (Fmake_byte_code): Use it. Don't purify here.
2480 * lread.c (read1): Use it as well to avoid extra allocation.
2481
1b9b4cf4
CY
24822012-06-11 Chong Yidong <cyd@gnu.org>
2483
2484 * image.c (imagemagick_load_image): Implement transparency.
2485
95988fcf
AS
24862012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2487
2488 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2489 account for preceding backslashes. (Bug#11663)
2490
cd4eb164
CY
24912012-06-09 Chong Yidong <cyd@gnu.org>
2492
2493 * term.c: Support italics in capable terminals (Bug#9652).
2494 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2495 (turn_on_face): Output using TS_enter_italic_mode if available.
2496 Don't handle unused blinking and alt-charset cases.
2497 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2498 and tty_alt_charset_p cases.
2499 (tty_capable_p, init_tty): Support italics.
2500
2501 * termchar.h (struct tty_display_info): Add field for italics.
2502 Remove unused blink field.
2503
2504 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2505 Handle slant.
2506
2507 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2508 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2509 tty_alt_charset_p. Add tty_italic_p.
2510
ff88beb8
MA
25112012-06-09 Michael Albinus <michael.albinus@gmx.de>
2512
2513 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
2514 dbus_type_is_basic if available.
2515 (xd_extract_signed, xd_extract_unsigned): Rename from
2516 extract_signed and extract_unsigned, respectively. Adapt callers.
2517
44286096
CY
25182012-06-09 Chong Yidong <cyd@gnu.org>
2519
1682701f
CY
2520 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2521
44286096
CY
2522 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2523 case (Bug#9752).
2524
d86feb17
PE
25252012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2526
2527 * xdisp.c (vmessage): Treat frame message as multibyte.
2528 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2529 would generate the diagnostic "Making \302\247 buffer-local while
2530 let-bound!".
2531
d5c20fe8
EZ
25322012-06-08 Eli Zaretskii <eliz@gnu.org>
2533
2534 * dispnew.c (showing_window_margins_p): Undo last change, which
2535 was done due to an inadvertent commit.
2536 (adjust_frame_glyphs_for_frame_redisplay): Do call
2537 showing_window_margins_p.
2538
513749ee
SM
25392012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2540
2541 * eval.c (Fmake_var_non_special): New primitive.
2542 (syms_of_eval): Defsubr it.
2543 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2544
d4a8f5c1
JB
25452012-06-08 Juanma Barranquero <lekktu@gmail.com>
2546
2547 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2548 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2549
8bbbc977
EZ
25502012-06-08 Eli Zaretskii <eliz@gnu.org>
2551
2552 * alloc.c (allocate_vectorlike): Fix last change.
2553
f3372c87
DA
25542012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2555
2556 Block-based vector allocation of small vectors.
2557 * lisp.h (struct vectorlike_header): New field `nbytes',
2558 adjust comment accordingly.
2559 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2560 to denote vector blocks. Adjust users (live_vector_p,
2561 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2562 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2563 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2564 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2565 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2566 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2567 (roundup_size): New constant.
2568 (struct vector_block): New data type.
2569 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2570 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2571 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2572 (sweep_vectors): New functions.
2573 (allocate_vectorlike): Return `zero_vector' as the only vector of
2574 0 items. Allocate new vector from block if vector size is less than
2575 or equal to VBLOCK_BYTES_MAX.
2576 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2577 (init_alloc_once): Add call to init_vectors.
2578
4f18a4ed
SM
25792012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2580
2581 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2582
86f158bc
PE
25832012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2584
2585 * doprnt.c (doprnt): Truncate multibyte char correctly.
2586 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2587 would mishandle a string argument "Xc" if X was a multibyte
2588 character of length 2: it would truncate after X's first byte
2589 rather than including all of X.
2590
c5cfcbe0
CY
25912012-06-06 Chong Yidong <cyd@gnu.org>
2592
2593 * buffer.c (word_wrap): Doc fix.
2594
c05cf390
PE
25952012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2596
2597 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2598
0c3461de
GM
25992012-06-03 Glenn Morris <rgm@gnu.org>
2600
2601 * xdisp.c (tool-bar-style): Doc fix.
2602
c71232db
UM
26032012-06-03 Ulrich Müller <ulm@gentoo.org>
2604
2605 * Makefile.in (PAXCTL): Define.
2606 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2607 binary via PaX flags if the paxctl utility is available.
2608 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2609 Restore PaX flags to their default. (Bug#11398)
2610
383f7350
CY
26112012-06-03 Chong Yidong <cyd@gnu.org>
2612
2613 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2614 buffer (Bug#11226).
2615
5f2c76c6
CY
26162012-06-03 Chong Yidong <cyd@gnu.org>
2617
2618 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2619 (note_mode_line_or_margin_highlight): If there is no help echo,
2620 use mode-line-default-help-echo. Handle the case where the mouse
2621 position is past the end of the mode line string.
2622
2623 * buffer.c (buffer_local_value_1): New function, split from
2624 Fbuffer_local_value; can return Qunbound.
2625 (Fbuffer_local_value): Use it.
2626 (Vmode_line_format): Docstring tweaks.
2627
773d47f6
PE
26282012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2629
2630 * sysdep.c (system_process_attributes): Improve comment.
2631
f2d6a3df
SM
26322012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2633
2634 * keyboard.c: Export real-this-command to Elisp.
2635 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2636 and DEFVAR it. Update all users.
2637
63810350
PE
26382012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2639
7bd5c1f4
PE
2640 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2641
63810350
PE
2642 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2643 Convert pctcpu and pctmem to Lisp float properly.
2644 Let the compiler fold better, as 100.0/0x8000 is exact.
2645
a2821611
AS
26462012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2647
2648 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2649 cons_block.
2650
5fceba1d
PE
26512012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2654
c98ff5dd
DA
26552012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2656
2657 For a 'struct window', replace some Lisp_Object fields to
2658 bitfields where appropriate, remove unused fields.
2659 * window.h (struct window): Remove unused 'last_mark_x' and
2660 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2661 change it's type from Lisp_Object to bitfield.
2662 Change type of 'force_start', 'optional_new_start',
2663 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2664 fields from Lisp_Object to bitfield. Adjust users accordingly.
2665
ca34e0be
PE
26662012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2667
2668 Pacify gcc -Wdouble-precision when using Xaw.
2669 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2670 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2671 Use 'float' consistently, rather than 'float' in most places
2672 and 'double' in a couple of places.
2673
efc00ab1 26742012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2675
2676 * xdisp.c (handle_stop): Detect whether we have overlay strings
2677 loaded by testing it->current.overlay_string_index to be
2678 non-negative, instead of checking whether n_overlay_strings is
2679 positive. (Bug#11587)
2680
efc00ab1 26812012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2682
2683 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2684
2685 * doc.c (Fsubstitute_command_keys): Doc fix.
2686
efc00ab1 26872012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2688
2689 * search.c (search_buffer): Remove calls to
2690 r_alloc_inhibit_buffer_relocation, as it is now called by
2691 maybe_unify_char, which was the cause of relocation of buffer text
2692 in bug#11519.
2693
efc00ab1 26942012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2695
2696 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2697 for the duration of call to load_charset, to avoid problems with
2698 callers of maybe_unify_char that access buffer text through C
2699 pointers.
2700
2701 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2702 decrement the inhibition flag, instead of just setting or
2703 resetting it.
2704
ba93a187
PE
27052012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2706
2707 Remove obsolete '#define static' cruft.
2708 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2709 This #undef was "temporary" in 2000; it is no longer needed
2710 now that '#define static' has gone away.
2711 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2712 (gray_bitmap_bits): Remove; no longer needed.
2713 All uses replaced with definiens.
2714 * xterm.c: Include "bitmaps/gray.xbm".
2715
9e4bf381
PE
27162012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2717
2718 Clean up __executable_start, monstartup when --enable-profiling.
2719 The following changes affect the code only when profiling.
2720 * dispnew.c (__executable_start): Rename from safe_bcopy.
2721 Define only on platforms that need it.
2722 * emacs.c: Include <sys/gmon.h> when profiling.
2723 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2724 (__executable_start): Remove decl, since lisp.h does it now.
2725 (safe_bcopy): Remove decl; no longer has that name.
2726 (main): Coalesce #if into single bit of code, for simplicity.
2727 Cast pointers to uintptr_t, since standard libraries want integers
2728 and not pointers.
2729 * lisp.h (__executable_start): New decl.
2730
32d72c2f
GM
27312012-05-31 Glenn Morris <rgm@gnu.org>
2732
2733 * image.c (Fimagemagick_types): Doc fix.
2734
baac5bc7
JM
27352012-05-30 Jim Meyering <meyering@redhat.com>
2736
2737 * callproc.c (Fcall_process_region): Include directory component
2738 in mkstemp error message (Bug#11586).
2739
72cb32cf
PE
27402012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2741
2742 * alloc.c, lisp.h (make_pure_vector): Now static.
2743
61b108cc
SM
27442012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2745
2746 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2747 Move to byte-run.el.
2748 (Fautoload): Do the hash-doc more carefully.
2749 * data.c (Fdefalias): Purify definition, except for keymaps.
2750 (Qdefun): Move from eval.c.
2751 * lisp.h (Qdefun): Remove.
2752 * lread.c (read1): Tiny simplification.
2753
471fe23d
TN
27542012-05-29 Troels Nielsen <bn.troels@gmail.com>
2755
934f3f58 2756 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2757 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2758 Bug#9642, but explicitly check that the buffer the overlay would
2759 be moved to is live and rearrange lines to make sure that errors
2760 will not put the overlay in an inconsistent state.
2761 (Fdelete_overlay): Cosmetics.
2762
85d0efd1
EZ
27632012-05-28 Eli Zaretskii <eliz@gnu.org>
2764
2765 * w32term.c (my_bring_window_to_top): New function.
2766 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2767 could be different from the original one.
2768 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2769 (Bug#11513)
2770
2771 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2772 by calling BringWindowToTop.
2773
2774 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2775 (WM_EMACS_END): Increase by one.
2776
da92a98c
PE
27772012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2778
2779 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2780 This avoids undefined behavior that might cause the eassert
2781 to not catch an out-of-range value.
2782
74d1f848
JB
27832012-05-28 Juanma Barranquero <lekktu@gmail.com>
2784
2785 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2786 Update dependencies.
2787
9e1a06fc
EZ
27882012-05-27 Eli Zaretskii <eliz@gnu.org>
2789
2790 * bidi.c (bidi_mirror_char): Fix last change.
2791
f3dd7312
AS
27922012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2793
2794 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2795 when referring to sectname field in printf format.
2796
81899c91
PE
27972012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2798
57b81a9f
PE
2799 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2800 Only r_alloc_inhibit_buffer_relocation needed to be added;
2801 the others were already declared.
2802
81899c91
PE
2803 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2804 before checking whether it's out of range. Put the check inside
2805 eassert. See
2806 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2807
33017faf 28082012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2809
2810 * callproc.c (Fcall_process): Restore a line that was accidentally
2811 commented out in the 2011-02-13 change (bug#11547).
2812
33017faf 28132012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2814
2815 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2816 defined on ralloc.c.
2817
2818 * buffer.c [REL_ALLOC]: Remove prototypes of
2819 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2820 they are now on lisp.h.
2821
2822 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2823
2824 * search.c (search_buffer): Use it to inhibit relocation of buffer
2825 text while re_search_2 is doing its job, because re_search_2 is
2826 passed C pointers to buffer text. (Bug#11519)
2827
23415acf
EZ
2828 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2829 Update value to 24.
2830
44e27368
EZ
2831 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2832 state after an additional call to move_it_in_display_line_to, keep
2833 the values of it->max_ascent and it->max_descent found for the
2834 entire line.
2835 (pos_visible_p): Revert the comparison against bottom_y to what it
2836 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2837 (Bug#11464)
2838
c1892f11
PE
28392012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2840
2841 Fix coding-related core dumps with gcc -ftrapv.
2842 The code was computing A - B, where A and B are pointers, and B is
2843 random garbage. This can lead to core dumps on platforms that
2844 have special pointer registers, and it also leads to core dumps on
2845 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2846 A - B only when B is initialized properly.
2847 * coding.c (coding_set_source, coding_set_destination): Return void.
2848 (coding_change_source, coding_change_destinations): New functions,
2849 with the old behaviors of coding_set_source and coding_set_destination.
2850 All callers that need an offset changed to use these new functions.
2851
eb7afdad
GM
28522012-05-26 Glenn Morris <rgm@gnu.org>
2853
2854 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2855
f12fdf02
EZ
28562012-05-26 Eli Zaretskii <eliz@gnu.org>
2857
53a63be6 2858 Extend mouse support on W32 text-mode console.
61b108cc
SM
2859 * xdisp.c (draw_row_with_mouse_face):
2860 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2861
eb3f6f01 2862 * w32console.c: Include window.h.
61b108cc
SM
2863 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2864 New functions.
eb3f6f01
EZ
2865 (initialize_w32_display): Initialize mouse-highlight data.
2866
53a63be6
EZ
2867 * w32inevt.c: Include termchar.h and window.h.
2868 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2869 moves, call note_mouse_highlight. If help_echo changed, call
2870 gen_help_event to produce help-echo message in the echo area.
2871 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2872 highlight info.
2873
4cfd81f6
PE
28742012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2875
2876 * lread.c (read1): Simplify slightly to avoid an overflow warning
2877 with GCC 4.7.0 on x86-64.
2878
4446092a
EZ
28792012-05-26 Eli Zaretskii <eliz@gnu.org>
2880
2881 * bidi.c (bidi_mirror_char): Revert last change: an int is
2882 definitely wide enough here.
2883
42b2a986 28842012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2885
42b2a986 2886 Fix integer width and related bugs (Bug#9874).
eb106a49 2887 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2888 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2889 (string_bytes, check_sblock, allocate_string_data):
2890 (compact_small_strings, Fmake_bool_vector, make_string)
2891 (make_unibyte_string, make_multibyte_string)
2892 (make_string_from_bytes, make_specified_string)
2893 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2894 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2895 (mark_vectorlike):
2896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2897 (allocate_pseudovector):
2898 Use int, not EMACS_INT, where int is wide enough.
2899 (inhibit_garbage_collection, Fgarbage_collect):
2900 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2901 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2902 int might not be wide enough.
2903 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2904 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2905 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2906 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2907 (bidi_level_of_next_char, bidi_move_to_visually_next):
2908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2909 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2910 (Fkill_buffer, Fset_buffer_major_mode)
2911 (advance_to_char_boundary, Fbuffer_swap_text)
2912 (Fset_buffer_multibyte, overlays_at, overlays_in)
2913 (overlay_touches_p, struct sortvec, record_overlay_string)
2914 (overlay_strings, recenter_overlay_lists)
2915 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2916 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2917 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2918 (Foverlay_recenter, last_overlay_modification_hooks_used)
2919 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2920 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2921 (validate_region): Omit unnecessary test for b <= e,
2922 since that's guaranteed by the previous test.
d311d28c
PE
2923 (adjust_overlays_for_delete): Avoid pos + length overflow.
2924 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2925 (report_overlay_modification):
2926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2927 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2928 Omit pointer cast, which isn't needed anyway, and doesn't work
2929 after the EMACS_INT -> ptrdiff_t change.
02481186 2930 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2931 * buffer.h: Adjust decls to match defn changes elsewhere.
2932 (struct buffer_text, struct buffer):
2933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2934 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2935 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2936 not int, to avoid needless 32-bit limit on 64-bit hosts.
2937 (exec_byte_code): Use tighter memory-full test, one that checks
2938 for alloca overflow. Don't compute the address of the object just
2939 before an array, as that's not portable. Use EMACS_INT, not
2940 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2941 * callint.c (Fcall_interactively):
2942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2943 * callproc.c (call_process_kill, Fcall_process):
2944 Don't assume pid_t fits into an Emacs fixnum.
2945 (call_process_cleanup, Fcall_process, child_setup):
2946 Don't assume pid_t fits into int.
2947 (call_process_cleanup, Fcall_process, delete_temp_file)
2948 (Fcall_process_region):
2949 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2950 (Fcall_process): Simplify handling of volatile integers.
2951 Use int, not EMACS_INT, where int will do.
2952 * casefiddle.c (casify_object, casify_region, operate_on_word)
2953 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2955 (casify_object): Avoid integer overflow when overallocating buffer.
2956 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2957 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2958 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2959 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2960 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2961 integers are now checked earlier. All uses replaced with XINT.
2962 (ccl_driver):
2963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2964 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2965 (ccl_driver, Fregister_code_conversion_map):
2966 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2967 (resolve_symbol_ccl_program): Check that vector header is in range.
2968 Always copy the vector, so that we can check its contents reliably
2969 now rather than having to recheck each instruction as it's being
2970 executed. Check that vector words fit in 'int'.
2971 (ccl_get_compiled_code, Fregister_ccl_program)
2972 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2973 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2974 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2975 contents are in range.
2976 (Fccl_execute_on_string): Check that status is in range.
2977 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2978 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2979 Accept and return EMACS_INT, not int, because callers can pass values
2980 out of 'int' range.
2981 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2982 (multibyte_chars_in_text, parse_str_as_multibyte)
2983 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2984 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2985 (string_escape_byte8, Fget_byte):
2986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2987 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2988 avoid mishandling large integers.
2989 * character.h: Adjust decls to match defn changes elsewhere.
2990 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2991 (Ffind_charset_region):
2992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2993 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2994 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2995 Don't assume fixnum fits in int.
d311d28c
PE
2996 (load_charset_map_from_vector, Fmap_charset_chars):
2997 Remove now-unnecessary CHECK_NATNUMs.
2998 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2999 Don't rely on undefined behavior with signed left shift overflow.
3000 Don't assume unsigned int fits into fixnum, or that fixnum fits
3001 into unsigned int. Don't require max_code to be a valid fixnum;
3002 that's not true for gb10830 4-byte on a 32-bit host. Allow
3003 invalid_code to be a cons, for the same reason. Require code_offset
3004 to be a character. Avoid int overflow if max_char is close
3005 to INT_MAX.
3006 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3007 this is intended anyway and avoids some undefined behavior.
3008 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3009 INDEX_TO_CODE_POINT, as that's what it expects.
3010 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
3011 * charset.h (DECODE_CHAR): Return int, not unsigned;
3012 this is what was intended anyway, and it avoids undefined behavior.
3013 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3014 integer-overflow issues.
3015 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3016 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3017 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
3018 * chartab.c (Fmake_char_table, Fset_char_table_range)
3019 (uniprop_get_decoder, uniprop_get_encoder):
3020 Don't assume fixnum fits in int.
3021 * cmds.c (move_point): New function, that does the gist of
3022 Fforward_char and Fbackward_char, but does so while checking
3023 for integer overflow more accurately.
c96e5d6a 3024 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
3025 (Fforward_line, Fend_of_line, internal_self_insert)
3026 (internal_self_insert):
3027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3028 Fix a FIXME, by checking for integer overflow when calculating
3029 target_clm and actual_clm.
3030 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 3031 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
3032 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3033 (coding_alloc_by_making_gap, alloc_destination)
3034 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3035 (encode_coding_utf_16, detect_coding_emacs_mule)
3036 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3037 (detect_coding_iso_2022, decode_coding_iso_2022)
3038 (encode_invocation_designation, encode_designation_at_bol)
3039 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3040 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3041 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3042 (encode_coding_ccl, encode_coding_raw_text)
3043 (detect_coding_charset, decode_coding_charset)
3044 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3045 (produce_composition, produce_charset, produce_annotation)
3046 (decode_coding, handle_composition_annotation)
3047 (handle_charset_annotation, consume_chars, decode_coding_gap)
3048 (decode_coding_object, encode_coding_object, detect_coding_system)
3049 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3050 (code_convert_region, code_convert_string)
8f50130c
PE
3051 (Fdefine_coding_system_internal)
3052 (coding_set_source, coding_set_destination):
d311d28c
PE
3053 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3054 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3055 (Fdefine_coding_system_internal):
3056 Don't assume fixnums fit in int.
3057 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 3058 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
3059 (Funencodable_char_position, Fcheck_coding_systems_region)
3060 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 3061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 3062 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 3063 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 3064 Don't access memory outside of the args array.
d311d28c 3065 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
3066 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3067 result of ENCODE_CHAR.
d311d28c
PE
3068 * coding.h: Adjust decls to match defn changes elsewhere.
3069 (struct coding_system):
3070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3071 * composite.c (get_composition_id, find_composition)
3072 (run_composition_function, update_compositions)
3073 (compose_text, composition_gstring_put_cache)
3074 (composition_gstring_p, composition_gstring_width)
3075 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3076 (composition_compute_stop_pos, composition_reseat_it)
3077 (composition_update_it, struct position_record)
3078 (find_automatic_composition, composition_adjust_point)
3079 (Fcomposition_get_gstring, Ffind_composition_internal):
3080 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3081 (update_compositions):
3082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3083 * composite.h: Adjust decls to match defn changes elsewhere.
3084 (struct composition):
3085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3086 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3087 Do not attempt to compute the address of the object just before a
3088 buffer; this is not portable.
3089 (Faref, Faset):
3090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3091 (Faset): Use int, not EMACS_INT, where int is wide enough.
3092 (Fstring_to_number): Don't assume fixnums fit in int.
3093 (Frem): Don't assume arg is nonnegative.
3094 * dbusbind.c (xd_append_arg): Check for integers out of range.
3095 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 3096 (extract_signed, extract_unsigned): New functions.
243e0530
PE
3097 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3098 (xd_get_connection_references): Return ptrdiff_t, not int.
3099 All uses changed.
3100 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3101 (xd_read_message_1):
3102 Use int, not unsigned, where the dbus API uses int.
3103 (Fdbus_message_internal): Don't overflow mtype.
3104 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
3105 * dired.c (directory_files_internal, file_name_completion, scmp)
3106 (file_name_completion_stat):
3107 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3108 (file_name_completion): Don't overflow matchcount.
3109 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3110 * dispextern.h: Adjust decls to match defn changes elsewhere.
3111 (struct text_pos, struct glyph, struct bidi_saved_info)
3112 (struct bidi_string_data, struct bidi_it, struct composition_it)
3113 (struct it):
3114 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3115 (struct display_pos, struct composition_it, struct it):
3116 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3117 * dispnew.c (increment_matrix_positions)
3118 (increment_row_positions, mode_line_string)
3119 (marginal_area_string):
3120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 3121 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
3122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3123 (duration_to_sec_usec): New function, to check for overflow better.
3124 (Fsleep_for, sit_for): Use it.
3125 * doc.c (get_doc_string, store_function_docstring):
3126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3127 (get_doc_string, Fsnarf_documentation):
3128 Use int, not EMACS_INT, where int is wide enough.
3129 (get_doc_string):
3130 Use SAFE_ALLOCA, not alloca.
3131 Check for overflow when converting EMACS_INT to off_t.
3132 * doprnt.c (doprnt):
3133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3134 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
3135 Don't assume uid_t fits into fixnum.
3136 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
3137 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
3138 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
3139 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
3140 (general_insert_function)
3141 (Finsert_char, make_buffer_string, make_buffer_string_both)
3142 (update_buffer_properties, Fbuffer_substring)
3143 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
3144 (Fsubst_char_in_region, check_translation)
3145 (Ftranslate_region_internal, save_restriction_restore, Fformat)
3146 (transpose_markers, Ftranspose_regions):
3147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3148 (clip_to_bounds): Move to lisp.h as an inline function).
3149 (Fconstrain_to_field): Don't assume integers are nonnegative.
3150 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
3151 (Fsubst_char_in_region, Fsave_restriction):
3152 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3153 (Femacs_pid): Don't assume pid_t fits into fixnum.
3154 (lo_time): Use int, not EMACS_INT, when int suffices.
3155 (lisp_time_argument): Check for usec out of range.
3156 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
3157 (Fuser_login_name, Fuser_full_name): Signal an error
3158 if a uid argument is out of range, rather than relying on
3159 undefined behavior.
c8d5c857
PE
3160 (Fformat_time_string): Remove now-unnecessary check.
3161 lisp_time_argument checks for out-of-range usec now.
243e0530 3162 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
3163 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
3164 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
3165 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
3166 (init_cmdargs, Fdump_emacs):
3167 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3168 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
3169 the bottom (typically) 32 bits of the fixnum.
3170 * eval.c (specpdl_size, call_debugger):
3171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3172 (when_entered_debugger, Fbacktrace_debug):
3173 Don't assume fixnum can fit in int.
3174 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
3175 the object just before a buffer; this is not portable.
3176 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
3177 (grow_specpdl, unbind_to):
3178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3179 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
3180 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 3181 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
3182 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
3183 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
3184 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3185 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
3186 (a_write, e_write):
3187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3188 (Fcopy_file, non_regular_nbytes, read_non_regular)
3189 (Finsert_file_contents):
3190 Use int, not EMACS_INT, where int is wide enough.
3191 (READ_BUF_SIZE): Verify that it fits in int.
3192 (Finsert_file_contents): Check that counts are in proper range,
3193 rather than assuming fixnums fit into ptrdiff_t etc.
3194 Don't assume fixnums fit into int.
125b3835 3195 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
3196 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
3197 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
3198 (string_char_to_byte, string_byte_to_char)
3199 (string_make_multibyte, string_to_multibyte)
3200 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
3201 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
3202 (substring_both, Fdelete, internal_equal, Ffillarray)
3203 (Fclear_string, mapcar1)
3204 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
3205 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
3206 (larger_vector, make_hash_table, maybe_resize_hash_table)
3207 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
3208 (Fmaphash, secure_hash):
3209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3210 (concat): Check for string index and length overflow.
3211 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
3212 (Frequire):
3213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3214 (larger_vector): New API (vec, incr_min, size_max) replaces old
3215 one (vec, new_size, init). This catches size overflow.
3216 INIT was removed because it was always Qnil.
3217 All callers changed.
3218 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
3219 the upper bound on a hash table index size.
3220 (make_hash_table, maybe_resize_hash_table): Use it.
3221 (secure_hash): Computer start_byte and end_byte only after
3222 they're known to be in ptrdiff_t range.
3223 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
3224 (Ffont_get_glyphs, Ffont_at):
3225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3226 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
3227 (Flist_fonts, Fopen_font):
3228 Don't assume fixnum can fit in int.
3229 (check_gstring): Don't assume index can fit in int.
3230 (font_match_p): Check that fixnum is a character, not a nonnegative
3231 fixnum, since the later code needs to stuff it into an int.
3232 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
3233 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
3234 conversion overflow issues.
3235 (Fopen_font): Check for integer out of range.
3236 (Ffont_get_glyphs): Don't assume index can fit in int.
3237 * font.h: Adjust decls to match defn changes elsewhere.
3238 * fontset.c (reorder_font_vector): Redo score calculation to avoid
3239 integer overflow.
3240 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
3241 printmax_t, where ptrdiff_t is wide enough.
3242 (Finternal_char_font):
3243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3244 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
3245 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
3246 (Fset_frame_position, x_set_frame_parameters)
3247 (x_set_line_spacing, x_set_border_width)
3248 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
3249 Check that fixnums are in proper range for system types.
3250 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
3251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3252 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
3253 Use SAFE_ALLOCA_LISP, not alloca.
3254 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
3255 intptr_t is wide enough.
3256 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
3257 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
3258 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
3259 Check for fixnum out of range.
3260 * ftfont.c (ftfont_list): Don't assume index fits in int.
3261 Check that fixnums are in proper range for system types.
3262 (ftfont_shape_by_flt):
3263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
3264 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3265 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3266 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
3267 Check that fixnums are in proper range for system types.
3268 * gnutls.h: Adjust decls to match defn changes elsewhere.
3269 * gtkutil.c (xg_dialog_run):
3270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3271 (update_frame_tool_bar):
3272 Check that fixnums are in proper range for system types.
3273 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 3274 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
3275 * indent.c (last_known_column, last_known_column_point):
3276 (current_column_bol_cache):
3277 (skip_invisible, current_column, check_display_width):
3278 (check_display_width, scan_for_column, current_column_1)
3279 (Findent_to, Fcurrent_indentation, position_indentation)
3280 (indented_beyond_p, Fmove_to_column, compute_motion):
3281 (Fcompute_motion, Fvertical_motion):
3282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3283 (last_known_column_modified): Use EMACS_INT, not int.
3284 (check_display_width):
3285 (Fcompute_motion):
3286 Check that fixnums and floats are in proper range for system types.
3287 (compute_motion): Don't assume index or fixnum fits in int.
3288 (compute_motion, Fcompute_motion):
3289 Use int, not EMACS_INT, when it is wide enough.
3290 (vmotion): Omit local var start_hpos that is always 0; that way
3291 we don't need to worry about overflow in expressions involving it.
3292 * indent.h: Adjust decls to match defn changes elsewhere.
3293 (struct position):
3294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3295 Use int, not EMACS_INT, where int is wide enough.
3296 Remove unused members ovstring_chars_done and tab_offset;
3297 all uses removed.
3298 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
3299 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
3300 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
3301 (make_gap, copy_text, insert, insert_and_inherit)
3302 (insert_before_markers, insert_before_markers_and_inherit)
3303 (insert_1, count_combining_before, count_combining_after)
3304 (insert_1_both, insert_from_string)
3305 (insert_from_string_before_markers, insert_from_string_1)
3306 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
3307 (adjust_after_replace, adjust_after_insert, replace_range)
3308 (replace_range_2, del_range, del_range_1, del_range_byte)
3309 (del_range_both, del_range_2, modify_region)
3310 (prepare_to_modify_buffer, signal_before_change)
3311 (signal_after_change, Fcombine_after_change_execute):
3312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3313 * intervals.c (traverse_intervals, rotate_right, rotate_left)
3314 (balance_an_interval, split_interval_right, split_interval_left)
3315 (find_interval, next_interval, update_interval)
3316 (adjust_intervals_for_insertion, delete_node, delete_interval)
3317 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3318 (static_offset_intervals, offset_intervals)
3319 (merge_interval_right, merge_interval_left, make_new_interval)
3320 (graft_intervals_into_buffer, temp_set_point_both)
3321 (temp_set_point, set_point, adjust_for_invis_intang)
3322 (set_point_both, move_if_not_intangible, get_property_and_range)
3323 (get_local_map, copy_intervals, copy_intervals_to_string)
3324 (compare_string_intervals, set_intervals_multibyte_1):
3325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3326 * intervals.h: Adjust decls to match defn changes elsewhere.
3327 (struct interval):
3328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3329 * keyboard.c (this_command_key_count, this_single_command_key_start)
3330 (before_command_key_count, before_command_echo_length, echo_now)
3331 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
3332 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
3333 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
3334 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
3335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3336 (last_non_minibuf_size, last_point_position, echo_truncate)
3337 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
3338 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
3339 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
3340 (stuff_buffered_input):
3341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3342 (last_auto_save, command_loop_1, read_char):
3343 Use EMACS_INT, not int, to avoid integer overflow.
3344 (record_char): Avoid overflow in total_keys computation.
3345 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
3346 * keyboard.h: Adjust decls to match defn changes elsewhere.
3347 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
3348 (Fkey_description, Fdescribe_vector, Flookup_key):
3349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3350 (click_position): New function, to check that positions are in range.
3351 (Fcurrent_active_maps):
3352 (describe_command):
3353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3354 (Faccessible_keymaps, Fkey_description):
3355 (preferred_sequence_p):
3356 Don't assume fixnum can fit into int.
3357 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
3358 Check for integer overflow in size calculations.
3359 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
3360 avoid mishandling large integers.
3361 * lisp.h: Adjust decls to match defn changes elsewhere.
3362 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
3363 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
3364 (struct Lisp_Marker):
3365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3366 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
3367 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
3368 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
3369 All callers changed.
3370 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
3371 Assume the arg has valid form, since it always does.
3372 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
3373 unsigned integer system type.
3374 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
3375 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
3376 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3377 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
3378 (duration_to_sec_usec): New decl.
3379 * lread.c (read_from_string_index, read_from_string_index_byte)
3380 (read_from_string_limit, readchar, unreadchar, openp)
3381 (read_internal_start, read1, oblookup):
3382 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3383 (Fload, readevalloop, Feval_buffer, Feval_region):
3384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3385 (openp): Check for out-of-range argument to 'access'.
3386 (read1): Use int, not EMACS_INT, where int is wide enough.
3387 Don't assume fixnum fits into int.
6efdadfd 3388 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
3389 (read_filtered_event): Use duration_to_sec_usec
3390 to do proper overflow checking on durations.
d311d28c
PE
3391 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
3392 in size calculation.
3393 (Fexecute_kbd_macro):
3394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3395 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
3396 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
3397 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
3398 (set_marker_both, set_marker_restricted_both, marker_position)
3399 (marker_byte_position, Fbuffer_has_markers_at):
3400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3401 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 3402 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
3403 It now merely ensures that the menu is large enough, without
3404 necessarily growing it, as this avoids some integer overflow issues.
3405 All callers changed.
3406 (keymap_panes, parse_single_submenu, Fx_popup_menu):
3407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3408 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
3409 Use SAFE_ALLOCA_LISP, not alloca.
3410 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
3411 to EMACS_INT. Check that fixnums are in proper range for system types.
3412 * minibuf.c (minibuf_prompt_width, string_to_object)
3413 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
3414 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
3415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3416 (get_minibuffer, read_minibuf_unwind):
3417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3418 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
3419 this simplifies overflow checking. All callers changed.
3420 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
3421 (Ftest_completion):
3422 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3423 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
3424 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
3425 Check that fixnums are in proper range for system types.
3426 (Fx_create_frame, Fx_show_tip):
3427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3428 * nsfont.m (ns_findfonts, nsfont_list_family):
3429 Don't assume fixnum fits in long.
3430 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3432 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3433 wide enough.
17fdb222 3434 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
3435 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3436 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3437 (PRINTDECLARE, PRINTPREPARE):
3438 (strout, print_string):
3439 (print, print_preprocess, print_check_string_charset_prop)
3440 (print_object):
3441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3442 (PRINTDECLARE):
3443 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3445 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 3446 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 3447 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
3448 (print_error_message): Use SAFE_ALLOCA, not alloca.
3449 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
3450 (print_depth, new_backquote_output, print_number_index):
3451 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
3452 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3453 (Fset_process_window_size, Fformat_network_address)
3454 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 3455 (sigchld_handler):
d311d28c 3456 Check that fixnums are in proper range for system types.
d44287d4 3457 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
3458 Check for process-ids out of pid_t range rather than relying on
3459 undefined behavior.
e4d81efc 3460 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
3461 (Fformat_network_address, read_process_output, send_process)
3462 (Fprocess_send_region, status_notify):
3463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3464 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3465 (wait_reading_process_output, read_process_output, exec_sentinel):
3466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3467 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3468 (Faccept_process_output): Use duration_to_sec_usec to do proper
3469 overflow checking on durations.
dde14581
PE
3470 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3471 Don't assume pid_t fits in int.
02481186
PE
3472 * process.h (struct Lisp_Process): Members tick and update_tick
3473 are now of type EMACS_INT, not int.
b62b53e8
PE
3474 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3475 configured --with-wide-int.
d311d28c
PE
3476 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3477 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3478 * search.c (looking_at_1, string_match_1):
3479 (fast_string_match, fast_c_string_match_ignore_case)
3480 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3481 (scan_newline, find_before_next_newline, search_command)
3482 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3483 (set_search_regs, wordify):
3484 (Freplace_match):
3485 (Fmatch_data):
3486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3487 (string_match_1, search_buffer, set_search_regs):
3488 (Fmatch_data):
3489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3490 (wordify): Check for overflow in size calculation.
3491 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3492 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3493 Check that fixnums are in proper range for system types.
3494 * sound.c (struct sound_device)
3495 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3497 (Fplay_sound_internal):
3498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 3499 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
3500 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3501 (Fparse_partial_sexp):
3502 Don't assume fixnums can fit in int.
3503 (struct lisp_parse_state, find_start_pos, find_start_value)
3504 (find_start_value_byte, find_start_begv)
3505 (update_syntax_table, char_quoted, dec_bytepos)
3506 (find_defun_start, prev_char_comend_first, back_comment):
3507 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3508 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3510 (Finternal_describe_syntax_value): Check that match_lisp is a
3511 character, not an integer, since the code stuffs it into int.
3512 (scan_words, scan_sexps_forward):
3513 Check that fixnums are in proper range for system types.
3514 (Fforward_word):
3515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3516 (scan_sexps_forward):
3517 Use CHARACTERP, not INTEGERP, since the value must fit into int.
3518 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3519 * syntax.h: Adjust decls to match defn changes elsewhere.
3520 (struct gl_state_s):
3521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3522 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3523 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3524 * sysdep.c (wait_for_termination_1, wait_for_termination)
3525 (interruptible_wait_for_termination, mkdir):
3526 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3527 (emacs_read, emacs_write):
3528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3529 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3530 and double all fit in int.
d311d28c
PE
3531 * term.c (set_tty_color_mode):
3532 Check that fixnums are in proper range for system types.
3533 * termhooks.h (struct input_event):
3534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3535 * textprop.c (validate_interval_range, interval_of)
3536 (Fadd_text_properties, set_text_properties_1)
3537 (Fremove_text_properties, Fremove_list_of_text_properties)
3538 (Ftext_property_any, Ftext_property_not_all)
3539 (copy_text_properties, text_property_list, extend_property_ranges)
3540 (verify_interval_modification):
3541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3542 (Fnext_single_char_property_change)
3543 (Fprevious_single_char_property_change):
3544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3545 (copy_text_properties):
3546 Check for integer overflow in index calculation.
d311d28c
PE
3547 * undo.c (last_boundary_position, record_point, record_insert)
3548 (record_delete, record_marker_adjustment, record_change)
3549 (record_property_change):
3550 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3551 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3553 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3554 (Fx_hide_tip, Fx_file_dialog):
3555 * w32menu.c (set_frame_menubar):
3556 Use ptrdiff_t, not int, for consistency with rest of code.
3557 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3558 (select_window, Fdelete_other_windows_internal)
3559 (window_scroll_pixel_based, window_scroll_line_based)
3560 (Frecenter, Fset_window_configuration):
3561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3562 (Fset_window_hscroll, run_window_configuration_change_hook)
3563 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3564 (Fscroll_other_window, Frecenter):
d311d28c
PE
3565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3566 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3567 Don't assume fixnum fits in int.
3568 (Fset_window_scroll_bars):
3569 Check that fixnums are in proper range for system types.
3570 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3571 (string_pos, c_string_pos, number_of_chars, init_iterator)
3572 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3573 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3574 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3575 (face_before_or_after_it_pos, handle_invisible_prop)
3576 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3577 (display_prop_intangible_p, string_buffer_position_lim)
3578 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3579 (get_overlay_strings_1, get_overlay_strings)
3580 (iterate_out_of_display_property, forward_to_next_line_start)
3581 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3582 (get_next_display_element, set_iterator_to_next)
3583 (get_visually_first_element, compute_stop_pos_backwards)
3584 (handle_stop_backwards, next_element_from_buffer)
3585 (move_it_in_display_line_to, move_it_in_display_line)
3586 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3587 (add_to_log, message_dolog, message_log_check_duplicate)
3588 (message2, message2_nolog, message3, message3_nolog
3589 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3590 (current_message_1, truncate_echo_area, truncate_message_1)
3591 (set_message, set_message_1, store_mode_line_noprop)
3592 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3593 (text_outside_line_unchanged_p, check_point_in_composition)
3594 (reconsider_clip_changes)
3595 (redisplay_internal, set_cursor_from_row, try_scrolling)
3596 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3597 (redisplay_window, find_last_unchanged_at_beg_row)
3598 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3599 (trailing_whitespace_p, find_row_edges, display_line)
3600 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3601 (display_mode_element, store_mode_line_string)
3602 (pint2str, pint2hrstr, decode_mode_spec)
3603 (display_count_lines, display_string, draw_glyphs)
3604 (x_produce_glyphs, x_insert_glyphs)
3605 (rows_from_pos_range, mouse_face_from_buffer_pos)
3606 (fast_find_string_pos, mouse_face_from_string_pos)
3607 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3609 (safe_call, init_from_display_pos, handle_fontified_prop)
3610 (handle_single_display_spec, load_overlay_strings)
3611 (with_echo_area_buffer, setup_echo_area_for_printing)
3612 (display_echo_area, echo_area_display)
3613 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3614 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3615 (redisplay_window, dump_glyph_row, display_mode_line)
3616 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3617 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3618 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3619 (handle_single_display_spec, build_desired_tool_bar_string)
3620 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3621 (get_specified_cursor_type):
3622 Check that fixnums are in proper range for system types.
3623 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3624 (Flookup_image_map):
3625 Don't assume fixnums fit in int.
3626 (compare_overlay_entries):
3627 Avoid mishandling comparisons due to subtraction overflow.
3628 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3629 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3630 (handle_tool_bar_click):
3631 Use int, not unsigned, since we prefer signed and the signedness
3632 doesn't matter here.
3633 (get_next_display_element, next_element_from_display_vector):
3634 Use int, not EMACS_INT, when int is wide enough.
3635 (start_hourglass): Use duration_to_sec_usec to do proper
3636 overflow checking on durations.
3637 * xfaces.c (Fbitmap_spec_p):
3638 Check that fixnums are in proper range for system types.
3639 (compare_fonts_by_sort_order):
3640 Avoid mishandling comparisons due to subtraction overflow.
3641 (Fx_family_fonts, realize_basic_faces):
3642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3643 (Fx_family_fonts):
3644 Don't assume fixnum fits in int.
3645 Use SAFE_ALLOCA_LISP, not alloca.
3646 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3647 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3648 (face_at_buffer_position, face_for_overlay_string)
3649 (face_at_string_position):
3650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3651 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3652 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3653 (Fx_show_tip):
3654 Check that fixnums are in proper range for system types.
3655 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3656 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3658 (Fx_change_window_property): Don't assume fixnums fit in int.
3659 * xfont.c (xfont_chars_supported):
3660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3661 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3662 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3664 * xml.c (parse_region):
3665 * xrdb.c (magic_file_p):
3666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3667 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3668 (x_get_local_selection, x_reply_selection_request)
3669 (x_handle_selection_request, wait_for_property_change):
3670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3671 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3672 short is wide enough.
3673 (x_send_client_event): Don't assume fixnum fits in int.
3674 * xterm.c (x_x_to_emacs_modifiers):
3675 Don't assume EMACS_INT overflows nicely into int.
3676 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3677 may come from Lisp.
3678 (handle_one_xevent): NATNUMP can eval its arg twice.
3679 (x_connection_closed):
3680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3681 * xterm.h: Adjust decls to match defn changes elsewhere.
3682 (struct scroll_bar): Use struct vectorlike_header
3683 rather than rolling our own approximation.
3684 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3685
c6574eb5
GM
36862012-05-25 Glenn Morris <rgm@gnu.org>
3687
3688 * lisp.mk (lisp): Update for more files being compiled now.
3689
e8d32c7e
SM
36902012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3691
48def666
SM
3692 * lread.c: Remove `read_pure' which makes no difference.
3693 (read_pure): Remove var.
3694 (unreadpure): Remove function.
3695 (readevalloop): Don't call read_list with -1 flag.
3696 (read1, read_vector): Don't test read_pure any more.
3697 (read_list): Simplify.
3698
e8d32c7e
SM
3699 * fileio.c, character.h: Minor style tweaks.
3700
4b2addb7
DA
37012012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3702
3703 * window.h (clip_changed): Remove useless declaration.
3704
584461b2
JB
37052012-05-22 Juanma Barranquero <lekktu@gmail.com>
3706
3707 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3708 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3709
34374650
PE
37102012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3711
3712 Remove src/m/*.
3713 This directory predates autoconf and is no longer needed nowadays.
3714 Move its few remaining bits of functionality to where they're needed.
3715 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3716 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3717 * m/template.h: Remove.
3718 * Makefile.in (M_FILE): Remove. All uses removed.
3719 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3720 * lisp.h (USE_LSB_TAG):
3721 * mem-limits.h (EXCEEDS_LISP_PTR):
3722 Use VAL_MAX, not VALBITS, in #if.
3723 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3724 (EMACS_UINT): Define unconditionally now.
3725 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3726 (BITS_PER_EMACS_INT): New constants, replacing
3727 what used to be in config.h, but not useful in #if.
3728 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3729 define them any more.
3730 (VAL_MAX): New macro.
3731 (VALMASK): Use it.
3732 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3733 BITS_PER_EMACS_INT, in #if.
3734 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3735 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3736 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3737 * s/ms-w32.h (DATA_START):
3738 Move here from removed file m/intel386.h.
3739 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3740 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3741
261cb4bb
PE
37422012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3743
3744 Assume C89 or later.
3745 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3746 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3747 (xrealloc):
3748 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3749 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3750 * textprop.c, tparam.c (NULL): Remove.
3751 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3752 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3753 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3754 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3755 * xterm.c (input_signal_count): Assume volatile works.
3756
ff23cd9f
KB
37572012-05-21 Ken Brown <kbrown@cornell.edu>
3758
3759 * xgselect.c (xg_select): Fix first argument in call to 'select'
3760 (bug#11508).
3761
1b170bc6
KB
37622012-05-20 Ken Brown <kbrown@cornell.edu>
3763
3764 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3765 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3766
b2f4d39f
KB
37672012-05-19 Ken Brown <kbrown@cornell.edu>
3768
3769 * xfns.c (x_in_use): Remove `static' qualifier.
3770 * xterm.h (x_in_use): Declare.
3771 * xgselect.c: Include xterm.h.
3772 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3773 and `display_arg' (bug#9754).
3774
003fdae2
PE
37752012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3776
9232a6d9
PE
3777 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3778
003fdae2
PE
3779 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3780 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3781
784b56e2
EZ
37822012-05-18 Eli Zaretskii <eliz@gnu.org>
3783
3784 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3785
3786 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3787 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3788
3789 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3790 reference to image_cache->refcount.
3791 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3792
a0a79cde
JL
37932012-05-17 Juri Linkov <juri@jurta.org>
3794
3795 * search.c (Fword_search_regexp, Fword_search_backward)
3796 (Fword_search_forward, Fword_search_backward_lax)
3797 (Fword_search_forward_lax): Move functions to isearch.el
3798 (bug#10145, bug#11381).
3799
b0572523
PE
38002012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3801
3802 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3803
9660f5fc
SM
38042012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3805
3806 * lread.c (init_obarray): Declare Qt and Qnil as special.
3807
4374de83
GM
38082012-05-14 Glenn Morris <rgm@gnu.org>
3809
3810 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3811 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3812
dc44c39a
PE
38132012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3814
078c97cb
PE
3815 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3816
dc44c39a
PE
3817 * unexaix.c: Port to more-recent AIX compilers.
3818 (report_error, report_error_1, make_hdr, copy_sym)
3819 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3820 Make arguments const char *, not char *, to avoid violations of C
3821 standard and to fix some AIX warnings reported by Gilles Pion.
3822
e18afed7 38232012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3824
3825 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3826 already have overlays loaded.
3827 (handle_single_display_spec): Before returning without displaying
3828 fringe bitmap, synchronize the bidi iterator with the main display
3829 iterator, by calling iterate_out_of_display_property.
3830 (iterate_out_of_display_property): Detect buffer iteration by
3831 testing that it->string is a Lisp string.
3832 (get_next_display_element): When the current object is exhausted,
3833 and there's something on it->stack, call set_iterator_to_next to
3834 proceed with what's on the stack, instead of returning zero.
3835 (set_iterator_to_next): If called at the end of a Lisp string,
3836 proceed to consider_string_end without incrementing string
3837 position. Don't increment display vector index past the end of
3838 the display vector. (Bug#11417)
c8fb9dc6
EZ
3839 (pos_visible_p): Don't report a position visible when move_it_to
3840 stopped at the last line of window, which happens to be scanned
3841 backwards by the bidi iteration. (Bug#11464)
ac268e67 3842
e18afed7 38432012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3844
3845 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3846 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3847 are on a TTY, and thus unable to display on the fringes.
3848 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3849 so we need to signal to the caller that this is a "replacing"
3850 display spec. This fixes display when the spec is invalid or we
3851 are on a TTY.
3852
e18afed7 38532012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3854
3855 * unexaix.c (make_hdr): Fix typo in prototype.
3856 This bug broke the build on AIX. Problem reported by Gilles Pion.
3857
9d0a235a
MA
38582012-05-14 Michael Albinus <michael.albinus@gmx.de>
3859
3860 * keyboard.c (kbd_buffer_get_event): Read special events also in
3861 batch mode. (Bug#11415)
3862
9e6b06ed
GM
38632012-05-12 Glenn Morris <rgm@gnu.org>
3864
3865 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3866
c1a1d7a3
EZ
38672012-05-12 Eli Zaretskii <eliz@gnu.org>
3868
3869 * lisp.mk (lisp): Add newcomment.elc.
3870
3fe7cdc8
GM
38712012-05-12 Glenn Morris <rgm@gnu.org>
3872
3873 * Makefile.in (MKDIR_P): New, set by configure.
3874 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3875
53f7d2c0
PE
38762012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3877
3878 Remove unused function hourglass_started.
3879 * dispextern.h (hourglass_started):
3880 * w32fns.c (hourglass_started):
3881 * xdisp.c (hourglass_started): Remove.
3882
75aafb17
JB
38832012-05-10 Juanma Barranquero <lekktu@gmail.com>
3884
3885 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3886 Update dependencies.
3887
12959e8e
PE
38882012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3889
97107e2e
PE
3890 * xgselect.c (xg_select): Put maxfds+1 into a var.
3891 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3892
12959e8e
PE
3893 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3894
836d29b3
DA
38952012-05-10 Dave Abrahams <dave@boostpro.com>
3896
3897 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3898 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3899
5cb67954
MA
39002012-05-09 Michael Albinus <michael.albinus@gmx.de>
3901
3902 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3903 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3904 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3905 Initialize xd_registered_buses.
3906
3478ec45
PE
39072012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3908
b263a6b0
PE
3909 Untag more efficiently if USE_LSB_TAG.
3910 This is based on a proposal by YAMAMOTO Mitsuharu in
3911 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3912 For an admittedly artificial (nth 8000 longlist) benchmark on
3913 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3914 Emacs's overall text size by 1%.
3915 * lisp.h (XUNTAG): New macro.
3916 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3917 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3918 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3919 * eval.c (Fautoload):
3920 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3921 * frame.h (XFRAME): Use XUNTAG.
3922
3478ec45
PE
3923 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3924 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3925 Remove unportable assumptions about print widths of types like
3926 dbus_uint32_t.
3927 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3928 intptr_t when converting between pointer and integer, to avoid GCC
3929 warnings about wrong width.
3930
666b903b 39312012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3932
3933 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3934 stack for each reader_thread, instead of defaulting to 8MB
3935 determined by the linker. This avoids failures in creating
3936 subprocesses on Windows 7, see the discussion in this thread:
3937 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3938
b120cc17
JC
39392012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3940
3941 Fix up display of the *Minibuf-0* buffer in the mini window.
3942 * keyboard.c (read_char): Don't clear the echo area if there's no
3943 message to clear.
3944 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3945 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3946
9a4b36f8
MA
39472012-05-07 Michael Albinus <michael.albinus@gmx.de>
3948
3949 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3950 batch mode.
3951
e5f9458f
CY
39522012-05-06 Chong Yidong <cyd@gnu.org>
3953
3954 * lisp.mk (lisp): Update.
3955
eceeb5fc 39562012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3957
3958 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3959
71873e2b
SM
39602012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3961
3962 * data.c (PUT_ERROR): New macro.
3963 (syms_of_data): Use it. Add new error type `user-error'.
3964 * undo.c (user_error): New function.
3965 (Fprimitive_undo): Use it.
3966 * print.c (print_error_message): Adjust print style for `user-error'.
3967 * keyboard.c (user_error): New function.
3968 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3969
ab0fa4e4
PE
39702012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3971
3972 Do not limit current-time-string to years 1000..9999.
3973 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3974 (Fcurrent_time_string): Support any year that is supported by the
3975 underlying localtime representation. Don't use asctime, as it
3976 has undefined behavior for years outside the range -999..9999.
3977
7ed806a7
PE
39782012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3979
3980 Fix race conditions involving setenv, gmtime, localtime, asctime.
3981 Without this fix, interrupts could mess up code that uses these
3982 nonreentrant functions, since setting TZ invalidates existing
3983 tm_zone or tzname values, and since most of these functions return
3984 pointers to static storage.
3985 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3986 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3987 Grow the critical sections to include not just invoking
3988 localtime/gmtime, but also accessing these functions' results
3989 including their tm_zone values if any, and any related TZ setting.
3990 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3991 so that the struct tm is saved in the critical section.
3992 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3993 motivated by the fact that memory allocation needs to be outside
3994 the critical section.
3995
0c16dfed
DA
39962012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3997
3998 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3999 with RESET_INTERVAL.
4000
4001 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4002 Remove duplicated buffer name initialization.
4003
3f83ace8
JM
40042012-05-02 Jim Meyering <jim@meyering.net>
4005
4006 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4007
c7b8541e
JM
4008 * xfns.c (x_window): Use xstrdup (Bug#11375).
4009
90207a15 40102012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
4011
4012 * xdisp.c (pos_visible_p): If already at a newline from the
4013 display string before the 'while' loop, don't walk back the glyphs
4014 from it3.glyph_row. Solves assertion violation when the display
4015 string begins with a newline (egg.el). (Bug#11367)
4016
b593d6a9
AH
40172012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4018
4019 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4020 Move to simple.el.
4021
4737362e
GM
40222012-05-01 Glenn Morris <rgm@gnu.org>
4023
99cf43f9
GM
4024 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4025 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4026 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4027 All were removed before 23.1.
4028
9311dcff
GM
4029 * dispnew.c: Remove HAVE_LIBNCURSES test;
4030 it is always true on relevant platforms.
4031
4d5c6349
GM
4032 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4033 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4034
4737362e
GM
4035 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4036
74dd3a6b
AS
40372012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4038
4039 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4040 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4041 Remove.
4042
13c379ee
PE
40432012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4044
4045 Do not avoid creating empty evaporating overlays (Bug#9642).
4046 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4047 That is, do not delete an evaporating overlay if it becomes
4048 empty after its bounds are adjusted to fit within its buffer.
4049 This fix caused other problems, and I'm reverting it until we get
4050 to the bottom of them.
4051
a8e7d6d7 40522012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
4053
4054 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4055
a8e7d6d7 40562012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
4057
4058 * xdisp.c (pos_visible_p): If the window start position is beyond
4059 ZV, start the display from buffer beginning. Prevents assertion
4060 violation in init_iterator when the minibuffer window is scrolled
4061 via the scroll bar.
4062
4063 * window.c (window_scroll_pixel_based): Likewise.
4064
a8e7d6d7 40652012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
4066
4067 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4068
a8e7d6d7 40692012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
4070
4071 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4072 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4073
a8e7d6d7 40742012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 4075
b593d6a9
AH
4076 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4077 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 4078
1c6900d9
EZ
40792012-04-26 Eli Zaretskii <eliz@gnu.org>
4080
4c3fa1d9
EZ
4081 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4082 display element, check also the underlying string or buffer
4083 character. (Bug#11341)
4084
1c6900d9
EZ
4085 * w32menu.c: Include w32heap.h.
4086 (add_menu_item): If the call to AppendMenuW (via
4087 unicode_append_menu) fails, disable Unicode menus only if we are
4088 running on Windows 9X/Me.
4089
42bf8205
AS
40902012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4091
4092 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4093 (xgetint): Add missing shift for LSB tags.
4094
b1bac16e
MR
40952012-04-24 Martin Rudalics <rudalics@gmx.at>
4096
4097 * keyboard.c (read_char): Don't wipe echo area for select window
4098 events: These might get delayed via `mouse-autoselect-window'
4099 (Bug#11304).
4100
d69621cc
JB
41012012-04-24 Juanma Barranquero <lekktu@gmail.com>
4102
4103 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4104 manipulation of :loaded-from data.
4105
02fd101b
JB
41062012-04-23 Juanma Barranquero <lekktu@gmail.com>
4107
4108 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4109 now a cons (bug#11311).
4110
888bec30
PE
41112012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4112
89a438bd
PE
4113 Do not create empty overlays with the evaporate property (Bug#9642).
4114 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4115 if it becomes empty after its bounds are adjusted to fit within
4116 its buffer. Without this fix, in a nonempty buffer (let ((o
4117 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4118 yields an empty overlay that has the evaporate property, which is
4119 not supposed to happen.
4120
1068fe4d
PE
4121 Fix minor GTK3 problems found by static checking.
4122 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4123 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4124 (struct _EmacsFixedClass, emacs_fixed_get_type):
4125 Move decls here from emacsgtkfixed.h, since they needn't be public.
4126 (emacs_fixed_get_type): Now static.
4127 (emacs_fixed_class_init): Omit unused local.
4128 (emacs_fixed_child_type): Remove; unused.
4129 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4130 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4131 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
4132 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
4133 (EMACS_FIXED_GET_CLASS): Remove; unused.
4134 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
4135
888bec30
PE
4136 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
4137 Problem reported by Juanma Barranquero for Windows -Wunused-function.
4138
de85e130
PE
41392012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4140
d0baac98 4141 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 4142 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
4143 (__malloc_size_t, __malloc_ptrdiff_t):
4144 Remove. All uses removed, replaced by the definiens if needed,
4145 since we can assume C89 or better now.
4146 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
4147 (protect_malloc_state, align, get_contiguous_space)
4148 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
4149 (malloc_atfork_handler_child, malloc_enable_thread)
4150 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
4151 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
4152 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
4153 (special_realloc, _realloc_internal_nolock, _realloc_internal)
4154 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
4155 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
4156 Define using prototypes, not old style.
4157 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
4158 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
4159 (align): Don't assume that signed integer overflow wraps around.
4160 Omit unused local var.
4161 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
4162 (_free_internal_nolock, memalign, mallochook, reallochook):
4163 Omit no-longer-needed casts.
4164 (valloc): Use getpagesize, not __getpagesize.
4165 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
4166 (struct hdr): The 'magic' member is now size_t, not unsigned long.
4167
de85e130
PE
4168 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
4169
dcbf5805
MA
41702012-04-22 Michael Albinus <michael.albinus@gmx.de>
4171
4172 Move functions from C to Lisp. Make non-blocking method calls
4173 the default. Implement further D-Bus standard interfaces.
4174
4175 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
4176 (QCdbus_request_name_allow_replacement)
4177 (QCdbus_request_name_replace_existing)
4178 (QCdbus_request_name_do_not_queue)
4179 (QCdbus_request_name_reply_primary_owner)
4180 (QCdbus_request_name_reply_in_queue)
4181 (QCdbus_request_name_reply_exists)
4182 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
4183 (QCdbus_registered_serial, QCdbus_registered_method)
4184 (QCdbus_registered_signal): New Lisp objects.
4185 (XD_DEBUG_MESSAGE): Use sizeof.
4186 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
4187 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
4188 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
4189 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
4190 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
4191 (xd_signature, xd_append_arg): Allow float for integer types.
4192 (xd_get_connection_references): New function.
b593d6a9
AH
4193 (xd_get_connection_address): Rename from xd_initialize.
4194 Return cached address.
dcbf5805
MA
4195 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
4196 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
4197 level.
4198 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 4199 Return number of refcounts.
dcbf5805
MA
4200 (Fdbus_get_unique_name): Make stronger parameter check.
4201 (Fdbus_message_internal): New defun.
4202 (Fdbus_call_method, Fdbus_call_method_asynchronously)
4203 (Fdbus_method_return_internal, Fdbus_method_error_internal)
4204 (Fdbus_send_signal, Fdbus_register_service)
4205 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
4206 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
4207 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
4208 (Vdbus_compiled_version, Vdbus_runtime_version)
4209 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
4210 (Vdbus_message_type_method_return, Vdbus_message_type_error)
4211 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
4212 (Vdbus_registered_buses, Vdbus_registered_objects_table):
4213 Adapt docstring.
dcbf5805 4214
52828e02
PE
42152012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4216
da05bc4c
PE
4217 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
4218 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
4219 Do not assume ptrdiff_t is the same width as 'int'.
4220
52828e02
PE
4221 * alloc.c: Handle unusual debugging option combinations.
4222 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
4223 since the two debugging options are incompatible.
4224 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
4225 is defined.
4226 (mem_init, mem_insert, mem_insert_fixup):
4227 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
4228 (NEED_MEM_INSERT): Remove; no longer needed.
4229
f01769f9
LL
42302012-04-22 Leo Liu <sdl.web@gmail.com>
4231
4232 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
4233
5790543d
PE
42342012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4235
4236 * sysdep.c [__FreeBSD__]: Minor cleanups.
4237 (list_system_processes, system_process_attributes) [__FreeBSD__]:
4238 Use Emacs indenting style more consistently. Avoid some casts.
4239 Use 'double' consistently rather than mixing 'float' and 'double'.
4240
b91b7e4d
EW
42412012-04-21 Eduard Wiebe <usenet@pusto.de>
4242
b593d6a9
AH
4243 * sysdep.c (list_system_processes, system_process_attributes):
4244 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 4245
6114eb15
AS
42462012-04-21 Andreas Schwab <schwab@linux-m68k.org>
4247
4248 * lisp.mk (lisp): Update.
4249
2f38dff7
PE
42502012-04-20 Paul Eggert <eggert@cs.ucla.edu>
4251
4252 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
4253 It is never used otherwise.
4254
4ae29f89
SM
42552012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
4256
4257 * print.c (print_preprocess): Only check print_depth if print-circle
4258 is nil.
4259 (print_object): Check for cycles even when print-circle is nil and
4260 print-gensym is t, but only check print_depth if print-circle is nil.
4261
f30d612a
CY
42622012-04-20 Chong Yidong <cyd@gnu.org>
4263
4264 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4265 set the status to "failed" and ensure that sentinel is run.
4266
c07a4c0b 42672012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
4268
4269 * process.c (Fset_process_inherit_coding_system_flag)
4270 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 4271 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 4272
c07a4c0b 42732012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
4274
4275 * xdisp.c (string_buffer_position_lim): Limit starting position to
4276 BEGV.
4277 (set_cursor_from_row): If called for a mode-line or header-line
4278 row, return zero immediately.
4279 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
4280 farther than the first row after the header line, if any.
4281 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
4282 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
4283
c07a4c0b 42842012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4285
4ae29f89
SM
4286 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
4287 (bug#11238).
ad3a2b41 4288
c07a4c0b 42892012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 42902012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
4291
4292 configure: new option --enable-gcc-warnings (Bug#11207)
4293 * Makefile.in (C_WARNINGS_SWITCH): Remove.
4294 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
4295 (ALL_CFLAGS): Use new macros rather than old.
4296 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
4297 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
4298 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
4299 -Wunused-result, -Wunused-variable. This should go away once
4300 the Emacs and Gnulib regex code is merged.
4301 (xmalloc, xrealloc): Now static.
4302
aba027e8
PE
43032012-04-17 Paul Eggert <eggert@cs.ucla.edu>
4304
4305 * dired.c (Fsystem_groups): Remove unused local.
4306
e5a36063
GM
43072012-04-17 Glenn Morris <rgm@gnu.org>
4308
4309 * dired.c (Fsystem_users): Doc fix.
4310
316411f0
DA
43112012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
4314 (syms_of_dired): Add them.
4315
9426aba4
PE
43162012-04-16 Paul Eggert <eggert@cs.ucla.edu>
4317
b62a57be
PE
4318 Fix minor alloc.c problems found by static checking.
4319 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
4320 New extern decls, to avoid calling undeclared functions.
4321 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
4322 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
4323 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
4324 (NEED_MEM_INSERT): New macro.
4325 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 4326 Remove one incorrect comment and fix another.
b62a57be 4327
3539f31f
PE
4328 Fix minor ralloc.c problems found by static checking.
4329 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4330 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
4331 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
4332 (r_alloc_sbrk): Now static.
4333
a041960a
PE
4334 Improve ralloc.c interface checking.
4335 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4336 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
4337 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
4338 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
4339 [REL_ALLOC]: ... to here, to check interface.
4340 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
4341 Remove decls. This fixes an "It stinks!".
4342
9426aba4
PE
4343 * alloc.c (which_symbols): Fix alignment issue / type clash.
4344
d55c12ed
AS
43452012-04-15 Andreas Schwab <schwab@linux-m68k.org>
4346
4347 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
4348 (struct Lisp_Misc_Any): Likewise.
4349 (struct Lisp_Free): Likewise.
4350 * alloc.c (union aligned_Lisp_Symbol): Define.
4351 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
4352 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
4353 (union aligned_Lisp_Misc): Define.
4354 (MARKER_BLOCK_SIZE, struct marker_block): Use union
4355 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 4356 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 4357
b948ce8b
PE
43582012-04-14 Paul Eggert <eggert@cs.ucla.edu>
4359
4360 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
4361 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
4362 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
4363 * s/netbsd.h, s/sol2-6.h:
4364 Remove definition of GC_MARK_STACK, since the default now works.
4365 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
4366 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
4367 no longer the default.
4368 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
4369
35dc09a1 43702012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4371
35dc09a1
GM
4372 * lread.c (lisp_file_lexically_bound_p):
4373 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 4374
35dc09a1
GM
43752012-04-14 Eli Zaretskii <eliz@gnu.org>
4376
4377 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
4378 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
4379
43802012-04-14 Jan Djärv <jan.h.d@swipnet.se>
4381
4382 * nsterm.m (constrainFrameRect): Always constrain when there is only
4383 one screen (Bug#10962).
4384
bcd86815
KB
43852012-04-13 Ken Brown <kbrown@cornell.edu>
4386
4387 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
4388
c25df26e
RT
43892012-04-13 Reuben Thomas <rrt@sc3d.org>
4390
4391 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
4392
0fc59f1e
DC
43932012-04-11 Daniel Colascione <dancol@dancol.org>
4394
4395 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
4396 against is gone. It's better to use vfork now so that when Cygwin
4397 gains a new, working vfork, we use it automatically (bug#10398).
4398
de8c03dc
SM
43992012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4400
4401 * window.c (save_window_save): Obey window-point-insertion-type.
4402
2f097256
GM
44032012-04-11 Glenn Morris <rgm@gnu.org>
4404
4405 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
4406
453b951e
SM
44072012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4408
4409 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
4410
75f1671a 44112012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
4412
4413 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
4414 (force_quit_count): New var.
4415 (handle_interrupt): Use it.
4416
2a8ce227
JB
44172012-04-10 Juanma Barranquero <lekktu@gmail.com>
4418
4419 * w32.c (w32_delayed_load): Record the full path of the library
4420 being loaded (bug#10424).
4421
935396c0
GM
44222012-04-09 Glenn Morris <rgm@gnu.org>
4423
05920a43
GM
4424 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
4425 not just in the obarray, before snarfing them. (Bug#11036)
4426
935396c0
GM
4427 * Makefile.in ($(leimdir)/leim-list.el):
4428 Pass EMACS rather than BUILT_EMACS.
4429
a18ecafa
TZ
44302012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4431
4432 * process.c (make_process):
4433 * process.h: Add integer `gnutls_handshakes_tried' member to
4434 process struct.
4435
6bbef4e5
JC
4436 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4437 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
4438
4439 * gnutls.c (gnutls_log_function2i): Convenience log function.
4440 (emacs_gnutls_read): Use new log functions,
4441 `gnutls_handshakes_tried' process member, and
4442 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4443 attempts per process (connection).
4444
b4d3bc10
CY
44452012-04-09 Chong Yidong <cyd@gnu.org>
4446
4447 * eval.c (Fuser_variable_p, user_variable_p_eh)
4448 (lisp_indirect_variable): Functions deleted.
4449 (Fdefvar): Caller changed.
4450
4451 * callint.c (Finteractive, Fcall_interactively):
4452 * minibuf.c (Fread_variable): Callers changed.
4453
70f4d973
EZ
44542012-04-09 Eli Zaretskii <eliz@gnu.org>
4455
4456 * xdisp.c (set_cursor_from_row): If the display string appears in
4457 the buffer at position that is closer to point than the position
4458 after the display string, display the cursor on the first glyph of
4459 the display string. Fixes cursor display when a 'display' text
4460 property immediately follows invisible text. (Bug#11094)
4461
cb3c2e3e
PE
44622012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4463
4464 composite.c: use 'double' consistently
4465 * composite.c (get_composition_id): Use 'double' consistently
4466 instead of converting 'float' to 'double' and vice versa; this is
4467 easier to understand and avoids a GCC warning.
4468
fd06db5d
GM
44692012-04-09 Glenn Morris <rgm@gnu.org>
4470
50fe702a
GM
4471 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4472 preparation for dumping it with emacs. (Bug#4789)
4473 (leimdir): New variable.
4474 ($(leimdir)/leim-list.el): New rule.
4475 (emacs$(EXEEXT)): Depend on leim-list.el.
4476
fd06db5d
GM
4477 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4478 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4479 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4480
55c131ee
AS
44812012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4482
4483 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4484 proper alignment.
4485
9209588f
JB
44862012-04-07 Juanma Barranquero <lekktu@gmail.com>
4487
4488 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4489 Remove unused local variable.
4490
e3fb2efb
PE
44912012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4492
4493 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4494 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4495 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4496 objects, as mark_maybe_pointer will catch them otherwise.
4497 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4498 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4499
b5385551
PE
45002012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4501
4502 Fix typo that broke non-Windows builds.
4503 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4504
9078ead6
EZ
45052012-04-07 Eli Zaretskii <eliz@gnu.org>
4506
4507 Support building on MS-Windows with libxml2.
4508
4509 * makefile.w32-in (OBJ2): Add xml.$(O).
4510 (GLOBAL_SOURCES): Add xml.c.
4511 ($(BLD)/xml.$(O)): New dependency list.
4512
4513 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
4514 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
4515 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
4516 [!WINDOWSNT]: New macros.
4517 (init_libxml2_functions, libxml2_loaded_p): New functions.
4518 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4519 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4520 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4521 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4522 linked in).
6bbef4e5
JC
4523 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4524 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4525 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4526
4527 * emacs.c: Don't include libxml/parser.h.
4528 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4529 xmlCleanupParser directly.
4530
4531 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4532
3811fdf3
EZ
45332012-04-07 Eli Zaretskii <eliz@gnu.org>
4534
4535 * indent.c (Fvertical_motion): If there is a display string at
4536 point, use it.vpos to compute how many lines to backtrack after
4537 move_it_to point. (Bug#11133)
4538
2f8e16b2
EZ
45392012-04-06 Eli Zaretskii <eliz@gnu.org>
4540
4541 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4542 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4543 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4544 macros related to unification of CJK characters. For the details,
4545 see the discussion following the message here:
4546 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4547
3d439cd1
CY
45482012-04-04 Chong Yidong <cyd@gnu.org>
4549
4550 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4551
8bc53d00
EZ
45522012-04-01 Eli Zaretskii <eliz@gnu.org>
4553
4554 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4555 instead of alloca. (Bug#11138)
4556
3b0512a3
AS
45572012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4558
4559 * w32menu.c (is_simple_dialog): Properly check lisp types.
4560 (Bug#11141)
4561
8427ddd2
EZ
45622012-03-31 Eli Zaretskii <eliz@gnu.org>
4563
979022ef
EZ
4564 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4565 position we get to after a call to move_it_to fails the
4566 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4567 only if we wind up in a string from display property. (Bug#11063)
4568
a6b1c7cc
EZ
4569 * window.c (Fdelete_other_windows_internal): Invalidate the row
4570 and column information about mouse highlight, so that redisplay
4571 restores it after reallocating the glyph matrices. (Bug#7464)
4572
8427ddd2
EZ
4573 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4574 string comes from a `display' text property, use the buffer
4575 position of that property as if we actually saw that position in
4576 the row's glyphs.
697ba24b
EZ
4577 (move_it_by_lines): Remove the assertion that
4578 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4579 violated when there's a before-string at the beginning of a line.
4580 (Bug#11063)
8427ddd2 4581
65a0a738
EZ
45822012-03-30 Eli Zaretskii <eliz@gnu.org>
4583
4584 * xdisp.c (append_space_for_newline): If the default face was
4585 remapped, use the remapped face for the appended newline.
4586 (extend_face_to_end_of_line): Use the remapped default face for
4587 extending the face to the end of the line.
4588 (display_line): Call extend_face_to_end_of_line when the default
4589 face was remapped. (Bug#11068)
4590
581355cc
EZ
45912012-03-29 Eli Zaretskii <eliz@gnu.org>
4592
4593 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4594
e8fc049f
SM
45952012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4596
4597 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4598
4fb9a543
GM
45992012-03-27 Glenn Morris <rgm@gnu.org>
4600
4601 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4602 Doc fixes.
4603
679910f1
KH
46042012-03-26 Kenichi Handa <handa@m17n.org>
4605
4606 * dispextern.h (struct glyph): Fix previous change. Change the
4607 bit length of glyphless.ch to 25 (Bug#11082).
4608
90d49b7f
CY
46092012-03-26 Chong Yidong <cyd@gnu.org>
4610
4611 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4612 (command_loop_1): Use it; inhibit selection update for
4613 handle-select-window too (Bug#8996).
4614
f514f6f0
FP
46152012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4616
e8fc049f 4617 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4618
bf43fa51
KH
46192012-03-25 Kenichi Handa <handa@m17n.org>
4620
4621 * dispextern.h (struct glyph): Change the bit length of
4622 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4623
8a0c01dd
EZ
46242012-03-24 Eli Zaretskii <eliz@gnu.org>
4625
4626 * s/ms-w32.h (tzname): Include time.h before redirecting to
4627 _tzname. Fixes the MSVC build. (Bug#9960)
4628
7d1c3a76
AS
46292012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4630
8ed79523
AS
4631 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4632 characters.
4633
7d1c3a76
AS
4634 * xterm.c (XTread_socket): Only modify handling_signal if
4635 !SYNC_INPUT. (Bug#11080)
4636
e99a9b8b
EZ
46372012-03-23 Eli Zaretskii <eliz@gnu.org>
4638
4639 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4640 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4641 when fetching a multibyte character consumes more bytes than
4642 CHAR_BYTES returns, due to unification of CJK characters in
4643 string_char. (Bug#11073)
4644
5063c0e1
TN
46452012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4646
4647 * process.c (wait_reading_process_output): Handle pty disconnect
4648 by refraining from sending oneself a SIGCHLD (bug#10933).
4649
9f851fbd
CY
46502012-03-22 Chong Yidong <cyd@gnu.org>
4651
4652 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4653
5063c0e1 4654 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4655 Mark string as coming from a prefix property.
4656 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4657 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4658
fb5b8aca
CY
46592012-03-21 Chong Yidong <cyd@gnu.org>
4660
4661 * xfaces.c (Vface_remapping_alist): Doc fix.
4662
62356a1b
EZ
46632012-03-20 Eli Zaretskii <eliz@gnu.org>
4664
4665 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4666 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4667 Doc fixes.
62356a1b 4668
025de85b
CY
46692012-03-20 Chong Yidong <cyd@gnu.org>
4670
4671 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4672 to reflect default non-nil value of redisplay-dont-pause.
4673
4827f94e
KH
46742012-03-19 Kenichi Handa <handa@m17n.org>
4675
4676 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4677 it fit in a valid range (Bug#11003).
4678
e50a24a2
EZ
46792012-03-18 Eli Zaretskii <eliz@gnu.org>
4680
4681 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4682 that is not from display property, accept the row as a "cursor
4683 row" if one of the string's character has a non-nil `cursor'
4684 property. Fixes cursor positioning when there are newlines in
4685 overlay strings, e.g. in icomplete.el. (Bug#11035)
4686
9af5ed87
PE
46872012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4690
d1f55f16
CY
46912012-03-12 Chong Yidong <cyd@gnu.org>
4692
4693 * eval.c (inhibit_lisp_code): Rename from
4694 inhibit_window_configuration_change_hook; move from window.c.
4695
4696 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4697 * window.c (run_window_configuration_change_hook)
4698 (syms_of_window): Callers changed.
4699
66c5eebd
CY
47002012-03-11 Chong Yidong <cyd@gnu.org>
4701
413df973
CY
4702 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4703
66c5eebd
CY
4704 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4705
1de11f56
CY
47062012-03-10 Chong Yidong <cyd@gnu.org>
4707
4708 * frame.c (other_visible_frames): Don't assume the selected frame
4709 is visible (Bug#10955).
4710
cae07000
SM
47112012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4712
4713 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4714
89c94350
JD
47152012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4716
4717 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4718 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4719 zero (Bug#10954).
4720
999dd333
GM
47212012-03-03 Glenn Morris <rgm@gnu.org>
4722
01a6dcc8 4723 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4724
de0100f2
EZ
47252012-03-02 Eli Zaretskii <eliz@gnu.org>
4726
4727 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4728 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4729 (redisplay_window, next_element_from_string): Fix typos in
4730 comments.
3e441275
EZ
4731 (redisplay_window): Pass to move_it_vertically the margin in
4732 pixels, not in screen lines.
de0100f2 4733
96a72ee9
GM
47342012-03-02 Glenn Morris <rgm@gnu.org>
4735
4736 * buffer.c (buffer-list-update-hook): Doc fix.
4737
312508d7
EZ
47382012-02-29 Eli Zaretskii <eliz@gnu.org>
4739
4740 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4741 push_it before setting up the iterator for the first overlay
4742 string, even if we have an empty string loaded.
4743 (next_overlay_string): If there's an empty string on the iterator
4744 stack, pop the stack. (Bug#10903)
4745
27f3c637
PE
47462012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4747
4748 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4749 Suggested by Stefan Monnier in
4750 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4751 * alloc.c (widen_to_Lisp_Object): New static function.
4752 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4753 and widening them to Lisp_Objects. This would work even if
4754 USE_LSB_TAG is defined and wide integers are used, which might
4755 happen in a future version of Emacs.
4756
3c9dfce6
CY
47572012-02-25 Chong Yidong <cyd@gnu.org>
4758
fa74b241
CY
4759 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4760 Doc fix.
4761
3c9dfce6
CY
4762 * xselect.c (Fx_selection_exists_p): Doc fix.
4763 (x_clipboard_manager_save_all): Print an informative message
4764 before saving to clipboard manager.
4765
9486df08
CY
47662012-02-24 Chong Yidong <cyd@gnu.org>
4767
4768 * keyboard.c (process_special_events): Handle all X selection
4769 requests in kbd_buffer, not just the next one (Bug#8869).
4770
f01d3321
CY
47712012-02-23 Chong Yidong <cyd@gnu.org>
4772
4773 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4774 call when setting menu-bar-lines and tool-bar-lines parameters.
4775 (unwind_create_frame_1): New helper function.
4776
4777 * window.c (inhibit_window_configuration_change_hook): New var.
4778 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4779 (syms_of_window): Initialize it.
f01d3321 4780
86b847b6
CY
47812012-02-22 Chong Yidong <cyd@gnu.org>
4782
4783 * xterm.c (x_draw_image_relief): Add missing type check for
4784 Vtool_bar_button_margin (Bug#10743).
4785
a59225b1
CY
47862012-02-21 Chong Yidong <cyd@gnu.org>
4787
4788 * fileio.c (Vfile_name_handler_alist): Doc fix.
4789
4790 * buffer.c (Fget_file_buffer): Protect against invalid file
4791 handler return value.
4792
310f5bd4
PE
47932012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4794
cb3a28cc
PE
4795 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4796 when computing $valmask.
4797
310f5bd4
PE
4798 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4799 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4800 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4801 It's useless in that case, and it can cause problems on hosts
4802 that allocate halves of EMACS_INT values separately.
4803 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4804 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4805 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4806 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4807 it avoids undefined behavior on hosts where shifting right by more
4808 than the word width has undefined behavior.
4809
2375c96a
CY
48102012-02-19 Chong Yidong <cyd@gnu.org>
4811
4812 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4813 (Funhandled_file_name_directory, Ffile_name_as_directory)
4814 (Fdirectory_file_name, Fexpand_file_name)
4815 (Fsubstitute_in_file_name): Protect against invalid file handler
4816 return values (Bug#10845).
4817
3eb49e71
EZ
48182012-02-18 Eli Zaretskii <eliz@gnu.org>
4819
4820 * .gdbinit (pitx): Fix incorrect references to fields of the
4821 iterator stack.
4822
7b926f3f
CY
48232012-02-17 Chong Yidong <cyd@gnu.org>
4824
4825 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4826
11273115
PE
48272012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4830 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4831
c3a70e2b
CY
48322012-02-15 Chong Yidong <cyd@gnu.org>
4833
4834 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4835 marked as special. Also, starting docstrings with * is obsolete.
4836
0ca43699
AS
48372012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4838
4839 * gnutls.c (emacs_gnutls_write): Fix last change.
4840
2e8f3c56
LI
48412012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4842
4843 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4844 send_process.
4845
af70074f
SM
48462012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4847
4848 * keymap.c (Fsingle_key_description): Handle char ranges.
4849
95986d52
CY
48502012-02-12 Chong Yidong <cyd@gnu.org>
4851
afd83bd1
CY
4852 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4853 as that creates a dangerous corner case.
4854
95986d52
CY
4855 * window.c (Fdelete_window_internal): Invalidate the mouse
4856 highlight (Bug#9904).
4857
bd7da63e
GM
48582012-02-12 Glenn Morris <rgm@gnu.org>
4859
4860 * xselect.c (Fx_own_selection_internal)
4861 (Fx_get_selection_internal, Fx_disown_selection_internal)
4862 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4863 * nsselect.m (Fx_own_selection_internal)
4864 (Fx_disown_selection_internal, Fx_selection_exists_p)
4865 (Fx_selection_owner_p, Fx_get_selection_internal):
4866 Sync docs and argument specs with the xselect.c versions.
4867
77abcbc2
LI
48682012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4869
4870 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4871
90b671e2
EZ
48722012-02-11 Eli Zaretskii <eliz@gnu.org>
4873
1c0ca0b7
EZ
4874 * w32select.c (Fx_selection_exists_p): Sync doc string and
4875 argument list with xselect.c. (Bug#10783)
4876
4877 * w16select.c (Fx_selection_exists_p): Sync doc string and
4878 argument list with xselect.c. (Bug#10783)
90b671e2 4879
49241268
GM
48802012-02-10 Glenn Morris <rgm@gnu.org>
4881
4882 * fns.c (Fsecure_hash): Doc fix.
4883
f998bbe7 48842012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4885
4886 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4887
0992bd9c
CY
48882012-02-07 Chong Yidong <cyd@gnu.org>
4889
4890 * buffer.c (Fbuffer_local_variables)
4891 (buffer_lisp_local_variables): Handle unbound vars correctly;
4892 don't let Qunbound leak into Lisp.
4893
af008560
GM
48942012-02-07 Glenn Morris <rgm@gnu.org>
4895
dd605cc4
GM
4896 * image.c (Fimagemagick_types): Doc fix.
4897
af008560
GM
4898 * image.c (imagemagick-render-type): Change it from a lisp object
4899 to an integer. Move the doc here from the lisp manual.
4900 Treat all values not equal to 0 the same.
4901
1449fa1d
CY
49022012-02-06 Chong Yidong <cyd@gnu.org>
4903
4904 * doc.c (store_function_docstring): Avoid applying docstring of
4905 alias to base function (Bug#2603).
4906
3723ec07
AS
49072012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4908
4909 * .gdbinit (pp1, pv1): Remove redundant defines.
4910 (pr): Use pp.
4911
79c1cc1e
CY
49122012-02-04 Chong Yidong <cyd@gnu.org>
4913
4914 * nsterm.m: Declare a global (Bug#10694).
4915
d7f29f8e
EZ
49162012-02-04 Eli Zaretskii <eliz@gnu.org>
4917
cae07000
SM
4918 * w32.c (get_emacs_configuration_options):
4919 Include --enable-checking, if specified, in the return value.
d7f29f8e 4920
3b95a6f9
MR
49212012-02-04 Martin Rudalics <rudalics@gmx.at>
4922
4923 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4924 after rounding frame sizes. (Bug#9723)
4925
d6fa96a6
EZ
49262012-02-04 Eli Zaretskii <eliz@gnu.org>
4927
4928 * keyboard.c (adjust_point_for_property): Don't position point
4929 before BEGV. (Bug#10696)
4930
df0b2940
PE
49312012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 Handle overflow when computing char display width (Bug#9496).
4934 * character.c (char_width): Return EMACS_INT, not int.
4935 (char_width, c_string_width): Check for overflow when
4936 computing the width; this is possible now that individual
4937 characters can have unbounded width. Problem introduced
4938 by merge from Emacs 23 on 2012-01-19.
4939
6bee44d6
MA
49402012-02-02 Michael Albinus <michael.albinus@gmx.de>
4941
4942 * dbusbind.c (Fdbus_register_method): Mention the return value
4943 :ignore in the docstring.
4944
44f92739
GM
49452012-02-02 Glenn Morris <rgm@gnu.org>
4946
1b9f60cc
GM
4947 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4948
44f92739
GM
4949 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4950 Unconditionally set to t. (Bug#10673)
4951 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4952 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4953 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4954
c5d3843c
KH
49552012-02-02 Kenichi Handa <handa@m17n.org>
4956
4957 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4958 0, do not call append_composite_glyph.
4959
159462d4 49602012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4961
4962 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4963 NULL (Bug#6988).
4964 (x_produce_glyphs): If the component of a composition is a null
4965 string, set it->pixel_width to 1 to avoid zero-width glyph.
4966
78cef877
EZ
49672012-02-01 Eli Zaretskii <eliz@gnu.org>
4968
4969 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4970 first 2 arguments are identical. This makes inserting large
4971 output from a subprocess an order of magnitude faster on
4972 MS-Windows, where all sbrk'ed memory is always contiguous.
4973
97897668
GM
49742012-01-31 Glenn Morris <rgm@gnu.org>
4975
4976 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4977 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4978 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4979
31fd3586
GM
49802012-01-29 Glenn Morris <rgm@gnu.org>
4981
4982 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4983
0e24a8b2
CY
49842012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4985
4986 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4987
cc0adcb0
CY
49882012-01-28 Chong Yidong <cyd@gnu.org>
4989
4990 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4991
acc28cb9
CY
49922012-01-26 Chong Yidong <cyd@gnu.org>
4993
9c69cfb7
CY
4994 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4995
acc28cb9
CY
4996 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4997 repeat counts (Bug#10507).
4998
48da7392
GM
49992012-01-26 Glenn Morris <rgm@gnu.org>
5000
5001 * lread.c (syms_of_lread): Doc fix.
5002
14af5f7f
CY
50032012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5004
5005 * coding.c (encode_designation_at_bol): Change return value to
5006 EMACS_INT.
5007
0b21c100
CY
50082012-01-25 Chong Yidong <cyd@gnu.org>
5009
5010 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5011
3c2907f7
CY
50122012-01-21 Chong Yidong <cyd@gnu.org>
5013
5014 * floatfns.c (Fcopysign): Make the second argument non-optional,
5015 since nil is not allowed anyway.
5016
959ad23f
AS
50172012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5018
5019 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5020 (send_process): Likewise.
5021
34a02f46
MR
50222012-01-19 Martin Rudalics <rudalics@gmx.at>
5023
5024 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
5025 (Vwindow_persistent_parameters): Do not use Qstate.
5026 Rewrite doc-strings.
34a02f46 5027
1259009a 50282012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
5029
5030 * character.c (char_width): New function.
70d4fdf6
GM
5031 (Fchar_width, c_string_width, lisp_string_width):
5032 Use char_width (Bug#9496).
25ed9e61 5033
6a6ee00d
MR
50342012-01-16 Martin Rudalics <rudalics@gmx.at>
5035
5036 * window.c (Vwindow_persistent_parameters): New variable.
5037 (Fset_window_configuration, save_window_save): Handle persistent
5038 window parameters.
5039
c85efaf7
EZ
50402012-01-14 Eli Zaretskii <eliz@gnu.org>
5041
5042 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5043 thrashing the stack of the thread. (Bug#9087)
5044
5944709e
PE
50452012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5046
5047 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5048
e71f5d99
EZ
50492012-01-11 Eli Zaretskii <eliz@gnu.org>
5050
5051 * xdisp.c (rows_from_pos_range): Handle the case where the
5052 highlight ends on a newline. (Bug#10464)
5053 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5054 he end column for display of highlight that ends on a newline
5055 before a R2L line.
5056
ce316182
GM
50572012-01-11 Glenn Morris <rgm@gnu.org>
5058
5059 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5060 from load-path also when installation-directory is nil. (Bug#10208)
5061
5b43da69
GM
50622012-01-10 Glenn Morris <rgm@gnu.org>
5063
74cc8ff9
GM
5064 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5065
7d8d6e4e
GM
5066 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5067 Update template values to be closer to their typical values these days.
5b43da69 5068
a0db8d43
EZ
50692012-01-09 Eli Zaretskii <eliz@gnu.org>
5070
5071 * xdisp.c (rows_from_pos_range): Accept additional argument
5072 DISP_STRING, and accept any glyph in a row whose object is that
5073 string as eligible for mouse highlight. Fixes mouse highlight of
5074 display strings from overlays. (Bug#10464)
5075
9a0115ab 50762012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 5077
b9110d6a 5078 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
5079 * fileio.c (auto_saving_dir_umask): New static var.
5080 (Fmake_directory_internal): Use it.
5081 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5082 creating the directory. The old code temporarily assigns
5083 too-generous permissions to the directory.
5084 (do_auto_save_eh): Clear it.
b9110d6a 5085 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
5086 that the var is always cleared.
5087
6c1bd3f3
EZ
50882012-01-07 Eli Zaretskii <eliz@gnu.org>
5089
5090 * search.c (scan_buffer): Pass character positions to
5091 know_region_cache, not byte positions. (Bug#6540)
5092
069d2b50
L
50932012-01-07 LynX <_LynX@bk.ru> (tiny change)
5094
5095 * w32.c (sys_rename): Report EXDEV when rename of a directory
5096 fails because the target is on another logical disk. (Bug#10284)
5097
75bf0d33
DB
50982012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5099
5100 * xterm.c (x_embed_request_focus): New function.
5101
5102 * xterm.h: Add prototype.
5103
5104 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5105
1c6e5a32
GM
51062012-01-05 Glenn Morris <rgm@gnu.org>
5107
5108 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5109
651e947e
EZ
51102012-01-01 Eli Zaretskii <eliz@gnu.org>
5111
5112 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5113 Load gnutls_transport_set_lowat only if GnuTLS version is below
5114 2.11.1.
5115 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5116 GnuTLS versions below 2.11.1.
5117
3778cdd8
AL
51182011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5119
5120 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5121 to the doc string advising against its use for altering the way
5122 windows are scrolled.
5123
0e5317f7
KH
51242011-12-28 Kenichi Handa <handa@m17n.org>
5125
5126 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
5127 coding-system ASCII compatible only when it does not produce BOM
5128 on encoding (Bug#10383).
5129
93d5ca1f
JD
51302011-12-26 Jan Djärv <jan.h.d@swipnet.se>
5131
5132 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
5133 can scroll.
5134 (create_and_show_popup_menu): Always use menu_position_func for
5135 Gtk3 (Bug#10361).
5136
ca22b785
AS
51372011-12-24 Andreas Schwab <schwab@linux-m68k.org>
5138
5139 * callint.c (Fcall_interactively): Don't truncate prompt string.
5140
d048e1e6
EZ
51412011-12-23 Eli Zaretskii <eliz@gnu.org>
5142
5143 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
5144 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 5145 resumed from there (after widening). (Bug#10360)
d048e1e6 5146
5ccaba1f
JD
51472011-12-22 Jan Djärv <jan.h.d@swipnet.se>
5148
5149 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
5150
204ee57f
JD
51512011-12-21 Jan Djärv <jan.h.d@swipnet.se>
5152
b81d40f0
JB
5153 * nsterm.m (x_free_frame_resources):
5154 Release f->output_data.ns->miniimage.
204ee57f
JD
5155 (ns_index_color): Fix indentation. Do not retain
5156 color_table->colors[i].
5157
5158 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
5159 before returning.
5160
5161 * nsfns.m (x_set_background_color): Assign return value from
5162 ns_index_color to face-background instead of NSColor*.
5163 (ns_implicitly_set_icon_type): Fix indentation.
5164 Change assignment in for loop to comparison.
5165
5166 * emacs.c (ns_pool): New variable.
5167 (main): Assign ns_pool.
5168 (Fkill_emacs): Call ns_release_autorelease_pool.
5169
5170 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
5171 autorelease fdesc, release fdAttrs and tdict.
5172 (ns_get_covering_families): Release charset.
5173 (ns_findfonts): Release NSFontDescriptor created with new.
5174 (ns_uni_to_glyphs): Fix indentation.
5175 (setString): Release attrStr before assigning new value.
5176
c803b2b7
JD
51772011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5178
678f4426
JD
5179 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
5180 and NS_IMPL_COCOA.
5181 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
5182 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
5183
cd394be1 51842011-12-18 David Reitter <reitter@cmu.edu>
678f4426 5185
5fecd5fc
JD
5186 * nsterm.m (ns_term_init): Subscribe for notifications
5187 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
5188 to method trackingNotification in EmacsMenu.
5189
5190 * nsmenu.m (trackingMenu): New variable.
3771cb17 5191 (trackingNotification): New method (from Aquamacs).
5fecd5fc 5192 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 5193 from Aquamacs (Bug#7030).
678f4426
JD
5194
51952011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 5196
c803b2b7
JD
5197 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
5198 (symbol_to_nsstring): Fix indentation.
5199 (ns_symbol_to_pb): New function.
cae07000
SM
5200 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
5201 (Fns_rotate_cut_buffers_internal): Remove.
5202 (Fns_store_selection_internal): Rename from
c803b2b7
JD
5203 Fns_store_cut_buffer_internal.
5204 (ns_get_foreign_selection, Fx_own_selection_internal)
5205 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
5206 (Fns_get_selection_internal, Fns_store_selection_internal):
5207 Use ns_symbol_to_pb and check if return value is nil.
5208 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
5209 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
5210 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
5211 renamed to Sns_store_selection_internal.
5212 (ns_handle_selection_request): Move code to Fx_own_selection_internal
5213 and remove this function.
5214 (ns_handle_selection_clear): Remove, never used.
5215 (Fx_own_selection_internal): Move code from ns_handle_selection_request
5216 here.
5217
e1b01a3a
KB
52182011-12-17 Ken Brown <kbrown@cornell.edu>
5219
5220 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
5221 GID is unknown (Bug#10257).
5222
2adb6e85
PE
52232011-12-17 Paul Eggert <eggert@cs.ucla.edu>
5224
5225 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
5226 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
5227 which caused a build failure on GNU/Linux IA-64. This problem was
5228 introduced by my 2011-10-07 patch.
5229
d1d7b339
JL
52302011-12-15 Juri Linkov <juri@jurta.org>
5231
5232 * image.c (imagemagick_error): New function. (Bug#10112)
5233 (imagemagick_load_image): Comment out `MagickSetResolution' call.
5234 Use `imagemagick_error' where ImageMagick functions return
5235 `MagickFalse'.
5236 (Fimagemagick_types): Add `Fnreverse' to return the list in the
5237 proper order.
5238
100d5755
KH
52392011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5240
5241 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
5242 fill background (Bug#8992).
5243
454592a6
MR
52442011-12-13 Martin Rudalics <rudalics@gmx.at>
5245
5246 * window.c (Vwindow_combination_resize)
5247 (Vwindow_combination_limit): Use t instead of non-nil in
5248 doc-strings.
61d4b438
MR
5249 (Vrecenter_redisplay): Add first sentence of doc-string on
5250 separate line.
53524d93 5251 (Frecenter): Fix doc-string typo.
454592a6 5252
3633e3aa
KH
52532011-12-11 Kenichi Handa <handa@m17n.org>
5254
5255 * coding.c (Funencodable_char_position): Pay attention to the
5256 buffer text relocation (Bug#9389).
5257
7b9d523a 52582011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 5259
7b9d523a
JD
5260 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
5261 gtk_init (Bug#10100).
5262
b73189c6
EZ
52632011-12-10 Eli Zaretskii <eliz@gnu.org>
5264
5265 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
5266 IT->string is nil. (Bug#10263)
5267
f7dfe5d6
JD
52682011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5269
83faebb4
JD
5270 * nsterm.h (x_free_frame_resources): Declare.
5271
f7dfe5d6
JD
5272 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
5273 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
5274
5275 * nsterm.h (ns_get_defaults_value): Declare.
5276
5277 * nsterm.m (ns_default): Call ns_get_defaults_value.
5278
7cd4e72c
EZ
52792011-12-09 Eli Zaretskii <eliz@gnu.org>
5280
5281 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
5282 (Bug#10170)
5283
b34d7317
YM
52842011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5285
5286 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
5287 that where the value of an _OBJC_* symbol points to is in the .bss
5288 section (Bug#10240).
5289
76470ad1
KH
52902011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5291
5292 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 5293 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 5294
745fff94
KH
52952011-12-08 Kenichi Handa <handa@m17n.org>
5296
5297 * ftfont.c (get_adstyle_property): Fix previous change
5298 (Bug#10233).
5299
6e44397c
JB
53002011-12-07 Juanma Barranquero <lekktu@gmail.com>
5301
5302 * w32.c (init_environment): If no_site_lisp, remove site-lisp
5303 dirs from the default value of EMACSLOADPATH (bug#10208).
5304
7efa6272
GM
53052011-12-07 Glenn Morris <rgm@gnu.org>
5306
5307 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
5308 installation and source directories as well. (Bug#10208)
5309
f6fc4d87
CY
53102011-12-06 Chong Yidong <cyd@gnu.org>
5311
5312 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
5313
2bf26180
GM
53142011-12-06 Glenn Morris <rgm@gnu.org>
5315
5316 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
5317 as an error, not just -1. (Bug#10217)
5318
3a6ad4f0
CY
53192011-12-05 Chong Yidong <cyd@gnu.org>
5320
5321 * keyboard.c (process_special_events): New function.
5322 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5323
75a3b399
PE
53242011-12-05 Paul Eggert <eggert@cs.ucla.edu>
5325
5326 * coding.c (encode_designation_at_bol): Don't use uninitialized
5327 local variable (Bug#9318).
5328
c3c9e25e
KH
53292011-12-05 Kenichi Handa <handa@m17n.org>
5330
5331 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
5332 return Qnil (Bug#8046, Bug#10193).
5333
5eb05ea3
KH
53342011-12-05 Kenichi Handa <handa@m17n.org>
5335
5336 * coding.c (encode_designation_at_bol): New args charbuf_end and
5337 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
5338 (coding_set_source): Return how many bytes coding->source was
5339 relocated.
5340 (coding_set_destination): Return how many bytes
5341 coding->destination was relocated.
5342 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 5343 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
5344
53452011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5346
5347 * coding.c (CODING_CHAR_CHARSET_P): New macro.
5348 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
5349 macro (Bug#9318).
5350
53512011-12-05 Andreas Schwab <schwab@linux-m68k.org>
5352
5353 The following changes are to fix Bug#9318.
5354
a79703f5 5355 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
5356 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
5357 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 5358 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 5359
7dbda6df
JB
53602011-12-05 Juanma Barranquero <lekktu@gmail.com>
5361
5362 * lisp.h (process_quit_flag): Fix external declaration.
5363
6d5eb5b0
SM
53642011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
5365
5366 Don't macro-inline non-performance-critical code.
5367 * eval.c (process_quit_flag): New function.
5368 * lisp.h (QUIT): Use it.
5369
a0c3fad0
JD
53702011-12-04 Jan Djärv <jan.h.d@swipnet.se>
5371
5372 * nsfns.m (get_geometry_from_preferences): New function.
5373 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
5374
6c07aac2
AS
53752011-12-04 Andreas Schwab <schwab@linux-m68k.org>
5376
5377 * emacs.c (Qkill_emacs): Define.
5378 (syms_of_emacs): Initialize it.
5379 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
5380 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
5381 (quit_throw_to_read_char): Add parameter `from_signal'.
5382 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
5383 * lisp.h (QUIT): Call Fkill_emacs if requested.
5384
c052ead4
JD
53852011-12-03 Jan Djärv <jan.h.d@swipnet.se>
5386
5387 * widget.c (update_wm_hints): Return if wmshell is null.
5388 (widget_update_wm_size_hints): New function.
5389
5390 * widget.h (widget_update_wm_size_hints): Declare.
5391
5392 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
5393 widget_update_wm_size_hints (Bug#10104).
5394
9e49252b
EZ
53952011-12-03 Eli Zaretskii <eliz@gnu.org>
5396
5397 * xdisp.c (handle_invisible_prop): If the invisible text ends just
5398 before a newline, prepare the bidi iterator for consuming the
5399 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 5400 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 5401
02b16839
JL
54022011-12-02 Juri Linkov <juri@jurta.org>
5403
5404 * search.c (Fword_search_regexp): New Lisp function created from
5405 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
5406 (Fword_search_backward, Fword_search_forward)
5407 (Fword_search_backward_lax, Fword_search_forward_lax):
5408 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
5409 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
5410
0068070e
SM
54112011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
5412
5413 * fileio.c (Finsert_file_contents): Move after-change-function call
5414 to before the "handled:" label, since all "goto handled" appear in
5415 cases where the *-change-functions have already been properly called
5416 (bug#10117).
5417
3360a3fc
AS
54182011-12-01 Andreas Schwab <schwab@linux-m68k.org>
5419
5420 * keyboard.c (interrupt_signal): Don't call kill-emacs when
5421 waiting for input. (Bug#10169)
5422
73d6c093
EZ
54232011-11-30 Eli Zaretskii <eliz@gnu.org>
5424
5425 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
5426 verifies glyph row's hash code--we have just reallocated the
5427 glyphs, so their contents can be complete garbage. (Bug#10164)
5428
febe6bea
JB
54292011-11-30 Juanma Barranquero <lekktu@gmail.com>
5430
5431 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5432
801a4313
EZ
54332011-11-30 Eli Zaretskii <eliz@gnu.org>
5434
5435 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5436 attributes are tested _before_ calling verify_row_hash, to protect
5437 against GCC re-ordering of the tests. (Bug#10164)
5438
2b56b87e
JD
54392011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5440
5441 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5442
5443 * xterm.c (handle_one_xevent): Only set async_visible and friends
5444 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 5445 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
5446 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5447
dbf31225
PE
54482011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5449
5450 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5451 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5452 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5453 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5454 All uses changed to use GCPRO1 etc.
5455 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5456 Revert to old implementation (i.e., before 2011-03-11).
5457
1305621b
YM
54582011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5459
5460 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5461 of scroll runs so as to avoid assigning disabled bogus rows and
5462 unnecessary graphics copy operations.
5463
8c9afb46
EZ
54642011-11-27 Eli Zaretskii <eliz@gnu.org>
5465
5466 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5467 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5468 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5469 (malloc, free, realloc, calloc): Redirect to e_* only when
5470 compiling Emacs.
5471
5472 * lisp.h (GCTYPEBITS): Move before first use.
5473 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5474 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5475 this macro definition.
5476
5477 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5478 _MSC_VER.
5479
54e9e3bf
JD
54802011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5481
6d5eb5b0
SM
5482 * gtkutil.c (xg_create_frame_widgets):
5483 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
5484 present with Gtk+ 2.0.
5485
83aca1cb
PE
54862011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5487
5488 * fileio.c (Finsert_file_contents): Undo previous change; see
5489 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5490
5b76caa4
PE
54912011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5492
5493 Rename locals to avoid shadowing.
5494 * fileio.c (Finsert_file_contents):
5495 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5496 * process.c (wait_reading_process_output):
5497 Rename inner 'proc' to 'p' to avoid shadowing.
5498 Indent for consistency with usual Emacs style.
5499
8c535114
EZ
55002011-11-25 Eli Zaretskii <eliz@gnu.org>
5501
5502 * xdisp.c (redisplay_window): If cursor row is not fully visible
5503 after recentering, and scroll-conservatively is set to a large
5504 number, scroll window by a few more lines to make the cursor fully
5505 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
5506 (start_display): Don't move to the next line if the display should
5507 start at a newline that is part of a display vector or an overlay
5508 string. (Bug#10119)
8c535114 5509
fa4fdb5c
JL
55102011-11-24 Juri Linkov <juri@jurta.org>
5511
5512 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
5513 after the `MagickPingImage' call. (Bug#10112)
5514
90ec88df
CY
55152011-11-23 Chong Yidong <cyd@gnu.org>
5516
5517 * window.c (Fcoordinates_in_window_p): Accept only live windows.
5518
56e2e794
MR
55192011-11-23 Martin Rudalics <rudalics@gmx.at>
5520
5521 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5522 making another buffer current. (Bug#10114)
5523
b6e64c41
GM
55242011-11-23 Glenn Morris <rgm@gnu.org>
5525
5526 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5527
6b21de18
CY
55282011-11-23 Chong Yidong <cyd@gnu.org>
5529
5530 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5531 using it (Bug#5984).
5532
b12cd789
EZ
55332011-11-22 Eli Zaretskii <eliz@gnu.org>
5534
5535 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5536 and header-lines, as they don't have one computed for them.
5537 (Bug#10098)
5538
5539 * .gdbinit (prow): Make displayed values more self-explaining.
5540 Add row's hash code.
5541
261b6fd4
LMI
55422011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5543
5544 * process.c (wait_reading_process_output): Fix asynchrounous
5545 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5546 (wait_reading_process_output): Add comment and URL.
261b6fd4 5547
e7cfd277
JD
55482011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5549
5550 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5551
a9b9b7f5
CY
55522011-11-21 Chong Yidong <cyd@gnu.org>
5553
5554 * window.c (Fnext_window, Fprevious_window): Doc fix.
5555
b0d15b4f
SM
55562011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5557
5558 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5559
fe7a3057
JB
55602011-11-20 Juanma Barranquero <lekktu@gmail.com>
5561
5562 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5563
d2999b1a
MR
55642011-11-20 Martin Rudalics <rudalics@gmx.at>
5565
5566 * window.c (Fset_window_combination_limit): Rename argument
5567 STATUS to LIMIT.
5568 (Vwindow_combination_limit): Remove "status" from doc-string.
5569
d5ff9cd0
AS
55702011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5571
5572 * m/ibms390.h: Remove.
5573 * m/ibms390x.h: Don't include "ibms390.h".
5574
a5bb9bd3
SM
55752011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5576
5577 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5578 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5579
cd1181db
JB
55802011-11-20 Juanma Barranquero <lekktu@gmail.com>
5581
5582 * casetab.c (Fset_case_table):
5583 * charset.c (Fcharset_after): Fix typos.
5584
615a3b8d 55852011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5586
17e845af
PE
5587 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5588 Otherwise, valgrind does not work on some platforms.
5589 Problem reported by Andreas Schwab in
6a0bf43d
PE
5590 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5591 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5592 is set, removing the need for VIRT_ADDRESS_VARIES.
5593 (PURE_P): Use a more-efficient implementation that needs just one
5594 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5595 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5596 to 4 (xorl, subq, cmpq, setbe).
5597 * alloc.c (pure): Always extern now, since that's the
5598 VIRT_ADDR_VARIES behavior.
5599 (PURE_POINTER_P): Use a single comparison, not two, for
5600 consistency with the new puresize.h.
5601 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5602 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5603 Remove VIRT_ADDR_VARIES no longer needed.
5604
f8fe6f96
EZ
56052011-11-19 Eli Zaretskii <eliz@gnu.org>
5606
5607 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5608 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5609 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5610 behave as if the cursor position were at the window margin.
5611
5612 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5613 and the cursor position is out of bounds, behave as if the cursor
5614 position were at the window margin. (Bug#10075)
5615
df05a53c
CY
56162011-11-18 Chong Yidong <cyd@gnu.org>
5617
5618 * window.c (Fwindow_combination_limit): Make first argument
5619 non-optional, since it is meaningless for live windows like the
5620 selected window.
61ccba97 5621
2071918e
DA
56222011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5623
5624 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5625
b50a28de
SM
56262011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5627
5628 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5629 (graft_intervals_into_buffer): Simplify.
5630
015137db
EZ
56312011-11-18 Eli Zaretskii <eliz@gnu.org>
5632
5633 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5634 hash values of the two rows.
5635 (copy_row_except_pointers): Preserve the used[] arrays and the
5636 hash values of the two rows. (Bug#10035)
68c95424 5637 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5638
5639 * xdisp.c (row_hash): New function, body extracted from
5640 compute_line_metrics.
5641 (compute_line_metrics): Call row_hash, instead of computing the
5642 hash code inline.
5643
5644 * dispnew.c (verify_row_hash): Call row_hash for computing the
5645 hash code of a row, instead of duplicating code from xdisp.c.
5646
5647 * dispextern.h (row_hash): Add prototype.
5648
a2addb04
TH
56492011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5650
5651 * frame.c (delete_frame): Don't delete the terminal when the last
5652 X frame is closed if emacs is built with GTK toolkit.
5653
df85d315
JB
56542011-11-17 Juanma Barranquero <lekktu@gmail.com>
5655
5656 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5657
a0c2d0ae
MR
56582011-11-17 Martin Rudalics <rudalics@gmx.at>
5659
5660 * window.c (Vwindow_splits): Rename to
5661 Vwindow_combination_resize. Suggested by Juri Linkov.
5662 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5663 of Vwindow_splits.
5664
58179cce
JB
56652011-11-16 Juanma Barranquero <lekktu@gmail.com>
5666
7877f373
JB
5667 * nsfns.m (Fns_font_name):
5668 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5669
b6f67890
MR
56702011-11-16 Martin Rudalics <rudalics@gmx.at>
5671
5672 * window.h (window): Rename slot "nest" to "combination_limit".
5673 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5674 (Fset_window_nest): Rename to Fset_window_combination_limit.
5675 (Vwindow_nest): Rename to Vwindow_combination_limit.
5676 (recombine_windows, make_parent_window, make_window)
5677 (Fsplit_window_internal, saved_window)
5678 (Fset_window_configuration, save_window_save): Rename all
5679 occurrences of window_nest to window_combination_limit.
5680
c7015153
JB
56812011-11-15 Juanma Barranquero <lekktu@gmail.com>
5682
5683 * image.c (imagemagick_load_image): Fix typo.
5684
322ad6ec
EZ
56852011-11-14 Eli Zaretskii <eliz@gnu.org>
5686
5687 * xdisp.c (display_line): Move the call to
5688 highlight_trailing_whitespace before the call to
5689 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5690 faces of all the glyphs to compute ROW's hash value.
5691 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5692
f067b8ec
JB
56932011-11-14 Juanma Barranquero <lekktu@gmail.com>
5694
5695 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5696 just return (bug#10044).
5697
1e5b2111
EZ
56982011-11-12 Eli Zaretskii <eliz@gnu.org>
5699
7ef3cbd5
EZ
5700 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5701 with user-defined heap size. Bump the default size of the temacs
5702 heap to 27MB, to avoid memory warning when running temacs.
5703 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5704
1e5b2111
EZ
5705 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5706 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5707 (verify_row_hash) [XASSERTS]: New function.
5708 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5709 that the hash value of glyph rows is correct.
1e5b2111 5710
89d61221
MR
57112011-11-12 Martin Rudalics <rudalics@gmx.at>
5712
5713 * window.h (window): Remove splits slot.
5714 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5715 (Fdelete_other_windows_internal, make_parent_window)
5716 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5717 (Fset_window_configuration, save_window_save): Don't deal with
5718 split status of windows.
5719 (saved_window): Remove splits slot.
5720 (Vwindow_splits): Rewrite doc-string.
5721
97f18cc8
JD
57222011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5723
5724 * xfns.c (unwind_create_frame):
5725 * nsfns.m (unwind_create_frame):
5726 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5727 Vframe_list (Bug#9999).
5728
22a648b4
DA
57292011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5730
0b381c7e 5731 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5732
659afede
KH
57332011-11-11 Kenichi Handa <handa@m17n.org>
5734
5735 * callproc.c (Fcall_process): Set the member dst_multibyte of
5736 process_coding.
5737
9ac0394b
KH
57382011-11-11 Johan Bockgård <bojohan@gnu.org>
5739
5740 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5741 avoid a crash (bug#9496).
5742
2fbdc249
CY
57432011-11-09 Chong Yidong <cyd@gnu.org>
5744
5745 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5746 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5747
ac6b1f81
PE
57482011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5749
5750 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5751
09db192c
PE
57522011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5753
5754 Avoid some portability problems by eschewing 'extern inline' functions.
5755 The trivial performance wins aren't worth the portability hassles; see
5756 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5757 et seq.
5758 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5759 (window_box_width, window_box_left, window_box_left_offset)
5760 (window_box_right, window_box_right_offset): Undo previous change,
5761 by removing the "extern"s.
5762 * intervals.c (adjust_intervals_for_insertion)
5763 (adjust_intervals_for_deletion): Undo previous change,
5764 making these static again.
5765 (offset_intervals, temp_set_point_both, temp_set_point)
5766 (copy_intervals_to_string): No longer inline.
5767 * xdisp.c (window_text_bottom_y, window_box_width)
5768 (window_box_height, window_box_left_offset)
5769 (window_box_right_offset, window_box_left, window_box_right)
5770 (window_box): No longer inline.
5771
105216ed
CY
57722011-11-08 Chong Yidong <cyd@gnu.org>
5773
5774 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5775 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5776 Signal an error if not a live window.
105216ed
CY
5777 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5778 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5779
ae9e237f
JB
57802011-11-07 Juanma Barranquero <lekktu@gmail.com>
5781
5782 * lisp.h (syms_of_abbrev): Remove declaration.
5783 Reported by CHENG Gao <chenggao@royau.me>.
5784
c7aa8333
EZ
57852011-11-07 Eli Zaretskii <eliz@gnu.org>
5786
5787 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5788 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5789 of temacs in GUI mode.
5790
be7f5545
MR
57912011-11-07 Martin Rudalics <rudalics@gmx.at>
5792
5793 * window.h: Declare delete_all_child_windows instead of
5794 delete_all_subwindows.
5795 * window.c (Fwindow_nest, Fset_window_nest)
5796 (Fset_window_new_total, Fset_window_new_normal)
5797 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5798 (delete_all_subwindows): Rename to delete_all_child_windows.
5799 (Fdelete_other_windows_internal, Fset_window_configuration):
5800 Call delete_all_child_windows instead of delete_all_subwindows.
5801 * frame.c (delete_frame): Call delete_all_child_windows instead
5802 of delete_all_subwindows.
5803
ca78dc43
PE
58042011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5805
5806 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5807 This is also needed for porting to any host where GC_MARK_STACK is
5808 not GC_MAKE_GCPROS_NOOPS.
5809 (which_symbols): Use it.
5810
a0241d01
KH
58112011-11-07 Kenichi Handa <handa@m17n.org>
5812
5813 * coding.c (coding_set_destination): Check coding->src_pos only
5814 when coding->src_object is a buffer (bug#9910).
5815
5816 * process.c (send_process): Set the member src_multibyte of coding
5817 to 0 (bug#9911) when sending a unibyte text.
5818
5819 * callproc.c (Fcall_process): Set the member src_multibyte of
5820 process_coding to 0 (bug#9912).
5821
a64bfdfa 58222011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5823
5824 * xmenu.c (cleanup_widget_value_tree): New function.
5825 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5826 calling free_menubar_widget_value_tree directly (Bug#9830).
5827
cb41b32a
PE
58282011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5829
5830 Fix some portability problems with 'inline'.
5831 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5832 (window_box_width, window_box_left, window_box_left_offset)
5833 (window_box_right, window_box_right_offset): Declare extern.
5834 Otherwise, these inline functions do not conform to C99 and
5835 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5836 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5837 * intervals.c (adjust_intervals_for_insertion)
5838 (adjust_intervals_for_deletion): Now extern, because otherwise the
5839 extern inline functions 'offset_intervals' couldn't refer to it.
5840 (static_offset_intervals): Remove.
5841 (offset_intervals): Rewrite using the old contents of
5842 static_offset_intervals. The old version didn't conform to C99
5843 because an extern inline function contained a reference to an
5844 identifier with static linkage.
5845
b7041366
AS
58462011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5847
5848 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5849 GC.
5850
88a37c4d
EZ
58512011-11-06 Eli Zaretskii <eliz@gnu.org>
5852
5853 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5854 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5855 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5856 return Qleft_to_right.
5857
49745b39
CY
58582011-11-06 Chong Yidong <cyd@gnu.org>
5859
5860 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5861 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5862 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5863 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5864 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5865 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5866 (Fwindow_vscroll): Doc fix.
5867 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5868 argument, since it makes no sense to pass a live window and for
5869 consistency with window-child.
5870
1f05cd82
CS
58712011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5872
5873 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5874 support MSVC.
5875
22610910
JR
58762011-11-05 Jason Rumney <jasonr@gnu.org>
5877
5878 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5879 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5880 fonts (Bug#6029).
5881 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5882 bitwise arithmetic preventing use of unicode-sip and non-truetype
5883 opentype fonts.
5884
a06776b2
EZ
58852011-11-05 Eli Zaretskii <eliz@gnu.org>
5886
3ad924ba
EZ
5887 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5888 "emacs"-only part.
5889
a06776b2
EZ
5890 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5891 initialization code to keep similarity to xfns.c after changes
5892 from 2011-11-05.
5893
c9e7db78
JD
58942011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5895
a97f8f3f
JD
5896 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5897 (unwind_create_frame): New function (Bug#9943).
5898 (Fx_create_frame): Restructure code to be more similar to the one in
5899 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5900 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5901 Move terminal->reference_count++ just before making the frame official
5902 (Bug#9943).
5903
5904 * nsterm.m (x_free_frame_resources): New function.
5905 (x_destroy_window): Move code to x_free_frame_resources.
5906
c9e7db78 5907 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5908 (Fx_create_frame, x_create_tip_frame):
5909 Move terminal->reference_count++ just before making the frame
75f1671a 5910 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5911 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5912
a6fc3b5c
EZ
59132011-11-05 Eli Zaretskii <eliz@gnu.org>
5914
5915 Support MSVC build with newer versions of Visual Studio.
5916 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5917 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5918 nt/gmake.defs.
5919
5920 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5921 which are not supported by MSVC.
5922 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5923 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5924 bitfields.
5925 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5926 types in bitfields.
5927 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5928
5929 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5930
58179cce 59312011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5932
5933 Support MSVC build with newer versions of Visual Studio.
5934 * w32.c: Don't include w32api.h for MSVC.
5935 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5936
5937 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5938 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5939 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5940 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5941 e_* cousins.
5942 (alloca) [_MSC_VER]: Define to _alloca.
5943
5944 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5945
5946 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5947
a58c13ed
EZ
59482011-11-04 Eli Zaretskii <eliz@gnu.org>
5949
5950 * xdisp.c (note_mouse_highlight): If either of
5951 previous/next-single-property-change returns nil, treat that as
5952 the beginning or the end of the buffer. (Bug#9955)
5953
fe0b6370
JD
59542011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5955
a58c13ed 5956 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5957 label is not null (Bug#9951).
5958 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5959 may be NULL.
5960
89bd5ee1
EZ
59612011-11-04 Eli Zaretskii <eliz@gnu.org>
5962
5963 * window.c (Fwindow_body_size): Mention in the doc string that the
5964 return value is in frame's canonical units. (Bug#9949)
5965
84c3edb9
EZ
59662011-11-03 Eli Zaretskii <eliz@gnu.org>
5967
4e2fb5c7
EZ
5968 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5969
84c3edb9 5970 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5971 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5972 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5973
bc17a887
EZ
59742011-11-01 Eli Zaretskii <eliz@gnu.org>
5975
5976 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5977 Don't stop backward scan on the continuation glyph, even though
5978 its CHARPOS is positive.
6d5eb5b0
SM
5979 (mouse_face_from_buffer_pos, note_mouse_highlight):
5980 Rename cover_string to disp_string.
bc17a887 5981
4ee88440
MR
59822011-11-01 Martin Rudalics <rudalics@gmx.at>
5983
5984 * window.c (temp_output_buffer_show): Don't use
5985 Vtemp_buffer_show_specifiers.
5986 (Vtemp_buffer_show_specifiers): Remove unused variable.
5987
c2ff3c02
EZ
59882011-10-30 Eli Zaretskii <eliz@gnu.org>
5989
5990 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5991 past the beginning of the current glyph matrix.
5992
58179cce 59932011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5994
5995 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5996 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5997 HAVE_GTK3 (Bug#9869).
b77a6a7f 5998
3b574623
JD
5999 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6000 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6001
b77a6a7f
JD
6002 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6003
6004 * xterm.c: Declare x_handle_net_wm_state to return int.
6005 (handle_one_xevent): Check if we are iconified but don't have
6006 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6007 (get_current_wm_state): Return non-zero if not hidden,
6008 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6009 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6010 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6011 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6012
196e41e4
PE
60132011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6014
6015 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6016 so that this new function doesn't get optimized away by a
6017 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6018
021f2e1a
AS
60192011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6020
6021 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6022
8b058d44
EZ
60232011-10-29 Eli Zaretskii <eliz@gnu.org>
6024
6025 Fix the `xbytecode' command.
6026 * .gdbinit (xprintbytestr): New command.
b50a28de 6027 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
6028 (xbytecode): Print the byte-code string as well.
6029
4452fb80
EZ
60302011-10-29 Kim Storm <storm@cua.dk>
6031
8b058d44
EZ
6032 * alloc.c (which_symbols): New function.
6033
21b72067
AS
60342011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6035
6036 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6037 line. (Bug#9903)
6038
83ed7b5c
GM
60392011-10-29 Glenn Morris <rgm@gnu.org>
6040
6041 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6042 Not clear what it was for, and it causes various bugs. (Bug#9839)
6043
5a7a728b
EZ
60442011-10-28 Eli Zaretskii <eliz@gnu.org>
6045
6046 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6047 possible random value that matches one of those tested as
6048 condition to clear the mouse face.
6049
d3d0842f
CY
60502011-10-28 Chong Yidong <cyd@gnu.org>
6051
6052 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6053
31b39d13
DN
60542011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6055
6056 * window.c (make_window): Initialize phys_cursor_on_p.
6057
9aba6043
SM
60582011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6059
6060 * lisp.h (struct Lisp_Symbol): Update comments.
6061
c20992f4
JB
60622011-10-28 Juanma Barranquero <lekktu@gmail.com>
6063
6064 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6065
db4f02f2
EZ
60662011-10-28 Eli Zaretskii <eliz@gnu.org>
6067
6068 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6069 <oslsachem@gmail.com> for helping to debug this.
6070
6071 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6072 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6073 (g_b_init_get_glyph_outline_w): New static variables.
6074 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6075 (GetGlyphOutlineW_Proc): New typedefs.
6076 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
6077 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6078 New functions.
6079 (w32font_open_internal, compute_metrics):
6080 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
6081 instead of calling the "wide" APIs directly.
6082
6083 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6084
6085 * w32.h (syms_of_w32font): Add prototype.
6086
87e68db4
JB
60872011-10-27 Juanma Barranquero <lekktu@gmail.com>
6088
6089 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6090 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6091 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6092 (Fmove_to_window_line): Doc fix.
6093
435c1d67
CY
60942011-10-27 Chong Yidong <cyd@gnu.org>
6095
6096 * process.c (make_process): Set gnutls_state to NULL.
6097
6098 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6099 non-NULL, regardless of GNUTLS_INITSTAGE.
6100 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6101 an error. Set process slots as soon as we allocate them.
6102
6103 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6104
9c6c6f49
CY
61052011-10-27 Chong Yidong <cyd@gnu.org>
6106
9aba6043
SM
6107 * gnutls.c (emacs_gnutls_deinit): New function.
6108 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
6109 (Fgnutls_deinit, Fgnutls_boot): Use it.
6110
6111 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6112 (deactivate_process): Call emacs_gnutls_deinit.
6113
657d08d3
JB
61142011-10-27 Juanma Barranquero <lekktu@gmail.com>
6115
6116 * image.c (x_create_x_image_and_pixmap):
6117 * w32.c (sys_rename, w32_delayed_load):
6118 * w32font.c (fill_in_logfont):
6119 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6120
5430d399
JB
61212011-10-26 Juanma Barranquero <lekktu@gmail.com>
6122
6123 * w32fns.c (w32_default_color_map): New function,
6124 extracted from Fw32_default_color_map.
a7ef684b 6125 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 6126
fe0055fa
PE
61272011-10-25 Paul Eggert <eggert@cs.ucla.edu>
6128
6129 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
6130
e6346438
SM
61312011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
6132
6133 * keyboard.c (test_undefined): New function (bug#9751).
6134 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
6135
e112cc37
ET
61362011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
6137
6138 * sysdep.c (init_sys_modes): Fix the check for the controlling
6139 terminal (Bug#6649).
6140
7b5d6677
EZ
61412011-10-20 Eli Zaretskii <eliz@gnu.org>
6142
6143 * dispextern.h (struct bidi_it): New member next_en_type.
6144
6145 * bidi.c (bidi_line_init): Initialize the next_en_type member.
6146 (bidi_resolve_explicit_1): When next_en_pos is valid for the
6147 current character, check also for next_en_type being WEAK_EN.
6148 (bidi_resolve_weak): Don't enter the expensive loop if the current
6149 position is before next_en_pos. Record the bidi type of the first
6150 non-ET, non-BN character we find, in addition to its position.
6151 (bidi_level_of_next_char): Invalidate next_en_type when
6152 next_en_pos is over-stepped.
6153
7da0b018
PE
61542011-10-20 Paul Eggert <eggert@cs.ucla.edu>
6155
6156 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
6157 * editfns.c: Rewrite current-time-zone so that it invokes
6158 the equivalent of (format-time-string "%Z") to get the time zone name.
6159 This fixes a bug when the time zone name contains characters that
6160 need converting from the system time locale to Emacs internal format.
6161 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
6162 that patch fixed format-time-string to do the conversion, but
6163 I forgot to fix current-time-zone.
6164 (format_time_string): New function, containing most of
6165 what Fformat_time_string used to contain.
6166 (Fformat_time_string): Rewrite in terms of format_time_string.
6167 This doesn't change this function's behavior.
6168 (current-time-zone): Rewrite to use format_time_string.
6169 This fixes the bug reported by Michael Schierl in
6170 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
6171 Jason Rumney's 2007-06-07 change worked around this bug, but
6172 didn't fix it.
6173 * systime.h (tzname, timezone): Remove no-longer-used declarations.
6174
8547b010
EZ
61752011-10-19 Eli Zaretskii <eliz@gnu.org>
6176
6177 * xdisp.c (start_display): If the character at POS is displayed
6178 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
6179 (try_window_reusing_current_matrix): If a line ends in a display
6180 vector or the next line starts in a display vector, continue
6181 redrawing the window even though the character position of
6182 start_row was reached.
8547b010
EZ
6183 (Bug#9771, part 2)
6184
4e948d15
CY
61852011-10-18 Chong Yidong <cyd@gnu.org>
6186
6187 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
6188 with nobreak-char-display too.
6189
4787455f
EZ
61902011-10-18 Eli Zaretskii <eliz@gnu.org>
6191
6192 Fix part 3 of bug#9771.
6193 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
6194 (bidi_resolve_neutral): Don't enter the expensive loop looking for
6195 non-neutral characters if the current character is a paragraph
6196 separator (a.k.a. Newline). This avoids running the same
6197 expensive loop twice, once when we consume the preceding newline
6198 and the other time when the line actually needs to be displayed.
6199 Avoid the loop when we see neutrals on the base embedding level
6200 following a character whose directionality is the same as the
6201 paragraph's. This avoids running the expensive loop when a line
6202 ends in a long sequence of neutrals, like control characters.
6203 Add assertion against STRONG_AL type. Slightly rearrange code
6204 that determines the type of a neutral given the first non-neutral
6205 that follows it.
6206 (bidi_level_of_next_char): Set next_en_pos to zero when
6207 invalidating its info.
6208
2c91f553
EZ
62092011-10-17 Eli Zaretskii <eliz@gnu.org>
6210
6211 * xdisp.c (push_display_prop): Determine whether to record string
6212 or buffer position by IT->string, not by IT->method. Allow
6213 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
6214 (move_it_vertically_backward): Don't look for character position
6215 immediately after the newline when in a continuation line.
6216 (Bug#9771, part 1)
2c91f553 6217
c7b08b0d
MR
62182011-10-15 Martin Rudalics <rudalics@gmx.at>
6219
6220 * window.c (coordinates_in_window): Rewrite and delabelize
6221 vertical border check. (Bug#5357) (Bug#9618)
6222
6b02f655
SM
62232011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
6224
6225 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
6226 errors in XSetWindowBorder (bug#9310).
6227
81d40c92
DA
62282011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
6229
6230 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
6231 avoid crash when xmalloc overrun checking is enabled.
6232
d4172c3b
EZ
62332011-10-13 Eli Zaretskii <eliz@gnu.org>
6234
6235 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
6236 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
6237 cursor motion with <left> and <right> arrow keys.
6238
6239 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
6240 some callers set that themselves.
6241
b00eea75
EZ
62422011-10-12 Eli Zaretskii <eliz@gnu.org>
6243
6244 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
6245 display string and the previous row comes from the same string and
6246 is empty. (Bug#9739) (Bug#9738)
6247
8fe012c4
SM
62482011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
6249
6250 * doc.c (get_doc_string): Encode file name (bug#9735).
6251
0074aef2
EZ
62522011-10-12 Eli Zaretskii <eliz@gnu.org>
6253
79beb178
EZ
6254 * bidi.c (bidi_level_of_next_char):
6255 * xdisp.c (get_visually_first_element): Remove old incorrect
6256 comments regarding the Unicode Line Separator character.
6257
0074aef2
EZ
6258 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
6259
6e4b3fbe
DA
62602011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
6261
6262 * alloc.c (Fgc_status): Do not access beyond zombies array
6263 boundary if nzombies > MAX_ZOMBIES.
6264 * alloc.c (dump_zombies): Add missing format specifier.
6265
0324f3af
PE
62662011-10-12 Paul Eggert <eggert@cs.ucla.edu>
6267
b5525cac
PE
6268 * xdisp.c (set_cursor_from_row): Simplify conditionals,
6269 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
6270
0324f3af
PE
6271 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
6272 Some packages use them to denote characters with modifiers.
6273
e9b5f888
AS
62742011-10-11 Andreas Schwab <schwab@linux-m68k.org>
6275
6276 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
6277 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
6278 matching a pp-number. Rename parameter var to var1.
6279
127827c0
SM
62802011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
6281
6282 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
6283
c8fd3bd0
GM
62842011-10-08 Glenn Morris <rgm@gnu.org>
6285
6286 * callint.c (Fcall_interactively): Give a more explicit error for the
6287 'c' case with a non-character input. (Bug#8479)
6288
352ec8ff
EZ
62892011-10-08 Eli Zaretskii <eliz@gnu.org>
6290
03669ccb
EZ
6291 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
6292 lines.
7061c986
EZ
6293 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
6294 lines that are hscrolled on the left.
03669ccb 6295
352ec8ff
EZ
6296 * dispnew.c (buffer_posn_from_coords): Account for a possible
6297 presence of header-line. (Bug#4426)
6298
a66cfb1c
SM
62992011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
6300
6b02f655
SM
6301 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
6302 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 6303
7c5ee88e
PE
63042011-10-07 Paul Eggert <eggert@cs.ucla.edu>
6305
6306 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
6307 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
6308 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
6309 this makes Emacs dump core during garbage collection on rare
6310 occasions. sizeof is obviously inferior to offsetof here, so
6311 stick with offsetof.
6312 (GC_POINTER_ALIGNMENT): New macro.
6313 (mark_memory): Omit 3rd (offset) arg; caller changed.
6314 Don't assume EMACS_INT alignment is the same as pointer alignment.
6315
df1bbe5b
SM
63162011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
6317
6318 * keyboard.c (read_key_sequence_remapped): New var.
6319 (read_key_sequence): Compute remapping in the right buffer.
6320 (command_loop_1): Use read_key_sequence's remapping directly.
6321
51553db6
SM
63222011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6323
32c1fffd
SM
6324 * dired.c (file_name_completion): Don't expand file name.
6325 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
6326 before checking file name handler.
6327
51553db6
SM
6328 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
6329 they've been requested explicitly (bug#9591).
6330
b6bd1599 63312011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
6332
6333 * keymap.c (Fsingle_key_description): Use make_specified_string
6334 instead of build_string to build string from push_key_description.
6335 (Bug#5193)
6336
f701dc2a
PE
63372011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6338
4222c55d
PE
6339 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
6340 This fixes a Y2038 bug on 64-bit hosts.
6341 * buffer.c (reset_buffer):
6342 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
6343 (Fclear_buffer_auto_save_failure):
6344 Use 0, not -1, to represent an unset failure time, since time_t
6345 might not be signed.
6346
f701dc2a
PE
6347 Remove dependency on glibc malloc internals.
6348 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6349 Move back here from lisp.h, but with their new implementations.
6350 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6351 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
6352 * charset.c (charset_table_init): New static var.
6353 (syms_of_charset): Use it instead of xmalloc. This removes a
6354 dependency on glibc malloc internals. See Eli Zaretskii's comment in
6355 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
6356 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6357 Move back to alloc.c.
6358 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6359 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
6360
9ceebf39
JD
63612011-09-30 Jan Djärv <jan.h.d@swipnet.se>
6362
6363 * nsterm.m (windowDidResize): Call x_set_window_size only when
6364 ns_in_resize is true. Otherwise set pixelwidth/height and
6365 call change_frame_size (Bug#9628).
6366
cb993c58
PE
63672011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6368
3930c88b
PE
6369 Port --enable-checking=all to Fedora 14 x86-64.
6370 * charset.c (syms_of_charset): Also account for glibc malloc's
6371 internal overhead when calculating the initial malloc maximum.
6372
cb993c58
PE
6373 Port --enable-checking=all to Fedora 14 x86.
6374 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6375 Move to lisp.h.
6376 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
6377 (overrun_check_realloc, overrun_check_free):
6378 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
6379 That way, xmalloc returns a properly-aligned pointer even if
6380 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
6381 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
6382 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
6383 into account when calculating the initial malloc maximum.
6384 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6385 Move here from alloc.c, so that charset.c can use it too.
6386 Properly align; the old code wasn't right for common 32-bit hosts
6387 when configured with --enable-checking=all.
6388 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6389 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
6390
31bed486
EZ
63912011-09-29 Eli Zaretskii <eliz@gnu.org>
6392
04c70788 6393 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
6394 use EDOM.
6395
fbcaa2f3
EZ
63962011-09-28 Eli Zaretskii <eliz@gnu.org>
6397
6398 * xdisp.c (compute_display_string_end): If there's no display
6399 string at CHARPOS, return -1.
6400
6401 * bidi.c (bidi_fetch_char): When compute_display_string_end
6402 returns a negative value, treat the character as a normal
6403 character not covered by a display string. (Bug#9624)
6404
a239d4e9
JB
64052011-09-28 Juanma Barranquero <lekktu@gmail.com>
6406
6407 * lread.c (Fread_from_string): Fix typo in docstring.
6408
88652fd5
EZ
64092011-09-27 Eli Zaretskii <eliz@gnu.org>
6410
6411 * xdisp.c (handle_invisible_prop): If invisible text ends on a
6412 newline, reseat the iterator instead of bidi-iterating there one
6413 character at a time. (Bug#9610)
32c1fffd
SM
6414 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
6415 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 6416
ed497dd4
AS
64172011-09-27 Andreas Schwab <schwab@linux-m68k.org>
6418
6419 * lread.c (readevalloop): Use correct code for NBSP.
6420 (read1): Likewise. (Bug#9608)
6421
b2bf61aa
MA
64222011-09-25 Michael Albinus <michael.albinus@gmx.de>
6423
6424 * dbusbind.c (Fdbus_register_signal): When service is not
6425 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
6426
32bbb17c
GM
64272011-09-25 Glenn Morris <rgm@gnu.org>
6428
6429 * buffer.c (truncate-lines): Doc fix.
6430
94e0933e
CY
64312011-09-24 Chong Yidong <cyd@stupidchicken.com>
6432
6433 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6434 (Fset_window_next_buffers): Doc fix.
6435
cddde921
GM
64362011-09-24 Glenn Morris <rgm@gnu.org>
6437
6438 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6439
1260aef1
PE
64402011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6441
25b4bfa0
PE
6442 Fix minor problems found by static checking.
6443 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
6444 * indent.c (Fvertical_motion): Fix == vs = typo.
6445
e3cbd34b
EZ
64462011-09-24 Eli Zaretskii <eliz@gnu.org>
6447
a66cfb1c
SM
6448 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6449 Default value is now t. Doc fix.
6bf7006f 6450
e3cbd34b 6451 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 6452 logic when moving up, not only when moving down. Fix the
e3cbd34b 6453 confusing name and values of the it_overshoot_expected variable;
32c1fffd 6454 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
6455
6456 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6457 CHARPOS is covered by a display string which includes newlines.
6458 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6459 is covered by a display string with embedded newlines.
6460
a3de0cbd
MA
64612011-09-24 Michael Albinus <michael.albinus@gmx.de>
6462
6463 * dbusbind.c (Fdbus_register_signal): Add match rule to
6464 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
6465 (Fdbus_register_method, Vdbus_registered_objects_table):
6466 Fix docstring.
a3de0cbd 6467
b260039d
JM
64682011-09-24 Jim Meyering <meyering@redhat.com>
6469
32c1fffd 6470 do not ignore write error for any output size
b260039d
JM
6471 The previous change was incomplete.
6472 While it makes emacs --batch detect the vast majority of stdout
6473 write failures, errors were still ignored whenever the output size is
6474 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6475 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6476 && echo FAIL: ignored write error
6477 FAIL: ignored write error
6478 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6479 && echo FAIL: ignored write error
6480 FAIL: ignored write error
6481 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6482
8eca8a7c
AS
64832011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6484
6485 * emacs.c (Fkill_emacs): In noninteractive mode exit
6486 non-successfully if a write error occurred on stdout. (Bug#9574)
6487
3341db62
EZ
64882011-09-21 Eli Zaretskii <eliz@gnu.org>
6489
6490 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6491 the xassert test.
6492
6493 * dispextern.h (struct it): Update the comment documenting what
6494 can it->OBJECT be.
6495
8c203dbf
EZ
64962011-09-20 Eli Zaretskii <eliz@gnu.org>
6497
6498 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6499 a display string, extend search for cursor position to end of row.
6500 (find_row_edges): If the row ends in a newline from a display
6501 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6502 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
6503 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6504 non-empty line. Fixes confusing cursor motion with arrow keys at
6505 the beginning of a line that starts with whitespace.
8c203dbf 6506
a4824228
LMI
65072011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6508
6509 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
6510 (bug#9493).
6511
33ed493b
CY
65122011-09-18 Chong Yidong <cyd@stupidchicken.com>
6513
6514 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
6515 boolean (Bug#9154).
6516
56cd55c8
EZ
65172011-09-18 Eli Zaretskii <eliz@gnu.org>
6518
6519 * xdisp.c (display_line): Record maximum and minimum buffer
6520 positions even if no glyphs were produced (e.g., by a zero-width
6521 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6522 buffer positions that will be removed from the glyph row because
6523 they don't fit.
c02dcedf
EZ
6524 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6525 column is beyond frame width: don't subtract 1 "pixel" when
6526 computing width of the stretch.
3e62b7e0
EZ
6527 (reseat_at_next_visible_line_start): Undo the change made on
6528 2011-09-17 that saved paragraph information and restored it after
6529 the call to `reseat'. (Bug#9545)
56cd55c8 6530
5ed99d36 65312011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6532
6533 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6534 and turn window cursor on if cleared (Bug#9415).
6535
5ed99d36 65362011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6537
6538 * search.c (boyer_moore): Take unibyte characters from pattern
6539 literally. (Bug#9458)
6540
9bade7b2
EZ
65412011-09-18 Eli Zaretskii <eliz@gnu.org>
6542
6543 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6544
e5e9d610
PE
65452011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6546
87e4427a
PE
6547 Fix minor problem found by static checking.
6548 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6549 initialized, to pacify gcc -Wuninitialized.
6550
e5e9d610
PE
6551 * fileio.c: Report proper errno when syscall falls.
6552 (Finsert_file_contents): Save and restore errno,
6553 so that report_file_error outputs the correct diagnostic.
6554 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6555
a1674f0b
EZ
65562011-09-18 Eli Zaretskii <eliz@gnu.org>
6557
6558 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6559
fbfb6dd4
EZ
65602011-09-17 Eli Zaretskii <eliz@gnu.org>
6561
6562 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6563 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6564
bb187662
EZ
65652011-09-17 Eli Zaretskii <eliz@gnu.org>
6566
1137e8b8 6567 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6568 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6569
6570 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6571 (bidi_find_paragraph_start): Search back for paragraph beginning
6572 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6573 (bidi_move_to_visually_next): Only trigger paragraph-related
6574 computations when the last character is a newline or at EOB, not
6575 just any NEUTRAL_B. (Bug#9470)
6576
bb187662
EZ
6577 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6578 truncated lines if point is covered by a display string. (Bug#9524)
6579
2e621251
PE
65802011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6581
6582 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6583 (cons_to_x_long): New function.
6584 (lisp_data_to_selection_data): Use it. Correct the test for
6585 short-versus-long data; it was negated. Break out of vector
6586 loop, for efficiency, when a long datum is discovered.
6587
91a15bc6
SM
65882011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6589
6590 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6591
b41c3a35
EZ
65922011-09-16 Eli Zaretskii <eliz@gnu.org>
6593
6594 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6595 GCC PR/17406) by declaring this function with external scope.
6596
7812ba2d
PE
65972011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6598
6599 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6600 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6601
cf7edc2a
AS
66022011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6603
6604 * editfns.c (Fformat): Correctly handle text properties on "%%".
6605
bd01620e
EZ
66062011-09-15 Eli Zaretskii <eliz@gnu.org>
6607
6608 * xterm.c (x_draw_composite_glyph_string_foreground):
6609 * w32term.c (x_draw_composite_glyph_string_foreground):
6610 * term.c (encode_terminal_code):
6611 * composite.c (composition_update_it, get_composition_id):
6612 * xdisp.c (get_next_display_element)
6613 (fill_composite_glyph_string): Add comments about special meaning
6614 of TAB characters in a composition.
6615
a02719a3
PE
66162011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6617
6618 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6619 This occurs when processing a multibyte format.
6620 Problem reported by Wolfgang Jenker.
a02719a3 6621
72589a3c
JB
66222011-09-15 Johan Bockgård <bojohan@gnu.org>
6623
6624 * xdisp.c (try_cursor_movement): Only check for exact match if
6625 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6626
1c14176c
PE
66272011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6628
6629 Remove unused external symbols.
6630 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6631 * xdisp.c (calc_pixel_width_or_height): Now static.
6632 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6633 * indent.c (check_display_width):
6634 * w32term.c: Fix comment to match code.
6635 * xterm.c, xterm.h (x_catching_errors): Remove.
6636
d2eea5b5
PE
66372011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6638
6639 * xselect.c: Use signed conversions more consistently (Bug#9498).
6640 (selection_data_to_lisp_data): Assume incoming selection data are
6641 signed integers, not unsigned. This is to be consistent with
6642 outgoing selection data, which was modified to use signed integers
6643 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6644 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6645 expects long, not unsigned long.
6646
46888499
EZ
66472011-09-14 Eli Zaretskii <eliz@gnu.org>
6648
6649 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6650 computation of loop end. Reported by Johan Bockgård
6651 <bojohan@gnu.org>.
6652
ef8ef9fb
CY
66532011-09-13 Chong Yidong <cyd@stupidchicken.com>
6654
6655 * frame.c (Fother_visible_frames_p): Function deleted.
6656
fa819fed
EZ
66572011-09-12 Eli Zaretskii <eliz@gnu.org>
6658
6659 * indent.c (compute_motion): Process display vector front to back
6660 rather than the other way around. (Bug#2496)
6661
2ba8e008
SM
66622011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6663
6664 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6665
20f53c69
CY
66662011-09-11 Chong Yidong <cyd@stupidchicken.com>
6667
6668 * minibuf.c (Fread_from_minibuffer): Doc fix.
6669
d562d7a4
EZ
66702011-09-11 Eli Zaretskii <eliz@gnu.org>
6671
6672 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6673 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6674
1c4d7f3d
LMI
66752011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6676
6677 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6678 value for non-existent files.
6679
b885bf36
EZ
66802011-09-11 Eli Zaretskii <eliz@gnu.org>
6681
6682 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6683 set its "size" to -1. This will set the modtime_size field of
6684 the corresponding buffer to -1, which is what
6685 verify-visited-file-modtime expects for files that do not exist.
6686 (Bug#9139)
6687
6612f0bf
PE
66882011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6689
6690 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6691 here ...
6692 * lisp.h: ... from here. push_key_description is no longer
6693 defined in keyboard.c, so its declaration should not be in
6694 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6695 logically belongs with push_key_description.
6696
dfb3f755
PE
66972011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6698
6699 * buffer.h: Include <sys/types.h> instead of <time.h>.
6700 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6701 Problem reported by Herbert J. Skuhra.
6702
3134906c
LMI
67032011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6704
6705 * xml.c (parse_region): Make the parsing work for
6706 non-comment-starting XML files again (bug#9144).
6707
8d903f4e
AS
67082011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6709
6710 * image.c (gif_load): Fix calculation of bottom and right corner.
6711 (Bug#9468)
6712
80ad64f4
EZ
67132011-09-10 Eli Zaretskii <eliz@gnu.org>
6714
6715 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6716 redisplay in small windows.
6717
208a048d
EZ
67182011-09-09 Eli Zaretskii <eliz@gnu.org>
6719
6720 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6721
9b1c252e
MR
67222011-09-08 Martin Rudalics <rudalics@gmx.at>
6723
6724 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6725 Operate on live windows only.
6726
2949f33b
JB
67272011-09-08 Juanma Barranquero <lekktu@gmail.com>
6728
6729 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6730
e08dcafd
EZ
67312011-09-07 Eli Zaretskii <eliz@gnu.org>
6732
6733 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6734 only under bidi iteration.
6735
115b96bd
JD
67362011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6737
6738 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6739
c8199d0f
PE
67402011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6741
6742 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6743 Without this fix, the command to link temacs failed due to an
6744 undefined symbol __builtin_isnan. This is because
6745 /usr/include/iso/math_c99.h #defines isnan(x) to
6746 __builtin_isnan(x), but the bundled gcc, which identifies itself
6747 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6748 a __builtin_isnan.
6749 * floatfns.c (isnan): #undef, and then #define to a clone of
6750 what's in data.c.
6751 (Fisnan): Always define, since it's always available now.
6752 (syms_of_floatfns): Always define isnan at the Lisp level.
6753
e39b275c 67542011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6755
6756 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6757
b2db44d9 67582011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6759
f4af5137 6760 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6761 The previous code assumed that file offsets (off_t values) fit in
6762 EMACS_INT variables, which is not true on typical 32-bit hosts.
6763 The code messed up by falsely reporting buffer overflow in cases
6764 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6765 when "big" contains more than 2**29 bytes, even though this
6766 inserts just one byte and does not overflow the buffer.
6767 (Finsert_file_contents): Store file offsets as off_t
6768 values, not as EMACS_INT values. Check for overflow when
6769 converting between EMACS_INT and off_t. When checking for
6770 buffer overflow or for overlap, take the offsets into account.
6771 Don't use EMACS_INT for small values where int suffices.
6772 When checking for overlap, fix a typo: ZV was used where
6773 ZV_BYTE was intended.
6774 (Fwrite_region): Don't assume off_t fits into 'long'.
6775 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6776
ecfc0a49
MA
67772011-09-05 Michael Albinus <michael.albinus@gmx.de>
6778
6779 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6780
6511acf2 67812011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6782
0999621a 6783 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6784
6785 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6786 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6787 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6788 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6789 (modify_event_symbol): Do not assume that the length of
6790 name_alist_or_stem is safe to alloca and fits in int.
6791 (Fexecute_extended_command): Likewise for function name and binding.
6792 (Frecursion_depth): Wrap around reliably on integer overflow.
6793 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6794 since some callers pass EMACS_INT values.
6795 (Fsingle_key_description): Don't crash if symbol name contains more
6796 than MAX_ALLOCA bytes.
6797 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6798 (get_minibuffer): Arg is now EMACS_INT, not int.
6799 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6800 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6801 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6802
2be7d702
PE
6803 * dbusbind.c (signature_cat): New function.
6804 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6805 Do not overrun buffer; instead, report string overflow.
6806
9d1df220
PE
6807 * dispnew.c (add_window_display_history): Don't overrun buffer.
6808 Truncate instead; this is OK since it's just a log.
6809
33ef5c64
PE
6810 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6811 even if the time zone offset is outlandishly large.
6812 Don't mishandle offset == INT_MIN.
6813
66c6fdd5
PE
6814 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6815 when creating daemon; the previous buffer-overflow check was incorrect.
6816
d749b01b
PE
6817 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6818 which has the guts of the old verror function.
6819
b5cd1905
PE
6820 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6821 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6822
6e1a67fb
PE
6823 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6824 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6825 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6826 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6827 length of string rather than counting it via multiple sprintfs;
6828 that's simpler and more reliable.
c21721cc
PE
6829 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6830 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6831 sprintf, in case result does not fit in int.
6832
c57b67fc
PE
6833 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6834 (fontset_from_font): Print it.
6835
8a401434
PE
6836 * frame.c (tty_frame_count): Now printmax_t, not int.
6837 (make_terminal_frame, set_term_frame_name): Print it.
6838 (x_report_frame_params): In X, window IDs are unsigned long,
6839 not signed long, so print them as unsigned.
6840 (validate_x_resource_name): Check for implausibly long names,
6841 and don't assume name length fits in 'int'.
6842 (x_get_resource_string): Don't blindly alloca invocation name;
6843 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6844 not fit in int.
6845
6e1a67fb
PE
6846 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6847 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6848 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6849
0df02bf3
PE
6850 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6851 Use esprintf, not sprintf, in case result does not fit in int.
6852
48e30793
PE
6853 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6854 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6855 it as a large positive number.
6856 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6857 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6858
a66ff6d8
PE
6859 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6860 in case result does not fit in int.
6861
aca216ff
PE
6862 * print.c (float_to_string): Detect width overflow more reliably.
6863 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6864 buffer overrun. Don't assume list length fits in 'int'. Treat
6865 print length of 0 as 0, not as infinity; to be consistent with other
6866 uses of print length in this function. Don't overflow print length
6867 index. Don't assume hash table size fits in 'long', or that
6868 vectorlike size fits in 'unsigned long'.
6869
31c286f7
PE
6870 * process.c (make_process): Use printmax_t, not int, to format
6871 process-name gensyms.
6872
55e5faa1
PE
6873 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6874
80f2e268
PE
6875 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6876 to avoid potential buffer overrun.
6877
670741ab
PE
6878 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6879 if X resource line is longer than 512 bytes.
6880
b7163a50
PE
6881 * xfns.c (x_window): Make sprintf buffer a bit bigger
6882 to avoid potential buffer overrun.
6883
ae58ff1f
PE
6884 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6885
c43c8a6a
PE
6886 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6887
3f8236f4
PE
68882011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6889
53e9fe90 6890 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6891 Without these, Emacs silently mishandles large integers sometimes.
6892 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6893 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6894
6511acf2
PE
6895 * xdisp.c (try_window_id): Check Emacs fixnum range before
6896 converting to 'int'.
806add1d 6897
6511acf2 6898 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6899 Check that an Emacs fixnum is in range before assigning it to 'int'.
6900 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6901 values converted from Emacs fixnums.
6902 (Frecenter): Don't wrap around a line count if it is out of 'int'
6903 range; instead, treat it as an extreme value.
6904 (Fset_window_configuration, compare_window_configurations):
6905 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6906
6511acf2
PE
6907 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6908 that can exceed INT_MAX. Check that EMACS_INT value is in range
6909 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6910 (match_limit): Don't assume that a fixnum can fit in 'int'.
6911
6511acf2 6912 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6913 exceed INT_MAX.
6914
6511acf2 6915 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6916 (Fvertical_motion): Don't wrap around LINES values that don't fit
6917 in 'int'. Instead, treat them as extreme values. This is good
6918 enough for windows, which can't have more than INT_MAX lines anyway.
6919
fcb901a7
LMI
69202011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6921
0f2f6b6d
LMI
6922 * Require libxml/parser.h to avoid compilation warning.
6923
fcb901a7
LMI
6924 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6925
6926 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6927 since this reportedly can destroy thread storage.
6928
6e20a0d4
CY
69292011-08-30 Chong Yidong <cyd@stupidchicken.com>
6930
6931 * syntax.c (find_defun_start): Update all cache variables if
6932 exiting early (Bug#9401).
6933
148ae00e
EZ
69342011-08-30 Eli Zaretskii <eliz@gnu.org>
6935
f6cfbd8f
EZ
6936 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6937
148ae00e
EZ
6938 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6939 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6940 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6941
6942 * term.c (tty_append_glyph): New function.
6943 (produce_stretch_glyph): Static function and its prototype deleted.
6944
a66cfb1c
SM
6945 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6946 Add prototypes.
148ae00e 6947
c4a07a4c
PE
69482011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6949
6950 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6951 when checking :margin (Bug#9390).
6952 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6953 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6954 so that the name doesn't mislead. All uses changed.
6955
6bc8cd65
JB
69562011-08-28 Johan Bockgård <bojohan@gnu.org>
6957
6958 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6959 set_tty_hooks.
6960
dca4927e
EZ
69612011-08-27 Eli Zaretskii <eliz@gnu.org>
6962
6963 * xdisp.c (move_it_to): Don't bail out early when reaching
6964 position beyond to_charpos, if we are scanning backwards.
6965 (move_it_vertically_backward): When DY == 0, make sure we get to
6966 the first character in the line after the newline.
6967
f2cad773
PE
69682011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6971 (ccl_driver): Do not generate an out-of-range pointer.
6972 (Fccl_execute_on_string): Remove unnecessary check for
6973 integer overflow, noted by Stefan Monnier in
6974 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6975 Remove a FIXME that didn't need fixing.
6976 Simplify the newly-introduced buffer reallocation code.
6977
0cae2cdb
JB
69782011-08-27 Juanma Barranquero <lekktu@gmail.com>
6979
6980 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6981
5fc295a4 69822011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6983
70c60eb2 6984 Integer and memory overflow issues (Bug#9196).
726e0ab1 6985
d31850da
PE
6986 * doc.c (get_doc_string): Rework so that
6987 get_doc_string_buffer_size is the actual buffer size, rather than
6988 being 1 less than the actual buffer size; this makes xpalloc more
6989 convenient.
6990
a69fbedb
PE
6991 * image.c (x_allocate_bitmap_record, cache_image):
6992 * xselect.c (Fx_register_dnd_atom):
6993 Simplify previous changes by using xpalloc.
6994
fe5c5d37
PE
6995 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6996 since either will do and ptrdiff_t is convenient with xpalloc.
6997
0065d054
PE
6998 * charset.c (charset_table_size)
6999 (struct charset_sort_data.priority): Now ptrdiff_t.
7000 (charset_compare): Don't overflow if priorities differ greatly.
7001 (Fsort_charsets): Don't assume list length fits in int.
7002 Check for size-calculation overflow when allocating sort data.
7003 (syms_of_charset): Allocate an initial charset table that is
7004 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7005
7006 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7007
7008 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7009 The actual value is always <= INT_MAX, and leaving it unsigned made
7010 overflow checking harder.
7011
7012 * dispextern.h (struct glyph_matrix.rows_allocated)
7013 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7014 with xpalloc. The values are still always <= INT_MAX.
7015
7016 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7017
7018 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7019 (SAFE_NALLOCA): New macro.
7020
7021 * region-cache.c (struct boundary.pos, find_cache_boundary)
7022 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7023 (set_cache_region, invalidate_region_cache)
7024 (revalidate_region_cache, know_region_cache, region_cache_forward)
7025 (region_cache_backward, pp_cache):
7026 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7027 so that ptrdiff_t * can be passed to xpalloc.
7028 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7029 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7030 (pp_cache): Don't assume cache_len fits in int.
7031 * region-cache.h: Adjust extern decls to match.
7032
7033 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7034 EMACS_INT, since either will do, for xpalloc.
7035
7036 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7037 (xnmalloc, xnrealloc, xpalloc): New functions.
7038
726e0ab1
PE
7039 * bidi.c (bidi_shelve_header_size): New constant.
7040 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7041 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7042
51f30bc5 7043 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
7044 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7045 (overlay_strings):
7046 Don't update size of array until after memory allocation succeeds,
7047 because xmalloc/xrealloc may not return.
0065d054
PE
7048 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7049 now that we have proper integer overflow checking.
7050 (record_overlay_string, overlay_strings): Catch overflows when
7051 calculating size of overlay_str_buf.
726e0ab1 7052
0065d054
PE
7053 * callproc.c (Fcall_process): Check for size overflow when
7054 calculating size of args2.
7055 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7056 Normally we prefer signed values, but sticking with ptrdiff_t would
7057 require adding more-complicated checks.
726e0ab1
PE
7058
7059 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7060 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7061 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 7062 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
7063
7064 * character.c (Fstring): Check for size-calculation overflow.
7065
7066 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7067 unnecessary integer overflow. Check for size overflow.
7068 (encode_coding_object): Don't update size until xmalloc succeeds.
7069
7070 * composite.c (get_composition_id): Check for overflow in glyph
7071 length calculations.
7072
7073 Integer and memory overflow fixes for display code.
7074 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7075 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7076 (scrolling_window): Check for overflow in size calculations.
7077 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7078 Don't assume glyph table len fits in int.
7079 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7080 (row_table_size): Now ptrdiff_t, not int.
7081 (scrolling_window): Avoid overflow in size calculations.
7082 Don't update size until allocation succeeds.
7083 * fns.c (concat): Check for overflow in size calculations.
7084 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7085 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7086 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7087
7088 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7089 (get_doc_string): Check for size calculation overflow.
7090 Don't update size until allocation succeeds.
7091 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7092 EMACS_INT, where ptrdiff_t will do.
7093 (Fsubstitute_command_keys): Check for string overflow.
7094
7095 * editfns.c (set_time_zone_rule): Don't assume environment length
7096 fits in int.
7097 (message_length): Now ptrdiff_t, not int.
7098 (Fmessage_box): Don't update size until allocation succeeds.
7099 Don't assume message length fits in int.
7100 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7101
0065d054
PE
7102 * emacs.c (main): Do not reallocate argv, since there is a null at
7103 the end that can be overwritten, and this way there's no need to
7104 worry about size-calculation overflow.
7105 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
7106
7107 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7108 alloc succeeds.
7109 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7110
7111 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7112 (x_set_scroll_bar_width, x_figure_window_size):
7113 Check for integer overflow.
7114 (x_set_alpha): Do not assume XINT fits in int.
7115
7116 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7117 This is for the members text_lines, text_cols, total_lines, total_cols,
7118 where the system imposes an 'int' limit.
7119
7120 * fringe.c (Fdefine_fringe_bitmap):
7121 Don't update size until alloc works.
7122
7123 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7124 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
7125
7126 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
7127 Check for size-calculation overflow.
7128 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
7129 do, as we prefer signed integers.
7130 (id_to_widget.max_size, id_to_widget.used)
7131 (xg_store_widget_in_map, xg_remove_widget_from_map)
7132 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
7133 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
7134 Use and return ptrdiff_t, not int.
7135 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
7136 * gtkutil.h: Change prototypes to match the above.
7137
7138 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
7139 are duplicate now that they've been promoted to lisp.h.
7140 (x_allocate_bitmap_record, x_alloc_image_color)
7141 (make_image_cache, cache_image, xpm_load):
7142 Don't update size until alloc is done.
7143 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
7144 (x_detect_edges):
3256efce 7145 Check for size calculation overflow.
726e0ab1
PE
7146 (ct_colors_allocated_max): New constant.
7147 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
7148 overflow.
3256efce 7149
726e0ab1
PE
7150 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
7151 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
7152 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
7153 Use ptrdiff_t, not int, to count maps.
7154 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
7155 calculations. Don't update size until allocation succeeds.
7156 Redo calculations to avoid overflow.
726e0ab1
PE
7157 * keyboard.h: Change prototypes to match the above.
7158
7159 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
7160 to count maps.
7161 (current_minor_maps): Check for size calculation overflow.
7162 * keymap.h: Change prototypes to match the above.
7163
7164 * lread.c (read1, init_obarray): Don't update size until alloc done.
7165
7166 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
7167 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
7168
726e0ab1
PE
7169 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
7170 Now ptrdiff_t, not int.
7171 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
7172 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
7173
7174 * process.c (Fnetwork_interface_list): Check for overflow
7175 in size calculation.
7176
7177 * region-cache.c (move_cache_gap): Check for size calculation overflow.
7178
7179 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
7180 overflow. Don't bother calling xmalloc when xrealloc will do.
7181
7182 * search.c (Freplace_match): Check for size calculation overflow.
7183 (Fset_match_data): Don't assume list lengths fit in 'int'.
7184
7185 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
7186 for command line length. Do not attempt to address one before the
7187 beginning of an array, as that's not portable.
7188
7189 * term.c (max_frame_lines): Remove; unused.
7190 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
7191 not int.
7192 (encode_terminal_code, calculate_costs): Check for size
7193 calculation overflow.
7194 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
7195 table lengths and related sizes. Don't update size until alloc
7196 done. Redo calculations to avoid overflow.
7197 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
7198
7199 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
7200 subtracting pointers.
7201 (gobble_line): Check for overflow more carefully. Don't update size
7202 until alloc done.
7203
7204 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
7205 Don't update size until alloc done.
7206 Redo size calculations to avoid overflow.
7207 Check for size calculation overflow.
0065d054 7208 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
7209
7210 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
7211 Use ptrdiff_t, not int, for sizes.
7212 (store_mode_line_noprop_char): Don't update size until alloc done.
7213
0065d054
PE
7214 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
7215 Use ptrdiff_t, not int, for sizes.
7216 (Finternal_make_lisp_face, cache_face):
7217 Check for size calculation overflow.
7218 (cache_face): Treat size calculation overflows as if they were
7219 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
7220
7221 * xfns.c (x_encode_text, x_set_name_internal)
7222 (Fx_change_window_property): Use ptrdiff_t, not int, to count
7223 sizes, since they can exceed INT_MAX in size. Check for size
7224 calculation overflow.
7225
0065d054
PE
7226 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
7227 (xg_select): Check for size calculation overflow.
726e0ab1
PE
7228 Don't update size until alloc done.
7229
0065d054 7230 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 7231 as sprintf is limited to int lengths.
1d526e2f 7232
252c5ee1
PE
7233 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
7234 (X_LONG_MIN): New macros.
864d7ce7
PE
7235 Use them to make the following changes clearer.
7236 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
7237 This change doesn't affect the value now, but it may help remind
7238 future maintainers not to raise the value too much later.
7239 (SELECTION_QUANTUM): Remove, replacing with ...
7240 (selection_quantum): ... new function, which avoids overflow.
7241 All uses changed.
7242 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
7243 assumption that selection length fits in 'int'.
7244 (x_reply_selection_request, x_handle_selection_request)
7245 (x_get_window_property, receive_incremental_selection)
7246 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
7247 (lisp_data_to_selection_data, clean_local_selection_data):
7248 Use ptrdiff_t, not int, to record length of selection.
7249 (x_reply_selection_request, x_get_window_property)
7250 (receive_incremental_selection, x_property_data_to_lisp):
7251 Redo calculations to avoid overflow.
7252 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 7253 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
7254 something.
7255 (x_get_window_property, receive_incremental_selection)
7256 (lisp_data_to_selection_data, x_property_data_to_lisp):
7257 Check for size-calculation overflow.
7258 (x_get_window_property, receive_incremental_selection)
7259 (lisp_data_to_selection_data, Fx_register_dnd_atom):
7260 Don't store size until memory allocation succeeds.
7261 (x_get_window_property): Plug memory leak on memory exhaustion.
7262 Don't double-block input; malloc is safe here. Don't assume 2**34
7263 - 4 fits in unsigned long. Add an xassert to check
7264 XGetWindowProperty overflow. Be more careful about overflow
7265 calculations, and distinguish size from memory overflow better.
7266 (receive_incremental_selection): When tracing, don't assume
7267 unsigned int is less than INT_MAX.
7268 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
7269 harmful) conversions of unsigned short to int.
7270 (lisp_data_to_selection_data): Don't assume that integers
7271 in the range -65535 through -1 fit in an X unsigned short.
7272 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
7273 result parameters unless successful. Rely on cons_to_unsigned
7274 to report problems with elements; the old code wasn't right anyway.
7275 (x_check_property_data): Check for int overflow; we cannot use
7276 a wider type due to X limits.
7277 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
7278
726e0ab1 7279 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 7280
0065d054
PE
7281 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
7282 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
7283 (x_color_cells): Don't store size until memory allocation succeeds.
7284 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 7285 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
7286 (x_term_init): Don't assume length fits in int (sprintf is limited
7287 to int size).
bc18e09d 7288
ebfa62c0
PE
7289 Use ptrdiff_t for composition IDs.
7290 * character.c (lisp_string_width):
7291 * composite.c (composition_table_size, n_compositions)
7292 (get_composition_id, composition_gstring_from_id):
7293 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
7294 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
7295 * window.c (Frecenter):
7296 Use ptrdiff_t, not int, for composition IDs.
7297 * composite.c (get_composition_id): Check for integer overflow.
7298 * composite.h: Adjust prototypes to match the above changes.
7299
d3411f89
PE
7300 Use ptrdiff_t for hash table indexes.
7301 * category.c (hash_get_category_set):
7302 * ccl.c (ccl_driver):
7303 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
7304 * coding.c (coding_system_charset_list, detect_coding_system):
7305 * coding.h (struct coding_system.id):
7306 * composite.c (get_composition_id, gstring_lookup_cache):
7307 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
7308 * image.c (xpm_get_color_table_h):
7309 * lisp.h (hash_lookup, hash_put):
7310 * minibuf.c (Ftest_completion):
7311 Use ptrdiff_t for hash table indexes, not int (which is too
7312 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
7313 32-bit --with-wide-int hosts).
7314
e097a6fa
PE
7315 * charset.c (Fdefine_charset_internal): Check for integer overflow.
7316 Add a FIXME comment about memory leaks.
7317 (syms_of_charset): Don't assume xmalloc returns.
7318
5637687f
PE
7319 Don't assume that stated character widths fit in int.
7320 * character.c (Fchar_width, c_string_width, lisp_string_width):
7321 * character.h (CHAR_WIDTH):
7322 * indent.c (MULTIBYTE_BYTES_WIDTH):
7323 Use sanitize_char_width to avoid undefined and/or bad behavior
7324 with outlandish widths.
a66cfb1c 7325 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
7326 now that we have two such functions. All uses changed.
7327 (sanitize_char_width): New inline function.
7328
a2271ba2
PE
7329 Don't assume that tab-width fits in int.
7330 * character.h (sanitize_width): New inline function.
7331 (SANE_TAB_WIDTH): New macro.
7332 (ASCII_CHAR_WIDTH): Use it.
7333 * indent.c (sane_tab_width): Remove. All uses replaced by
7334 SANE_TAB_WIDTH (current_buffer).
7335 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
7336
18c52557
PE
7337 * fileio.c: Integer overflow issues with file modes.
7338 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
7339
caeeedc1
PE
7340 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
7341 Remove unreachable code.
7342 (read_hex, load_charset_map_from_file): Check for integer overflow.
7343
6df6ae42 7344 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
7345 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
7346 (x_send_scroll_bar_event): Likewise. Check that the size does not
7347 exceed limits imposed by XClientMessageEvent, as well as the usual
7348 ptrdiff_t and size_t limits.
7349
b13995db
PE
7350 * keyboard.c: Overflow, signedness and related fixes.
7351 (make_lispy_movement): Use same integer type in forward decl
7352 that is used in the definition.
7353 (read_key_sequence, keyremap_step):
7354 Change bufsize argument back to int, undoing my 2011-03-30 change.
7355 We prefer signed types, and int is wide enough here.
7356 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
7357 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
7358 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
7359 length, not size_t. Use ptrdiff_t for index, not int.
7360 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
7361 possibility of integer overflow.
7362
13464394
PE
7363 Overflow, signedness and related fixes for images.
7364
7365 * dispextern.h (struct it.stack[0].u.image.image_id)
7366 (struct_it.image_id, struct image.id, struct image_cache.size)
7367 (struct image_cache.used, struct image_cache.ref_count):
7368 * gtkutil.c (update_frame_tool_bar):
7369 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
7370 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
7371 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
7372 * nsmenu.m (update_frame_tool_bar):
7373 * xdisp.c (calc_pixel_width_or_height):
7374 * xfns.c (image_cache_refcount):
7375 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
7376 on typical 64-bit hosts.
7377
7378 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7379 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
7380 Omit unnecessary casts to int.
7381 (parse_image_spec): Check that integers fall into 'int' range
7382 when the callers expect that.
7383 (image_ascent): Redo ascent calculation to avoid int overflow.
7384 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
7385 (lookup_image): Remove unnecessary tests.
7386 (xbm_image_p): Locals are now of int, not EMACS_INT,
7387 since parse_image_check makes sure they fit into int.
7388 (png_load, gif_load, svg_load_image):
7389 Prefer int to unsigned where either will do.
7390 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
7391 old tiff_error_handler and tiff_warning_handler.
7392 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
7393 stack buffer overflows. It uses only the features of vsnprintf
7394 that are common to both POSIX and native Microsoft.
7395 (tiff_error_handler, tiff_warning_handler): Use it.
7396 (tiff_load, gif_load, imagemagick_load_image):
7397 Don't assume :index value fits in 'int'.
7398 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
7399 (imagemagick_load_image): Check that crop parameters fit into
7400 the integer types that MagickCropImage accepts. Don't assume
7401 Vimagemagick_render_type has a nonnegative value. Don't assume
7402 size_t fits in 'long'.
7403 (gs_load): Use printmax_t to print the widest integers possible.
7404 Check for integer overflow when computing image height and width.
7405
c11821d4
EZ
74062011-08-26 Eli Zaretskii <eliz@gnu.org>
7407
7408 * xdisp.c (redisplay_window): Don't force window start if point
7409 will be invisible in the resulting window. (Bug#9324)
7410
0c95fcf7
EZ
74112011-08-25 Eli Zaretskii <eliz@gnu.org>
7412
7413 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
7414 the display spec is of the form `(space ...)'.
7415 (handle_display_spec): Return the value returned by
7416 handle_single_display_spec, not just 1 or zero.
7417 (handle_single_display_spec): If the display spec is of the form
7418 `(space ...)', and specifies display in the text area, return 2
7419 rather than 1.
fee65a97 7420 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
7421 accurately, and prefer exact match for point under bidi.
7422 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
7423
7424 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
7425 into disp_prop; all users changed.
7426
7427 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
7428 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
7429 for the text covered by the display property.
7430
e4ed06f1
CY
74312011-08-25 Chong Yidong <cyd@stupidchicken.com>
7432
7433 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7434 Change return value to nil.
7435 (Frecord_buffer): Delete unused function.
7436
f67cdd7f
EZ
74372011-08-24 Eli Zaretskii <eliz@gnu.org>
7438
5980d4c6
EZ
7439 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7440 buffers, return left-to-right.
8610fe8b
EZ
7441 (set_cursor_from_row): Consider candidate row a win if its glyph
7442 represents a newline and point is on that newline. Fixes cursor
7443 positioning on the newline at EOL of R2L text within L2R
7444 paragraph, and vice versa.
7445 (try_cursor_movement): Check continued rows, in addition to
7446 continuation rows. Fixes unwarranted scroll when point enters a
7447 continued line of R2L text within an L2R paragraph, or vice versa.
7448 (cursor_row_p): Consider the case of point being equal to
7449 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7450 from the end of a short line to the beginning of a continued line
7451 of R2L text within L2R paragraph.
7452 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7453 composed characters.
5980d4c6 7454
f67cdd7f
EZ
7455 * bidi.c (bidi_check_type): Use xassert.
7456 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7457 members.
7458
bca633fb
EZ
74592011-08-23 Eli Zaretskii <eliz@gnu.org>
7460
7461 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7462 a character.
7463
4a5885a7
CY
74642011-08-23 Chong Yidong <cyd@stupidchicken.com>
7465
7466 * nsfont.m (ns_otf_to_script): Fix typo.
7467
0902a04e
KH
74682011-08-22 Kenichi Handa <handa@m17n.org>
7469
7470 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7471 extra slot even if the purpose is char-code-property-table.
7472
1a2e6670
EZ
74732011-08-23 Eli Zaretskii <eliz@gnu.org>
7474
8ddde651
EZ
7475 * xdisp.c (redisplay_window): When computing centering_position,
7476 account for the height of the header line. (Bug#8874)
7477
425cc014
EZ
7478 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7479 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7480 candidate is selected by the mouse, and that candidate has a
7481 composed character under the mouse.
7482
1a2e6670
EZ
7483 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7484 coordinates reported by pos-visible-in-window-p for a composed
7485 character in column zero.
7486
8b76d6f8
SM
74872011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7488
7489 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7490
dac347dd
EZ
74912011-08-22 Eli Zaretskii <eliz@gnu.org>
7492
7493 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7494 consider it a hit if to_charpos is anywhere in the range of the
7495 composed buffer positions.
7496
e013fb34
CY
74972011-08-22 Chong Yidong <cyd@stupidchicken.com>
7498
7499 * image.c (gif_load): Don't assume that each subimage has the same
7500 dimensions as the base image. Handle disposal method that is
7501 "undefined" by the gif spec (Bug#9335).
7502
bd1ba3e8
CY
75032011-08-20 Chong Yidong <cyd@stupidchicken.com>
7504
7505 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 7506 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 7507
54a1215b
EZ
75082011-08-19 Eli Zaretskii <eliz@gnu.org>
7509
823564e5
EZ
7510 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
7511 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
7512 from an Org mode buffer to a Speedbar frame.
7513
54a1215b
EZ
7514 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
7515 a composition, take its buffer position from IT->cmp_it.charpos.
7516 Fixes cursor positioning at the beginning of a line that begins
7517 with a composed character.
7518
9778ebcc
EZ
75192011-08-18 Eli Zaretskii <eliz@gnu.org>
7520
0be6ee06
EZ
7521 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7522 character bidirectional type, use STRONG_L instead. Fixes crashes
7523 in a buffer produced by `describe-categories'.
7524
9778ebcc
EZ
7525 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7526 members before the level stack, so they would be saved and
7527 restored when copying iterator state. Fixes incorrect reordering
7528 around TABs covered by display properties.
7529
156bffbe
AS
75302011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7531
6b02f655 7532 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7533
72ad093b
CY
75342011-08-17 Chong Yidong <cyd@stupidchicken.com>
7535
7536 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7537 (internal_condition_case_2, internal_condition_case_n):
7538 Remove unnecessary aborts (Bug#9081).
72ad093b 7539
35774242
EZ
75402011-08-17 Eli Zaretskii <eliz@gnu.org>
7541
7542 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7543 has no `load' handler, try opening the file locally. (Bug#9311)
7544
db76dd85
KB
75452011-08-16 Ken Brown <kbrown@cornell.edu>
7546
7547 * gmalloc.c: Expand comment.
7548
b215eee5
EZ
75492011-08-16 Eli Zaretskii <eliz@gnu.org>
7550
7551 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7552 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7553
a4579d33
KB
75542011-08-16 Ken Brown <kbrown@cornell.edu>
7555
7556 Fix memory allocation problems in Cygwin build (Bug#9273).
7557
7558 * unexcw.c ( __malloc_initialized): Declare external variable.
7559 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7560
8b76d6f8
SM
7561 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7562 New variables.
a4579d33
KB
7563 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7564 dumped emacs.
7565 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7566 in the static heap.
7567 [CYGWIN] (special_realloc): New function.
7568 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7569 requests to realloc storage in the static heap.
7570
3ebec551
PE
75712011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7572
7573 * bidi.c (bidi_initialize): Remove unused local.
7574
9fd8be00
EZ
75752011-08-15 Eli Zaretskii <eliz@gnu.org>
7576
6b02f655
SM
7577 * bidimirror.h:
7578 * biditype.h: Remove file.
7579 * makefile.w32-in ($(BLD)/bidi.$(O)):
7580 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7581
7582 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7583
7584 * chartab.c: Improve commentary for the uniprop_table API.
7585
32413314
EZ
7586 * bidi.c (bidi_paragraph_init): Support zero value of
7587 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7588 (bidi_initialize): Use uniprop_table instead of including
7589 biditype.h and bidimirror.h.
32413314 7590
9fd8be00
EZ
7591 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7592 coordinates of the iterator when restoring from ppos_it.
7593 (Bug#9296)
7594
5cf2b69b
KH
75952011-08-14 Kenichi Handa <handa@m17n.org>
7596
7597 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7598 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7599
daf17d00
EZ
76002011-08-14 Eli Zaretskii <eliz@gnu.org>
7601
7602 * xdisp.c (move_it_in_display_line_to): Don't invoke
7603 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7604 ppos_it. Fixes vertical cursor motion when line beginning is
7605 covered by an image. (Bug#9296)
7606
08e3161a
JD
76072011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7608
7609 * nsterm.h (ns_run_ascript): Declare.
7610 (NSAPP_DATA2_RUNASSCRIPT): Define.
7611
7612 * nsfns.m (as_script, as_result, as_status): New static variables.
7613 (ns_run_ascript): New function.
5e617bc2 7614 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7615 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7616 the event loop. Get status from as_status (Bug#7276).
7617
7618 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7619 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7620 the event loop (Bug#7276).
7621
a3720aa2
AS
76222011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7623
7624 * gnutls.c (QCgnutls_bootprop_priority)
7625 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7626 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7627 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7628 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7629 (QCgnutls_bootprop_verify_hostname_error)
7630 (QCgnutls_bootprop_callbacks_verify): Rename from
7631 Qgnutls_bootprop_..., all uses changed.
7632
7633 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7634 uses changed.
7635
0a0d27fb
PE
76362011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7637
19d5c50c
PE
7638 * xfaces.c (Qframe_set_background_mode): Now static.
7639 * dispextern.h (Qframe_set_background_mode): Remove decl.
7640
0a0d27fb
PE
7641 * process.c (Fnetwork_interface_info): Declare local only if needed.
7642
377538cb
JD
76432011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7644
7645 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7646 (Fnetwork_interface_list): Allocate in increments of bytes instead
7647 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7648 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7649 sockaddr.
7650 (struct ifflag_def): notrailers is smart on OSX.
7651 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7652 Get hardware address with getifaddrs if available.
7653
08fff70c
EZ
76542011-08-12 Eli Zaretskii <eliz@gnu.org>
7655
7656 * xdisp.c (iterate_out_of_display_property): xassert that
7657 IT->position is set to within IT->object's boundaries. Break from
7658 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7659 when IT->position is set up wrongly due to some bug.
7660 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7661 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7662 entry. Force push_it to save on the stack the current
7663 buffer/string position, to be restored by pop_it. Fix flags in
7664 the iterator structure wrt the object coming from a display
7665 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7666 properties. (Bug#9284)
7667
7be1c708 76682011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7669
7be1c708
CY
7670 * fontset.c (fontset_get_font_group): Add proper type checks.
7671 (Bug#9172)
aac0c6e3 7672
7be1c708 76732011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7674
7be1c708
CY
7675 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7676 and LC_VERSION_MIN_MACOSX.
7677 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7678 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7679
97bb72a6
EZ
76802011-08-08 Eli Zaretskii <eliz@gnu.org>
7681
7682 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7683 no-display-properties-and-no-overlays under bidi display.
7684 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7685 properties and overlays.
97bb72a6 7686
d5617611
CY
76872011-08-08 Chong Yidong <cyd@stupidchicken.com>
7688
37e11a63
CY
7689 * editfns.c (Fset_time_zone_rule): Document relationship with the
7690 setenv function.
7691
d5617611
CY
7692 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7693 the font entity extracted from the cache (Bug#8109).
7694
58872834
CY
76952011-08-07 Chong Yidong <cyd@stupidchicken.com>
7696
7697 * composite.c (autocmp_chars): Don't reset point. That is done by
7698 restore_point_unwind (Bug#5984).
7699
75bfc667
JL
77002011-08-07 Juri Linkov <juri@jurta.org>
7701
7702 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7703 to show the arg `TIME' instead of `TIMEVAL'.
7704
d1410150
EZ
77052011-08-06 Eli Zaretskii <eliz@gnu.org>
7706
7707 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7708 display property strides EOL and includes a newline, as in
7709 longlines-mode. (Bug#9254)
75b771e4
EZ
7710 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7711 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7712
7713 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7714 is non-zero, even if the data buffer is NULL. Fixes a crash in
7715 vertical-motion with longlines-mode. (Bug#9254)
7716
35928349
EZ
77172011-08-05 Eli Zaretskii <eliz@gnu.org>
7718
ec7cc85b
EZ
7719 * bidi.c <bidi_cache_total_alloc>: Now static.
7720 (bidi_initialize): Initialize bidi_cache_total_alloc.
7721
8b76d6f8 7722 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7723 cache. (Bug#9221)
7724
7725 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7726 amount allocated this far in `bidi_cache_total_alloc'.
7727 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7728 non-zero, only free the data buffer without restoring the cache
7729 contents. All callers changed.
7730
7731 * dispextern.h (bidi_unshelve_cache): Update prototype.
7732
7733 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7734 (move_it_in_display_line, move_it_to)
7735 (move_it_vertically_backward, move_it_by_lines): Replace the call
7736 to xfree to an equivalent call to bidi_unshelve_cache.
7737 (move_it_in_display_line_to): Fix logic of returning
412b6358 7738 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7739
e2e2423b
EZ
77402011-08-05 Eli Zaretskii <eliz@gnu.org>
7741
7742 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7743 came from a string character with a `cursor' property. (Bug#9229)
7744
ae9e757a
JD
77452011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7746
7747 * Makefile.in (LIB_PTHREAD): New variable.
7748 (LIBES): Add LIB_PTHREAD (Bug#9216).
7749
7750 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7751 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7752
213bd7f2
AS
77532011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7754
6b02f655 7755 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7756
99aaf75f
JD
77572011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7758
7759 * xterm.c (x_find_topmost_parent): New function.
7760 (x_set_frame_alpha): Find topmost parent window with
7761 x_find_topmost_parent and set the property there also (bug#9181).
7762 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7763
c74e9d86
PE
77642011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7765
7766 * callproc.c (Fcall_process): Avoid vfork clobbering
7767 the local vars buffer, coding_systems, current_dir.
7768
640c8776
SM
77692011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7770
7771 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7772
f26d0e4c
PE
77732011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7774
8a10d76c
PE
7775 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7776 so that it is not optimized away.
7777
f26d0e4c
PE
7778 * xdisp.c (compute_display_string_pos): Remove unused local.
7779
55439c61
EZ
77802011-08-02 Eli Zaretskii <eliz@gnu.org>
7781
7782 Fix slow cursor motion and scrolling in large buffers with
7783 selective display, like Org Mode buffers. (Bug#9218)
7784
7785 * dispextern.h (struct bidi_it): New member disp_prop_p.
7786
7787 * xdisp.c: Remove one-slot cache of display string positions.
7788 (compute_display_string_pos): Accept an additional argument
5e617bc2 7789 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7790 for a display string or property. If found, set DISP_PROP_P
7791 non-zero.
7792
7793 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7794 DISP_PROP_P, and pass it to compute_display_string_pos.
7795 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7796 non-zero. All callers of bidi_fetch_char changed.
7797
fb33fa43
SM
77982011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7799
7800 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7801
b099e063
DM
78022010-12-03 Don March <don@ohspite.net>
7803
7804 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7805 last character M-[char] is translated to ESC [char] (bug#7541).
7806
5cc7f7af
KH
78072011-08-02 Kenichi Handa <handa@m17n.org>
7808
d0fffa3f 7809 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7810
7811 * chartab.c (uniprop_table): Make it non-static.
7812
525d5e6e
EZ
78132011-08-01 Eli Zaretskii <eliz@gnu.org>
7814
7815 * xdisp.c (forward_to_next_line_start): Accept additional argument
7816 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7817 on the newline.
7818 (reseat_at_next_visible_line_start): Use the bidi iterator state
7819 returned by forward_to_next_line_start to restore the state of
7820 it->bidi_it after backing up to previous newline. (Bug#9212)
7821
31011111
AS
78222011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7823
7824 * regex.c (re_comp): Protoize.
7825 (re_exec): Fix return type.
7826 (regexec): Fix type of `ret'. (Bug#9203)
7827
476371c4
PE
78282011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7829
e5d76069
PE
7830 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7831 This is needed if max-image-size is a floating-point number.
7832
9a79b20c
AS
78332011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7834
7835 * print.c (print_object): Print empty symbol as ##.
7836
7837 * lread.c (read1): Read ## as empty symbol.
7838
d8c2fa78
AA
78392011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7840
7841 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7842 setting frame foreground color (Bug#9175).
7843 (x_set_background_color): Likewise.
7844
ffe57a7a
AA
7845 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7846 contents (Bug#9176).
7847 (EmacsTooltip -init): Remove bezels and add shadows to
7848 tooltip windows.
7849
bf3492a5
AA
7850 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7851 or scroll bar (Bug#8470).
7852
d55e9c53
AA
7853 * nsfont.m (nsfont_open): Remove assignment to voffset and
7854 unnecessary vars hshink, expand, hd, full_height, min_height.
7855 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7856
7857 * nsterm.h (nsfont_info): Remove voffset field.
7858
d8c2fa78 78592011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7860
7861 Implement strike-through and overline on NextStep (Bug#8863).
7862
7863 * nsfont.m (nsfont_open): Use underline position provided by font,
7864 instead of hard-coded value of 2.
7865 (nsfont_draw): Call ns_draw_text_decoration instead.
7866
7867 * nsterm.h: Add declaration for ns_draw_text_decoration.
7868
7869 * nsterm.m (ns_draw_text_decoration): New function for drawing
7870 underline, overline, and strike-through.
7871 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7872 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7873 accommodate underlining, etc.
4843aac3 7874
4cc60b9b
EZ
78752011-07-28 Eli Zaretskii <eliz@gnu.org>
7876
bc7ece87
EZ
7877 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7878 default.
4cc60b9b 7879
476371c4
PE
78802011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7881
66606eea
PE
7882 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7883 Without this fix, if a signal arrives just after memory fills up,
7884 'malloc' might be invoked reentrantly.
7885
476371c4
PE
7886 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7887 In other words, assume that every image size is allowed, on non-X
7888 hosts. This assumption is probably wrong, but it lets Emacs compile.
7889
f3fcc40d
AS
78902011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7891
7892 * regex.c (re_iswctype): Convert return values to boolean.
7893
350c992f
EZ
78942011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7895
7896 * xdisp.c (compute_display_string_pos): Don't use cached display
7897 string position if the buffer had its restriction changed.
7898 (Bug#9184)
7899
5266b4bb
PE
79002011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7901
7902 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7903
2573a837 79042011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7905
41f55ccd 7906 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7907
39e378da
PE
7908 * bidi.c: Integer size and overflow fixes.
7909 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7910 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7911 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7912 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7913 (bidi_find_other_level_edge):
7914 Use ptrdiff_t instead of EMACS_INT where either will do.
7915 This works better on 32-bit hosts configured --with-wide-int.
7916 (bidi_cache_ensure_space): Check for size-calculation overflow.
7917 Use % rather than repeated addition, for better worst-case speed.
7918 Don't set bidi_cache_size until after xrealloc returns, because it
7919 might not return.
7920 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7921 (bidi_cache_ensure_space): Also check that the bidi cache size
7922 does not exceed that of the largest Lisp string or buffer. See Eli
7923 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7924
5e927815
PE
7925 * alloc.c (__malloc_size_t): Remove.
7926 All uses replaced by size_t. See Andreas Schwab's note
7927 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7928
ca4aa935
PE
7929 * image.c: Improve checking for integer overflow.
7930 (check_image_size): Assume that f is nonnull, since
7931 it is always nonnull in practice. This is one less thing to
7932 worry about when checking for integer overflow later.
7933 (x_check_image_size): New function, which checks for integer
7934 overflow issues inside X.
7935 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7936 This removes the need for a memory_full check.
7937 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7938 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7939 (xbm_read_bitmap_data): Change locals back to 'int', since
7940 their values must fit in 'int'.
7941 (xpm_load_image, png_load, tiff_load):
7942 Invoke x_create_x_image_and_pixmap earlier,
7943 to avoid much needless work if the image is too large.
7944 (tiff_load): Treat overly large images as if
7945 x_create_x_image_and_pixmap failed, not as malloc failures.
7946 (gs_load): Use x_check_image_size.
7947
5f8f9cc2
PE
7948 * gtkutil.c: Omit integer casts.
7949 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7950 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7951
5adf60bc
PE
7952 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7953
c8907a93
PE
7954 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7955 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7956 would wrongly return t on a 64-bit host.
7957
e3c25c68
PE
7958 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7959 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7960 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7961 and therefore cause GCC to emit a bogus diagnostic in some cases.
7962
3f791afe
PE
7963 * image.c: Integer signedness and overflow and related fixes.
7964 This is not an exhaustive set of fixes, but it's time to
7965 record what I've got.
7966 (lookup_pixel_color, check_image_size): Remove redundant decls.
7967 (check_image_size): Don't assume that arbitrary EMACS_INT values
7968 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7969 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7970 (tiff_load, imagemagick_load_image):
7971 Check for overflow in size calculations.
7972 (x_create_x_image_and_pixmap): Remove unnecessary test for
7973 xmalloc returning NULL; that can't happen.
7974 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7975 (xpm_color_bucket): Use better integer hashing function.
7976 (xpm_cache_color): Don't possibly over-allocate memory.
7977 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7978 (gif_memory_source):
7979 Use ptrdiff_t, not int or size_t, to record sizes.
7980 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7981 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7982 either works, as we prefer signed integers.
7983 (tiff_read_from_memory, tiff_write_from_memory):
7984 Return tsize_t, not size_t, since that's what the TIFF API wants.
7985 (tiff_read_from_memory): Don't fail simply because the read would
7986 go past EOF; instead, return a short read.
7987 (tiff_load): Omit no-longer-needed casts.
7988 (Fimagemagick_types): Don't assume size fits into 'int'.
7989
3cc5a532
PE
7990 Improve hashing quality when configured --with-wide-int.
7991 * fns.c (hash_string): New function, taken from sxhash_string.
7992 Do not discard information about ASCII character case; this
7993 discarding is no longer needed.
7994 (sxhash-string): Use it. Change sig to match it. Caller changed.
7995 * lisp.h: Declare it.
7996 * lread.c (hash_string): Remove, since we now use fns.c's version.
7997 The fns.c version returns a wider integer if --with-wide-int is
7998 specified, so this should help the quality of the hashing a bit.
7999
b312a492
PE
8000 * emacs.c: Integer overflow minor fix.
8001 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8002 Define only if GNU_LINUX.
8003 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8004
dfd153ae
PE
8005 * dispnew.c: Integer signedness and overflow fixes.
8006 Remove unnecessary forward decls, that were a maintenance hassle.
8007 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8008 All uses changed.
8009 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8010 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8011 (prepare_desired_row, line_draw_cost):
8012 Use int, not unsigned, where either works.
8013 (save_current_matrix, restore_current_matrix):
8014 Use ptrdiff_t, not size_t, where either works.
8015 (init_display): Check for overflow more accurately, and without
8016 relying on undefined behavior.
8017
a81d11a3
PE
8018 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8019 Remove, replacing with the new symbols in lisp.h. All uses changed.
8020 * fileio.c (make_temp_name):
8021 * filelock.c (lock_file_1, lock_file):
8022 * xdisp.c (message_dolog):
8023 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8024 Use pMd etc. instead.
8025 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8026 replacing the pWIDE etc. symbols removed from editfns.c.
8027
3300e6fd
PE
8028 * keyboard.h (num_input_events): Now uintmax_t.
8029 This is (very slightly) less likely to mess up due to wraparound.
8030 All uses changed.
8031
fd05c7e9
PE
8032 * buffer.c: Integer signedness fixes.
8033 (alloc_buffer_text, enlarge_buffer_text):
8034 Use ptrdiff_t rather than size_t when either will do, as we prefer
8035 signed integers.
8036
903fe15d
PE
8037 * alloc.c: Integer signedness and overflow fixes.
8038 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8039 (__malloc_size_t): Default to size_t, not to int.
8040 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8041 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8042 Prefer ptrdiff_t to size_t when either would do, as we prefer
8043 signed integers.
8044 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8045 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8046 Now const. Initialize with values that are in range even if char
8047 is signed.
8048 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8049 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8050 These functions do the right thing with sizes > 2**32.
8051 (check_depth): Now ptrdiff_t, not int.
8052 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8053 Adjust to new way of storing sizes. Check for size overflow bugs
8054 in rest of code.
8055 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8056 slightly wrong anyway, as it missed one instance of
8057 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8058 (refill_memory_reserve): Omit needless cast to size_t.
8059 (mark_object_loop_halt): Mark as externally visible.
8060
ac82cc6a
PE
8061 * xselect.c: Integer signedness and overflow fixes.
8062 (Fx_register_dnd_atom, x_handle_dnd_message):
8063 Use ptrdiff_t, not size_t, since we prefer signed.
8064 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8065 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8066 x_dnd_atoms_size and x_dnd_atoms_length.
8067
c2d1e36d
PE
8068 * doprnt.c: Prefer signed to unsigned when either works.
8069 * eval.c (verror):
8070 * doprnt.c (doprnt):
8071 * lisp.h (doprnt):
8072 * xdisp.c (vmessage):
8073 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8074 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8075 prefer signed arithmetic to avoid comparison confusion.
8076 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8077 but is a bit tricky.
8078
0e926e56
PE
8079 Assume freestanding C89 headers, string.h, stdlib.h.
8080 * data.c, doprnt.c, floatfns.c, print.c:
8081 Include float.h unconditionally.
8082 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8083 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8084 * regex.c: Likewise for stddef.h, string.h.
8085 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8086 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8087 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8088 (STDC_HEADERS): Remove obsolete defines.
8089 * sysdep.c: Include limits.h unconditionally.
8090
9cfdb3ec
PE
8091 Assume support for memcmp, memcpy, memmove, memset.
8092 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8093 * regex.c (memcmp, memcpy):
8094 Remove; we assume C89 now.
8095
8096 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8097 (__malloc_safe_bcopy): Remove; no longer needed.
8098
cf950e6b 8099 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
8100 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8101 well either way, and we prefer signed to unsigned.
8102
dbf38e02
LMI
81032011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8104
8105 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8106 closes the connection while we're reading (bug#9182).
8107
d6f0886c 81082011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 8109
d6f0886c
JD
8110 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8111 are specified (Bug#9168).
24e0f6b1 8112
2eb1f9e6
PE
81132011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8116 Found by GCC static checking and --with-wide-int on a 32-bit host.
8117
22381272 81182011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
8119
8120 * xdisp.c (compute_display_string_pos): Fix logic of caching
8121 previous display string position. Initialize cached_prev_pos to
8122 -1. Fixes slow-down at the beginning of a buffer.
8123
f25e39b4
EZ
81242011-07-24 Eli Zaretskii <eliz@gnu.org>
8125
8126 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
8127 for attrs[LFACE_FONTSET_INDEX].
8128
04c4b52e
PE
81292011-07-23 Paul Eggert <eggert@cs.ucla.edu>
8130
8131 * xml.c (parse_region): Remove unused local
8132 that was recently introduced.
8133
c1734fbd
EZ
81342011-07-23 Eli Zaretskii <eliz@gnu.org>
8135
be18c5a5
EZ
8136 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
8137 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
8138
c1734fbd
EZ
8139 * xdisp.c (move_it_in_display_line_to): Record the best matching
8140 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
8141 exit if none of the characters scanned was an exact match.
8142 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
8143 when exact match is impossible due to invisible text, and the
8144 lines are truncated.
8145
a258d627
JD
81462011-07-23 Jan Djärv <jan.h.d@swipnet.se>
8147
8148 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
8149 for OSX >= 10.7.
8150
b6d5a689
EZ
81512011-07-22 Eli Zaretskii <eliz@gnu.org>
8152
0f74f785
EZ
8153 Fix a significant slow-down of cursor motion with C-n, C-p,
8154 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
8155 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 8156 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
8157 (next_element_from_buffer): Call compute_stop_pos_backwards to
8158 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
8159 base_level_stop.
8160 (reseat): Don't look for prev_stop, as that could mean a very long
8161 run.
8162 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
8163 <cached_disp_overlay_modiff>: Cache for last found display string
8164 position.
551918c1 8165 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
8166 about the same buffer in the same area of character positions, and
8167 the buffer wasn't changed since the time the display string
8168 position was cached.
551918c1 8169
b2d0c91a
EZ
81702011-07-22 Eli Zaretskii <eliz@gnu.org>
8171
8172 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
8173 is an integer, which is important for empty lines. (Bug#9149)
8174
043604ee
CY
81752011-07-22 Chong Yidong <cyd@stupidchicken.com>
8176
8177 * frame.c (Fmodify_frame_parameters): In tty case, update the
8178 default face if necessary (Bug#4238).
8179
da4adb04
CY
81802011-07-21 Chong Yidong <cyd@stupidchicken.com>
8181
8182 * editfns.c (Fstring_to_char): No need to explain what a character
8183 is in the docstring (Bug#6576).
8184
9abd0532
LMI
81852011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8186
8187 * xml.c (parse_region): Make sure we always return a tree.
8188
36881d16
HK
81892011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
8190
8191 * xml.c (parse_region): If a document contains only comments,
8192 return that, too.
8193
1e98674d
LMI
81942011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8195
8196 * xml.c (make_dom): Return comments, too.
8197
590bd467
PE
81982011-07-19 Paul Eggert <eggert@cs.ucla.edu>
8199
8200 Port to OpenBSD.
8201 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
8202 and the surrounding thread.
8203 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
8204 rather than fgets, and retry after EINTR. Otherwise, 'emacs
8205 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
8206 timer goes off.
8207 * s/openbsd.h (BROKEN_SIGIO): Define.
8208 * unexelf.c (unexec) [__OpenBSD__]:
8209 Don't update the .mdebug section of the Alpha COFF symbol table.
8210
f41628b2
LMI
82112011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8212
8213 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
8214 (bug#8460).
8215
b59b67c5
PE
82162011-07-18 Paul Eggert <eggert@cs.ucla.edu>
8217
15e3a074
PE
8218 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
8219 This fixes some race conditions on the permissions of any newly
8220 created file.
8221
41bed37d
PE
8222 * alloc.c (valid_pointer_p): Use pipe, not open.
8223 This fixes some permissions issues when debugging.
8224
b59b67c5
PE
8225 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
8226 If fchown fails to set both uid and gid, try to set just gid,
8227 as that is sometimes allowed. Adjust the file's mode to eliminate
8228 setuid or setgid bits that are inappropriate if fchown fails.
8229
925a6be7
SM
82302011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8231
8232 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
8233 to compare Lisp_Objects.
8234 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
8235 global_gnutls_log_level, don't mistake it for a Lisp_Object.
8236 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
8237
52968808
AS
82382011-07-17 Andreas Schwab <schwab@linux-m68k.org>
8239
0a6a104b
AS
8240 * lread.c (read_integer): Unread even EOF character.
8241 (read1): Likewise. Properly record start position of symbol.
8242
52968808
AS
8243 * lread.c (read1): Read `#:' as empty uninterned symbol if no
8244 symbol character follows.
8245
9e381cdd
PE
82462011-07-17 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
8249 This works around a problem with the previous change to Fcopy_file.
8250 Recent glibc declares fchown with __attribute__((warn_unused_result)),
8251 and without this change, GCC might complain about discarding
8252 fchown's return value.
8253
b5641435
JB
82542011-07-16 Juanma Barranquero <lekktu@gmail.com>
8255
8256 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
8257
a8031457
PE
82582011-07-16 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
8261
dd889327
LMI
82622011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
8263
750c33f7
LMI
8264 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
8265 it's used from the C level.
8266
dd889327
LMI
8267 * process.c: Use the same condition for POLL_FOR_INPUT in both
8268 keyboard.c and process.c (bug#1858).
8269
87e86684
LM
82702011-07-09 Lawrence Mitchell <wence@gmx.li>
8271
8272 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
8273 (Fgnutls_boot): Use it.
8274
64348f40
AS
82752011-07-15 Andreas Schwab <schwab@linux-m68k.org>
8276
8277 * doc.c (Fsubstitute_command_keys): Revert last change.
8278
1d698799
LMI
82792011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
8280
f863868c
LMI
8281 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
8282 quotes the next character, and doesn't affect other longer
8283 sequences (bug#8935).
8284
1d698799
LMI
8285 * lread.c (syms_of_lread): Clarify that is isn't only
8286 `eval-buffer' and `eval-defun' that's affected by
8287 `lexical-binding' (bug#8460).
8288
aa4b6df6
EZ
82892011-07-15 Eli Zaretskii <eliz@gnu.org>
8290
8291 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 8292 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 8293
5d856da6
PE
82942011-07-14 Paul Eggert <eggert@cs.ucla.edu>
8295
ad6042bb
PE
8296 Fix minor problems found by static checking.
8297 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
8298 (elsz): Now a signed constant, not a size_t var. We prefer signed
8299 types to unsigned, to avoid integer comparison confusion. Without
8300 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
8301 "cannot optimize loop, the loop counter may overflow", a symptom
8302 of the confusion.
f00bbb22 8303 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
8304 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
8305
6468f31c
LMI
83062011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8307
49080b10
LMI
8308 * search.c (Fre_search_backward): Mention `case-fold-search' in
8309 all the re_search_* functions (bug#8138).
8310
6468f31c
LMI
8311 * keyboard.c (Fopen_dribble_file): Document when the file is
8312 closed (bug#8056).
8313
c965adc5
EZ
83142011-07-14 Eli Zaretskii <eliz@gnu.org>
8315
df9733bf
EZ
8316 * bidi.c (bidi_dump_cached_states): Fix format of displaying
8317 bidi_cache_idx.
8318
0bb23927
EZ
8319 Support bidi reordering of display and overlay strings.
8320 * xdisp.c (compute_display_string_pos)
8321 (compute_display_string_end): Accept additional argument STRING.
8322 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
8323 (reseat_to_string): Initialize bidi_it->string.s and
8324 bidi_it->string.schars.
8325 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
8326 NULL (avoids a crash in bidi_paragraph_init).
8327 Initialize itb.string.lstring.
0bb23927
EZ
8328 (init_iterator): Call bidi_init_it only of a valid
8329 buffer position was specified. Initialize paragraph_embedding to
8330 L2R.
8331 (reseat_to_string): Initialize the bidi iterator.
8332 (display_string): If we need to ignore text properties of
8333 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
8334 original value of -1 will not work with bidi.)
8335 (compute_display_string_pos): First arg is now struct
8336 `text_pos *'; all callers changed. Support display properties on
8337 Lisp strings.
8338 (compute_display_string_end): Support display properties on Lisp
8339 strings.
8340 (init_iterator, reseat_1, reseat_to_string): Initialize the
8341 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
8342 when iterating on a string not from display properties).
640c8776
SM
8343 (compute_display_string_pos, compute_display_string_end):
8344 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
8345 arrow keys.
8346 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
8347 base_level_stop; instead, set base_level_stop to BEGV.
8348 Fixes crashes in vertical-motion.
0bb23927
EZ
8349 (next_element_from_buffer): Improve commentary for when
8350 the iterator is before prev_stop.
8351 (init_iterator): Initialize bidi_p from the default value of
8352 bidi-display-reordering, not from buffer-local value. Use the
8353 buffer-local value only if initializing for buffer iteration.
8354 (handle_invisible_prop): Support invisible properties on strings
8355 that are being bidi-reordered.
8356 (set_iterator_to_next): Support bidi reordering of C strings and
8357 Lisp strings.
8358 (next_element_from_string): Support bidi reordering of Lisp
8359 strings.
8360 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
8361 (display_string): Support display of R2L glyph rows.
8362 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
8363 (init_iterator): Don't initialize it->bidi_p for strings
8364 here.
8365 (reseat_to_string): Initialize it->bidi_p for strings here.
8366 (next_element_from_string, next_element_from_c_string)
8367 (next_element_from_buffer): Add xassert's for correspondence
8368 between IT's object being iterated and it->bidi_it.string
8369 structure.
8370 (face_before_or_after_it_pos): Support bidi iteration.
8371 (next_element_from_c_string): Handle the case of the first string
8372 character that is not the first one in the visual order.
8373 (get_visually_first_element): New function, refactored from common
8374 parts of next_element_from_buffer, next_element_from_string, and
8375 next_element_from_c_string.
8376 (tool_bar_lines_needed, redisplay_tool_bar)
8377 (display_menu_bar): Force left-to-right direction. Add a FIXME
8378 comment for making that be controlled by a user option.
8379 (push_it, pop_it): Save and restore the state of the
8380 bidi iterator. Save and restore the bidi_p flag.
8381 (pop_it): Iterate out of display property for string iteration as
8382 well.
8383 (iterate_out_of_display_property): Support iteration over strings.
8384 (handle_single_display_spec): Set up it->bidi_it for iteration
8385 over a display string, and call bidi_init_it.
8386 (handle_single_display_spec, next_overlay_string)
8387 (get_overlay_strings_1, push_display_prop): Set up the bidi
8388 iterator for displaying display or overlay strings.
8389 (forward_to_next_line_start): Don't use the shortcut if
8390 bidi-iterating.
8391 (back_to_previous_visible_line_start): If handle_display_prop
8392 pushed the iterator stack, restore the internal state of the bidi
8393 iterator by calling bidi_pop_it same number of times.
8394 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
8395 and we are bidi-iterating, don't decrement the iterator position;
8396 instead, set the first_elt flag in the bidi iterator, to produce
8397 the same effect.
8398 (reseat_1): Remove redundant setting of string_from_display_prop_p.
8399 (push_display_prop): xassert that we are iterating a buffer.
8400 (push_it, pop_it): Save and restore paragraph_embedding member.
8401 (handle_single_display_spec, next_overlay_string)
8402 (get_overlay_strings_1, reseat_1, reseat_to_string)
8403 (push_display_prop): Set up the `unibyte' member of bidi_it.string
8404 correctly. Don't assume unibyte strings are not bidi-reordered.
8405 (compute_display_string_pos)
8406 (compute_display_string_end): Fix handling the case of C string.
8407 (push_it, pop_it): Save and restore from_disp_prop_p.
8408 (handle_single_display_spec, push_display_prop): Set the
8409 from_disp_prop_p flag.
8410 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
8411 (pop_it): Call iterate_out_of_display_property only if we are
8412 popping after iteration over a string that came from a display
8413 property. Fix a typo in popping stretch info. Add an assertion
8414 for verifying that the iterator position is in sync with the bidi
8415 iterator.
8416 (handle_single_display_spec, get_overlay_strings_1)
8417 (push_display_prop): Fix initialization of paragraph direction for
8418 string when that of the parent object is not yet determined.
8419 (reseat_1): Call bidi_init_it to resync the bidi
8420 iterator with IT's position. (Bug#7616)
8421 (find_row_edges): If ROW->start.pos gives position
8422 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
8423 (handle_stop, back_to_previous_visible_line_start, reseat_1):
8424 Reset the from_disp_prop_p flag.
8425 (SAVE_IT, RESTORE_IT): New macros.
8426 (pos_visible_p, face_before_or_after_it_pos)
8427 (back_to_previous_visible_line_start)
8428 (move_it_in_display_line_to, move_it_in_display_line)
8429 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8430 (try_scrolling, redisplay_window, display_line): Use them when
8431 saving a temporary copy of the iterator and restoring it back.
8432 (back_to_previous_visible_line_start, reseat_1)
8433 (init_iterator): Empty the bidi cache "stack".
8434 (move_it_in_display_line_to): If iterator ended up at
8435 EOL, but we never saw any buffer positions smaller than
8436 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8437 motion in bidi-reordered lines.
8438 (move_it_in_display_line_to): Record prev_method and prev_pos
8439 immediately before the call to set_iterator_to_next. Fixes cursor
8440 motion in bidi-reordered lines with stretch glyphs and strings
8441 displayed in margins. (Bug#8133) (Bug#8867)
8442 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8443 TO_CHARPOS.
640c8776
SM
8444 (pos_visible_p): Support positions in bidi-reordered lines.
8445 Save and restore bidi cache.
0bb23927
EZ
8446
8447 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8448 (bidi_paragraph_info): Delete unused struct.
8449 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8450 (bidi_cache_start): New variable.
8451 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8452 to zero.
8453 (bidi_cache_fetch_state, bidi_cache_search)
8454 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8455 (bidi_cache_find, bidi_peek_at_next_level)
8456 (bidi_level_of_next_char, bidi_find_other_level_edge)
8457 (bidi_move_to_visually_next): Compare cache index with
8458 bidi_cache_start rather than with zero.
8459 (bidi_fetch_char): Accept new argument STRING; all callers
8460 changed. Support iteration over a string. Support strings with
8461 display properties. Support unibyte strings. Fix the type of
8462 `len' according to what STRING_CHAR_AND_LENGTH expects.
8463 (bidi_paragraph_init, bidi_resolve_explicit_1)
8464 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
8465 (bidi_level_of_next_char, bidi_move_to_visually_next):
8466 Support iteration over a string.
0bb23927
EZ
8467 (bidi_set_sor_type, bidi_resolve_explicit_1)
8468 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8469 can now be zero (for strings); special values 0 and -1 were
8470 changed to -1 and -2, respectively.
8471 (bidi_char_at_pos): New function.
8472 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8473 Call it instead of FETCH_MULTIBYTE_CHAR.
8474 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8475 initialized to valid values.
8476 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8477 values.
8478 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8479 the test for valid cached positions. Fix the logic for looking up
8480 the sentinel state in the cache. GCPRO the Lisp string we are
8481 iterating.
8482 (bidi_push_it, bidi_pop_it): New functions.
8483 (bidi_initialize): Initialize the bidi cache start stack pointer.
8484 (bidi_cache_ensure_space): New function, refactored from part of
8485 bidi_cache_iterator_state. Don't assume the required size is just
8486 one BIDI_CACHE_CHUNK away.
8487 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8488 (bidi_count_bytes, bidi_char_at_pos): New functions.
8489 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8490 always valid if bidi_cache_idx is valid.
8491 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8492 is valid if it's going to be used.
8493 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8494 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
8495 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8496 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
8497 (bidi_find_other_level_edge, bidi_cache_start_stack):
8498 All variables related to cache indices are now EMACS_INT.
c965adc5 8499
0bb23927
EZ
8500 * dispextern.h (struct bidi_string_data): New structure.
8501 (struct bidi_it): New member `string'. Make flag members be 1-bit
8502 fields, and put them last in the struct.
640c8776
SM
8503 (compute_display_string_pos, compute_display_string_end):
8504 Update prototypes.
0bb23927
EZ
8505 (bidi_push_it, bidi_pop_it): Add prototypes.
8506 (struct iterator_stack_entry): New members bidi_p,
8507 paragraph_embedding, and from_disp_prop_p.
8508 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
8509 (bidi_shelve_cache, bidi_unshelve_cache):
8510 Declare prototypes.
0bb23927
EZ
8511
8512 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
8513 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
8514 and vector-like objects.
8515
8516 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
8517 cache around display iteration.
8518
8519 * window.c (Fwindow_end, window_scroll_pixel_based)
8520 (displayed_window_lines, Frecenter): Save and restore the bidi
8521 cache around display iteration.
8522
3bbd2265
LMI
85232011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8524
8525 * editfns.c (Fdelete_region): Clarify the use of the named
8526 parameters (bug#6788).
8527
adc47434
MR
85282011-07-14 Martin Rudalics <rudalics@gmx.at>
8529
8530 * indent.c (Fvertical_motion): Set and restore w->pointm when
8531 saving and restoring the window's buffer (Bug#9006).
8532
837c31f8
LMI
85332011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8534
8535 * editfns.c (Fstring_to_char): Clarify just what is returned
8536 (bug#6576). Text by Eli Zaretskii.
8537
ac389d0c
JB
85382011-07-13 Juanma Barranquero <lekktu@gmail.com>
8539
8540 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8541
0be0ce47
EZ
85422011-07-13 Eli Zaretskii <eliz@gnu.org>
8543
8544 * buffer.c (mmap_find): Fix a typo.
8545
cd18e7e3
JB
85462011-07-13 Johan Bockgård <bojohan@gnu.org>
8547
8548 Fix execution of x selection hooks.
8549 * xselect.c (Qx_lost_selection_functions)
8550 (Qx_sent_selection_functions): New vars.
8551 (syms_of_xselect): DEFSYM them.
8552 (x_handle_selection_request): Pass Qx_sent_selection_functions
8553 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8554 (x_handle_selection_clear,x_clear_frame_selections):
8555 Pass Qx_lost_selection_functions rather than
8556 Vx_lost_selection_functions to Frun_hook_with_args.
8557
47ea7f44
PE
85582011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8559
ac389d0c 8560 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8561 The old code sometimes used this field without initializing it.
8562
47ea7f44
PE
8563 * alloc.c (gc_sweep): Don't read past end of array.
8564 In theory, the old code could also have corrupted Emacs internals,
8565 though it'd be very unlikely.
8566
bc985c87
AS
85672011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8568
8569 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8570 argument. (Bug#4026)
bc985c87 8571
0cf34688
LMI
85722011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8573
b3dadd76
LMI
8574 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8575 key" (bug#4257).
8576
0cf34688
LMI
8577 * window.c (Fset_window_start): Doc fix (bug#4199).
8578 (Fset_window_hscroll): Ditto.
8579
270768cd
PE
85802011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8581
077e3dda 8582 Fix minor new problems caught by GCC 4.6.1.
270768cd 8583 * term.c (init_tty): Remove unused local.
490011a6 8584 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8585 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8586 not used otherwise.
270768cd 8587
b1f58454
CY
85882011-07-12 Chong Yidong <cyd@stupidchicken.com>
8589
8590 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8591
22b9578d
LMI
85922011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8593
6e70ab07
LMI
8594 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8595 are the mini-buffer and the echo area (bug#3320).
8596
22b9578d
LMI
8597 * term.c (init_tty): Remove support for supdup, c10 and perq
8598 terminals, which are no longer supported (bug#1482).
8599
8974cc9f
JB
86002011-07-10 Johan Bockgård <bojohan@gnu.org>
8601
8602 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8603
a560d974
JD
86042011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8605
8606 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8607 for non-popups (Bug#3642).
8608
1dae0f0a
AS
86092011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8610
268c2c36 8611 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8612 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8613 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8614 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8615 * data.c (fmod): Likewise.
8616 * dispnew.c (swap_glyphs_in_rows): Likewise.
8617 * emacs.c (memory_warning_signal): Likewise.
8618 * floatfns.c (float_error): Likewise.
8619 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8620 (otf_open, font_otf_capability, generate_otf_features)
8621 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8622 Likewise.
8623 * image.c (pbm_read_file): Likewise.
8624 * indent.c (string_display_width): Likewise.
8625 * intervals.c (check_for_interval, search_for_interval)
8626 (inc_interval_count, count_intervals, root_interval)
8627 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8628 * lread.c (defalias): Likewise.
268c2c36 8629 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8630 * regex.c (set_image_of_range_1, set_image_of_range)
8631 (regex_grow_registers): Likewise.
8632 * sysdep.c (strerror): Likewise.
8633 * termcap.c (valid_filename_p, tprint, main): Likewise.
8634 * tparam.c (main): Likewise.
8635 * unexhp9k800.c (run_time_remap, save_data_space)
8636 (update_file_ptrs, read_header, write_header, calculate_checksum)
8637 (copy_file, copy_rest, display_header): Likewise.
8638 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8639 Likewise.
8640 * xdisp.c (check_it): Likewise.
8641 * xfaces.c (register_color, unregister_color, unregister_colors):
8642 Likewise.
8643 * xfns.c (print_fontset_result): Likewise.
8644 * xrdb.c (member, fatal, main): Likewise.
8645
99033785
PE
86462011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8647
8648 Fix minor problems found by static checking (Bug#9031).
8649 * chartab.c (char_table_set_range, map_sub_char_table):
8650 Remove unused locals.
8651 (uniprop_table): Now static.
8652 * composite.c (_work_char): Remove unused static var.
8653
9cb2ac56
JB
86542011-07-09 Juanma Barranquero <lekktu@gmail.com>
8655
8656 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8657
f25661f0
JD
86582011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8659
8660 * gtkutil.c (qttip_cb): Remove code without function.
8661
8278c4fe
EZ
86622011-07-09 Eli Zaretskii <eliz@gnu.org>
8663
8664 * w32.c (pthread_sigmask): New stub.
8665
1692ae2d 86662011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8667
8a6ebd58 8668 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8669 sigprocmask is portable only for single-threaded applications, and
8670 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8671 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8672 (LIBES): Use it.
8673 * callproc.c (Fcall_process):
8674 * process.c (create_process):
8675 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8676 Use pthread_sigmask, not sigprocmask.
123403e4 8677
1b854618
JD
86782011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8679
8680 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8681 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8682 wrong (Bug#8591).
8683
3fe4b549
JD
86842011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8685
0ce7e563
JD
8686 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8687 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8688 (xg_hide_tooltip): Fix comment.
8689
3fe4b549
JD
8690 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8691 in registerServicesMenuSendTypes.
8692 (validRequestorForSendType): Don't check ns_return_types.
8693
8694 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8695 ns_return_type.
8696
5df75e47
JR
86972011-07-08 Jason Rumney <jasonr@gnu.org>
8698
22610910
JR
8699 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8700 SH_SHOW for hidden windows (Bug#5482).
8701
5df75e47
JR
8702 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8703 frame struct members of non-existent frames (Bug#6284).
8704
699c10bd
JD
87052011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8706
4393663b
JD
8707 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8708 variable firstTime not needed on OSX >= 10.6.
8709 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8710 >= 10.5. Use setKnobProportion, setDoubleValue.
8711
8712 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8713 (MAC_OS_X_VERSION_10_5): Define if not defined.
8714 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8715 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8716 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8717
8718 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8719 cString and lossyCString on OSX >= 10.4.
4393663b 8720
58179cce 8721 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8722 sizeToFit on OSX >= 10.2.
8723
8724 * nsimage.m (allocInitFromFile): Don't use deprecated method
8725 bestRepresentationForDevice on OSX >= 10.6.
8726
8727 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8728 to avoid warning.
8729
8730 * emacs.c: Declare unexec_init_emacs_zone.
8731
a63e0781
JD
8732 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8733
699c10bd
JD
8734 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8735
8736 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8737 on svcsMenu (Bug#8842).
8738
8739 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8740 ns_return_types.
8741 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8742
8743 * nsterm.m (QUTF8_STRING): Declare.
8744 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8745 (validRequestorForSendType): Return type is (id).
8746 Change indexOfObjectIdenticalTo to indexOfObject.
8747 Check if we have local selection before returning self (Bug#8842).
8748 (writeSelectionToPasteboard): Put local selection into paste board
8749 if we have a local selection (Bug#8842).
8750 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8751
8752 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8753 (ns_get_local_selection): Declare.
8754
54e10184
LMI
87552011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8756
9888ff71
LMI
8757 * keymap.c (describe_map_tree): Don't insert a double newline at
8758 the end of the buffer (bug#1169) and return whether we inserted
8759 something.
8760
54e10184
LMI
8761 * callint.c (Fcall_interactively): Change "reading args" to
8762 "providing args" to try to clarify what it does (bug#1010).
8763
15fa4783
KH
87642011-07-07 Kenichi Handa <handa@m17n.org>
8765
8766 * composite.c (composition_compute_stop_pos): Ignore a static
8767 composition starting before CHARPOS (Bug#8915).
8768
8769 * xdisp.c (handle_composition_prop): Likewise.
8770
a8815b00
EZ
87712011-07-07 Eli Zaretskii <eliz@gnu.org>
8772
8773 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8774 (Bug#9015)
8775
ef7b981d 87762011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8777
8778 * character.h (unicode_category_t): New enum type.
8779
8780 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8781 (Qchar_code_property_table): New variable.
8782 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8783 (UNIPROP_COMPRESSED_FORM_P): New macros.
8784 (char_table_ascii): Uncompress the compressed values.
8785 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8786 Uncompress the compressed values.
ac389d0c 8787 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8788 (char_table_ref_and_range): Uncompress the compressed values.
8789 (sub_char_table_set): New arg is_uniprop. Callers changed.
8790 Uncompress the compressed values.
8791 (sub_char_table_set_range): Args changed. Callers changed.
8792 (char_table_set_range): Adjuted for the above change.
8793 (map_sub_char_table): Delete args default_val and parent. Add arg
8794 top. Give decoded values to a Lisp function.
640c8776 8795 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8796 values to a Lisp function. Gcpro more variables.
8797 (uniprop_table_uncompress)
8798 (uniprop_decode_value_run_length): New functions.
8799 (uniprop_decoder, uniprop_decoder_count): New variables.
8800 (uniprop_get_decoder, uniprop_encode_value_character)
8801 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8802 New functions.
8803 (uniprop_encoder, uniprop_encoder_count): New variables.
8804 (uniprop_get_encoder, uniprop_table)
8805 (Funicode_property_table_internal, Fget_unicode_property_internal)
8806 (Fput_unicode_property_internal): New functions.
8807 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8808 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8809 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8810 char-code-property-alist.
8811
640c8776 8812 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8813 Vunicode_category_table.
8814
640c8776 8815 * font.c (font_range): Adjust for the change of
c805dec0
KH
8816 Vunicode_category_table.
8817
76b397fb
DN
88182011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8819
8820 * m/iris4d.h: Remove file, move contents ...
8821 * s/irix6-5.h: ... here.
8822
22b4128e
PE
88232011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8824
8825 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8826 * alloc.c (mark_buffer):
8827 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8828 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8829 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8830 This isn't true in general, and it's particularly not true
8831 if Emacs is configured with --with-wide-int.
8832 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8833 New macros, used in the buffer.c change.
8834
869795d6
JD
88352011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8836
8837 * xsettings.c: Use both GConf and GSettings if both are available.
8838 (store_config_changed_event): Add comment.
8839 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8840 (store_tool_bar_style_changed): New functions.
5e617bc2 8841 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8842 (struct xsettings): Move font inside HAVE_XFT.
8843 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8844 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8845 Move inside HAVE_XFT.
640c8776 8846 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8847 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8848 also.
8849 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8850 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8851 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8852 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8853 (parse_settings): Move check for font inside HAVE_XFT.
8854 (read_settings, apply_xft_settings): Add comment.
8855 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8856 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8857 call store_font_name_changed.
8858 (xft_settings_event): Add comment.
8859 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8860 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8861 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8862 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8863 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8864 (xsettings_get_system_font, xsettings_get_system_normal_font):
8865 Add comment.
869795d6 8866
d8ed26bd
PE
88672011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8868
8869 Random fixes. E.g., (random) never returned negative values.
8870 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8871 subseconds part to the entropy, as that's a bit more random.
8872 Prefer signed to unsigned, since the signedness doesn't matter and
8873 in general we prefer signed. When given a limit, use a
8874 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8875 latter isn't right if USE_2_TAGS_FOR_INTS.
8876 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8877 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8878
cabf1cac
SM
88792011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8880
8881 * textprop.c (text_property_stickiness):
8882 Obey Vtext_property_default_nonsticky.
8883 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8884 * w32fns.c (syms_of_w32fns):
8885 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8886
6e9b2be9
PE
88872011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8888
8889 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8890 This is more efficient than Ffile_directory_p and avoids a minor race.
8891
90186c68
LMI
88922011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8893
7c301272
LMI
8894 * buffer.c (Foverlay_put): Say what the return value is
8895 (bug#7835).
8896
c4f2d8d4
LMI
8897 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8898 is a directory before asking whether to use the file name
8899 (bug#7564).
ad637907
LMI
8900 (barf_or_query_if_file_exists): Make the "File is a directory"
8901 error be more correct.
c4f2d8d4 8902
90186c68
LMI
8903 * fns.c (Frequire): Remove the mention of the .gz files, since
8904 that's installation-specific, but keep the mention of
8905 `get-load-suffixes'.
8906
da64016e
PE
89072011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8908
8909 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8910 Report string overflow if the output is too long.
8911
7d47b580
JB
89122011-07-04 Juanma Barranquero <lekktu@gmail.com>
8913
a555cb87
JB
8914 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8915 (syms_of_gnutls): Remove duplicate DEFSYM for
8916 Qgnutls_bootprop_verify_hostname_error, an error for
8917 Qgnutls_bootprop_verify_error (which is no longer used).
8918
7d47b580
JB
8919 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8920 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8921 Also (re)move comments that are misplaced or no longer relevant.
8922
1e49bfab
LMI
89232011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8924
8925 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8926
1485f4c0
CY
89272011-07-03 Chong Yidong <cyd@stupidchicken.com>
8928
8929 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8930 and background color parameters if they have been changed.
8931
a9ab721e
LMI
89322011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8933
8934 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8935
cf7cff57
PE
89362011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8937
2e13213d
PE
8938 * xsettings.c (SYSTEM_FONT): Define only when used.
8939 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8940
cf7cff57
PE
8941 * keymap.c (access_keymap_1): Now static.
8942
7a8e04f7
CY
89432011-07-02 Chong Yidong <cyd@stupidchicken.com>
8944
8945 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8946 leave any prefix arg for the up event (Bug#1586).
8947
61352f62
LMI
89482011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8949
69bb1ef7
LMI
8950 * lread.c (syms_of_lread): Mention single symbols defined by
8951 `defvar' or `defconst' (bug#7154).
8952
61352f62 8953 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8954 (Frequire): Mention get-load-suffixes.
61352f62 8955
28545e04
MR
89562011-07-02 Martin Rudalics <rudalics@gmx.at>
8957
8958 * window.h (window): Remove clone_number slot.
8959 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8960 Remove.
8961 (make_parent_window, make_window, saved_window)
8962 (Fset_window_configuration, save_window_save): Don't deal with
8963 clone numbers.
8964 * buffer.c (Qclone_number): Remove declaration.
8965 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8966
3349e122
SM
89672011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8968
8969 Add multiple inheritance to keymaps.
8970 * keymap.c (Fmake_composed_keymap): New function.
8971 (Fset_keymap_parent): Simplify.
8972 (fix_submap_inheritance): Remove.
8973 (access_keymap_1): New function extracted from access_keymap to handle
8974 embedded parents and handle lists of maps.
8975 (access_keymap): Use it.
8976 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8977 (Fcopy_keymap): Handle embedded parents.
8978 (Fcommand_remapping, define_as_prefix): Simplify.
8979 (Fkey_binding): Simplify.
8980 (syms_of_keymap): Move minibuffer-local-completion-map,
8981 minibuffer-local-filename-completion-map,
8982 minibuffer-local-must-match-map, and
8983 minibuffer-local-filename-must-match-map to Elisp.
8984 (syms_of_keymap): Defsubr make-composed-keymap.
8985 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8986 (parse_menu_item): Trivial simplification.
8987
3279eb87
GM
89882011-07-01 Glenn Morris <rgm@gnu.org>
8989
8990 * Makefile.in (SETTINGS_LIBS): Fix typo.
8991
4550efdf
KI
89922011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8993
8994 * coding.c (Fencode_coding_string): Record the last coding system
8995 used, as the function doc string says (bug#8738).
8996
0949d2b6
JD
89972011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8998
8999 * xsettings.c (store_monospaced_changed): Take new font as arg and
9000 check for change against current_mono_font.
9001 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9002 (emacs_settings_constructor, emacs_settings_get_property)
9003 (emacs_settings_set_property, emacs_settings_class_init)
9004 (emacs_settings_init, gsettings_obj): Remove.
9005 (something_changedCB): New function for HAVE_GSETTINGS.
9006 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9007 with value as argument.
9008 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9009 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 9010 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
9011 "changed".
9012
9013 * xgselect.c: Add defined (HAVE_GSETTINGS).
9014 (xgselect_initialize): Ditto.
9015
9016 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9017 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9018 xg_select.
9019
bbc6b304
PE
90202011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9021
9022 * eval.c (struct backtrace): Simplify and port the data structure.
9023 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9024 signed bit field, as this assumption is not portable and it makes
9025 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9026 "char debug_on_exit : 1" as this is not portable either; instead,
9027 use the portable "unsigned int debug_on_exit : 1". Remove unused
9028 member evalargs. Remove obsolete comments about cc bombing out.
9029
9851bfc5
JD
90302011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9031
51bb811f 9032 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
9033 Let HAVE_GSETTINGS override HAVE_GCONF.
9034 (store_monospaced_changed): New function.
9035 (EMACS_SETTINGS): A new type derived from GObject to handle
9036 GSettings notifications.
9037 (emacs_settings_constructor, emacs_settings_get_property)
9038 (emacs_settings_set_property, emacs_settings_class_init):
9039 New functions.
9040 (gsettings_client, gsettings_obj): New variables.
9041 (GSETTINGS_SCHEMA): New define.
9042 (something_changedCB): Call store_monospaced_changed.
9043 (init_gsettings): New function.
9044 (xsettings_initialize): Call init_gsettings.
9045 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9046 to NULL.
9047
640c8776 9048 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
9049 GCONF_CFLAGS/LIBS.
9050
5386012d
MR
90512011-06-29 Martin Rudalics <rudalics@gmx.at>
9052
9053 * window.c (resize_root_window, grow_mini_window)
9054 (shrink_mini_window): Rename Qresize_root_window to
9055 Qwindow_resize_root_window and Qresize_root_window_vertically to
9056 Qwindow_resize_root_window_vertically.
9057
f13e0b08
PE
90582011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9059
9060 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9061
94515237
JB
90622011-06-27 Juanma Barranquero <lekktu@gmail.com>
9063
9064 * makefile.w32-in: Redesign dependencies so they reflect more
9065 clearly which files are directly included by each source file,
9066 and not through other includes.
9067
e43b6e43
MR
90682011-06-27 Martin Rudalics <rudalics@gmx.at>
9069
9070 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9071 (sort_overlays, overlay_strings): When an overlay's clone number
9072 matches the window's clone number process the overlay even if
9073 the overlay's window property doesn't match the current window.
9074
d68443dc
MR
9075 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9076 (Fwindow_hchild): Rename to Fwindow_left_child.
9077 (Fwindow_next): Rename to Fwindow_next_sibling.
9078 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
9079 (resize_window_check): Rename to window_resize_check.
9080 (resize_window_apply): Rename to window_resize_apply.
9081 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9082 (Fdelete_other_windows_internal, resize_frame_windows)
9083 (Fsplit_window_internal, Fdelete_window_internal)
9084 (grow_mini_window, shrink_mini_window)
9085 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 9086
c7e73be5
JD
90872011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9088
9089 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9090 (emacs_fixed_set_min_size): Remove.
9091 (emacs_fixed_new): Take frame as argument.
9092
9093 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9094 (_EmacsFixedPrivate): Remove minwidth/height.
9095 Add struct frame *f.
9096 (emacs_fixed_init): Initialize priv->f.
9097 (get_parent_class, emacs_fixed_set_min_size): Remove.
9098 (emacs_fixed_new): Set priv->f to argument.
9099 (emacs_fixed_get_preferred_width)
9100 (emacs_fixed_get_preferred_height): Use min_width/height from
9101 frames size_hint to set minimum and natural (Bug#8919).
9102 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9103 and use min_width/height from frames size_hint to set
9104 min_width/height (Bug#8919).
9105
9106 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
9107 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9108 Fix indentation.
c7e73be5 9109
cf99dcf8
EZ
91102011-06-26 Eli Zaretskii <eliz@gnu.org>
9111
9112 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9113 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9114 called at ZV.
9115
029529ac
CY
91162011-06-26 Chong Yidong <cyd@stupidchicken.com>
9117
9118 * process.c (wait_reading_process_output): Bypass select if
9119 waiting for a cell while ignoring keyboard input, and input is
9120 pending. Suggested by Jan Djärv (Bug#8869).
9121
7a7ef429
PE
91222011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9123
9124 Use gnulib's dup2 module instead of rolling our own.
9125 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
9126
11fdef7d 91272011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
9128
9129 * dispnew.c (scrolling_window): Before scrolling, turn off a
9130 mouse-highlight in the window being scrolled.
9131
cd3520a4
JB
91322011-06-24 Juanma Barranquero <lekktu@gmail.com>
9133
9134 Move DEFSYM to lisp.h and use everywhere.
9135
9136 * character.h (DEFSYM): Move declaration...
9137 * lisp.h (DEFSYM): ...here.
9138
9139 * gnutls.c:
9140 * minibuf.c:
9141 * w32menu.c:
9142 * w32proc.c:
9143 * w32select.c: Don't include character.h.
9144
9145 * alloc.c (syms_of_alloc):
9146 * buffer.c (syms_of_buffer):
9147 * bytecode.c (syms_of_bytecode):
9148 * callint.c (syms_of_callint):
9149 * casefiddle.c (syms_of_casefiddle):
9150 * casetab.c (init_casetab_once):
9151 * category.c (init_category_once, syms_of_category):
9152 * ccl.c (syms_of_ccl):
9153 * cmds.c (syms_of_cmds):
9154 * composite.c (syms_of_composite):
9155 * dbusbind.c (syms_of_dbusbind):
9156 * dired.c (syms_of_dired):
9157 * dispnew.c (syms_of_display):
9158 * doc.c (syms_of_doc):
9159 * editfns.c (syms_of_editfns):
9160 * emacs.c (syms_of_emacs):
9161 * eval.c (syms_of_eval):
9162 * fileio.c (syms_of_fileio):
9163 * fns.c (syms_of_fns):
9164 * frame.c (syms_of_frame):
9165 * fringe.c (syms_of_fringe):
9166 * insdel.c (syms_of_insdel):
9167 * keymap.c (syms_of_keymap):
9168 * lread.c (init_obarray, syms_of_lread):
9169 * macros.c (syms_of_macros):
9170 * msdos.c (syms_of_msdos):
9171 * print.c (syms_of_print):
9172 * process.c (syms_of_process):
9173 * search.c (syms_of_search):
9174 * sound.c (syms_of_sound):
9175 * syntax.c (init_syntax_once, syms_of_syntax):
9176 * terminal.c (syms_of_terminal):
9177 * textprop.c (syms_of_textprop):
9178 * undo.c (syms_of_undo):
9179 * w32.c (globals_of_w32):
9180 * window.c (syms_of_window):
9181 * xdisp.c (syms_of_xdisp):
9182 * xfaces.c (syms_of_xfaces):
9183 * xfns.c (syms_of_xfns):
9184 * xmenu.c (syms_of_xmenu):
9185 * xsettings.c (syms_of_xsettings):
9186 * xterm.c (syms_of_xterm): Use DEFSYM.
9187
4228cf16
TZ
91882011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
9189
cd3520a4 9190 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 9191
7fcccf1e
PE
91922011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9193
7efb4e0e
PE
9194 Integer and buffer overflow fixes (Bug#8873).
9195
ff5844ad
PE
9196 * print.c (printchar, strout): Check for string overflow.
9197 (PRINTPREPARE, printchar, strout):
9198 Don't set size unless allocation succeeds.
9199
90532f02
PE
9200 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
9201 for sizes. Check for string overflow more accurately.
9202 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
9203
6d84508d
PE
9204 * macros.c: Integer and buffer overflow fixes.
9205 * keyboard.h (struct keyboard.kbd_macro_bufsize):
9206 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
9207 Use ptrdiff_t, not int, for sizes.
9208 Don't increment bufsize until after realloc succeeds.
9209 Check for size-calculation overflow.
9210 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
9211
437b2cb4
PE
9212 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
9213
8b9ac8b4
PE
9214 * lread.c: Integer overflow fixes.
9215 (read_integer): Radix is now EMACS_INT, not int,
9216 to improve quality of diagnostics for out-of-range radices.
9217 Calculate buffer size correctly for out-of-range radices.
9218 (read1): Check for integer overflow in radices, and in
9219 read-circle numbers.
82cb60d3
PE
9220 (read_escape): Avoid int overflow.
9221 (Fload, openp, read_buffer_size, read1)
9222 (substitute_object_recurse, read_vector, read_list, map_obarray):
9223 Use ptrdiff_t, not int, for sizes.
9224 (read1): Use EMACS_INT, not int, for sizes.
20270765 9225 Check for size overflow.
8b9ac8b4 9226
7fcccf1e
PE
9227 * image.c (cache_image): Check for size arithmetic overflow.
9228
bfbbd7e7
PE
9229 * lread.c: Integer overflow issues.
9230 (saved_doc_string_size, saved_doc_string_length)
9231 (prev_saved_doc_string_size, prev_saved_doc_string_length):
9232 Now ptrdiff_t, not int.
9233 (read1): Don't assume doc string length fits in int. Check for
9234 out-of-range doc string lengths.
9235 (read_list): Don't assume file position fits in int.
39019e54 9236 (read_escape): Check for hex character overflow.
bfbbd7e7 9237
4e323265
LL
92382011-06-22 Leo Liu <sdl.web@gmail.com>
9239
9240 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
9241 Move to minibuffer.el.
9242
85fece3e
PE
92432011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9244
20b84ce9 9245 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
9246 The following patches are for when GLYPH_DEBUG && !XASSERT.
9247 * dispextern.h (trace_redisplay_p, dump_glyph_string):
9248 * dispnew.c (flush_stdout):
9249 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
9250 Mark as externally visible.
9251 * dispnew.c (check_window_matrix_pointers): Now static.
9252 * dispnew.c (window_to_frame_vpos):
9253 * xfns.c (unwind_create_frame):
9254 * xterm.c (x_check_font): Remove unused local.
9255 * scroll.c (CHECK_BOUNDS):
9256 * xfaces.c (cache_fache): Rename local to avoid shadowing.
9257 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
9258 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
9259 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
9260 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
9261 Now static.
9262 (debug_method_add): Use va_list and vsprintf rather than relying
9263 on undefined behavior with wrong number of arguments.
9264 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
9265 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
9266 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
9267 since we're not interested in debugging glyphs with old libraries.
9268 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
9269 GCC 4.6.0's static checking.
9270
0766b489
PE
92712011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9272
31fd4b32
PE
9273 Integer overflow and signedness fixes (Bug#8873).
9274 A few related buffer overrun fixes, too.
9275
b79e8648
PE
9276 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
9277
0766b489
PE
9278 * dispextern.h (struct face.stipple):
9279 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
9280 (x_bitmap_mask, x_allocate_bitmap_record)
9281 (x_create_bitmap_from_data, x_create_bitmap_from_file)
9282 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
9283 (x_create_bitmap_from_xpm_data):
9284 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
9285 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
9286 (.bitmaps_last):
9287 * xfaces.c (load_pixmap):
9288 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
9289 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
9290 (.bitmaps_last, struct x_output.icon_bitmap):
9291 Use ptrdiff_t, not int, for bitmap indexes.
9292 (x_allocate_bitmap_record): Check for size overflow.
9293 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
9294
b081724f
PE
9295 Use ptrdiff_t, not int, for overlay counts.
9296 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
9297 * editfns.c (overlays_around, get_pos_property):
9298 * textprop.c (get_char_property_and_overlay):
9299 * xdisp.c (next_overlay_change, note_mouse_highlight):
9300 * xfaces.c (face_at_buffer_position):
21514da7
PE
9301 * buffer.c (OVERLAY_COUNT_MAX): New macro.
9302 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
9303 (Fnext_overlay_change, Fprevious_overlay_change)
9304 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 9305 Use ptrdiff_t, not int, for sizes.
21514da7 9306 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 9307
3de73e5e
PE
9308 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
9309
2606c57b
PE
9310 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
9311 (x_session_initialize): Do not assume string length fits in int.
9312
aaafe47a
PE
9313 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
9314 This is unlikely, but can occur if DPI is outlandish.
9315
2674ddc8 9316 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
9317 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
9318
28154962
PE
9319 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
9320 * xrdb.c (magic_file_p, search_magic_path):
9321 Omit last arg SUFFIX; it was always 0. All callers changed.
9322 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
9323
7de51af5
PE
9324 * xfont.c (xfont_match): Avoid need for strlen.
9325
25ed6cc3
PE
9326 * xfns.c: Don't assume strlen fits in int.
9327 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
9328
4eab31dd
PE
9329 * xdisp.c (message_log_check_duplicate): Return intmax_t,
9330 not unsigned long, as we prefer signed integers. All callers changed.
9331 Detect integer overflow in repeat count.
9332 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 9333 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 9334
171e2a58
PE
9335 * termcap.c: Don't assume sizes fit in int and never overflow.
9336 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
9337 (gobble_line): Check for size-calculation overflow.
9338
ad39faca 9339 * minibuf.c (Fread_buffer):
6e5bb2dc 9340 * lread.c (intern, intern_c_string):
74ca2eb3
PE
9341 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
9342 Don't assume string length fits in int.
9343
52c61c22 9344 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
9345 * gtkutil.c (style_changed_cb): Avoid need for strlen.
9346
b5b8c9e5
PE
9347 * font.c: Don't assume string length fits in int.
9348 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
9349 Use ptrdiff_t, not int.
ccd6111c
PE
9350 (font_intern_prop): Don't assume string length fits in int.
9351 Don't assume integer property fits in fixnum.
9352 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 9353
882f0d81 9354 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 9355 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
9356 Reformulate so as not to need the command string.
9357 Invoke gzip -cd rather than gunzip, as it's more portable.
9358 (lock_info_type, lock_file_1, lock_file):
9359 Don't assume pid_t and time_t fit in unsigned long.
9360 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
9361 (current_lock_owner): Prefer signed type for sizes.
9362 Use memcpy, not strncpy, where memcpy is what is really wanted.
9363 Don't assume (via atoi) that time_t and pid_t fit in int.
9364 Check for time_t and/or pid_t out of range, e.g., via a network share.
9365 Don't alloca where an auto var works fine.
9366
93f4cf88
PE
9367 * fileio.c: Fix some integer overflow issues.
9368 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
9369 Don't assume string length fits in int.
9370 (directory_file_name): Don't assume string length fits in long.
9371 (make_temp_name): Don't assume pid fits in int, or that its print
9372 length is less than 20.
9373
f3e92b69
PE
9374 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
9375
1bfdaf10
PE
9376 * coding.c (make_subsidiaries): Don't assume string length fits in int.
9377
35016e9a
PE
9378 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
9379
3d1e65a1
PE
9380 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
9381 We prefer signed integers, even for size calculations.
9382
0b963a93
PE
9383 * emacs.c: Don't assume string length fits in 'int'.
9384 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
9385 (main): Don't invoke strlen when not needed.
9386
573f4b54
PE
9387 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
9388 (XD_DEBUG_MESSAGE): Don't waste a byte.
9389
989f33ba
PE
9390 * callproc.c (getenv_internal_1, getenv_internal)
9391 (Fgetenv_internal):
965d34eb
PE
9392 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
9393
e4d29b33
PE
9394 * lread.c (invalid_syntax): Omit length argument.
9395 All uses changed. This doesn't fix a bug, but it simplifies the
9396 code away from its former Hollerith-constant appearance, and it's
9397 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 9398 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 9399
eb49b136
PE
9400 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
9401 This didn't break anything, but it didn't help either.
9402 It's confusing to put a bogus integer in a place where the actual
9403 value does not matter.
9f62aeb1 9404 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 9405 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 9406
15375a22
PE
9407 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
9408 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
9409 implementation.
b61cc01c
PE
9410 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
9411 We prefer signed types, and the value cannot exceed the EMACS_INT
9412 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
9413 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
9414 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
9415 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 9416
53b2623d
PE
9417 * indent.c (sane_tab_width): New function.
9418 (current_column, scan_for_column, Findent_to, position_indentation)
9419 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 9420 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 9421
51cab52b 9422 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 9423
f2ed8a70
PE
9424 * lisp.h (lint_assume): New macro.
9425 * composite.c (composition_gstring_put_cache):
9426 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
9427
abe80cc6
PE
9428 * editfns.c, insdel.c:
9429 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 9430
b02c740e
PE
9431 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9432
ebc96716
PE
9433 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9434
b4e50fa0 9435 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 9436 Use much-faster test for byte-length change.
311d5d7c 9437 Don't assume string byte-length fits in 'int'.
a4cf38e4 9438 Check that character arg fits in 'int'.
85461888 9439 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 9440
c0c1ee9f
PE
9441 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9442
a498d7f4
PE
9443 * fns.c (concat): Catch string overflow earlier.
9444 Do not rely on integer wraparound.
9445
51cab52b
PE
9446 * dispextern.h (struct it.overlay_strings_charpos)
9447 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
9448 * xdisp.c (forward_to_next_line_start)
9449 (back_to_previous_visible_line_start)
9450 (reseat_at_next_visible_line_start, next_element_from_buffer):
9451 Don't arbitrarily truncate the value of 'selective' to int.
9452
76031fad
PE
9453 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9454
5eb55db9
PE
9455 * composite.c: Don't truncate sizes to 'int'.
9456 (composition_gstring_p, composition_reseat_it)
9457 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
9458 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9459 not EMACS_UINT, for indexes.
5eb55db9 9460
0703a717
PE
9461 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9462
d6202519
PE
9463 * buffer.c: Include <verify.h>.
9464 (struct sortvec.priority, struct sortstr.priority):
8961a454 9465 Now EMACS_INT, not int.
c20998a7 9466 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
9467 (struct sortstr.size, record_overlay_string)
9468 (struct sortstrlist.size, struct sortlist.used):
9469 Don't truncate size to int.
9470 (record_overlay_string): Check for size-calculation overflow.
d6202519 9471 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 9472
d5a19415
JM
94732011-06-22 Jim Meyering <meyering@redhat.com>
9474
029529ac 9475 Don't leak an XBM-image-sized buffer
d5a19415
JM
9476 * image.c (xbm_load): Free the image buffer after using it.
9477
a9041e6c
PE
94782011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9479
9480 Port to Sun C.
9481 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9482 that Sun C diagnosed.
9483 * fns.c (secure_hash): Fix pointer signedness issue.
9484 * intervals.c (static_offset_intervals): New function.
9485 (offset_intervals): Use it.
9486
7f3f739f
LL
94872011-06-21 Leo Liu <sdl.web@gmail.com>
9488
9489 * deps.mk (fns.o):
9490 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9491 sha512.h.
9492
9493 * fns.c (secure_hash): Rename from crypto_hash_function and change
9494 the first arg to accept symbols.
5b66d427 9495 (Fsecure_hash): New primitive.
7f3f739f
LL
9496 (syms_of_fns): New symbols.
9497
76147d94
DD
94982011-06-20 Deniz Dogan <deniz@dogan.se>
9499
9500 * process.c (Fset_process_buffer): Clarify return value in
9501 docstring.
9502
7d7d0045
CY
95032011-06-18 Chong Yidong <cyd@stupidchicken.com>
9504
9505 * dispnew.c (add_window_display_history): Use BVAR.
9506
9507 * xdisp.c (debug_method_add): Use BVAR.
9508 (check_window_end, dump_glyph_matrix, dump_glyph)
9509 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
9510
9511 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
9512 Likewise.
9513
9514 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
9515 check till after the cache is created in init_frame_faces.
9516
ff2bc410
SM
95172011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
9518
9519 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9520
28177add
PE
95212011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9522
dd3482fe
PE
9523 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9524 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9525 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9526
393d71f3 9527 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9528 * fileio.c (Finsert_file_contents):
9529 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9530 Remove the old (too-loose) buffer overflow checks.
9531 They weren't needed, since make_gap checks for buffer overflow.
9532 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9533 The old code merely checked for Emacs fixnum overflow, and relied
9534 on undefined (wraparound) behavior. The new code avoids undefined
9535 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9536
2e6813b0 9537 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9538 Tune. Don't use wider integers than needed. Don't use alloca.
9539 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9540
599a9e4f
PE
9541 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9542
99561444
PE
9543 * insdel.c, lisp.h (buffer_overflow): New function.
9544 (insert_from_buffer_1, replace_range, replace_range_2):
9545 * insdel.c (make_gap_larger):
9546 * editfns.c (Finsert_char):
9547 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9548
28177add
PE
9549 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9550
e69dafad
PE
95512011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9552
4baa020d 9553 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9554
b1c46f02
PE
9555 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9556 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9557
e69dafad
PE
9558 * fileio.c: Don't assume EMACS_INT fits in off_t.
9559 (emacs_lseek): New static function.
9560 (Finsert_file_contents, Fwrite_region): Use it.
9561 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9562
566684ea
PE
9563 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9564
e6966cd6
PE
9565 * fns.c: Don't overflow int when computing a list length.
9566 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9567 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9568 truncation on 64-bit hosts. Check for QUIT every
9569 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9570 faster and is responsive enough.
9571 (Flength): Report an error instead of overflowing an integer.
9572 (Fsafe_length): Return a float if the value is not representable
9573 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9574 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9575 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9576
dd0b0efb
PE
9577 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9578 (header_size, word_size): New constants.
9579 (allocate_vectorlike): Don't check size overflow here.
9580 (allocate_vector): Check it here instead, since this is the only
9581 caller of allocate_vectorlike that could cause overflow.
9582 Check that the new vector's length is representable as a fixnum.
9583
86fe5cfe
PE
9584 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9585 The previous code was bogus. For example, next_almost_prime (32)
9586 returned 39, which is undesirable as it is a multiple of 3; and
9587 next_almost_prime (24) returned 25, which is a multiple of 5 so
9588 why was the code bothering to check for multiples of 7?
9589
80e88859
PE
9590 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9591
4a2f0ad6
PE
9592 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9593
f66c7cf8
PE
9594 Variadic C functions now count arguments with ptrdiff_t.
9595 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9596 Back then I didn't know that the Emacs coding style prefers signed int.
9597 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9598 were being counted with int, which may truncate counts on 64-bit
9599 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9600 * lisp.h (struct Lisp_Subr.function.aMANY)
9601 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9602 Arg counts are now ptrdiff_t, not size_t.
9603 All variadic functions and their callers changed accordingly.
9604 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9605 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9606 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9607 * callint.c (Fcall_interactively): Check arg count for overflow,
9608 to avoid potential buffer overrun. Use signed char, not 'int',
9609 for 'varies' array, so that we needn't bother to check its size
9610 calculation for overflow.
9611 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9612 * eval.c (apply_lambda):
9613 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9614 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9615 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9616
a1759b76
PE
9617 * callint.c (Fcall_interactively): Don't use index var as event count.
9618
d96be9fc
PE
9619 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9620 * mem-limits.h (SIZE): Remove; no longer used.
9621
a690a978 9622 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9623
578c21e6
PE
9624 Remove unnecessary casts.
9625 * xterm.c (x_term_init):
9626 * xfns.c (x_set_border_pixel):
9627 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9628 These aren't needed now that we assume ANSI C.
9629
96f53c6c
PE
9630 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9631 It's more likely to cause problems (due to unsigned overflow)
9632 than to cure them.
9633
83c77d31
PE
9634 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9635
ee2079f1
PE
9636 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9637
6da65536
PE
9638 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9639
7147c4a4
PE
9640 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9641
193e32d9
PE
9642 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9643
e5533da6
PE
9644 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9645
9910e595
PE
9646 GLYPH_CODE_FACE returns EMACS_INT, not int.
9647 * dispextern.h (merge_faces):
9648 * xfaces.c (merge_faces):
01103c44
PE
9649 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9650 Don't assume EMACS_INT fits in int.
9910e595 9651
2638320e
PE
9652 * character.h (CHAR_VALID_P): Remove unused parameter.
9653 * fontset.c, lisp.h, xdisp.c: All uses changed.
9654
045eb8d9
PE
9655 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9656
c1f134b5
PE
9657 * fns.c (concat): Minor tuning based on overflow analysis.
9658 This doesn't fix any bugs. Use int to hold character, instead
9659 of constantly refetching from Emacs object. Use XFASTINT, not
9660 XINT, for value known to be a character. Don't bother comparing
9661 a single byte to 0400, as it's always less.
9662
395fcb93 9663 * floatfns.c (Fexpt):
327eeec8
PE
9664 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9665
abbd3d23
PE
9666 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9667 for characters.
9668
684a03ef
PE
9669 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9670
0fed43f3
PE
9671 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9672 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9673 incorrectly succeed when S was a string, because 4294967386 was
9674 truncated before it was used.
9675
8fd02eb7
PE
9676 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9677 Otherwise, an out-of-range integer could cause undefined behavior
9678 on a 64-bit host.
9679
f8c86b69
PE
9680 * composite.c: Use int, not EMACS_INT, for characters.
9681 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9682 EMACS_INT, for values that are known to be in character range.
9683 This doesn't fix any bugs but is the usual style inside Emacs and
9684 may generate better code on 32-bit machines.
9685
34206dd2
PE
9686 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9687 This is for reasons similar to the recent CHAR_STRING fix.
9688 * charset.c (Fencode_char): Check that character arg is actually
9689 a character. Pass an int to ENCODE_CHAR.
9690 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9691 wider than 'int', as a compile-time check to prevent future regressions
9692 in this area.
9693
c5958d4c 9694 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9695
9696 Make sure a 64-bit char is never passed to CHAR_STRING.
9697 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9698 by silently ignoring the top 32 bits, allowing some values
9699 that were far too large to be valid characters.
9700 * character.h: Include <verify.h>.
9701 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9702 arguments are no wider than unsigned, as a compile-time check
9703 to prevent future regressions in this area.
9704 * data.c (Faset):
01103c44 9705 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9706 (Fsubst_char_in_region):
9707 * fns.c (concat):
9708 * xdisp.c (decode_mode_spec_coding):
9709 Adjust to CHAR_STRING's new requirement.
9710 * editfns.c (Finsert_char, Fsubst_char_in_region):
9711 * fns.c (concat): Check that character args are actually
9712 characters. Without this test, these functions did the wrong
9713 thing with wildly out-of-range values on 64-bit hosts.
9714
d37ca623
PE
9715 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9716 These casts should not be needed on 32-bit hosts, either.
9717 * keyboard.c (read_char):
9718 * lread.c (Fload): Remove casts to unsigned.
9719
ea204efb
PE
9720 * lisp.h (UNSIGNED_CMP): New macro.
9721 This fixes comparison bugs on 64-bit hosts.
9722 (ASCII_CHAR_P): Use it.
9723 * casefiddle.c (casify_object):
01103c44 9724 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9725 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9726 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9727 * dispextern.h (FACE_FROM_ID):
9728 * keyboard.c (read_char): Use UNSIGNED_CMP.
9729
41cb286c
PE
9730 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9731 not to EMACS_INT, to avoid GCC warning.
9732
4a1b9832
PE
9733 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9734
55daad71
PE
9735 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9736 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9737 isn't needed on 32-bit machines.
8f95c75c 9738
01103c44
PE
9739 * buffer.c (Fgenerate_new_buffer_name):
9740 Use EMACS_INT for count, not int.
0ceccced 9741 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9742
9743 * data.c (Qcompiled_function): Now static.
9744
c6f072e7
PE
9745 * window.c (window_body_lines): Now static.
9746
20ce5912
PE
9747 * image.c (gif_load): Rename local to avoid shadowing.
9748
9c4c5f81
PE
9749 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9750 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9751 * alloc.c (make_save_value): Integer argument is now of type
9752 ptrdiff_t, not int.
9753 (mark_object): Use ptrdiff_t, not int.
9754 * lisp.h (pD): New macro.
9755 * print.c (print_object): Use it.
9756
c0c5c8ae
PE
9757 * alloc.c: Use EMACS_INT, not int, to count objects.
9758 (total_conses, total_markers, total_symbols, total_vector_size)
9759 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9760 (total_free_floats, total_floats, total_free_intervals)
9761 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9762 Now EMACS_INT, not int. All uses changed.
9763 (Fgarbage_collect): Compute overall total using a double, so that
9764 integer overflow is less likely to be a problem. Check for overflow
9765 when converting back to an integer.
5a25e253
PE
9766 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9767 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9768 These were 'int' variables that could overflow on 64-bit hosts;
9769 they were never used, so remove them instead of repairing them.
211a0b2a 9770 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9771 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9772 Previously, this ceilinged at INT_MAX, but that doesn't work on
9773 64-bit machines.
e46bb31a 9774 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9775
c78baabf 9776 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9777 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9778 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9779 when a (possibly-narrower) signed value would do just as well.
9780 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9781
c9d624c6
PE
9782 * alloc.c: Catch some string size overflows that we were missing.
9783 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9784 for convenience in STRING_BYTES_MAX.
9785 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9786 The definition here is exact; the one in lisp.h was approximate.
9787 (allocate_string_data): Check for string overflow. This catches
9788 some instances we weren't catching before. Also, it catches
9789 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9790 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9791 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9792
c9d624c6
PE
9793 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9794 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9795 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9796
353032ce
PE
9797 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9798
2bccce07
PE
9799 * alloc.c (Fmake_string): Check for out-of-range init.
9800
0ac30604
SM
98012011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9802
9803 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9804
c195f2de
JD
98052011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9806
9807 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9808 xg_get_default_scrollbar_width.
9809
9810 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9811 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9812 (style_changed_cb): Call update_theme_scrollbar_width and call
9813 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9814 all frames (Bug#8505).
9815 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9816 Call gtk_window_set_resizable if HAVE_GTK3.
9817 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9818 and height if HAVE_GTK3 (Bug#8505).
9819 (scroll_bar_width_for_theme): New variable.
9820 (update_theme_scrollbar_width): New function.
9821 (xg_get_default_scrollbar_width): Move code to
9822 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9823 (xg_initialize): Call update_theme_scrollbar_width.
9824
9825 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9826
9827 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9828
e10ac9f1
MR
98292011-06-12 Martin Rudalics <rudalics@gmx.at>
9830
9831 * frame.c (make_frame): Call other_buffer_safely instead of
9832 other_buffer.
9833
9834 * window.c (temp_output_buffer_show): Call display_buffer with
9835 second argument Vtemp_buffer_show_specifiers and reset latter
9836 immediately after the call.
9837 (Vtemp_buffer_show_specifiers): New variable.
9838 (auto_window_vscroll_p, next_screen_context_lines)
9839 (Vscroll_preserve_screen_position): Remove leading asterisks from
9840 doc-strings.
9841
2d3c217e 98422011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9843
7b7f97e8 9844 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9845 * buffer.c (Qclone_number): Remove for now, as it's unused.
9846 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9847 (record_buffer): Remove unused local.
9848 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9849 (set_frame_buffer_list): Remove; unused.
9850 * frame.h (other_visible_frames): Remove decl.
9851 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9852 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9853 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9854 if HAVE_GPM.
9855 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9856 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9857 Define only if HAVE_GPM.
9858 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9859 (update_hints_inhibit): Remove; never set. All uses removed.
9860 * widgetprv.h (emacsFrameClassRec): Remove decl.
9861 * window.c (delete_deletable_window): Now returns void, since it
9862 wasn't returning anything.
9863 (compare_window_configurations): Remove unused locals.
9864 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9865 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9866 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9867 the same widths as pointers. This follows up on the 2011-05-06 patch.
9868 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9869 * xterm.h: Likewise.
9870 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9871
1384b89e
JB
98722011-06-12 Juanma Barranquero <lekktu@gmail.com>
9873
9874 * makefile.w32-in: Update dependencies.
9875 (LISP_H): Add lib/intprops.h.
9876
1100a63c
CY
98772011-06-11 Chong Yidong <cyd@stupidchicken.com>
9878
9879 * image.c (gif_load): Add animation frame delay to the metadata.
9880 (syms_of_image): Use DEFSYM. New symbol `delay'.
9881
6198ccd0
MR
98822011-06-11 Martin Rudalics <rudalics@gmx.at>
9883
9884 * window.c (delete_deletable_window): Re-add.
9885 (Fset_window_configuration): Rewrite to handle dead buffers and
9886 consequently deletable windows.
9887 (window_tree, Fwindow_tree): Remove. Supply functionality in
9888 window.el.
9889 (compare_window_configurations): Simplify code.
9890
b6e3633c
AS
98912011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9892
1ab0dee5
AS
9893 * image.c (imagemagick_load_image): Fix type mismatch.
9894 (Fimagemagick_types): Likewise.
9895
b6e3633c
AS
9896 * window.h (replace_buffer_in_windows): Declare.
9897
9397e56f
MR
98982011-06-11 Martin Rudalics <rudalics@gmx.at>
9899
9900 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9901 Qclone_number. Remove external declaration of Qdelete_window.
9902 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9903 code.
640c8776
SM
9904 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9905 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9906 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9907 buffer list implementation.
9908 (other_buffer_safely): New function.
9909 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9910 calls to replace_buffer_in_windows and
9911 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9912 if allowed.
9913 (record_buffer): Inhibit quitting and rewrite using quittable
9914 functions. Run Qbuffer_list_update_hook if allowed.
9915 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9916 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9917 Move switch-to-buffer to window.el.
9397e56f
MR
9918 (bury-buffer): Move to window.el.
9919 (Vbuffer_list_update_hook): New variable.
9920
9921 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9922 section.
9923
9924 * window.h (resize_frame_windows): Move up in code.
9925 (Fwindow_frame): Remove EXFUN.
9926 (replace_buffer_in_all_windows): Remove prototype.
9927 (replace_buffer_in_windows_safely): Add prototype.
9928
9929 * window.c: Declare Qdelete_window static again. Move down
9930 declaration of select_count.
9931 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9932 (Fother_window): Move to window.el.
9933 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9934 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9935 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9936 window.el.
9937 (replace_buffer_in_windows): Implement by calling
9938 Qreplace_buffer_in_windows.
9939 (replace_buffer_in_all_windows): Remove with some functionality
9940 moved into replace_buffer_in_windows_safely.
9941 (replace_buffer_in_windows_safely): New function.
9942 (select_window_norecord, select_frame_norecord): Move in front
9943 of run_window_configuration_change_hook. Remove now obsolete
9944 declarations.
640c8776
SM
9945 (Fset_window_buffer): Rewrite doc-string.
9946 Call Qrecord_window_buffer.
9397e56f
MR
9947 (keys_of_window): Move binding for other-window to window.el.
9948
b50691aa
CY
99492011-06-11 Chong Yidong <cyd@stupidchicken.com>
9950
9951 * dispextern.h (struct image): Replace data member, whose int_val
9952 and ptr_val fields were not used by anything, with a single
9953 lisp_val object.
9954
9955 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9956 (gif_clear_image, gif_load, imagemagick_load_image)
9957 (gs_clear_image, gs_load): Callers changed.
9958
3f754b86
PE
99592011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9960
cca69397
PE
9961 * buffer.h: Include <time.h>, for time_t.
9962 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9963
109e28d0
PE
9964 Fix minor problems found by static checking.
9965
60737f02
PE
9966 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9967
4b66faf3
PE
9968 Make identifiers static if they are not used in other modules.
9969 * data.c (Qcompiled_function, Qframe, Qvector):
9970 * image.c (QimageMagick, Qsvg):
9971 * minibuf.c (Qmetadata):
9972 * window.c (resize_window_check, resize_root_window): Now static.
9973 * window.h (resize_window_check, resize_root_window): Remove decls.
9974
109e28d0
PE
9975 * window.c (window_deletion_count, delete_deletable_window):
9976 Remove; unused.
46a4ce9e
PE
9977 (window_body_lines): Now static.
9978 (Fdelete_other_windows_internal): Mark vars as initialized.
9979 Make sure 'resize_failed' is initialized.
9980 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9981 (resize_window_apply): Remove unused local.
9982 * window.h (delete_deletable_window): Remove decl.
9983
109e28d0 9984 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9985 (imagemagick_load_image): Fix pointer signedness problem by changing
9986 last arg from unsigned char * to char *. All uses changed.
9987 Also, fix a local for similar reasons.
9988 Remove unused locals. Remove locals to avoid shadowing.
9989 (fn_rsvg_handle_free): Remove; unused.
9990 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9991 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9992
3f754b86
PE
9993 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9994
2547adb1
CY
99952011-06-10 Chong Yidong <cyd@stupidchicken.com>
9996
9997 * image.c (gif_load): Fix omitted cast error introduced by
9998 2011-06-06 change.
9999
2c8e37d4
MR
100002011-06-10 Martin Rudalics <rudalics@gmx.at>
10001
10002 * window.h (resize_proportionally, orig_total_lines)
10003 (orig_top_line): Remove from window structure.
10004 (set_window_height, set_window_width, change_window_heights)
10005 (Fdelete_window): Remove prototypes.
10006 (resize_frame_windows): Remove duplicate declaration.
10007
440a42e3
EZ
100082011-06-10 Eli Zaretskii <eliz@gnu.org>
10009
10010 * window.h (resize_frame_windows, resize_window_check)
10011 (delete_deletable_window, resize_root_window)
10012 (resize_frame_windows): Declare prototypes.
10013
10014 * window.c (resize_window_apply): Make definition be "static" to
10015 match the prototype.
10016
562dd5e9
MR
100172011-06-10 Martin Rudalics <rudalics@gmx.at>
10018
10019 * window.c: Remove declarations of Qwindow_size_fixed,
10020 window_min_size_1, window_min_size_2, window_min_size,
10021 size_window, window_fixed_size_p, enlarge_window, delete_window.
10022 Remove static from declaration of Qdelete_window, it's
10023 temporarily needed by Fbury_buffer.
10024 (replace_window): Don't assign orig_top_line and
10025 orig_total_lines.
10026 (Fdelete_window, delete_window): Remove. Window deletion is
10027 handled by window.el.
640c8776
SM
10028 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10029 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
10030 (Fdelete_other_windows): Remove. Deleting other windows is
10031 handled by window.el.
10032 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10033 handled in window.el.
10034 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10035 Window minimum sizes are handled in window.el.
10036 (shrink_windows, size_window, set_window_height)
10037 (set_window_width, change_window_heights, window_height)
10038 (window_width, CURBEG, CURSIZE, enlarge_window)
10039 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10040 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10041 handled in window.el.
10042 (make_dummy_parent): Rename to make_parent_window and give it a
10043 second argument horflag.
10044 (make_window): Don't set resize_proportionally any more.
10045 (Fsplit_window): Remove. Windows are split in window.el.
10046 (save_restore_action, save_restore_orig_size)
10047 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10048 Resize mini windows in window.el.
10049 (grow_mini_window, shrink_mini_window): Implement by calling
10050 Qresize_root_window_vertically, resize_window_check and
10051 resize_window_apply.
640c8776
SM
10052 (saved_window, Fset_window_configuration, save_window_save):
10053 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
10054 resize_proportionally.
10055 (window_min_height, window_min_width): Move to window.el.
10056 (keys_of_window): Move bindings for delete-other-windows,
10057 split-window, delete-window and enlarge-window to window.el.
10058
10059 * buffer.c: Temporarily extern Qdelete_window.
10060 (Fbury_buffer): Temporarily call Qdelete_window instead of
10061 Fdelete_window (Fbury_buffer will move to window.el soon).
10062
10063 * frame.c (set_menu_bar_lines_1): Remove code handling
10064 orig_top_line and orig_total_lines.
10065
10066 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10067 set_window_height but set heights directly.
10068 (change_frame_size_1): Use resize_frame_windows.
10069
10070 * xdisp.c (init_xdisp): Don't use set_window_height but set
10071 heights directly.
10072
640c8776
SM
10073 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10074 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
10075 run_window_configuration_change_hook.
10076
10077 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10078 instead of change_window_heights and run
10079 run_window_configuration_change_hook.
10080
1a13852e
MR
100812011-06-09 Martin Rudalics <rudalics@gmx.at>
10082
10083 * window.c (replace_window): Rename second argument REPLACEMENT to
10084 NEW. New third argument SETFLAG. Rewrite.
10085 (delete_window, make_dummy_parent): Call replace_window with
10086 third argument 1.
10087 (window_list_1): Move down in code.
10088 (run_window_configuration_change_hook): Move set_buffer part
10089 before select_frame_norecord part in order to unwind correctly.
10090 Rename count1 to count.
10091 (recombine_windows, delete_deletable_window, resize_root_window)
10092 (Fdelete_other_windows_internal)
10093 (Frun_window_configuration_change_hook, make_parent_window)
10094 (resize_window_check, resize_window_apply, Fresize_window_apply)
10095 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
10096 (Fdelete_window_internal, Fresize_mini_window_internal):
10097 New functions.
1a13852e
MR
10098 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10099
f3d1777e
MR
101002011-06-08 Martin Rudalics <rudalics@gmx.at>
10101
496e208e
MR
10102 * window.h (window): Add some new members to window structure -
10103 normal_lines, normal_cols, new_total, new_normal, clone_number,
10104 splits, nest, prev_buffers, next_buffers.
10105 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 10106 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 10107
f3d1777e
MR
10108 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10109 Remove.
496e208e
MR
10110 (make_dummy_parent): Set new members of windows structure.
10111 (make_window): Move down in code. Handle new members of window
10112 structure.
10113 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10114 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10115 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10116 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
10117 (Fset_window_next_buffers, Fset_window_clone_number):
10118 New functions.
496e208e
MR
10119 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10120 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10121 Doc-string fixes.
10122 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10123 Argument WINDOW can be now internal window too.
10124 (Fwindow_use_time): Move up in code.
10125 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
10126 Rewrite doc-string.
10127 (Fset_window_configuration, saved_window)
10128 (Fcurrent_window_configuration, save_window_save): Handle new
10129 members of window structure.
b9e809c2
MR
10130 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
10131 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
10132 (syms_of_window): New Lisp objects Qrecord_window_buffer,
10133 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
10134 Qget_mru_window, Qresize_root_window,
10135 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
10136 Qauto_buffer_name; staticpro them.
f3d1777e 10137
abde8f8c
MR
101382011-06-07 Martin Rudalics <rudalics@gmx.at>
10139
10140 * window.c (Fwindow_total_size, Fwindow_left_column)
10141 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
10142 (Fwindow_list_1): New functions.
10143 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
10144 (Fwindow_width, Fscroll_left, Fscroll_right):
10145 Use window_body_cols instead of window_box_text_cols.
10146 (delete_window, Fset_window_configuration):
10147 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
10148 (delete_all_subwindows): Take a window as argument and not a
10149 structure. Rewrite.
190b47e6
MR
10150 (window_loop): Remove handling of GET_LRU_WINDOW and
10151 GET_LARGEST_WINDOW.
10152 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
10153
10154 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
10155 window_box_text_cols. delete_all_subwindows now takes a
10156 Lisp_Object as argument.
abde8f8c 10157
640c8776
SM
10158 * indent.c (compute_motion, Fcompute_motion):
10159 Use window_body_cols instead of window_box_text_cols.
abde8f8c 10160
fa8a67e6
MR
10161 * frame.c (delete_frame): Call delete_all_subwindows with root
10162 window as argument.
10163
a54e3482
DC
101642011-06-07 Daniel Colascione <dan.colascione@gmail.com>
10165
10166 * fns.c (Fputhash): Document return value.
10167
60002bf5
CY
101682011-06-06 Chong Yidong <cyd@stupidchicken.com>
10169
10170 * image.c (gif_load): Implement gif89a spec "no disposal" method.
10171
0c671da6 101722011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 10173
b862a52a 10174 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 10175
be44ca6c
PE
10176 Check for overflow when converting integer to cons and back.
10177 * charset.c (Fdefine_charset_internal, Fdecode_char):
10178 Use cons_to_unsigned to catch overflow.
10179 (Fencode_char): Use INTEGER_TO_CONS.
10180 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
10181 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
10182 * data.c (long_to_cons, cons_to_long): Remove.
10183 (cons_to_unsigned, cons_to_signed): New functions.
10184 These signal an error for invalid or out-of-range values.
10185 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
10186 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
10187 * font.c (Ffont_variation_glyphs):
10188 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
10189 * lisp.h: Include <intprops.h>.
10190 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
10191 (cons_to_signed, cons_to_unsigned): New decls.
10192 (long_to_cons, cons_to_long): Remove decls.
10193 * undo.c (record_first_change): Use INTEGER_TO_CONS.
10194 (Fprimitive_undo): Use CONS_TO_INTEGER.
10195 * xfns.c (Fx_window_property): Likewise.
10196 * xselect.c: Include <limits.h>.
10197 (x_own_selection, selection_data_to_lisp_data):
10198 Use INTEGER_TO_CONS.
10199 (x_handle_selection_request, x_handle_selection_clear)
10200 (x_get_foreign_selection, Fx_disown_selection_internal)
10201 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
10202 (lisp_data_to_selection_data): Use cons_to_unsigned.
10203 (x_fill_property_data): Use cons_to_signed.
10204 Report values out of range.
10205
d1f3d2af
PE
10206 Check for buffer and string overflow more precisely.
10207 * buffer.h (BUF_BYTES_MAX): New macro.
10208 * lisp.h (STRING_BYTES_MAX): New macro.
10209 * alloc.c (Fmake_string):
10210 * character.c (string_escape_byte8):
10211 * coding.c (coding_alloc_by_realloc):
10212 * doprnt.c (doprnt):
10213 * editfns.c (Fformat):
10214 * eval.c (verror):
10215 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
10216 since they may not be the same number.
10217 * editfns.c (Finsert_char):
10218 * fileio.c (Finsert_file_contents):
10219 Likewise for BUF_BYTES_MAX.
10220
dd52fcea
PE
10221 * image.c: Use ptrdiff_t, not int, for sizes.
10222 (slurp_file): Switch from int to ptrdiff_t.
10223 All uses changed.
10224 (slurp_file): Check that file size fits in both size_t (for
10225 malloc) and ptrdiff_t (for sanity and safety).
10226
7f9bbdbb
PE
10227 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
10228 if b->modtime has its maximal value.
10229
dfe18f82
PE
10230 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
10231
84acfcf0
PE
10232 Don't assume time_t can fit into int.
10233 * buffer.h (struct buffer.modtime): Now time_t, not int.
10234 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
10235 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
10236
ccd9a01a
PE
10237 Minor fixes for signed vs unsigned integers.
10238 * character.h (MAYBE_UNIFY_CHAR):
10239 * charset.c (maybe_unify_char):
10240 * keyboard.c (read_char, reorder_modifiers):
10241 XINT -> XFASTINT, since the integer must be nonnegative.
10242 * ftfont.c (ftfont_spec_pattern):
10243 * keymap.c (access_keymap, silly_event_symbol_error):
10244 XUINT -> XFASTINT, since the integer must be nonnegative.
10245 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
10246 since it makes no difference and we prefer signed.
10247 * keyboard.c (record_char): Use XUINT when all the neighbors do.
10248 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
10249 nonnegative.
10250
d6d100dd
SM
102512011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
10252
10253 * window.h (Fwindow_frame): Declare.
10254
2b6148e4
PE
102552011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10256
10257 * alloc.c: Simplify handling of large-request failures (Bug#8800).
10258 (SPARE_MEMORY): Always define.
10259 (LARGE_REQUEST): Remove.
10260 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
10261
f230ecc9
MR
102622011-06-06 Martin Rudalics <rudalics@gmx.at>
10263
727e958e
MR
10264 * lisp.h: Move EXFUNS for Fframe_root_window,
10265 Fframe_first_window and Fset_frame_selected_window to window.h.
10266
10267 * window.h: Move EXFUNS for Fframe_root_window,
10268 Fframe_first_window and Fset_frame_selected_window here from
10269 lisp.h.
10270
10271 * frame.c (Fwindow_frame, Fframe_first_window)
10272 (Fframe_root_window, Fframe_selected_window)
10273 (Fset_frame_selected_window): Move to window.c.
10274 (Factive_minibuffer_window): Move to minibuf.c.
10275 (Fother_visible_frames_p): New function.
10276
10277 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
10278
f230ecc9
MR
10279 * window.c (decode_window, decode_any_window): Move up in code.
10280 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
10281 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
10282 (Fwindow_buffer): Move up and rewrite doc-string.
10283 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
10284 (Fwindow_prev): New functions.
727e958e
MR
10285 (Fwindow_frame): Move here from frame.c. Accept any window as
10286 argument.
10287 (Fframe_root_window, Fframe_first_window)
10288 (Fframe_selected_window): Move here from frame.c. Accept frame
10289 or arbitrary window as argument. Update doc-strings.
10290 (Fminibuffer_window): Move up in code.
10291 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
10292 (Fset_frame_selected_window): Move here from frame.c.
10293 Marginal rewrite.
727e958e
MR
10294 (Fselected_window, select_window, Fselect_window): Move up in
10295 code. Minor doc-string fixes.
f230ecc9 10296
4d09bcf6
PE
102972011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10298
10299 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
10300 Do not assume that spare memory exists; that assumption is valid
10301 only if SYSTEM_MALLOC.
10302 (LARGE_REQUEST): New macro, so that the issue of large requests
10303 is separated from the issue of spare memory.
10304
810928a2
AS
103052011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10306
172418ad
AS
10307 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
10308 format. (Bug#8806)
10309
43f862f7
AS
10310 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
10311
810928a2
AS
10312 * xfns.c (x_set_scroll_bar_default_width): Move declarations
10313 before statements.
10314
a059fe24
JD
103152011-06-05 Jan Djärv <jan.h.d@swipnet.se>
10316
10317 * gtkutil.c (xg_get_default_scrollbar_width): New function.
10318
10319 * gtkutil.h: Declare xg_get_default_scrollbar_width.
10320
10321 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
10322 min width by calling x_set_scroll_bar_default_width (Bug#8505).
10323
989bf368
JB
103242011-06-05 Juanma Barranquero <lekktu@gmail.com>
10325
10326 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
10327
4b80f674
CY
103282011-06-04 Chong Yidong <cyd@stupidchicken.com>
10329
10330 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
10331 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
10332 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
10333 New error handlers.
4b80f674
CY
10334 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
10335 Obey Vx_select_enable_clipboard_manager. Catch errors in
10336 x_clipboard_manager_save (Bug#8779).
10337 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 10338 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 10339
99a33b77 103402011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
10341
10342 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
10343
99a33b77 103442011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
10345
10346 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
10347 in the current matrix if keep_current_p is non-zero.
10348
8264569d
EZ
103492011-06-04 Eli Zaretskii <eliz@gnu.org>
10350
10351 * bidi.c (bidi_level_of_next_char): Fix last change.
10352
57f97249
EZ
103532011-06-03 Eli Zaretskii <eliz@gnu.org>
10354
fec2107c 10355 Support bidi reordering of text covered by display properties.
57f97249 10356
fec2107c
EZ
10357 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
10358 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
10359 (bidi_cache_search, bidi_cache_iterator_state)
10360 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
10361 (bidi_level_of_next_char, bidi_move_to_visually_next):
10362 Support character positions inside a run of characters covered by a
fec2107c
EZ
10363 display string.
10364 (bidi_paragraph_init, bidi_resolve_explicit_1)
10365 (bidi_level_of_next_char): Call bidi_fetch_char and
10366 bidi_fetch_char_advance instead of FETCH_CHAR and
10367 FETCH_CHAR_ADVANCE.
10368 (bidi_init_it): Initialize new members.
10369 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
10370 definitions.
10371 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
10372 instead of using explicit *_CHAR codes.
d6d100dd
SM
10373 (bidi_resolve_explicit, bidi_resolve_weak):
10374 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
10375 bidirectional text is supported only in multibyte buffers.
10376 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
10377 it to initialize the frame_window_p member of struct bidi_it.
10378 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
10379 (bidi_resolve_explicit, bidi_resolve_weak)
10380 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
10381 bidi_it->nchars is non-positive.
10382 (bidi_level_of_next_char): Don't try to lookup the cache for the
10383 next/previous character if nothing is cached there yet, or if we
10384 were just reseat()'ed to a new position.
c40e2fb2 10385
0e14fe90
EZ
10386 * xdisp.c (set_cursor_from_row): Set start and stop points
10387 according to the row's direction when priming the loop that looks
10388 for the glyph on which to display cursor.
10389 (single_display_spec_intangible_p): Function deleted.
10390 (display_prop_intangible_p): Reimplement to call
10391 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
10392 Accept 3 additional arguments needed by handle_display_spec.
10393 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
10394 values: lists, `(when COND...)' forms, etc.
10395 (single_display_spec_string_p): Support property values that are
10396 lists with the argument STRING its top-level element.
10397 (display_prop_string_p): Fix the condition for processing a
10398 property that is a list to be consistent with handle_display_spec.
fec2107c 10399 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
10400 last portion of handle_display_prop.
10401 (compute_display_string_pos): Accept additional argument
10402 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
10403 value of a `display' property is a "replacing spec".
10404 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
10405 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
10406 the display property, but just return a value indicating whether
10407 the display property will replace the characters it covers.
10408 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
10409 frame_window_p members of struct bidi_it.
d6d100dd
SM
10410 (compute_display_string_pos, compute_display_string_end):
10411 New functions.
fec2107c
EZ
10412 (push_it): Accept second argument POSITION, where pop_it should
10413 jump to continue iteration.
10414 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 10415
fec2107c
EZ
10416 * keyboard.c (adjust_point_for_property): Adjust the call to
10417 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
10418
10419 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
10420 (bidi_init_it): Update prototypes.
10421 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
10422 (compute_display_string_pos, compute_display_string_end):
10423 Declare prototypes.
fec2107c
EZ
10424 (struct bidi_it): New members nchars and disp_pos. ch_len is now
10425 EMACS_INT.
fc6f18ce 10426
40087514 104272011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 10428
57f53182
PE
10429 Malloc failure behavior now depends on size of allocation.
10430 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10431 * lisp.h: Change signatures accordingly.
10432 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10433 All callers changed. (Bug#8762)
10434
10435 * gnutls.c: Use Emacs's memory allocators.
10436 Without this change, the gnutls library would invoke malloc etc.
10437 directly, which causes problems on non-SYNC_INPUT hosts, and which
10438 runs afoul of improving memory_full behavior. (Bug#8761)
10439 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10440 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10441 xfree instead of the default malloc, realloc, free.
10442 (Fgnutls_boot): No need to check for memory allocation failure,
10443 since xmalloc does that for us.
10444
ac32cd99 10445 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
10446 * category.c (hash_get_category_set):
10447 * ccl.c (ccl_driver):
10448 * charset.c (Fdefine_charset_internal):
10449 * charset.h (struct charset.hash_index):
10450 * composite.c (get_composition_id, gstring_lookup_cache)
10451 (composition_gstring_put_cache):
10452 * composite.h (struct composition.hash_index):
10453 * dispextern.h (struct image.hash):
10454 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10455 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10456 (hashfn_equal, hashfn_user_defined, make_hash_table)
10457 (maybe_resize_hash_table, hash_lookup, hash_put)
10458 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10459 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10460 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10461 * image.c (make_image, search_image_cache, lookup_image)
10462 (xpm_put_color_table_h):
10463 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 10464 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 10465 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 10466 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
10467 * alloc.c (allocate_vectorlike):
10468 Check for overflow in vector size calculations.
10469 * ccl.c (ccl_driver):
10470 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
10471 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10472 need to be updated by these changes.
40087514
PE
10473 * fns.c (make_hash_table, maybe_resize_hash_table):
10474 Check for integer overflow with large hash tables.
0de4bb68
PE
10475 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10476 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10477 (SXHASH_REDUCE): New macro.
10478 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10479 Use it instead of discarding useful hash info with large hash values.
10480 (sxhash_float): New function.
10481 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10482 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
10483 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10484 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
10485 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10486 Adjust signatures to match updated version of code.
10487 (consing_since_gc): Now EMACS_INT, since a single hash table can
10488 use more than INT_MAX bytes.
10489
698d32e2
DN
104902011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10491
10492 Make it possible to build with GCC-4.6+ -O2 -flto.
10493
10494 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10495
fd6fa53f
SM
104962011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10497
10498 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10499 Call minibuffer-inactive-mode.
10500
864db017
JB
105012011-05-31 Juanma Barranquero <lekktu@gmail.com>
10502
10503 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10504 Update dependencies.
10505
2ad0baf4
DN
105062011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10507
10508 * data.c (init_data): Remove code for UTS, this system is not
10509 supported anymore.
10510
4fcc2638
DN
105112011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10512
10513 Don't force ./temacs to start in terminal mode.
10514
10515 * frame.c (make_initial_frame): Initialize faces in all cases, not
10516 only when CANNOT_DUMP is defined.
10517 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
10518
c56e0fd5
DN
105192011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10520
10521 * dispnew.c (add_window_display_history): Use const for the string
10522 pointer. Remove declaration, not needed.
10523
333d54da 105242011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10525
55d4c1b2 10526 Use 'inline', not 'INLINE'.
333d54da 10527 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10528 * alloc.c, fontset.c (INLINE): Remove.
10529 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10530 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10531 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10532 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10533 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10534
738db178
DN
105352011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10536
10537 Make it possible to run ./temacs.
10538
10539 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10540 syms_of_callproc does the same thing. Remove test for
10541 "initialized", do it in the caller.
10542 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10543
620c53a6
SM
105442011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10545
10546 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10547 (read_minibuf): Use get_minibuffer.
10548 (syms_of_minibuf): Use DEFSYM.
10549 (Qmetadata): New var.
10550 * data.c (Qbuffer): Don't make it static.
10551 (syms_of_data): Use DEFSYM.
10552
e003a292
PE
105532011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10554
10555 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10556 (CCL_CODE_MIN): New macro.
10557
ed008a6d
PE
105582011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10559
3687c2ef
PE
10560 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10561
ed008a6d
PE
10562 * eval.c (Qdebug): Now static.
10563 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10564 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10565 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10566
d66c4c7c
CY
105672011-05-29 Chong Yidong <cyd@stupidchicken.com>
10568
10569 * image.c: Various fixes to ImageMagick code comments.
10570 (Fimagemagick_types): Doc fix.
10571
5fbc2025
PE
105722011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10573
0196f88a
PE
10574 Minor fixes prompted by GCC 4.6.0 warnings.
10575
10576 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10577
5fbc2025
PE
10578 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10579 (x_clipboard_manager_save_all): Move extern decl to ...
10580 * xterm.h: ... here, so that it can be checked for consistency.
10581
1dd3c2d9
CY
105822011-05-29 Chong Yidong <cyd@stupidchicken.com>
10583
10584 * xselect.c (x_clipboard_manager_save_frame)
10585 (x_clipboard_manager_save_all): New functions.
10586 (Fx_clipboard_manager_save): Lisp function deleted.
10587
10588 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10589 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10590
10591 * xterm.h: Update prototype.
10592
5ba6571d
WX
105932011-05-28 William Xu <william.xwl@gmail.com>
10594
10595 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10596 exiting (Bug#8239).
10597
3eaff834
JM
105982011-05-28 Jim Meyering <meyering@redhat.com>
10599
e1900994 10600 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10601 * fns.c (to_uchar): Define.
10602 (crypto_hash_function): Use it to convert some newly-signed
10603 variables to unsigned, to avoid sign-extension bugs. For example,
10604 without this change, (md5 "truc") would evaluate to
10605 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10606 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10607 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10608
0f6990a7
PE
106092011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10610
10611 Integer overflow fixes.
c8a9ca5a 10612
08686060
PE
10613 * dbusbind.c: Serial number integer overflow fixes.
10614 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10615 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10616 to hold a serial number that is too large for a fixnum.
10617 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10618 Check for serial numbers out of range. Decode any serial number
59568bf0 10619 that was so large that it became a float. (Bug#8722)
08686060 10620
2d1fc3c7
PE
10621 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10622 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10623 Use XFASTINT rather than XUINT when numbers are nonnegative.
10624 (xd_append_arg, Fdbus_method_return_internal):
10625 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10626 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10627 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10628 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10629 (Bug#8722)
2d1fc3c7 10630
c8a9ca5a
PE
10631 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10632
519e1d69
PE
10633 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10634
6df6ae42 10635 ccl: Add integer overflow checks.
30569699
PE
10636 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10637 (IN_INT_RANGE): New macros.
10638 (ccl_driver): Use them to check for integer overflow when
10639 decoding a CCL program. Many of the new checks are whether XINT (x)
10640 fits in int; it doesn't always, on 64-bit hosts. The new version
10641 doesn't catch all possible integer overflows, but it's an
847044ea 10642 improvement. (Bug#8719)
30569699 10643
c11285dc
PE
10644 * alloc.c (make_event_array): Use XINT, not XUINT.
10645 There's no need for unsigned here.
10646
fdccd48e
PE
10647 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10648 This follows up to the 2011-05-06 change that substituted uintptr_t
10649 for EMACS_INT. This case wasn't caught back then.
10650
37910ab2
PE
10651 Rework Fformat to avoid integer overflow issues.
10652 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10653 now (part of C89). Include <verify.h>.
10654 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10655 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10656 (Fformat): Avoid the prepass trying to compute sizes; it was only
10657 approximate and thus did not catch overflow reliably. Instead, walk
10658 through the format just once, formatting and computing sizes as we go,
10659 checking for integer overflow at every step, and allocating a larger
10660 buffer as needed. Keep track separately whether the format is
10661 multibyte. Keep only the most-recently calculated precision, rather
10662 than them all. Record whether each argument has been converted to
10663 string. Use EMACS_INT, not int, for byte and char and arg counts.
10664 Support field widths and precisions larger than INT_MAX. Avoid
10665 sprintf's undefined behavior with conversion specifications such as %#d
10666 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10667 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10668 formatting out-of-range floating point numbers with int
9173deec 10669 formats. (Bug#8668)
37910ab2 10670
2e6578fb
PE
10671 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10672
0ae6bdee
PE
10673 * data.c: Avoid integer truncation in expressions involving floats.
10674 * data.c: Include <intprops.h>.
10675 (arith_driver): When there's an integer overflow in an expression
10676 involving floating point, convert the integers to floating point
10677 so that the resulting value does not suffer from catastrophic
10678 integer truncation. For example, on a 64-bit host (* 4
10679 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10680 Do not rely on undefined behavior after integer overflow.
10681
de883a70
PE
10682 merge count_size_as_multibyte, parse_str_to_multibyte
10683 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10684 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10685 Check for integer overflow.
10686 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10687 since it's now a duplicate of the other. This is more of
10688 a character than a buffer op, so better that it's in character.c.
10689 * fns.c, print.c: Adjust to above changes.
10690
2ff916cb
PE
106912011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10692
10693 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10694
f1b54466
PE
106952011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10696
fb1ac845
PE
10697 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10698 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10699 (x_clipboard_manager_save): Now static.
10700 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10701
f1b54466
PE
10702 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10703 (crypto_hash_function): Now static.
10704 Fix pointer signedness problems. Avoid unnecessary initializations.
10705
a9f737ee
CY
107062011-05-27 Chong Yidong <cyd@stupidchicken.com>
10707
10708 * termhooks.h (Vselection_alist): Make it terminal-local.
10709
10710 * terminal.c (create_terminal): Initialize it.
10711
10712 * xselect.c: Support for clipboard managers.
10713 (Vselection_alist): Move to termhooks.h as terminal-local var.
10714 (LOCAL_SELECTION): New macro.
10715 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10716 (symbol_to_x_atom): Remove gratuitous arg.
10717 (x_handle_selection_request, lisp_data_to_selection_data)
10718 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10719 (x_own_selection, x_get_local_selection, x_convert_selection):
10720 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10721 (some_frame_on_display): Delete unused function.
10722 (Fx_own_selection_internal, Fx_get_selection_internal)
10723 (Fx_disown_selection_internal, Fx_selection_owner_p)
10724 (Fx_selection_exists_p): New optional frame arg.
10725 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10726 (x_handle_selection_clear): Don't treat other terminals with the
10727 same keyboard specially. Use the terminal-local Vselection_alist.
10728 (x_clear_frame_selections): Use Frun_hook_with_args.
10729
10730 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10731
10732 * xterm.h: Add support for those atoms.
10733
e067f0c1
CY
107342011-05-26 Chong Yidong <cyd@stupidchicken.com>
10735
10736 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10737 (converted_selections, conversion_fail_tag): New global variables.
10738 (x_selection_request_lisp_error): Free the above.
10739 (x_get_local_selection): Remove unnecessary code.
10740 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10741 of converted selections stored in converted_selections.
10742 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10743 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10744 (x_convert_selection): New function.
10745 (x_handle_selection_event): Simplify.
10746 (x_get_foreign_selection): Don't ignore incoming requests while
10747 waiting for an answer; this will fail when we implement
10748 SAVE_TARGETS, and seems unnecessary anyway.
10749 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10750 (Vx_sent_selection_functions): Doc fix.
10751
0f4aebc0
LL
107522011-05-26 Leo Liu <sdl.web@gmail.com>
10753
10754 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10755
e61124cd
YM
107562011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10757
10758 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10759
10760 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10761 for fringe update if it has periodic bitmap.
ac389d0c 10762 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10763 and fringe_bitmap_periodic_p.
10764
10765 * fringe.c (get_fringe_bitmap_data): New function.
10766 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10767 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10768 row. Mark glyph row for fringe update if periodicity changed.
10769
10770 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10771 for fringe update unless it has periodic bitmap.
10772
f16d9837
KH
107732011-05-25 Kenichi Handa <handa@m17n.org>
10774
10775 * xdisp.c (get_next_display_element): Set correct it->face_id for
10776 a static composition.
10777
e1b90ef6
LL
107782011-05-24 Leo Liu <sdl.web@gmail.com>
10779
10780 * deps.mk (fns.o):
10781 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10782
10783 * fns.c (crypto_hash_function, Fsha1): New function.
10784 (Fmd5): Use crypto_hash_function.
10785 (syms_of_fns): Add Ssha1.
10786
7400048f
PE
107872011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10788
10789 * gnutls.c: Remove unused macros.
10790 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10791 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10792 Remove macros that are defined and never used.
10793 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10794
abb71cf4
CY
107952011-05-22 Chong Yidong <cyd@stupidchicken.com>
10796
10797 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10798 (Fx_get_selection_internal): Minor cleanup.
10799 (Fx_own_selection_internal): Rename arguments for consistency with
10800 select.el.
10801
6307db39
PE
108022011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10803
10804 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10805
f3d4e0a4
CY
108062011-05-22 Chong Yidong <cyd@stupidchicken.com>
10807
10808 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10809
4d8ade89
YM
108102011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10811
10812 * dispnew.c (scrolling_window): Don't exclude the case that the
10813 last enabled row in the desired matrix touches the bottom boundary.
10814
32078c8d
GM
108152011-05-21 Glenn Morris <rgm@gnu.org>
10816
10817 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10818 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10819 and add some more files.
32078c8d 10820
7285dc67
EZ
108212011-05-20 Eli Zaretskii <eliz@gnu.org>
10822
10823 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10824 report_file_error introduced by the change from 2011-05-07.
10825
89d1bd22
PE
108262011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10827
10828 * systime.h (Time): Define only if emacs is defined.
10829 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10830 where the include path doesn't have X11/X.h by default. See
10831 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10832
cd394be1 108332011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10834
10835 * composite.c (find_automatic_composition): Fix previous change.
10836
b9704ad9
GM
108372011-05-20 Glenn Morris <rgm@gnu.org>
10838
10839 * lisp.mk: New file, split from Makefile.in.
10840 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10841 (shortlisp): Remove.
10842 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10843
4a720484
GM
108442011-05-19 Glenn Morris <rgm@gnu.org>
10845
10846 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10847 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10848 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10849 (lisp): Set the order to that of loadup.el.
10850 (shortlisp): Make it a copy of $lisp.
10851 (SOME_MACHINE_LISP): Remove.
10852 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10853 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10854
a28d4396
KH
108552011-05-18 Kenichi Handa <handa@m17n.org>
10856
10857 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10858 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10859 (find_automatic_composition): Mostly rewrite for efficiency.
10860
a2b1fa8e
JB
108612011-05-18 Juanma Barranquero <lekktu@gmail.com>
10862
10863 * makefile.w32-in: Update dependencies.
10864
8e1f5610
CS
108652011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10866
10867 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10868 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10869
7025ee00 108702011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10871
cdfa6eab
PE
10872 Fix some integer overflow issues, such as string length overflow.
10873
06d6db33
PE
10874 * insdel.c (count_size_as_multibyte): Check for string overflow.
10875
2b4560a8
PE
10876 * character.c (lisp_string_width): Check for string overflow.
10877 Use EMACS_INT, not int, for string indexes and lengths; in
10878 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10879 the resulting string length overflows an EMACS_INT; instead,
10880 report a string overflow if no precision given. When checking for
10881 precision exhaustion, use a check that cannot possibly have
10882 integer overflow. (Bug#8675)
10883 * character.h (lisp_string_width): Adjust to new signature.
10884
cb93f9be
PE
10885 * alloc.c (string_overflow): New function.
10886 (Fmake_string): Use it. This doesn't change behavior, but saves
10887 a few bytes and will simplify future changes.
10888 * character.c (string_escape_byte8): Likewise.
10889 * lisp.h (string_overflow): New decl.
10890
1a1f3366
PE
10891 Fixups, following up to the user-interface timestamp change.
10892 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10893 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10894 * msdos.c (mouse_get_pos): Likewise.
10895 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10896 * w32gui.h (Time): Define by including "systime.h" rather than by
10897 declaring it ourselves. (Bug#8664)
10898
d4e3e4d3
PE
10899 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10900 * image.c (clear_image_cache): Likewise.
10901
f6a24d19
PE
10902 * term.c (term_mouse_position): Don't assume time_t wraparound.
10903
08dc5ae6
PE
10904 Be more systematic about user-interface timestamps.
10905 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10906 and sometimes 'EMACS_UINT', to represent these timestamps.
10907 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10908 This makes the code easier to follow, and makes it easier to catch
10909 integer overflow bugs such as Bug#8664.
10910 * frame.c (Fmouse_position, Fmouse_pixel_position):
10911 Use Time, not unsigned long, for user-interface timestamps.
10912 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10913 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10914 * keyboard.h (last_event_timestamp): Likewise.
10915 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10916 * menu.h (xmenu_show): Likewise.
10917 * term.c (term_mouse_position): Likewise.
10918 * termhooks.h (struct input_event.timestamp): Likewise.
10919 (struct terminal.mouse_position_hook): Likewise.
10920 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10921 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10922 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10923 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10924 what it was before.
10925 * menu.h, termhooks.h: Include "systime.h", for Time.
10926
8e55734a
PE
10927 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10928 Don't assume that the difference between two unsigned long values
10929 can fit into an integer. At this point, we know button_down_time
10930 <= event->timestamp, so the difference must be nonnegative, so
10931 there's no need to cast the result if double-click-time is
10932 nonnegative, as it should be; check that it's nonnegative, just in
10933 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10934 apart (about 25 days). (Bug#8664)
8e55734a 10935
841f1b75 10936 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10937 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10938
3e26f69c
PE
10939 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10940 that always fit in int. Use a sentinel instead of a counter, to
10941 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10942 * frame.h (struct frame): Use int for menu_bar_items_used
10943 instead of EMACS_INT, since it always fits in int.
3e26f69c 10944
5cc152c0
PE
10945 * menu.c (grow_menu_items): Check for int overflow.
10946
d89eb65e
PE
10947 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10948
5235bd3e
PE
10949 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10950 Before, the code was not consistent. These values cannot exceed
10951 2**31 - 1 so there's no need to make them unsigned.
10952 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10953 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10954 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10955 as modifiers.
10956 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10957
bc827e23
PE
10958 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10959 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10960 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10961 presumably because the widths might not match.
10962
78eb494e
PE
10963 * window.c (size_window): Avoid needless test at loop start.
10964
04f2d78b
CB
109652011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10966
10967 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10968
d2fc7e3d 109692011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10970
10971 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10972
d2fc7e3d 109732011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10974
10975 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10976 `width' to `bar_area_x' and `bar_area_width', respectively.
10977 (x_scroll_run): Take account of fringe background extension.
10978
04f2d78b
CB
10979 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10980 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10981 `bar_area_width', respectively.
10982 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10983 background extension.
10984
79b70037
GM
109852011-05-10 Jim Meyering <meyering@redhat.com>
10986
10987 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10988
2f142cc5
JB
109892011-05-10 Juanma Barranquero <lekktu@gmail.com>
10990
10991 * image.c (Finit_image_library): Return t for built-in image types,
10992 like pbm and xbm. (Bug#8640)
10993
57679c86
AS
109942011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10995
10996 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10997
888c9e86
EZ
109982011-05-07 Eli Zaretskii <eliz@gnu.org>
10999
b0512a1d
EZ
11000 * w32console.c (Fset_screen_color): Doc fix.
11001 (Fget_screen_color): New function.
11002 (syms_of_ntterm): Defsubr it.
11003
7285dc67
EZ
11004 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11005 unlink the temporary file if Fcall_process didn't create it in the
11006 first place.
11007 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11008 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
11009 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11010 cue to call_process_cleanup not to close that handle.
11011
4d3fcc8e
BK
110122011-05-07 Ben Key <bkey76@gmail.com>
11013
11014 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11015 one of two shell specific rules, either bootstrap-temacs-CMD or
11016 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11017 to the previous implementation of the bootstrap-temacs rule.
11018 The bootstrap-temacs-CMD rule is similar to the previous
11019 implementation of the bootstrap-temacs rule except that it
11020 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11021 variable.
11022
11023 These changes, along with some changes to nt/configure.bat,
11024 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11025 earlier fix to add support for --cflags and --ldflags options
11026 that include quotes so that it works whether make uses cmd or
11027 sh as the shell.
11028
b4289b64
MA
110292011-05-06 Michael Albinus <michael.albinus@gmx.de>
11030
11031 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11032 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11033 is a constant.
11034 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11035 a string. Handle both cases.
11036 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11037 (Fdbus_register_method): Use Qinvalid_function.
11038
af4c0e28
JB
110392011-05-06 Juanma Barranquero <lekktu@gmail.com>
11040
11041 * makefile.w32-in: Update dependencies.
11042 (LISP_H): Add inttypes.h and stdin.h.
11043 (PROCESS_H): Add unistd.h.
11044
c51453d9
EZ
110452011-05-06 Eli Zaretskii <eliz@gnu.org>
11046
11047 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11048 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11049
8ff0ac3c 110502011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 11051
4c4b566b
PE
11052 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11053
aab2b9b5
PE
11054 * term.c (vfatal): Remove stray call to va_end.
11055 It's not needed and the C Standard doesn't allow it here anyway.
11056
c378da0b
PE
11057 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11058 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11059
288b08c7
PE
11060 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11061 bytes.
11062
e3601888
PE
11063 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11064
db6c0e74
PE
11065 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11066
dd5963ea
PE
11067 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11068
88c9450f
PE
11069 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11070
2f9442b8
PE
11071 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11072
c032b5f8
PE
11073 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11074 * charset.c (Fdefine_charset_internal): Don't initialize
11075 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 11076 32-bit int (Bug#8600).
a108c10b
PE
11077
11078 * lread.c (read_integer): Be more consistent with string-to-number.
11079 Use string_to_number to do the actual conversion; this avoids
11080 rounding errors and fixes some other screwups. Without this fix,
11081 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11082 (digit_to_number): Move earlier, for benefit of read_integer.
11083 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 11084 not a digit in any supported base. (Bug#8602)
a108c10b 11085
ad5f9eea
PE
11086 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11087
aec1708a
PE
11088 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11089 to match comment at start of function. This also removes a
11090 GCC warning about overflow in a 32+64-bit port.
11091
47be4ab5
PE
11092 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11093
371cac43
PE
11094 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11095 Reported by Stefan Monnier in
11096 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
11097 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11098 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 11099
d01a7826
PE
11100 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11101 (EMACS_UINTPTR): Likewise, with uintptr_t.
11102
7fd47d5c
PE
11103 * lisp.h: Prefer 64-bit EMACS_INT if available.
11104 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11105 on 32-bit hosts that have 64-bit int, so that they can access
11106 large files.
122b0c86
PE
11107 However, temporarily disable this change unless the temporary
11108 symbol WIDE_EMACS_INT is defined.
7fd47d5c 11109
8727937b
PE
11110 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11111
8ac068ac
PE
11112 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11113 This removes an assumption that EMACS_INT and long are the same
11114 width as pointers. The assumption is true for Emacs porting targets
11115 now, but we want to make other targets possible.
11116 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11117 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11118 In the rest of the code, change types of integers that hold casted
11119 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11120 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11121 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11122 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11123 No need to cast type when ORing.
11124 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
11125 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
11126 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
11127 assume EMACS_INT is the same width as char *.
11128 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
11129 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
11130 Remove no-longer-needed casts.
11131 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
11132 (xg_tool_bar_help_callback, xg_make_tool_item):
11133 Use EMACS_INTPTR to hold an integer
11134 that will be cast to void *; this can avoid a GCC warning
11135 if EMACS_INT is not the same width as void *.
11136 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
11137 * xdisp.c (display_echo_area_1, resize_mini_window_1):
11138 (current_message_1, set_message_1):
11139 Use a local to convert to proper width without a cast.
11140 * xmenu.c (dialog_selection_callback): Likewise.
11141
ede49d71
PE
11142 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
11143 Also, don't assume VALBITS / RAND_BITS is less than 5,
11144 and don't rely on undefined behavior when shifting a 1 left into
11145 the sign bit.
11146 * lisp.h (get_random): Change signature to match.
11147
2f30ecd0
PE
11148 * lread.c (hash_string): Use size_t, not int, for hash computation.
11149 Normally we prefer signed values; but hashing is special, because
11150 it's better to use unsigned division on hash table sizes so that
11151 the remainder is nonnegative. Also, size_t is the natural width
11152 for hashing into memory. The previous code used 'int', which doesn't
11153 retain enough info to hash well into very large tables.
11154 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
11155
2a866e7b
PE
11156 * dbusbind.c: Don't possibly lose pointer info when converting.
11157 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11158 Use XPNTR rather than XHASH, so that the high-order bits of
11159 the pointer aren't lost when converting through void *.
11160
51639eac
PE
11161 * eval.c (Fautoload): Don't double-shift a pointer.
11162
92394119
PE
11163 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
11164
dbdb9a7c
JB
111652011-05-06 Juanma Barranquero <lekktu@gmail.com>
11166
11167 * gnutls.c (DEF_GNUTLS_FN):
11168 * image.c (DEF_IMGLIB_FN): Make function pointers static.
11169
db7a0b4f
AS
111702011-05-05 Andreas Schwab <schwab@linux-m68k.org>
11171
11172 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
11173 marker. (Bug#8610)
11174
cd394be1 111752011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
11176
11177 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
11178 New version that can reserve upto 2GB of heap space.
11179
f7ff1b0f 111802011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
11181
11182 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
11183
639c109b
TZ
111842011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
11185
11186 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
11187 `gnutls_certificate_set_x509_key_file'.
11188
d2127135
JB
111892011-05-05 Juanma Barranquero <lekktu@gmail.com>
11190
11191 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
11192 Update dependencies.
11193
e968f4f3
JB
111942011-05-04 Juanma Barranquero <lekktu@gmail.com>
11195
11196 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
11197 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11198 Remove unused parameter `fildes'.
11199 * process.c (read_process_output, send_process): Don't pass it.
11200
84d358f0
JB
112012011-05-04 Juanma Barranquero <lekktu@gmail.com>
11202
11203 Fix previous change: the library cache is defined in w32.c.
11204 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
11205 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
11206
0898ca10
JB
112072011-05-04 Juanma Barranquero <lekktu@gmail.com>
11208
11209 Implement dynamic loading of GnuTLS on Windows.
11210
11211 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
11212 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
11213 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11214 Declare.
11215
11216 * gnutls.c (Qgnutls_dll): Define.
11217 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
11218 (gnutls_*): Declare function pointers.
11219 (init_gnutls_functions): New function to initialize function pointers.
11220 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
11221 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
11222 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11223 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
11224 (emacs_gnutls_write, emacs_gnutls_read)
11225 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
11226 (Fgnutls_available_p): New function.
11227 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
11228 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
11229 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
11230
11231 * image.c: Include w32.h.
11232 (Vimage_type_cache): Delete.
11233 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
11234 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
11235 (w32_delayed_load): Move to w32.c.
11236
11237 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
11238
11239 * w32.c (QCloaded_from, Vlibrary_cache): Define.
11240 (w32_delayed_load): Move from image.c. When loading a library, record
11241 its filename in the :loaded-from property of the library id.
11242 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
11243 Initialize and staticpro them.
11244 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
11245
11246 * process.c: Include lisp.h before w32.h, not after.
11247 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
11248 instead of gnutls_record_check_pending.
11249
11250 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
11251
ff4de4aa
TZ
112522011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
11253
11254 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
11255 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
11256 as passed in.
11257
abe95abb
JD
112582011-05-03 Jan Djärv <jan.h.d@swipnet.se>
11259
11260 * xterm.c (x_set_frame_alpha): Do not set property on anything
11261 else than FRAME_X_OUTER_WINDOW (Bug#8608).
11262
e16e55d4
JB
112632011-05-02 Juanma Barranquero <lekktu@gmail.com>
11264
11265 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
11266
bafcf6a5
JB
112672011-05-02 Juanma Barranquero <lekktu@gmail.com>
11268
11269 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
11270 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
11271 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
11272 (gnutls_global_initialized, Qgnutls_bootprop_priority)
11273 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
11274 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
11275 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
11276 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
11277 (Qgnutls_bootprop_callbacks_verify): Make static.
11278
e7a6747f
AS
112792011-05-01 Andreas Schwab <schwab@linux-m68k.org>
11280
19ed11ba
AS
11281 * callproc.c: Indentation fixup.
11282
e7a6747f 11283 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
11284 (wait_for_termination, interruptible_wait_for_termination):
11285 Move after wait_for_termination_1.
e7a6747f 11286
1ef14cb4
LMI
112872011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
11288
11289 * sysdep.c (interruptible_wait_for_termination): New function
11290 which is like wait_for_termination, but allows keyboard
11291 interruptions.
11292
11293 * callproc.c (Fcall_process): Add (:file "file") as an option for
11294 the STDOUT buffer.
11295 (Fcall_process_region): Ditto.
11296
330d880c
EZ
112972011-04-30 Eli Zaretskii <eliz@gnu.org>
11298
8db90b73
EZ
11299 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
11300 rather than `XVECTOR (FOO)->size'.
11301
330d880c
EZ
11302 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
11303 inttypes.h, as a gnulib replacement is used if it not available in
11304 system headers.
11305
15cbd324
EZ
113062011-04-21 Eli Zaretskii <eliz@gnu.org>
11307
11308 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
11309 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
11310 of MOST_POSITIVE_FIXNUM. (Bug#8528)
11311
11312 * coding.c (coding_alloc_by_realloc): Error out if destination
11313 will grow beyond MOST_POSITIVE_FIXNUM.
11314 (decode_coding_emacs_mule): Abort if there isn't enough place in
11315 charbuf for the composition carryover bytes. Reserve an extra
11316 space for up to 2 characters produced in a loop.
11317 (decode_coding_iso_2022): Abort if there isn't enough place in
11318 charbuf for the composition carryover bytes.
11319
113202011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 11321
ae940cca
EZ
11322 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
11323 aborting when %lld or %lll format is passed.
11324 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
11325 %llo or %llx format is passed. (Bug#8545)
11326
03ab8921
EZ
11327 * window.c (window_scroll_line_based): Use a marker instead of
11328 simple variables to record original value of point. (Bug#7952)
11329
afda1437
EZ
11330 * doprnt.c (doprnt): Fix the case where a multibyte sequence
11331 produced by %s or %c overflows available buffer space. (Bug#8545)
11332
f76dee0c
PE
113332011-04-28 Paul Eggert <eggert@cs.ucla.edu>
11334
11335 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 11336 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 11337
fdc5744d
JB
113382011-04-28 Juanma Barranquero <lekktu@gmail.com>
11339
11340 * w32.c (init_environment): Warn about defaulting HOME to C:\.
11341
638f053a
JB
113422011-04-28 Juanma Barranquero <lekktu@gmail.com>
11343
11344 * keyboard.c (Qdelayed_warnings_hook): Define.
11345 (command_loop_1): Run `delayed-warnings-hook'
11346 if Vdelayed_warnings_list is non-nil.
11347 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
11348 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
11349
d178f871
EZ
113502011-04-28 Eli Zaretskii <eliz@gnu.org>
11351
11352 * doprnt.c (doprnt): Don't return value smaller than the buffer
11353 size if the message was truncated. (Bug#8545).
11354
b124fd93
JB
113552011-04-28 Juanma Barranquero <lekktu@gmail.com>
11356
11357 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
11358 (Fx_window_property): #if-0 the whole functions, not just the bodies.
11359
e810457d
PE
113602011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11361
11362 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
11363
ea51cceb
JB
113642011-04-27 Juanma Barranquero <lekktu@gmail.com>
11365
11366 * makefile.w32-in: Update dependencies.
11367
94dcfacf
EZ
113682011-04-27 Eli Zaretskii <eliz@gnu.org>
11369
11370 Improve `doprnt' and its usage. (Bug#8545)
11371 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
11372 `format_end'. Remove support for %l as a conversion specifier.
11373 Don't use xrealloc. Improve diagnostics when the %l size modifier
11374 is used. Update the commentary.
11375
11376 * eval.c (verror): Simplify calculation of size_t.
11377
11378 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
11379 messages.
11380
f61f41d7
PE
113812011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
11382
11383 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
11384 change.
11385
96fb4434
PE
113862011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11387
11388 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
11389 This makes this file independent of the recent pseudovector change.
11390
671875da 113912011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 11392
69e9b5a3
PE
11393 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
11394
b5f869a7 11395 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 11396 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 11397 Remove unused local.
c8926152 11398 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 11399
841a1577 11400 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
11401 GCC 4.6.0 optimizes based on type-based alias analysis.
11402 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
11403 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
11404 != &v->size, and therefore "v->size = 1; b->size = 2; return
11405 v->size;" must therefore return 1. This assumption is incorrect
11406 for Emacs, since it type-puns struct Lisp_Vector * with many other
11407 types. To fix this problem, this patch adds a new type struct
f904488f 11408 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
11409 and pseudovectors, and helps optimizing compilers not get fooled
11410 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
11411 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
11412 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
11413 the size member.
eab3844f
PE
11414 (XSETPVECTYPE): Rewrite in terms of new macro.
11415 (XSETPVECTYPESIZE): New macro, specifying both type and size.
11416 This is a bit clearer, and further avoids the possibility of
11417 undesirable aliasing.
11418 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 11419 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
11420 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
11421 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
11422 (ASIZE): Now uses header.size rather than size.
11423 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
11424 to avoid the hassle of writing XVECTOR (foo)->header.size.
11425 (struct vectorlike_header): New type.
eab3844f
PE
11426 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
11427 object, to help avoid aliasing.
11428 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
11429 (SUBRP): Likewise, since Lisp_Subr is a special case.
11430 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11431 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11432 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 11433 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
11434 changed to be "header.size" and "header.next".
11435 * buffer.h (struct buffer): Likewise.
11436 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11437 * frame.h (struct frame): Likewise.
11438 * process.h (struct Lisp_Process): Likewise.
11439 * termhooks.h (struct terminal): Likewise.
11440 * window.c (struct save_window_data, struct saved_window): Likewise.
11441 * window.h (struct window): Likewise.
11442 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11443 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11444 * buffer.c (init_buffer_once): Likewise.
11445 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11446 special case.
11447 * process.c (Fformat_network_address): Use local var for size,
11448 for brevity.
11449
0df1eac5
PE
11450 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11451
847ab9d1 11452 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
11453 * data.c (atof): Remove decl; no longer used or needed.
11454 (digit_to_number): Move to lread.c.
11455 (Fstring_to_number): Use new string_to_number function, to be
11456 consistent with how the Lisp reader treats infinities and NaNs.
11457 Do not assume that floating-point numbers represent EMACS_INT
11458 without losing information; this is not true on most 64-bit hosts.
11459 Avoid double-rounding errors, by insisting on integers when
11460 parsing non-base-10 numbers, as the documentation specifies.
11461 * lisp.h (string_to_number): New decl, replacing ...
11462 (isfloat_string): Remove.
bc0a5c13 11463 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 11464 (read1): Do not accept +. and -. as integers; this
452f4150
PE
11465 appears to have been a coding error. Similarly, do not accept
11466 strings like +-1e0 as floating point numbers. Do not report
11467 overflow for integer overflows unless the base is not 10 which
11468 means we have no simple and reliable way to continue.
11469 Break out the floating-point parsing into a new
11470 function string_to_number, so that Fstring_to_number parses
11471 floating point numbers consistently with the Lisp reader.
04f2d78b 11472 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
11473 (E_CHAR, EXP_INT): Remove, replacing with ...
11474 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11475 (string_to_number): New function, replacing isfloat_string.
11476 This function checks for valid syntax and produces the resulting
11477 Lisp float number too. Rework it so that string-to-number
bc0a5c13 11478 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
11479 so that overflow for non-base-10 numbers is reported only when
11480 there's no portable and simple way to convert to floating point.
452f4150 11481
67769ffc
PE
11482 * textprop.c (set_text_properties_1): Rewrite for clarity,
11483 and to avoid GCC warning about integer overflow.
11484
c20db43f
PE
11485 * intervals.h (struct interval): Use EMACS_INT for members
11486 where EMACS_UINT might cause problems. See
11487 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11488 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11489 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11490 All uses changed.
37aa2f85
PE
11491 (offset_intervals): Tell GCC not to worry about length overflow
11492 when negating a negative length.
c20db43f 11493
2538aa2f
PE
11494 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11495 (overrun_check_free): Likewise.
11496
f2d3008d
PE
11497 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11498 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11499 word size.
11500
ec8df744
PE
11501 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11502 (gnutls_make_error): Rename local to avoid shadowing.
11503 (gnutls_emacs_global_deinit): ifdef out; not used.
11504 (Fgnutls_boot): Use const for pointer to readonly storage.
11505 Comment out unused local. Fix pointer signedness problems.
11506
640ee02d
PE
11507 * lread.c (openp): Don't stuff size_t into an 'int'.
11508 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11509 about possible signed overflow.
11510
6048fb2a
PE
11511 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11512 (GDK_KEY_g): Don't define if already defined.
11513 (xg_prepare_tooltip): Avoid pointer signedness problem.
11514 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
11515
fa3c87e1
PE
11516 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
11517 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
11518
2172544b
PE
11519 * xfns.c (Fx_window_property): Simplify a bit,
11520 to make a bit faster and to avoid GCC 4.6.0 warning.
11521 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11522
9b821a21
PE
11523 * fns.c (internal_equal): Don't assume size_t fits in int.
11524
3c616cfa
PE
11525 * alloc.c (compact_small_strings): Tighten assertion a little.
11526
c2982e87
PE
11527 Replace pEd with more-general pI, and fix some printf arg casts.
11528 * lisp.h (pI): New macro, generalizing old pEd macro to other
11529 conversion specifiers. For example, use "...%"pI"d..." rather
11530 than "...%"pEd"...".
11531 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11532 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11533 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11534 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11535 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11536 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11537 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11538 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11539 64-bit hosts.
11540 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11541 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11542 * print.c (safe_debug_print, print_object): Likewise.
11543 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11544 to int.
6f04d126
PE
11545 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11546 avoiding the 0 flag, which is not portable.
c2982e87
PE
11547 * process.c (Fmake_network_process): Use pI to avoid cast.
11548 * region-cache.c (pp_cache): Likewise.
11549 * xdisp.c (decode_mode_spec): Likewise.
11550 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11551 behavior on 64-bit hosts with printf arg.
6f04d126 11552 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11553 (x_stop_queuing_selection_requests): Likewise.
11554 (x_get_window_property): Don't truncate byte count to an 'int'
11555 when tracing.
0b432f21 11556
5e073ec7
PE
11557 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11558 here, since it parses constructs like leading '-' and spaces,
11559 which are not wanted; and it overflows with large numbers.
11560 Instead, simply match F[0-9]+, which is what is wanted anyway.
11561
36372bf9
PE
11562 * alloc.c: Remove unportable assumptions about struct layout.
11563 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11564 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11565 (allocate_vectorlike, make_pure_vector): Use the new macros,
11566 plus offsetof, to remove unportable assumptions about struct layout.
11567 These assumptions hold on all porting targets that I know of, but
11568 they are not guaranteed, they're easy to remove, and removing them
11569 makes further changes easier.
11570
0b432f21
PE
11571 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11572 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11573 (string_overrun_cookie): Now const. Use initializers that
11574 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11575 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11576 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11577 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11578 multiple of sizeof (EMACS_INT); it need not be, if
11579 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11580 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11581
895009e1
JB
115822011-04-26 Juanma Barranquero <lekktu@gmail.com>
11583
11584 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11585
6a7a1b0b
TZ
115862011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11587
11588 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11589 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11590 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11591
841a1577 115922011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11593
11594 * lisp.h (Qdebug): List symbol.
895009e1 11595 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11596 * keyboard.c (debug-on-event): New variable.
11597 (handle_user_signal): Break into debugger when debug-on-event
11598 matches the current signal symbol.
11599
f2d3ba6f
DN
116002011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11601
11602 * alloc.c (check_sblock, check_string_bytes)
11603 (check_string_free_list): Convert to standard C.
11604
42ce4c63
TZ
116052011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11606
11607 * w32.c (emacs_gnutls_push): Fix typo.
11608
825cd63c
EZ
116092011-04-25 Eli Zaretskii <eliz@gnu.org>
11610
fb11d64d
EZ
11611 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11612 "cast to pointer from integer of different size".
11613
825cd63c
EZ
11614 Improve doprnt and its use in verror. (Bug#8545)
11615 * doprnt.c (doprnt): Document the set of format control sequences
11616 supported by the function. Use SAFE_ALLOCA instead of always
11617 using `alloca'.
11618
11619 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11620 is one byte too soon. Don't use xrealloc; instead xfree and
11621 xmalloc anew.
11622
e061a11b
TZ
116232011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11624
11625 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11626 callbacks stage.
11627
11628 * gnutls.c: Renamed global_initialized to
11629 gnutls_global_initialized. Added internals for the
11630 :verify-hostname-error, :verify-error, and :verify-flags
11631 parameters of `gnutls-boot' and documented those parameters in the
11632 docstring. Start callback support.
9173deec
JB
11633 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11634 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11635 on error. Return error code.
e061a11b
TZ
11636 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11637 (emacs_gnutls_read): Likewise.
11638 (Fgnutls_boot): Return handshake error code.
11639 (emacs_gnutls_handle_error): New function.
11640 (wsaerror_to_errno): Likewise.
11641
11642 * w32.h (emacs_gnutls_pull): Add prototype.
11643 (emacs_gnutls_push): Likewise.
11644
11645 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11646 (emacs_gnutls_push): Likewise.
11647
116482011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11649
11650 * process.c (wait_reading_process_output): Check if GnuTLS
11651 buffered some data internally if no FDs are set for TLS
11652 connections.
11653
11654 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11655 (LIBS): Link to USER_LIBS.
11656 ($(BLD)/gnutls.$(0)): New target.
11657
fa6996bc
EZ
116582011-04-24 Eli Zaretskii <eliz@gnu.org>
11659
eb35682e
EZ
11660 * xdisp.c (handle_single_display_spec): Rename the
11661 display_replaced_before_p argument into display_replaced_p, to
11662 make it consistent with the commentary. Fix typos in the
11663 commentary.
11664
e2ad650c
EZ
11665 * textprop.c (syms_of_textprop): Remove dead code.
11666 (copy_text_properties): Delete obsolete commentary about an
11667 interface that was deleted long ago. Fix typos in the description
11668 of arguments.
11669
1b2de274
EZ
11670 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11671 to changes in oldXMenu/XMenu.h from 2011-04-16.
11672 <menu_help_message, prev_menu_help_message>: Constify.
11673 (IT_menu_make_room): menu->help_text is now `const char **';
11674 adjust.
11675
11676 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11677 to changes in oldXMenu/XMenu.h from 2011-04-16.
11678 (struct XMenu): Declare `help_text' `const char **'.
11679
11680 * xfaces.c <Qunspecified>: Make extern again.
11681
11682 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11683 required by POSIX.
1b2de274 11684
762b15be
EZ
11685 * doc.c (get_doc_string): Improve the format passed to `error'.
11686
11687 * doprnt.c (doprnt): Improve commentary.
11688
11689 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11690
11691 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11692 them with etags.
11693
f1052e5d
EZ
11694 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11695 changes in globals.h immediately force recompilation.
762b15be
EZ
11696 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11697 $(CURDIR)/s/ms-w32.h.
11698 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11699
fa6996bc
EZ
11700 * character.c (Fchar_direction): Function deleted.
11701 (syms_of_character): Don't defsubr it.
11702 <char-direction-table>: Deleted.
11703
e6c3da20
EZ
117042011-04-23 Eli Zaretskii <eliz@gnu.org>
11705
11706 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11707 * doprnt.c: Include limits.h.
11708 (SIZE_MAX): New macro.
04f2d78b
CB
11709 (doprnt): Return a size_t value. 2nd arg is now size_t.
11710 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11711 Improve overflow protection. Support `l' modifier for integer
11712 conversions. Support %l conversion. Don't assume an EMACS_INT
11713 argument for integer conversions and for %c.
11714
11715 * lisp.h (doprnt): Restore prototype.
11716
11717 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11718 $(SRC)/character.h.
11719
11720 * Makefile.in (base_obj): Add back doprnt.o.
11721
11722 * deps.mk (doprnt.o): Add back prerequisites.
11723 (callint.o): Depend on character.h.
11724
11725 * eval.c (internal_lisp_condition_case): Include the handler
11726 representation in the error message.
11727 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11728 when breaking from the loop.
11729
11730 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11731
11732 * callint.c (Fcall_interactively): When displaying error message
11733 about invalid control letter, pass the character's codepoint, not
11734 a pointer to its multibyte form. Improve display of the character
11735 in octal and display also its hex code.
11736
11737 * character.c (char_string): Use %x to display the (unsigned)
11738 codepoint of an invalid character, to avoid displaying a bogus
11739 negative value.
11740
11741 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11742 `error', not SYMBOL_NAME itself.
11743
11744 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11745 character arguments to `error'.
11746
11747 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11748 to `error' in error message about FINAL_CHAR argument. Make sure
11749 FINAL_CHAR is a character, and use %c when it is passed as
11750 argument to `error'.
11751
4ffd0d6b 117522011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11753
11754 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11755
11756 * w32.c: Include <time.h>.
11757 (sys_localtime): New function.
11758
4ffd0d6b 117592011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11760
11761 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11762
4ffd0d6b 11763 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11764
4ffd0d6b 117652011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11766
4ffd0d6b
GM
11767 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11768 zombies (Bug#8467).
aac0c6e3 11769
04c56954
EZ
117702011-04-19 Eli Zaretskii <eliz@gnu.org>
11771
11772 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11773 gl_state.e_property when gl_state.object is Qt.
11774
11775 * insdel.c (make_gap_larger): Remove limitation of buffer size
11776 to <= INT_MAX.
11777
16a43933
CY
117782011-04-18 Chong Yidong <cyd@stupidchicken.com>
11779
11780 * xdisp.c (lookup_glyphless_char_display)
11781 (produce_glyphless_glyph): Handle cons cell entry in
11782 glyphless-char-display.
11783 (Vglyphless_char_display): Document it.
11784
11785 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11786 glyphless-char-display.
11787
4581706e
CY
117882011-04-17 Chong Yidong <cyd@stupidchicken.com>
11789
11790 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11791
11792 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11793
11794 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11795 definition for no-X builds.
11796
4887c6e2 117972011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11798
fd35b6f9
PE
11799 Static checks with GCC 4.6.0 and non-default toolkits.
11800
5c1ccb01
PE
11801 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11802
006c5daa
PE
11803 * process.c (keyboard_bit_set): Define only if SIGIO.
11804 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11805 (send_process): Repair possible setjmp clobbering.
11806
efc736d3
PE
11807 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11808
4e2fe2e6
PE
11809 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11810
f97334a2
PE
11811 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11812
4e75f29d
PE
11813 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11814 Define only if needed.
11815
90efadd1
PE
11816 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11817 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11818 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11819
3c647824
PE
11820 * dispextern.h (struct redisplay_interface): Rename param
11821 to avoid shadowing.
e264f262 11822 * termhooks.h (struct terminal): Likewise.
761383f4 11823 * xterm.c (xembed_send_message): Likewise.
3c647824 11824
b58c5c4a
PE
11825 * insdel.c (make_gap_smaller): Define only if
11826 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11827
cad59032
PE
11828 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11829 it.
11830
c339dc2e
PE
11831 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11832 so that we aren't warned about unused symbols.
11833
91a3e27b
PE
11834 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11835
399c71d3 11836 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11837
8ffc96f5
PE
11838 * xfns.c (x_real_positions): Mark locals as initialized.
11839
eef9bc79
PE
11840 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11841
098db9dd
PE
11842 * xterm.c: Fix problems found by static analysis with other toolkits.
11843 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11844 (x_dispatch_event): Declare static if USE_GTK, and
11845 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11846 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11847 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11848 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11849 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11850
eb18f6cc
PE
11851 * xmenu.c (menu_help_callback): Pointer type fixes.
11852 Use const pointers when pointing at readonly data. Avoid pointer
11853 signedness clashes.
11854 (FALSE): Remove unused macro.
11855 (update_frame_menubar): Remove unused decl.
11856
1fe72bf8
PE
11857 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11858
60d9e1db
PE
11859 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11860 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11861 (single_menu_item): Rename local to avoid shadowing.
11862
39261c26
PE
11863 * keyboard.c (make_lispy_event): Remove unused local var.
11864
018c5e19
PE
11865 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11866 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11867
63d2b86e
PE
11868 * bitmaps: Change bitmaps from unsigned char back to the X11
11869 compatible char. Avoid the old compiler warnings about
11870 out-of-range initializers by using, for example, '\xab' rather
11871 than 0xab.
11872
aefd87e1
PE
11873 * xgselect.c (xgselect_initialize): Check vs interface
11874 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11875
bf501fb9
PE
11876 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11877
e9829fdf
PE
11878 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11879 to read-only memory.
11880
1086c095
PE
11881 * fns.c (vector): Remove; this old hack is no longer needed.
11882
2baccd04 11883 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11884 Remove unused var.
dde42981 11885 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11886
72391843 11887 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11888
436c16df 11889 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11890 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11891 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11892
92bb796d 11893 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11894 (x_term_init): Remove local to avoid shadowing.
92bb796d 11895
764430a3 11896 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11897
11898 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11899 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11900
d1dfb56c
EZ
119012011-04-16 Eli Zaretskii <eliz@gnu.org>
11902
c4354cb4
EZ
11903 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11904
d1dfb56c
EZ
11905 Fix regex.c, syntax.c and friends for buffers > 2GB.
11906 * syntax.h (struct gl_state_s): Declare character position members
11907 EMACS_INT.
11908
11909 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11910
04f2d78b
CB
11911 * textprop.c (verify_interval_modification, interval_of):
11912 Declare arguments EMACS_INT.
d1dfb56c
EZ
11913
11914 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11915 EMACS_INT.
11916
11917 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11918
11919 * indent.c (Fvertical_motion): Local variable it_start is now
11920 EMACS_INT.
11921
11922 * regex.c (re_match, re_match_2, re_match_2_internal)
11923 (bcmp_translate, regcomp, regexec, print_double_string)
11924 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11925 (re_compile_pattern, re_exec): Declare arguments and local
11926 variables `size_t' and `ssize_t' and return values `regoff_t', as
11927 appropriate.
11928 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11929 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11930 <compile_stack_type>: `size' and `avail' are now `size_t'.
11931
11932 * regex.h <regoff_t>: Use ssize_t, not int.
11933 (re_search, re_search_2, re_match, re_match_2): Arguments that
11934 specify buffer/string position and length are now ssize_t and
11935 size_t. Return type is regoff_t.
11936
613052cd
BK
119372011-04-16 Ben Key <bkey76@gmail.com>
11938
11939 * nsfont.m: Fixed bugs in ns_get_family and
11940 ns_descriptor_to_entity that were caused by using free to
11941 deallocate memory blocks that were allocated by xmalloc (via
11942 xstrdup). This caused Emacs to crash when compiled with
11943 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11944 --enable-checking=xmallocoverrun). xfree is now used to
11945 deallocate these memory blocks.
11946
4170f62f 119472011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11948
71b41406
PE
11949 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11950
9587a89d
PE
11951 emacs_write: Accept and return EMACS_INT for sizes.
11952 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11953 et seq.
11954 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11955 Accept and return EMACS_INT.
11956 (emacs_gnutls_write): Return the number of bytes written on
11957 partial writes.
11958 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11959 (emacs_read, emacs_write): Remove check for negative size, as the
11960 Emacs source code has been audited now.
9587a89d
PE
11961 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11962 (emacs_read, emacs_write): Use it.
273a5f82
PE
11963 * process.c (send_process): Adjust to the new signatures of
11964 emacs_write and emacs_gnutls_write. Do not attempt to store
11965 a byte offset into an 'int'; it might overflow.
9587a89d 11966 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11967
3e047f51
PE
11968 * sound.c: Don't assume sizes fit in 'int'.
11969 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11970 Return EMACS_INT, not int.
3e047f51 11971 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11972 Accept EMACS_INT, not int.
11973 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11974 record read return values.
11975
cc39a9db
BK
119762011-04-15 Ben Key <bkey76@gmail.com>
11977
c9d0ec6d
JB
11978 * keyboard.c (Qundefined): Don't declare static since it is used
11979 in nsfns.m.
11980 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11981 static since they are used in nsfont.m.
cc39a9db 11982
6c60eb9f
SM
119832011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11984
11985 * process.c (Qprocessp): Don't declare static.
11986 * lisp.h (Qprocessp): Declare again.
11987
7990b61a
JB
119882011-04-15 Juanma Barranquero <lekktu@gmail.com>
11989
11990 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11991
5d4cb038
PE
119922011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11993
8bd7b830 11994 Improve C-level modularity by making more things 'static'.
cd64ea1d 11995
e3b27b31
PE
11996 Don't publish debugger-only interfaces to other modules.
11997 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11998 (verify_bytepos, count_markers): Move decls to the only modules
11999 that need them.
12000 * region-cache.h (pp_cache): Likewise.
12001 * window.h (check_all_windows): Likewise.
12002 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12003
5d4cb038
PE
12004 * sysdep.c (croak): Now static, if
12005 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12006 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
12007
12008 * alloc.c (refill_memory_reserve): Now static if
12009 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12010 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 12011
e87b6180
PE
12012 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12013 Define only if USE_LUCID.
12014
ac64929e
PE
12015 * xrdb.c (x_customization_string, x_rm_string): Now static.
12016
6f37259d
PE
12017 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12018 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12019
1683e3ab
PE
12020 * xdisp.c (draw_row_with_mouse_face): Now static.
12021 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12022
de9c2632
PE
12023 * window.h (check_all_windows): Mark externally visible.
12024
2b96acb7
PE
12025 * window.c (window_deletion_count): Now static.
12026
12027 * undo.c: Make symbols static if they're not exported.
12028 (last_undo_buffer, last_boundary_position, pending_boundary):
12029 Now static.
12030
50436f33
PE
12031 * textprop.c (interval_insert_behind_hooks): Now static.
12032 (interval_insert_in_front_hooks): Likewise.
12033
64520e5c
PE
12034 * term.c: Make symbols static if they're not exported.
12035 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12036 (max_frame_lines, tty_set_terminal_modes):
12037 (tty_reset_terminal_modes, tty_turn_off_highlight):
12038 (get_tty_terminal): Now static.
12039 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12040 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 12041 HAVE_WINDOW_SYSTEM.
64520e5c
PE
12042 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12043 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12044
1fa53021
PE
12045 * sysdep.c: Make symbols static if they're not exported.
12046 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12047 Now static.
12048 (sigprocmask_set, full_mask): Remove; unused.
12049 (wait_debugging): Mark as visible.
12050 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12051 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12052
d4b43b22
PE
12053 * syntax.c (syntax_temp): Define only if !__GNUC__.
12054
b7c513d0
PE
12055 * sound.c (current_sound_device, current_sound): Now static.
12056
989b29ad
PE
12057 * search.c (searchbufs, searchbuf_head): Now static.
12058
13a55a78
PE
12059 * scroll.c (scroll_cost): Remove; unused.
12060 * dispextern.h (scroll_cost): Remove decl.
12061
de68a1fc
PE
12062 * region-cache.h (pp_cache): Mark as externally visible.
12063
40ccffa6
PE
12064 * process.c: Make symbols static if they're not exported.
12065 (process_tick, update_tick, create_process, chan_process):
12066 (Vprocess_alist, proc_buffered_char, datagram_access):
12067 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12068 (deactivate_process): Mark defn as static, as well as decl.
12069 * lisp.h (create_process): Remove decl.
12070 * process.h (chan_process, Vprocess_alist): Remove decls.
12071
ad64fc97
PE
12072 * print.c: Make symbols static if they're not exported.
12073 (print_depth, new_backquote_output, being_printed, print_buffer):
12074 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12075 (print_interval, print_number_index, initial_stderr_stream):
12076 Now static.
12077 * lisp.h (Fprinc): Remove decl.
12078 (debug_output_compilation_hack): Mark as externally visible.
12079
adddb265
PE
12080 * sysdep.c (croak): Move decl from here to syssignal.h.
12081 * syssignal.h (croak): Put it here, so the API can be checked when
12082 'croak' is called from dissociate_if_controlling_tty.
12083
1717ede2
PE
12084 * minibuf.c: Make symbols static if they're not exported.
12085 (minibuf_save_list, choose_minibuf_frame): Now static.
12086 * lisp.h (choose_minibuf_frame): Remove decl.
12087
fa5fb2bc
PE
12088 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12089
1e3890d1
PE
12090 * lread.c: Make symbols static if they're not exported.
12091 (read_objects, initial_obarray, oblookup_last_bucket_number):
12092 Now static.
12093 (make_symbol): Remove; unused.
12094 * lisp.h (initial_obarray, make_symbol): Remove decls.
12095
8a1414fa
PE
12096 * keyboard.c: Make symbols static if they're not exported.
12097 (single_kboard, recent_keys_index, total_keys, recent_keys):
12098 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12099 (this_single_command_key_start, echoing, last_auto_save):
12100 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12101 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12102 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12103 (Vlispy_mouse_stem, double_click_count):
12104 Now static.
12105 (force_auto_save_soon): Define only if SIGDANGER.
12106 (ignore_mouse_drag_p): Now static if
12107 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12108 (print_help): Remove; unused.
12109 (stop_character, last_timer_event): Mark as externally visible.
12110 * keyboard.h (ignore_mouse_drag_p): Declare only if
12111 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12112 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12113 * lisp.h (echoing): Remove decl.
12114 (force_auto_save_soon): Declare only if SIGDANGER.
12115 * xdisp.c (redisplay_window): Simplify code, to make it more
12116 obvious that ignore_mouse_drag_p is not accessed if !defined
12117 USE_GTK && !defined HAVE_NS.
12118
93ea6e8f
PE
12119 * intervals.c: Make symbols static if they're not exported.
12120 (merge_properties_sticky, merge_interval_right, delete_interval):
12121 Now static.
12122 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12123
77382fcc
PE
12124 * insdel.c: Make symbols static if they're not exported.
12125 However, leave prepare_to_modify_buffer alone. It's never
12126 called from outside this function, but that appears to be a bug.
12127 (combine_after_change_list, combine_after_change_buffer):
4889fc82 12128 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
12129 (adjust_after_replace_noundo): Remove; unused.
12130 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 12131 (signal_before_change): Remove decls.
77382fcc 12132
9306c32e
PE
12133 * indent.c (val_compute_motion, val_vmotion): Now static.
12134
cd44d2eb
PE
12135 * image.c: Make symbols static if they're not exported.
12136 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
12137 if USE_GTK.
12138 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
12139 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
12140
ad9a7a06
PE
12141 * fringe.c (standard_bitmaps): Now static.
12142 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
12143
81626931
PE
12144 * frame.c: Make symbols static if they're not exported.
12145 (x_report_frame_params, make_terminal_frame): Now static.
12146 (get_frame_param): Now static, unless HAVE_NS.
12147 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
12148 (x_get_resource_string): Remove; not used.
12149 * frame.h (make_terminal_frame, x_report_frame_params):
12150 (x_get_resource_string); Remove decls.
12151 (x_fullscreen_adjust): Declare only if WINDOWSNT.
12152 * lisp.h (get_frame_param): Declare only if HAVE_NS.
12153
239f9db9
PE
12154 * font.c, fontset.c: Make symbols static if they're not exported.
12155 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
12156 (FACE_SUITABLE_FOR_CHAR_P): Use it.
12157 * font.c (font_close_object): Now static.
12158 * font.h (font_close_object): Remove.
12159 * fontset.c (FONTSET_OBJLIST): Remove.
12160 (free_realized_fontset) #if-0 the body, which does nothing.
12161 (face_suitable_for_char_p): #if-0, as it's never called.
12162 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
12163 * xfaces.c (face_at_string_position):
12164 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
12165 since 0 is always ASCII.
12166
dfcf3579
PE
12167 * fns.c (weak_hash_tables): Now static.
12168
5045092b
PE
12169 * fileio.c: Make symbols static if they're not exported.
12170 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
12171 (Vwrite_region_annotation_buffers): Now static.
12172
57a96f5c
PE
12173 * eval.c: Make symbols static if they're not exported.
12174 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
12175 * lisp.h (backtrace_list): Remove decl.
12176
35f08c38
PE
12177 * emacs.c: Make symbols static if they're not exported.
12178 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
12179 (fatal_error_code, fatal_error_signal_hook, standard_args):
12180 Now static.
12181 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
12182 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
12183 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
12184 * lisp.h (fatal_error_signal_hook): Remove decl.
12185 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
12186
f44bd759
PE
12187 * editfns.c: Move a (normally-unused) function to its only use.
12188 * editfns.c, lisp.h (get_operating_system_release): Remove.
12189 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
12190 worth the hassle of breaking this out.
12191
b532497d
PE
12192 * xterm.c: Make symbols static if they're not exported.
12193 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
12194 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
12195 (x_destroy_window, x_delete_display):
12196 Now static.
12197 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
12198 (x_mouse_leave): Remove; unused.
12199 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
12200 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
12201 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
12202 Remove decls.
12203 (x_mouse_leave): Declare only if WINDOWSNT.
12204 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
12205 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
12206 USE_X_TOOLKIT.
12207
1675728f
PE
12208 * ftxfont.c: Make symbols static if they're not exported.
12209 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
12210 HAVE_FREETYPE.
12211 * font.h (ftxfont_driver): Likewise.
12212
e4cebfca
PE
12213 * xfns.c: Make symbols static if they're not exported.
12214 (x_last_font_name, x_display_info_for_name):
12215 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
12216 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
12217 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
12218 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
12219 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
12220 (last_show_tip_args): Now static.
12221 (xic_defaut_fontset, xic_create_fontsetname): Define only if
12222 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
12223 (x_screen_planes): Remove; unused.
12224 * dispextern.h (x_screen_planes): Remove decl.
12225
5bf46f05
PE
12226 * dispnew.c: Make symbols static if they're not exported.
12227 * dispextern.h (redraw_garbaged_frames, scrolling):
12228 (increment_row_positions): Remove.
12229 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
12230 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
12231 Now static.
12232 (redraw_garbaged_frames): Remove; unused.
12233
435f4c28
PE
12234 * xfaces.c: Make symbols static if they're not exported.
12235 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
12236 Remove decls.
12237 * xterm.h (defined_color): Remove decls.
12238 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
12239 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
12240 (menu_face_changed_default, defined_color, free_realized_face):
12241 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
12242 (ascii_face_of_lisp_face): Remove; unused.
12243
8524aef3
PE
12244 * xdisp.c: Make symbols static if they're not exported.
12245 * dispextern.h (scratch_glyph_row, window_box_edges):
12246 (glyph_to_pixel_coords, set_cursor_from_row):
12247 (get_next_display_element, set_iterator_to_next):
12248 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
12249 (show_mouse_face): Remove decls
12250 * frame.h (message_buf_print): Likewise.
12251 * lisp.h (pop_message, set_message, check_point_in_composition):
12252 Likewise.
12253 * xterm.h (set_vertical_scroll_bar): Likewise.
12254 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
12255 (message_buf_print, scratch_glyph_row, displayed_buffer):
12256 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
12257 (get_next_display_element, show_mouse_face, window_box_edges):
12258 (frame_to_window_pixel_xy, check_point_in_composition):
12259 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
12260 (glyph_to_pixel_coords): Remove; unused.
12261
16390cd2
PE
12262 * dired.c (file_name_completion): Now static.
12263
12264 * dbusbind.c (xd_in_read_queued_messages): Now static.
12265
a25f4dfa
PE
12266 * lisp.h (circular_list_error, FOREACH): Remove; unused.
12267 * data.c (circular_list_error): Remove.
12268
14a9c8df
PE
12269 * commands.h (last_point_position, last_point_position_buffer):
12270 (last_point_position_window): Remove decls.
12271 * keyboard.c: Make these variables static.
12272
04f2d78b
CB
12273 * coding.h (coding, code_convert_region, encode_coding_gap):
12274 Remove decls.
74ab6df5
PE
12275 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
12276 (iso_code_class, detect_coding, code_convert_region): Now static.
12277 (encode_coding_gap): Remove; unused.
12278
38dfbee1
PE
12279 * chartab.c (chartab_chars, chartab_bits): Now static.
12280
a2cb4e63
PE
12281 * charset.h (charset_iso_8859_1): Remove decl.
12282 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
12283 Now static.
12284
127198fd
PE
12285 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
12286 * ccl.c (Vccl_program_table): Now static.
12287 (check_ccl_update): Remove; unused.
12288
d85b608f
PE
12289 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
12290 * category.h: ... from here.
12291 * category.c (check_category_table, set_category_set): Now static.
12292
31cd66f3
PE
12293 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
12294 * lisp.h: Remove these decls.
12295
c358e587
PE
12296 * buffer.c (buffer_count): Remove unused var.
12297
e78aecca
PE
12298 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
12299 so that it's not optimized away.
12300 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
12301 * dispextern.h (bidi_dump_cached_states): Remove, since it's
12302 exported only to the debugger.
12303
e192d7d3 12304 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 12305 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 12306
92470028
PE
12307 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
12308 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
12309 was inaccessible from Lisp.
12310 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
12311 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
12312
244ed907
PE
12313 alloc.c: Import and export fewer symbols, and remove unused items.
12314 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
12315 is defined.
12316 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
12317 it's not optimized away by whole-program optimization.
12318 (message_enable_multibyte, free_misc): Remove.
12319 (catchlist, handlerlist, mark_backtrace):
12320 Declare only if BYTE_MARK_STACK.
12321 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12322 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
12323 (message_enable_multibyte): Remove decl.
12324 (free_misc, interval_free_list, float_block, float_block_index):
12325 (n_float_blocks, float_free_list, cons_block, cons_block_index):
12326 (cons_free_list, last_marked_index):
12327 Now static.
12328 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
12329 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
12330 (mark_backtrace): Define only if BYTE_MARK_STACK.
12331 * xdisp.c (message_enable_multibyte): Now static.
12332
61c2b50e 12333 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
12334 This makes it easier for human readers (and static analyzers)
12335 to see whether these variables are used from other modules.
12336 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
12337 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
12338 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
12339 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
12340 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
12341 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
12342 * xmenu.c, xselect.c:
12343 Declare Q* vars static if they are not used in other modules.
12344 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
12345 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
12346 Remove decls of unexported vars.
12347 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
12348
95c82688
PE
12349 * lisp.h (DEFINE_FUNC): Make sname 'static'.
12350
16a97296
PE
12351 Make Emacs functions such as Fatom 'static' by default.
12352 This makes it easier for human readers (and static analyzers)
12353 to see whether these functions can be called from other modules.
12354 DEFUN now defines a static function. To make the function external
12355 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
12356 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
12357 (Finit_image_library):
16a97296
PE
12358 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
12359 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
12360 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
12361 Remove decls, since these functions are now static.
12362 (Funintern, Fget_internal_run_time): New decls, since these functions
12363 were already external.
95c82688 12364
16a97296
PE
12365 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
12366 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
12367 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
12368 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
12369 * keyboard.c, keymap.c, lread.c:
12370 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
12371 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
12372 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
12373 Mark functions with DEFUE instead of DEFUN,
12374 if they are used in other modules.
12375 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
12376 decls for now-static functions.
12377 * buffer.h (Fdelete_overlay): Remove decl.
12378 * callproc.c (Fgetenv_internal): Mark as internal.
12379 * composite.c (Fremove_list_of_text_properties): Remove decl.
12380 (Fcomposition_get_gstring): New forward static decl.
12381 * composite.h (Fcomposite_get_gstring): Remove decl.
12382 * dired.c (Ffile_attributes): New forward static decl.
12383 * doc.c (Fdocumntation_property): New forward static decl.
12384 * eval.c (Ffetch_bytecode): New forward static decl.
12385 (Funintern): Remove extern decl; now in .h file where it belongs.
12386 * fileio.c (Fmake_symbolic_link): New forward static decl.
12387 * image.c (Finit_image_library): New forward static decl.
12388 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
12389 * intervals.h (Fprevious_property_change):
12390 (Fremove_list_of_text_properties): Remove decls.
12391 * keyboard.c (Fthis_command_keys): Remove decl.
12392 (Fcommand_execute): New forward static decl.
12393 * keymap.c (Flookup_key): New forward static decl.
12394 (Fcopy_keymap): Now static.
12395 * keymap.h (Flookup_key): Remove decl.
12396 * process.c (Fget_process): New forward static decl.
12397 (Fprocess_datagram_address): Mark as internal.
12398 * syntax.c (Fsyntax_table_p): New forward static decl.
12399 (skip_chars): Remove duplicate decl.
12400 * textprop.c (Fprevious_property_change): New forward static decl.
12401 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
12402 Now internal.
12403 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
12404 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
12405
785bbd42
PE
12406 * editfns.c (Fformat): Remove unreachable code.
12407
8b913b57
AS
124082011-04-14 Andreas Schwab <schwab@linux-m68k.org>
12409
12410 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
12411 change. (Bug#8496)
12412
a6744a35
EZ
124132011-04-13 Eli Zaretskii <eliz@gnu.org>
12414
12415 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
12416 when at ZV. (Bug#8487)
12417
e7974947
AS
124182011-04-12 Andreas Schwab <schwab@linux-m68k.org>
12419
baad03f0
AS
12420 * charset.c (Fclear_charset_maps): Use xfree instead of free.
12421 (Bug#8437)
12422 * keyboard.c (parse_tool_bar_item): Likewise.
12423 * sound.c (sound_cleanup, alsa_close): Likewise.
12424 * termcap.c (tgetent): Likewise.
12425 * xfns.c (x_default_font_parameter): Likewise.
12426 * xsettings.c (read_and_apply_settings): Likewise.
12427
e7974947
AS
12428 * alloc.c (overrun_check_malloc, overrun_check_realloc)
12429 (overrun_check_free): Protoize.
12430
28272684
PE
124312011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12432
12433 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12434 since callers should never pass a negative size.
12435 Change the signature to match that of plain 'read' and 'write'; see
12436 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12437 * lisp.h: Update prototypes of emacs_write and emacs_read.
12438
11997c76
EZ
124392011-04-11 Eli Zaretskii <eliz@gnu.org>
12440
12441 * xdisp.c (redisplay_window): Don't try to determine the character
12442 position of the scroll margin if the window start point w->startp
e896f03c 12443 is outside the buffer's accessible region. (Bug#8468)
11997c76 12444
8a2cbd72
EZ
124452011-04-10 Eli Zaretskii <eliz@gnu.org>
12446
12447 Fix write-region and its subroutines for buffers > 2GB.
12448 * fileio.c (a_write, e_write): Modify declaration of arguments and
12449 local variables to support buffers larger than 2GB.
12450 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12451
12452 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12453 argument, local variables, and return value.
12454
12455 * lisp.h: Update prototypes of emacs_write and emacs_read.
12456
12457 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12458
4073e537 124592011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 12460
1ebfdcb6
PE
12461 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12462
b2ded58d
PE
12463 Fix more problems found by GCC 4.6.0's static checks.
12464
7d66342c
PE
12465 * xdisp.c (vmessage): Use a better test for character truncation.
12466
bbf47d44
PE
12467 * charset.c (load_charset_map): <, not <=, for optimization,
12468 and to avoid potential problems with integer overflow.
9248994d 12469 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 12470 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 12471 * editfns.c (Fformat): Likewise.
1e69125e 12472 * syntax.c (skip_chars): Likewise.
3befa583 12473
e3019616
PE
12474 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12475 This also lets GCC 4.6.0 generate slightly better loop code.
12476
becfa255
PE
12477 * callint.c (Fcall_interactively): <, not <=, for optimization.
12478 (Fcall_interactively): Count the number of arguments produced,
12479 not the number of arguments given. This is simpler and lets GCC
12480 4.6.0 generate slightly better code.
12481
dae0cd48
PE
12482 * ftfont.c: Distingish more carefully between FcChar8 and char.
12483 The previous code passed unsigned char * to a functions like
12484 strlen and xstrcasecmp that expect char *, which does not
12485 conform to the C standard.
12486 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12487 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12488 char * when the C standard requires it.
12489
76032d70
PE
12490 * keyboard.c (read_char): Remove unused var.
12491
eb3f1cc8
PE
12492 * eval.c: Port to Windows vsnprintf (Bug#8435).
12493 Include <limits.h>.
12494 (SIZE_MAX): Define if the headers do not.
12495 (verror): Do not give up if vsnprintf returns a negative count.
12496 Instead, grow the buffer. This ports to Windows vsnprintf, which
12497 does not conform to C99. Problem reported by Eli Zaretskii.
12498 Also, simplify the allocation scheme, by avoiding the need for
12499 calling realloc, and removing the ALLOCATED variable.
12500
70476b54
PE
12501 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12502
12020a9e
PE
12503 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12504 But keep the doprint source code for now, as we might revamp it
12505 and use it again (Bug#8435).
ea6c7ae6
PE
12506 * lisp.h (doprnt): Remove.
12507 * Makefile.in (base_obj): Remove doprnt.o.
12508 * deps.mk (doprnt.o): Remove.
12509
5fdb398c
PE
12510 error: Print 32- and 64-bit integers portably (Bug#8435).
12511 Without this change, on typical 64-bit hosts error ("...%d...", N)
12512 was used to print both 32- and 64-bit integers N, which relied on
12513 undefined behavior.
61bdb816 12514 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
12515 * lisp.h (error, verror): Mark as printf-like functions.
12516 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
12517 Report overflow in size calculations when allocating printf buffer.
12518 Do not truncate output string at its first null byte.
12519 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12520 Truncate the output at a character boundary, since vsnprintf does not
12521 do that.
12522 * charset.c (check_iso_charset_parameter): Convert internal
12523 character to string before calling 'error', since %c now has the
12524 printf meaning.
12525 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12526 overflow when computing char to be passed to 'error'. Do not
12527 pass Lisp_Object to 'error'; pass the integer instead.
12528 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12529 formatted with plain %d.
12530
b189fa66
PE
12531 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12532
bff87ef0
PE
12533 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12534
7e2cac20
PE
12535 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12536
ce4d90b5
PE
12537 * xterm.c (x_catch_errors): Remove duplicate declaration.
12538
266c9547
PE
12539 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12540
79c49ad2
PE
12541 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12542
368f4090
JM
125432011-04-10 Jim Meyering <meyering@redhat.com>
12544
12545 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12546 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12547 return ssize_t not "int", and use size_t as the buffer length.
12548 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12549 * gnutls.h: Update declarations.
12550 * process.c (read_process_output): Use ssize_t, to match.
12551 (send_process): Likewise.
12552
a32d4040
CY
125532011-04-09 Chong Yidong <cyd@stupidchicken.com>
12554
12555 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12556
8546720e 125572011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12558
04f2d78b
CB
12559 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12560 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12561
8546720e
GM
12562 * xterm.c (handle_one_xevent):
12563 * xmenu.c (create_and_show_popup_menu):
12564 * xselect.c (x_decline_selection_request)
12565 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12566
0a2f5c1a 125672011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12568
12569 Fix some uses of `int' instead of EMACS_INT.
12570 * search.c (string_match_1, fast_string_match)
12571 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12572 (scan_buffer, find_next_newline_no_quit)
12573 (find_before_next_newline, search_command, Freplace_match)
12574 (Fmatch_data): Make some `int' variables be EMACS_INT.
12575
12576 * xdisp.c (display_count_lines): 3rd argument and return value now
12577 EMACS_INT. All callers changed.
12578 (pint2hrstr): Last argument is now EMACS_INT.
12579
12580 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12581 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12582 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12583 (decode_coding_utf_16, decode_coding_emacs_mule)
12584 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12585 (decode_coding_ccl, decode_coding_charset)
12586 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12587 (decode_coding_iso_2022, decode_coding_emacs_mule)
12588 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12589 <char_offset, last_offset>: Declare EMACS_INT.
12590 (encode_coding_utf_8, encode_coding_utf_16)
12591 (encode_coding_emacs_mule, encode_invocation_designation)
12592 (encode_designation_at_bol, encode_coding_iso_2022)
12593 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12594 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12595 Declare EMACS_INT.
12596 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12597 (encode_invocation_designation): Last argument P_NCHARS is now
12598 EMACS_INT.
12599 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12600 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12601
12602 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12603 All users changed.
12604
12605 * ccl.c (Fccl_execute_on_string): Declare some variables
12606 EMACS_INT.
12607
8546720e 126082011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12609
12610 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12611
4e19a977
CS
126122011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12613
12614 * process.c (Fformat_network_address): Doc fix.
12615
87302331
R
126162011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12617
ee7683eb 12618 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12619
cbb59342
CY
126202011-04-08 Chong Yidong <cyd@stupidchicken.com>
12621
12622 * keyboard.c (read_char): Call Lisp function help-form-show,
12623 instead of using internal_with_output_to_temp_buffer.
12624 (Qhelp_form_show): New var.
e0d38eeb 12625 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12626
12627 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12628
12629 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12630
e67a13ab
CY
126312011-04-06 Chong Yidong <cyd@stupidchicken.com>
12632
04f2d78b
CB
12633 * process.c (Flist_processes): Remove to Lisp.
12634 (list_processes_1): Delete.
e67a13ab 12635
973f782d
EZ
126362011-04-06 Eli Zaretskii <eliz@gnu.org>
12637
7c106b1e
EZ
12638 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12639
973f782d
EZ
12640 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12641
41cf7d1a 126422011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12643
ca23cc88
PE
12644 Fix more problems found by GCC 4.6.0's static checks.
12645
f390e2d5
PE
12646 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12647
42eea0d0
PE
12648 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12649
b69769da 12650 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12651
f9541e84
PE
12652 * xdisp.c (vmessage): Mark as a printf-like function.
12653
13841b55
PE
12654 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12655
c136c10f
PE
12656 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12657
5e2d4a30
PE
12658 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12659 printf-like functions.
12660 (tiff_load): Add casts to remove these marks before passing them
12661 to system-supplied API.
12662
583f48b9
PE
12663 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12664
b25d760e
PE
12665 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12666 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12667 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12668 directly, rather than having caller test rule sign. This avoids
12669 some unnecessary tests.
12670 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12671 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12672 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12673
bc7b6697 12674 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12675 (xfont_open): Avoid unnecessary tests.
bc7b6697 12676
27ccc379
PE
12677 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12678
dcd5c89a
PE
12679 * composite.h, composite.c (composition_gstring_put_cache):
12680 Use EMACS_INT, not int, for length.
12681
b13a45c6
PE
12682 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12683 breaking out part of COMPOSITION_DECODE_RULE.
12684 (COMPOSITION_DECODE_RULE): Use it.
12685 * composite.c (get_composition_id): Remove unused local vars,
12686 by using the new macro.
12687
1e792e4d
PE
12688 * textprop.c (set_text_properties_1): Change while to do-while,
12689 since the condition is always true at first.
12690
dc6c6455 12691 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12692 (interval_deletion_adjustment): Return unsigned value.
12693 All uses changed.
dc6c6455 12694
aba7731a
PE
12695 * process.c (list_processes_1, create_pty, read_process_output):
12696 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12697 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12698 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12699 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12700 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12701
fdfc4bf3
PE
12702 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12703
fca8fe46 12704 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12705 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12706
06a0259a 12707 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12708 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12709 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12710
e7b9e80f
PE
12711 * print.c (print_error_message): Avoid int overflow.
12712
56201685
PE
12713 * font.c (font_list_entities): Redo for clarity,
12714 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12715
78834453 12716 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12717 (font_score): Avoid potential overflow in diff calculation.
78834453 12718
0bc0b309 12719 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12720 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12721
e610eaca
PE
12722 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12723
b895abce
PE
12724 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12725 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12726 can always succeed if overflow has undefined behavior.
12727
1f1d9321 12728 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12729 (wordify): Omit three unnecessary tests.
1f1d9321 12730
c59478bc
PE
12731 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12732 All callers changed. This avoids the need for an unused var.
12733
79b73827
PE
12734 * casefiddle.c (casify_region): Remove var that is set but not used.
12735
a4db5dfe
PE
12736 * dired.c (file_name_completion): Remove var that is set but not used.
12737
43aae36e
PE
12738 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12739
2a47c44d 12740 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12741 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12742
a37c69bf
PE
12743 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12744 Check for integer overflow on size calculations.
12745
328ab8e7
PE
12746 * buffer.c (Fprevious_overlay_change): Remove var that is set
12747 but not used.
12748
e5a2a5cb
PE
12749 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12750 Remove vars that are set but not used.
8d84a6eb 12751 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12752 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12753
a60e5f68
PE
12754 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12755
f661cb61 12756 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12757 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12758
f0397f5a
PE
12759 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12760 that are set but not used.
12761
8664db06 12762 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12763 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12764
6abdaa4a
PE
12765 * xselect.c (x_get_local_selection, x_handle_property_notify):
12766 Remove vars that are set but not used.
12767
0ce7538d 12768 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12769 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12770
9ae848fc
PE
12771 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12772 Remove var that is set but not used.
0b918413
PE
12773 (scroll_bar_windows_size): Now size_t, not int.
12774 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12775 Check for overflow.
9ae848fc 12776
a5a62657
PE
12777 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12778 (map_tty_color) [!defined MSDOS]: Likewise.
12779
5c5cdd39
PE
12780 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12781
66ebf983
PE
12782 * coding.c: Remove vars that are set but not used.
12783 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12784 All callers changed.
12785 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12786 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12787 (decode_coding_charset): Remove vars that are set but not used.
12788
1be4d761
PE
12789 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12790 that is set but not used.
12791
47553fa8
PE
12792 * print.c (print_object): Remove var that is set but not used.
12793
1f7196bf 12794 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12795 The gnulib version avoids calling malloc in the usual case,
12796 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12797 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12798 * filelock.c (current_lock_owner): Likewise.
12799 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12800 * sysdep.c: Include allocator.h, careadlinkat.h.
12801 (emacs_no_realloc_allocator): New static constant.
12802 (emacs_readlink): New function.
fdb61804
PE
12803 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12804 ../lib/careadlinkat.h.
d1fdcab7 12805
f84c17c7
SM
128062011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12807
12808 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12809 first non-nil return value).
12810
ef3862ad
JD
128112011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12812
12813 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12814 if not defined (Bug#8403).
12815
376a7006
JB
128162011-04-02 Juanma Barranquero <lekktu@gmail.com>
12817
12818 * xdisp.c (display_count_lines): Remove parameter `start',
12819 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12820 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12821 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12822 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12823 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12824 and thereabouts. All callers changed.
12825 (get_per_char_metric): Remove parameter `f', unused since
12826 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12827
6ca3801d
JM
128282011-04-02 Jim Meyering <meyering@redhat.com>
12829
12830 do not dereference NULL upon failed strdup
12831 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12832 (ns_get_family): Likewise.
12833
d8e2b5ba
JB
128342011-04-02 Juanma Barranquero <lekktu@gmail.com>
12835
12836 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12837
8c74fcbd
JD
128382011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12839
12840 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12841 later (Bug#8403).
12842
7200d79c
SM
128432011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12844
03408648 12845 Add lexical binding.
7200d79c 12846
03408648
SM
12847 * window.c (Ftemp_output_buffer_show): New fun.
12848 (Fsave_window_excursion):
12849 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12850
12851 * lread.c (lisp_file_lexically_bound_p): New function.
12852 (Fload): Bind Qlexical_binding.
12853 (readevalloop): Remove `evalfun' arg.
12854 Bind Qinternal_interpreter_environment.
12855 (Feval_buffer): Bind Qlexical_binding.
12856 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12857 Mark as dynamic.
12858 (syms_of_lread): Declare `lexical-binding'.
12859
12860 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12861
12862 * keyboard.c (eval_dyn): New fun.
12863 (menu_item_eval_property): Use it.
ca105506
SM
12864
12865 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12866
03408648
SM
12867 * fns.c (concat, mapcar1): Accept byte-code-functions.
12868
12869 * eval.c (Fsetq): Handle lexical vars.
12870 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12871 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12872 (FletX, Flet): Obey lexical binding.
12873 (Fcommandp): Handle closures.
12874 (Feval): New `lexical' arg.
12875 (eval_sub): New function extracted from Feval. Use it almost
12876 everywhere where Feval was used. Look up vars in lexical env.
12877 Handle closures.
12878 (Ffunctionp): Move from subr.el.
12879 (Ffuncall): Handle closures.
12880 (apply_lambda): Remove `eval_flags'.
12881 (funcall_lambda): Handle closures and new byte-code-functions.
12882 (Fspecial_variable_p): New function.
12883 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12884 but without exporting it to Lisp.
23aba0ea 12885
23aba0ea 12886 * doc.c (Fdocumentation, store_function_docstring):
03408648 12887 * data.c (Finteractive_form): Handle closures.
23aba0ea 12888
03408648
SM
12889 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12890 interactive spec.
ba83908c 12891
04f2d78b
CB
12892 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12893 New byte-codes.
03408648
SM
12894 (exec_byte_code): New function extracted from Fbyte_code to handle new
12895 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12896
03408648 12897 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12898
03408648 12899 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12900
e2abce01
JB
129012011-03-31 Juanma Barranquero <lekktu@gmail.com>
12902
12903 * xdisp.c (redisplay_internal): Fix prototype.
12904
63696a73 129052011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12906
63696a73 12907 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12908 (try_scrolling): Use it when setting scroll_limit.
12909 Limit scrolling to 100 screen lines.
63696a73
EZ
12910 (redisplay_window): Even when falling back on "recentering",
12911 position point in the window according to scroll-conservatively,
12912 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12913
12914 (try_scrolling): When point is above the window, allow searching
12915 as far as scroll_max, or one screenful, to compute vertical
12916 distance from PT to the scroll margin position. This prevents
12917 try_scrolling from unnecessarily failing when
12918 scroll-conservatively is set to a value slightly larger than the
12919 window height. Clean up the case of PT below the margin at bottom
12920 of window: scroll_max can no longer be INT_MAX. When aggressive
12921 scrolling is in use, don't let point enter the opposite scroll
12922 margin as result of the scroll.
12923 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12924 threshold of 100 lines for never-recentering scrolling.
12925
e4cc2dfc
JB
129262011-03-31 Juanma Barranquero <lekktu@gmail.com>
12927
12928 * dispextern.h (move_it_by_lines):
12929 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12930 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12931 (message_log_check_duplicate): Remove parameters `prev_bol' and
12932 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12933 (redisplay_internal): Remove parameter `preserve_echo_area',
12934 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12935
12936 * indent.c (Fvertical_motion):
12937 * window.c (window_scroll_pixel_based, Frecenter):
12938 Don't pass `need_y_p' to `move_it_by_lines'.
12939
1c470562
SM
129402011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12941
44f230aa
SM
12942 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12943 steal a few bits to be more compact.
12944 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12945 Remove unneeded casts.
12946
1c470562
SM
12947 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12948
888adce9
ZK
129492011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12950
12951 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12952 binding" message (bug#7967).
12953
f838ed7b
PE
129542011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12955
77861b95
PE
12956 Fix more problems found by GCC 4.6.0's static checks.
12957
de6dbc14
PE
12958 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12959 Remove unused local var.
12960
f838ed7b
PE
12961 * editfns.c (Fmessage_box): Remove unused local var.
12962
792c7b2b
PE
12963 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12964 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12965 Omit unused local vars.
c499e557 12966 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12967 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12968 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12969 Omit unused local var.
12970
ba0165e1
PE
12971 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12972 Don't assume string length fits in int.
32ad8845 12973 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12974 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12975
3c59b4c9
PE
12976 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12977 instead of alloca (Bug#8344).
12978
a3eed478 12979 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12980 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12981
eb4d412d
PE
12982 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12983
1658b401
PE
12984 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12985 concerns.
12986
12987 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12988
12989 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12990
9a2c6e05
PE
12991 * keyboard.c (syms_of_keyboard): Use the same style as later
12992 in this function when indexing through an array. This also
12993 works around GCC bug 48267.
12994
03d0a109
PE
12995 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12996
44f730c8
PE
12997 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12998
fe75f926
PE
12999 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13000 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13001
ffa8c828
PE
13002 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13003 This avoids undefined behavior on integer overflow, and is a bit
13004 more convenient anyway since it is compared to a size_t variable.
13005
c5101a77
PE
13006 Variadic C functions now count arguments with size_t, not int.
13007 This avoids an unnecessary limitation on 64-bit machines, which
13008 caused (substring ...) to crash on large vectors (Bug#8344).
13009 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13010 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 13011 All variadic functions and their callers changed accordingly.
c5101a77
PE
13012 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13013 * data.c (arith_driver, float_arith_driver): Likewise.
13014 * editfns.c (general_insert_function): Likewise.
13015 * eval.c (struct backtrace.nargs, interactive_p)
13016 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13017 (funcall_lambda, mark_backtrace): Likewise.
13018 * fns.c (concat): Likewise.
13019 * frame.c (x_set_frame_parameters): Likewise.
13020 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13021 0 if not found, not -1. All callers changed.
13022
dd3f25f7
PE
13023 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13024 (stack_copy_size): Now size_t, not int.
13025 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13026
461c2ab9
JB
130272011-03-28 Juanma Barranquero <lekktu@gmail.com>
13028
13029 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13030 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13031 All callers changed.
13032
13033 * lisp.h (multibyte_char_to_unibyte):
13034 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13035 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13036 * character.h (CHAR_TO_BYTE8):
13037 * cmds.c (internal_self_insert):
13038 * editfns.c (general_insert_function):
13039 * keymap.c (push_key_description):
13040 * search.c (Freplace_match):
13041 * xdisp.c (message_dolog, set_message_1): All callers changed.
13042
f6d62986
SM
130432011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13044
13045 * keyboard.c (safe_run_hook_funcall): New function.
13046 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13047 don't set the hook to nil, but remove the offending function instead.
13048 (Qcommand_hook_internal): Remove, unused.
13049 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13050 Vcommand_hook_internal.
13051
13052 * eval.c (enum run_hooks_condition): Remove.
13053 (funcall_nil, funcall_not): New functions.
13054 (run_hook_with_args): Call each function through a `funcall' argument.
13055 Remove `cond' argument, now redundant.
13056 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13057 (Frun_hook_with_args_until_failure): Adjust accordingly.
13058 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13059
1db5b1ad
JB
130602011-03-28 Juanma Barranquero <lekktu@gmail.com>
13061
13062 * dispextern.h (string_buffer_position): Remove declaration.
13063
13064 * print.c (strout): Remove parameter `multibyte', unused since
13065 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13066
13067 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13068 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13069 All callers changed.
13070
13071 * w32.c (_wsa_errlist): Use braces for struct initializers.
13072
13073 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13074 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13075 All callers changed.
13076 (string_buffer_position): Likewise. Also, make static (it's never
13077 used outside xdisp.c).
13078 (cursor_row_p): Remove parameter `w', unused since
13079 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13080 (decode_mode_spec): Remove parameter `precision', introduced during
13081 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13082 All callers changed.
13083
5ffb62aa
JD
130842011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13085
13086 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13087
461c2ab9 130882011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
13089
13090 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13091 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13092 (ns_update_auto_hide_menu_bar): New functions.
13093 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13094 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13095 ns_constrain_all_frames.
13096 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13097 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13098
5c380ffb
JD
130992011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13100
13101 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13102
9af30bdf
GM
131032011-03-27 Glenn Morris <rgm@gnu.org>
13104
13105 * syssignal.h: Replace RETSIGTYPE with void.
13106 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13107 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13108 Replace SIGTYPE with void everywhere.
13109 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13110 * s/template.h (SIGTYPE): Remove commented out definition.
13111
e2abce01
JB
131122011-03-26 Eli Zaretskii <eliz@gnu.org>
13113
13114 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13115 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13116
f868cd8a
JB
131172011-03-26 Juanma Barranquero <lekktu@gmail.com>
13118
59eb0929
JB
13119 * w32.c (read_unc_volume): Use parameter `henum', instead of
13120 global variable `wget_enum_handle'.
13121
13122 * keymap.c (describe_vector): Remove parameters `indices' and
13123 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13124 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
13125
f868cd8a
JB
13126 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
13127
13128 * keyboard.c (timer_check): Remove parameter `do_it_now',
13129 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
13130 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
13131 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
13132
13133 * keyboard.c (read_char):
13134 * w32menu.c (w32_menu_display_help):
13135 * xmenu.c (show_help_event, menu_help_callback):
13136 Adjust calls to `show_help_echo'.
13137
13138 * gtkutil.c (xg_maybe_add_timer):
13139 * keyboard.c (readable_events):
13140 * process.c (wait_reading_process_output):
13141 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
13142
13143 * insdel.c (adjust_markers_gap_motion):
13144 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
13145 (gap_left, gap_right): Don't call it.
13146
2ecf6fdb
CY
131472011-03-25 Chong Yidong <cyd@stupidchicken.com>
13148
13149 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
13150 incurred during fontification.
13151
6b1f9ba4
JB
131522011-03-25 Juanma Barranquero <lekktu@gmail.com>
13153
13154 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
13155 (DEFVAR_PER_BUFFER): Don't pass it.
13156
13157 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
13158 (scrolling_window): Don't pass it.
13159
0f4a96b5
JB
131602011-03-25 Juanma Barranquero <lekktu@gmail.com>
13161
13162 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
13163
13164 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
13165 and `suffix'.
13166 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
13167 of variables specific to SELinux and computation of `encoded_absname'.
13168
13169 * image.c (XPutPixel): Remove unused variable `height'.
13170
13171 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
13172
13173 * unexw32.c (get_section_info): Remove unused variable `section'.
13174
13175 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
13176 (system_process_attributes): Remove unused variable `sess'.
13177 (sys_read): Remove unused variable `err'.
13178
13179 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
13180 (w32_wnd_proc): Remove unused variable `isdead'.
13181 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
13182 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
13183 (x_create_tip_frame): Remove unused variable `tem'.
13184
13185 * w32inevt.c (w32_console_read_socket):
13186 Remove unused variable `no_events'.
13187
13188 * w32term.c (x_draw_composite_glyph_string_foreground):
13189 Remove unused variable `width'.
13190
1149507c
JB
131912011-03-24 Juanma Barranquero <lekktu@gmail.com>
13192
13193 * w32term.c (x_set_glyph_string_clipping):
13194 Don't pass uninitialized region to CombineRgn.
13195
9c88f339
JB
131962011-03-23 Juanma Barranquero <lekktu@gmail.com>
13197
13198 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
13199 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
13200 (Fx_close_connection): Remove unused variable `i'.
13201
13202 * w32font.c (w32font_draw): Return number of glyphs.
13203 (w32font_open_internal): Remove unused variable `i'.
13204 (w32font_driver): Add missing initializer.
13205
13206 * w32menu.c (utf8to16): Remove unused variable `utf16'.
13207 (fill_in_menu): Remove unused variable `items_added'.
13208
13209 * w32term.c (last_mouse_press_frame): Remove static global variable.
13210 (w32_clip_to_row): Remove unused variable `f'.
13211 (x_delete_terminal): Remove unused variable `i'.
13212
13213 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
13214 (NOTHING): Remove unused static global variable.
13215 (uniscribe_check_otf): Remove unused variable `table'.
13216 (uniscribe_font_driver): Add missing initializers.
13217
dee091a3
JD
132182011-03-23 Julien Danjou <julien@danjou.info>
13219
13220 * term.c (Fsuspend_tty, Fresume_tty):
13221 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
13222 * window.c (temp_output_buffer_show):
13223 * insdel.c (signal_before_change):
13224 * frame.c (Fhandle_switch_frame):
13225 * fileio.c (Fdo_auto_save):
13226 * emacs.c (Fkill_emacs):
13227 * editfns.c (save_excursion_restore):
13228 * cmds.c (internal_self_insert):
13229 * callint.c (Fcall_interactively):
13230 * buffer.c (Fkill_all_local_variables):
13231 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
13232 Use Frun_hooks.
0f4a96b5 13233 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 13234 unconditionally since it does the check itself.
dee091a3 13235
2c520ab5 132362011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 13237
c9c49752
PE
13238 Fix more problems found by GCC 4.5.2's static checks.
13239
8abc3f12
PE
13240 * coding.c (encode_coding_raw_text): Avoid unnecessary test
13241 the first time through the loop, since we know p0 < p1 then.
13242 This also avoids a gcc -Wstrict-overflow warning.
13243
a2d26660
PE
13244 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
13245 leading to a memory leak, possible in functions like
13246 load_charset_map_from_file that can allocate an unbounded number
b12ef411 13247 of objects (Bug#8318).
a2d26660 13248
916c72e9
PE
13249 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
13250 that could (at least in theory) be that large.
13251
19ab8a18
PE
13252 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
13253 This is less likely to overflow, and avoids undefined behavior if
13254 overflow does occur. All callers changed. Use strtoul to scan
13255 for the unsigned long integer.
b7cbbd6f
PE
13256 (pint2hrstr): Simplify and tune code slightly.
13257 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 13258
f0641eff
PE
13259 * scroll.c (do_scrolling): Work around GCC bug 48228.
13260 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
13261
7f650bb9
PE
13262 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
13263 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
13264 (validate_x_resource_name): Simplify count usage.
13265 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 13266
37dd57d1
PE
13267 * fileio.c (Fcopy_file): Report error if fchown or fchmod
13268 fail (Bug#8306).
81e56e61 13269
699979fc 13270 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 13271
401bf9b4
PE
13272 * process.c (Fmake_network_process): Use socklen_t, not int,
13273 where POSIX says socklen_t is required in portable programs.
13274 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 13275 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
13276 (Fmake_network_process, server_accept_connection):
13277 (wait_reading_process_output, read_process_output):
13278 Likewise.
13279
b93aacde
PE
13280 * process.c: Rename or move locals to avoid shadowing.
13281 (list_processes_1, Fmake_network_process):
13282 (read_process_output_error_handler, exec_sentinel_error_handler):
13283 Rename or move locals.
4dc343ee 13284 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 13285 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 13286 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 13287 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 13288 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 13289
af8a867c 13290 Make tparam.h and terminfo.c consistent.
44f230aa
SM
13291 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
13292 Include tparam.h instead, since it declares them.
af8a867c
PE
13293 * cm.h (PC): Remove extern decl; tparam.h now does this.
13294 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
13295 * terminfo.c: Include tparam.h, to check interfaces.
13296 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
13297 (tparam): Adjust signature to match interface in tparam.h;
13298 this removes some undefined behavior. Check that outstring and len
13299 are zero, which they always are with Emacs.
13300 * tparam.h (PC, BC, UP): New extern decls.
13301
0248044d 13302 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 13303 (xftfont_open): Rename locals to avoid shadowing.
0248044d 13304
8ff096c1 13305 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
13306 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
13307 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 13308 (ftfont_list): Remove unused local.
49eaafba
PE
13309 (get_adstyle_property, ftfont_pattern_entity):
13310 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
13311 Rename locals to avoid shadowing.
8ff096c1 13312
e2be39f6
PE
13313 * xfont.c (xfont_list_family): Mark var as initialized.
13314
c9735e30
PE
13315 * xml.c (make_dom): Now static.
13316
8f5201ae
PE
13317 * composite.c (composition_compute_stop_pos): Rename local to
13318 avoid shadowing.
b246f932
PE
13319 (composition_reseat_it): Remove unused locals.
13320 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 13321 (composition_update_it): Mark var as initialized.
11b61122
PE
13322 (find_automatic_composition): Mark vars as initialized,
13323 with a FIXME (Bug#8290).
8f5201ae 13324
760fbc2c
PE
13325 character.h: Rename locals to avoid shadowing.
13326 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
13327 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
13328 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
13329 (BUF_DEC_POS): Be more systematic about renaming local temporaries
13330 to avoid shadowing.
13331
ff08eb85
PE
13332 * textprop.c (property_change_between_p): Remove; unused.
13333
fc7bf025
PE
13334 * intervals.c (interval_start_pos): Now static.
13335
235d7abc
PE
13336 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
13337
44f230aa
SM
13338 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
13339 Rename locals to avoid shadowing.
3e7d6594 13340
50060332
PE
13341 * sound.c (wav_play, au_play, Fplay_sound_internal):
13342 Fix pointer signedness.
d01f234b 13343 (alsa_choose_format): Remove unused local var.
c83b8872
PE
13344 (wav_play): Initialize a variable to 0, to prevent undefined
13345 behavior (Bug#8278).
50060332 13346
c4fc4e30
PE
13347 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
13348
918436ed
PE
13349 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
13350
c939f91b
PE
13351 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
13352 clobbering (Bug#8298).
b9c7f648
PE
13353 * sysdep.c (sys_subshell): Likewise.
13354 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 13355
6bd8c144
PE
13356 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
13357 This should get cleaned up, so that child_setup has the
13358 same signature on all platforms.
13359
7710357c 13360 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 13361 (relocate_fd): Rename locals to avoid shadowing.
7710357c 13362
c59da222
CY
133632011-03-22 Chong Yidong <cyd@stupidchicken.com>
13364
13365 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
13366 not to be necessary, and produces flickering.
13367
66b87493
GM
133682011-03-20 Glenn Morris <rgm@gnu.org>
13369
13370 * config.in: Remove file.
13371
45b6f6d5
JB
133722011-03-20 Juanma Barranquero <lekktu@gmail.com>
13373
13374 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
13375 are now in src/globals.h.
13376 (syms_of_minibuf): Remove spurious & from previous change.
13377
cd394be1 133782011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
13379
13380 * minibuf.c (completing-read-function): New variable.
13381 (completing-read-default): Rename from completing-read.
13382 (completing-read): Call completing-read-function.
13383
b14e3e21
CY
133842011-03-19 Juanma Barranquero <lekktu@gmail.com>
13385
13386 * xfaces.c (Fx_load_color_file):
13387 Read color file from absolute filename (bug#8250).
13388
f2b726e6
JB
133892011-03-19 Juanma Barranquero <lekktu@gmail.com>
13390
13391 * makefile.w32-in: Update dependencies.
13392
09f6ff02
EZ
133932011-03-17 Eli Zaretskii <eliz@gnu.org>
13394
13395 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
13396
29a6015a
PE
133972011-03-17 Paul Eggert <eggert@cs.ucla.edu>
13398
a3a6c54e
PE
13399 Fix more problems found by GCC 4.5.2's static checks.
13400
b766f867
PE
13401 * process.c (make_serial_process_unwind, send_process_trap):
13402 (sigchld_handler): Now static.
13403
be02381c
PE
13404 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
13405 That way, the code declares only the vars that it needs.
13406 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
13407 * s/cygwin.h (PTY_ITERATION): Likewise.
13408 * s/darwin.h (PTY_ITERATION): Likewise.
13409 * s/gnu-linux.h (PTY_ITERATION): Likewise.
13410
57048744
PE
13411 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
13412 * process.c (allocate_pty): Don't declare stb unless it's needed.
13413
7914961c 13414 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
13415 (CONSTANTLIM): Remove; unused.
13416 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
13417 Define only if needed.
7914961c 13418
b3967b18
PE
13419 * unexelf.c (unexec): Name an expression,
13420 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
13421 Use a different way to cause a compilation error if anyone uses
13422 n rather than nn, a way that does not involve shadowing.
73366a00 13423 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 13424
29a6015a
PE
13425 * deps.mk (unexalpha.o): Remove; unused.
13426
43cfc33e 13427 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 13428 * unexec.h: New file.
ce701a33
PE
13429 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13430 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13431 Depend on unexec.h.
13432 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13433 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13434 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 13435 Change as necessary to match prototype in unexec.h.
ce701a33 13436
01f44d5a
PE
13437 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13438 shadowing.
4f63c6bb 13439 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 13440
a6670b0b
PE
13441 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13442 Rename locals to avoid shadowing.
13443
cef2010d 13444 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 13445 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 13446
d4d7173a
PE
13447 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13448
f08b802a
PE
13449 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13450 warning when compiling print.c.
13451
3ddb0639
PE
13452 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13453 instead of using an uninitialized var.
5ad03b97 13454 (font_sort_entities): Mark var as initialized.
3ddb0639 13455
170a2692
PE
13456 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13457
e663c700
PE
13458 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13459 pointers to constants.
89bc529a 13460 (font_parse_fcname): Remove unused vars.
7b81e2d0 13461 (font_delete_unmatched): Now static.
ea838e10 13462 (font_get_spec): Remove; unused.
13a547c6
PE
13463 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13464 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13465 Rename or move locals to avoid shadowing.
e663c700 13466
2a80c887 13467 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 13468 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 13469
1384fa33 13470 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 13471 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 13472
8b2c52e9
PE
13473 * alloc.c (mark_backtrace): Move decl from here ...
13474 * lisp.h: ... to here, so that it can be checked.
13475
475545b5 13476 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 13477 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
13478 (lisp_indirect_variable): Name an expression,
13479 to avoid gcc -Wbad-function-cast warning.
1faed8ae 13480 (Fdefvar): Rename locals to avoid shadowing.
475545b5 13481
b1349114 13482 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 13483 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 13484 Use const pointer when appropriate.
b1349114 13485
a2928364
PE
13486 * lisp.h (get_system_name, get_operating_system_release):
13487 Move decls here, to check interfaces.
13488 * process.c (get_operating_system_release): Move decl to lisp.h.
13489 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
13490 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13491 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13492 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
13493 (Fformat_time_string, Fencode_time, Finsert_char):
13494 (Ftranslate_region_internal, Fformat):
13495 Rename or remove local vars to avoid shadowing.
9710023e 13496 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 13497
a415e694
PE
13498 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13499 avoid shadowing.
13500
8ef4622d
PE
13501 * lisp.h (eassert): Check that the argument compiles, even if
13502 ENABLE_CHECKING is not defined.
13503
946f9a5b
PE
13504 * data.c (Findirect_variable): Name an expression, to avoid
13505 gcc -Wbad-function-cast warning.
112396d6 13506 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 13507 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
13508 (Fmake_variable_buffer_local, Fmake_local_variable):
13509 Mark variables as initialized.
52746918 13510 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 13511
e5aab7e7 13512 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
13513 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
13514 Rename locals to avoid shadowing.
dff45157
PE
13515 (mark_stack): Move local variables into the #ifdef region where
13516 they're used.
7bc26fdb
PE
13517 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
13518 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13519 needed otherwise.
13520 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13521 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13522 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13523
e5aab7e7
PE
13524 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13525 avoids undefined behavior in theory.
13526
4da60324
PE
13527 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13528
88043301
PE
13529 Use functions, not macros, for up- and down-casing (Bug#8254).
13530 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13531 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13532 to use the following functions instead of these macros.
13533 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13534 EMACS_INT, since callers assume the returned value fits in int.
13535 (upcase1): Likewise, for UPCASE_TABLE.
13536 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13537 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13538 the race-condition problem in the old DOWNCASE.
88043301 13539
19ed5445
PE
13540 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13541 Rename locals to avoid shadowing.
13542 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13543 (regex_compile, re_search_2, re_match_2_internal):
13544 Remove unused local vars.
952db0d7
PE
13545 (FREE_VAR): Rewrite so as not to use empty "else",
13546 which gcc can warn about.
da053e48 13547 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13548 (RETALLOC_IF): Define only if needed.
13549 (WORDCHAR_P): Likewise. This one is never needed, but is used
13550 only in a comment talking about a compiler bug, so put inside
13551 the #if 0 of that comment.
13552 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13553 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13554 Remove; unused.
19ed5445 13555
1f3561e4 13556 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13557 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13558 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13559
ded6f8f7
PE
13560 * search.c (simple_search): Remove unused var.
13561
dbd37a95
PE
13562 * dired.c (compile_pattern): Move decl from here ...
13563 * lisp.h: ... to here, so that it can be checked.
13564 (struct re_registers): New forward decl.
13565
7e47afad
PE
13566 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13567
85f24f61
PE
13568 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13569 All uses changed.
13570 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13571 Rename locals to avoid shadowing.
5671df8f 13572 (Fvertical_motion): Mark locals as initialized.
85f24f61 13573
181aa2be 13574 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13575 (casify_region): Mark local as initialized.
181aa2be 13576
930d429c
PE
13577 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13578
7082eac6
PE
13579 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13580 New macros, so that the caller can use some names other than
13581 gcpro1, gcpro2, etc.
13582 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13583 of the new macros.
13584 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13585 argument, for consistency with GCPRO2_VAR, etc: it is now the
13586 prefix of the variable, not the variable itself. All uses
13587 changed.
38b2c076
PE
13588 * dired.c (directory_files_internal, file_name_completion):
13589 Rename locals to avoid shadowing.
13590
15206ed9
PE
13591 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13592 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13593 dired.c's scmp function, had undefined behavior.
13594 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13595 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13596 * buffer.h: ... to here, because these macros use current_buffer,
13597 and the new implementation with inline functions needs to have
13598 current_buffer in scope now, rather than later when the macros
13599 are used.
13600 (downcase, upcase1): New static inline functions.
13601 (DOWNCASE, UPCASE1): Reimplement using these functions.
13602 This avoids undefined behavior in expressions like
13603 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13604 from race conditions in accessing the global variables
13605 case_temp1 and case_temp2.
13606 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13607 * lisp.h (case_temp1, case_temp2): Remove their decls.
13608 * character.h (ASCII_CHAR_P): Move from here ...
13609 * lisp.h: ... to here, so that the inline functions mentioned
13610 above can use them.
13611
4a6bea26
PE
13612 * dired.c (directory_files_internal_unwind): Now static.
13613
f14b7e14
PE
13614 * fileio.c (file_name_as_directory, directory_file_name):
13615 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13616 Now static.
2893f146
PE
13617 (file_name_as_directory): Use const pointers when appropriate.
13618 (Fexpand_file_name): Likewise. In particular, newdir might
13619 point at constant storage, so make it a const pointer.
fd4ead52 13620 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13621 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13622 signedness issues.
f839df0c
PE
13623 (Fset_file_times, Finsert_file_contents, auto_save_error):
13624 Rename locals to avoid shadowing.
f14b7e14 13625
5716756e 13626 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13627 (Ftry_completion, Fall_completions): Rename or remove locals
13628 to avoid shadowing.
5716756e 13629
b4c3046a
PE
13630 * marker.c (bytepos_to_charpos): Remove; unused.
13631
b45db522
PE
13632 * lisp.h (verify_bytepos, count_markers): New decls,
13633 so that gcc does not warn that these functions aren't declared.
13634
85876d07
PE
13635 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13636 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13637 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13638 (copy_text): Remove unused local var.
85876d07 13639
03d78a21 13640 * filelock.c (within_one_second): Now static.
b3dd38ab 13641 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13642
5df8f01b
PE
13643 * buffer.c (fix_overlays_before): Mark locals as initialized.
13644 (fix_start_end_in_overlays): Likewise. This function should be
13645 simplified by using pointers-to-pointers, but that's a different
13646 matter.
b1d876f1 13647 (switch_to_buffer_1): Now static.
8f54f30a
PE
13648 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13649 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13650
a70072c9 13651 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13652 Fix pointer signedness issue.
edced198
PE
13653 (sys_subshell): Mark local as volatile if checking for lint,
13654 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13655 (MAXPATHLEN): Define only if needed.
a70072c9 13656
a0977c44
PE
13657 * process.c (serial_open, serial_configure): Move decls from here ...
13658 * systty.h: ... to here, so that they can be checked.
13659
a884fdcc
PE
13660 * fns.c (get_random, seed_random): Move extern decls from here ...
13661 * lisp.h: ... to here, so that they can be checked.
13662
604efe86 13663 * sysdep.c (reset_io): Now static.
b8950c94 13664 (wait_for_termination_signal): Remove; unused.
604efe86 13665
38fc62d9
PE
13666 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13667 (copy_keymap_item, append_key, push_text_char_description):
13668 Now static.
1004a21a 13669 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13670 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13671 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13672 (describe_map_tree):
13673 Rename locals to avoid shadowing.
38fc62d9 13674
2f2650da
PE
13675 * keyboard.c: Declare functions static if they are not used elsewhere.
13676 (echo_char, echo_dash, cmd_error, top_level_2):
13677 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13678 (read_char, kbd_buffer_get_event, make_lispy_position):
13679 (make_lispy_event, make_lispy_movement, apply_modifiers):
13680 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13681 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13682 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13683 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13684 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13685
a053e86c 13686 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13687 (mark_kboards): Move decl here ...
13688 * alloc.c (mark_kboards): ... from here.
a053e86c 13689
4752793e
PE
13690 * lisp.h (force_auto_save_soon): New decl.
13691
74f10ca7 13692 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13693 (DEFINE_DUMMY_FUNCTION): New macro.
13694 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13695 Use it.
c03cd23f
PE
13696 (main): Add casts to avoid warnings
13697 if GCC considers string literals to be constants.
74f10ca7 13698
022e70d4
PE
13699 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13700
59d6fe83
PE
13701 * dbusbind.c: Pointer signedness fixes.
13702 (xd_signature, xd_append_arg, xd_initialize):
13703 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13704 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13705 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13706 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13707
78320123
PE
13708 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13709 if GCC considers string literals to be constants.
49cebcca 13710 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13711
35ac2a97
SM
137122011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13713
fb103ca9
SM
13714 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13715 (print_preprocess, print_object): New macro to fix last change.
13716
35ac2a97
SM
13717 * print.c (print_preprocess): Don't forget font objects.
13718
62973b41
JB
137192011-03-16 Juanma Barranquero <lekktu@gmail.com>
13720
13721 * emacs.c (USAGE3): Doc fixes.
13722
0e48bb22
AS
137232011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13724
13725 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13726 structure.
13727
7684e57b
JB
137282011-03-14 Juanma Barranquero <lekktu@gmail.com>
13729
13730 * lisp.h (VWindow_system, Qfile_name_history):
13731 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13732 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13733 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13734
13735 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13736 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13737
13738 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13739 * w32console.c (detect_input_pending, read_input_pending)
13740 (encode_terminal_code):
13741 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13742 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13743 (w32_system_caret_y, Qfile_name_history):
13744 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13745 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13746 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13747 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13748 * w32proc.c (Qlocal, report_file_error):
13749 * w32term.c (Vwindow_system, updating_frame):
13750 * w32uniscribe.c (initialized, uniscribe_font_driver):
13751 Remove unneeded extern declarations.
13752
2aa46d6c
CY
137532011-03-14 Chong Yidong <cyd@stupidchicken.com>
13754
c96bbc66 13755 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13756
cffc6f3b
CY
137572011-03-13 Chong Yidong <cyd@stupidchicken.com>
13758
13759 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13760 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13761 These macros can no longer be used for assignment.
13762
44f230aa
SM
13763 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13764 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13765 (record_buffer_markers, fetch_buffer_markers): New functions for
13766 recording and fetching special buffer markers.
13767 (set_buffer_internal_1, set_buffer_temp): Use them.
13768
13769 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13770
13771 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13772
13773 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13774 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13775
13776 * xdisp.c (hscroll_window_tree):
13777 (reconsider_clip_changes): Use PT instead of BUF_PT.
13778
d251f04b
EZ
137792011-03-13 Eli Zaretskii <eliz@gnu.org>
13780
13781 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13782 $(EMACS_ROOT)/lib/intprops.h.
13783
f0c77cd1
PE
137842011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13785
3eca4629
PE
13786 Fix more problems found by GCC 4.5.2's static checks.
13787
7c86ee98
PE
13788 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13789 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13790 (xg_free_frame_widgets): Make it clear that a local variable is
13791 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13792 (gdk_window_get_screen): Make it clear that this macro is needed
13793 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13794 (int_gtk_range_get_value): New function, which avoids a diagnostic
13795 from gcc -Wbad-function-cast.
13796 (xg_set_toolkit_scroll_bar_thumb): Use it.
13797 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13798 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13799 (get_utf8_string, xg_get_file_with_chooser):
13800 Rename locals to avoid shadowing.
13801 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13802
41729b81
PE
13803 * xgselect.c (xg_select): Remove unused var.
13804
f0c77cd1
PE
13805 * image.c (four_corners_best): Mark locals as initialized.
13806 (gif_load): Initialize transparent_p to zero (Bug#8238).
13807 Mark another local as initialized.
ec6cf4c6 13808 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13809
ce0ad53d 13810 * image.c (clear_image_cache): Now static.
d5d5a617 13811 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13812 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13813 (x_edge_detection): Remove unnecessary cast that
13814 gcc -Wbad-function-cast diagnoses.
2037898d 13815 (gif_load): Fix pointer signedness.
6ae141d6
PE
13816 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13817 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13818
33383987 138192011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13820
d32df629
PE
13821 Improve quality of tests for time stamp overflow.
13822 For example, without this patch (encode-time 0 0 0 1 1
13823 1152921504606846976) returns the obviously-bogus value (-948597
13824 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13825 reports time overflow. See
13826 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13827 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13828 * editfns.c: Include limits.h and intprops.h.
13829 (TIME_T_MIN, TIME_T_MAX): New macros.
13830 (time_overflow): Move earlier, to before first use.
13831 (hi_time, lo_time): New functions, for an accurate test for
13832 out-of-range times.
13833 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13834 (Fget_internal_run_time): Don't assume time_t fits in int.
13835 (make_time): Use list2 instead of Fcons twice.
13836 (Fdecode_time): More accurate test for out-of-range times.
13837 (check_tm_member): New function.
13838 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13839 (lisp_time_argument): Don't rely on undefined left-shift and
13840 right-shift behavior when checking for time stamp overflow.
8be6f318 13841
fe31d94c
PE
13842 * editfns.c (time_overflow): New function, refactoring common code.
13843 (Fformat_time_string, Fdecode_time, Fencode_time):
13844 (Fcurrent_time_string): Use it.
13845
8be6f318
PE
13846 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13847 * dired.c (make_time): Move to ...
13848 * editfns.c (make_time): ... here.
13849 * systime.h: Note the move.
13850
09d9db2c 138512011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13852
126bc0dc
YM
13853 * fringe.c (update_window_fringes): Remove unused variables.
13854
c47cbdfd
YM
13855 * unexmacosx.c (copy_data_segment): Also copy __got section.
13856 (Bug#8223)
13857
7ac80be9
EZ
138582011-03-12 Eli Zaretskii <eliz@gnu.org>
13859
c96bbc66 13860 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13861 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13862 Constify `char *' arguments and their references according to
13863 prototypes in tparam.h.
13864
ecb0f94d 13865 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13866
7ac80be9
EZ
13867 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13868 Adapt all references accordingly.
13869
13870 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13871
ef1fd07e
TT
138722011-03-11 Tom Tromey <tromey@redhat.com>
13873
13874 * buffer.c (syms_of_buffer): Remove obsolete comment.
13875
7ef4b50c
EZ
138762011-03-11 Eli Zaretskii <eliz@gnu.org>
13877
13878 * termhooks.h (encode_terminal_code): Declare prototype.
13879
13880 * msdos.c (encode_terminal_code): Don't declare prototype.
13881
13882 * term.c (encode_terminal_code): Now external again, used by
13883 w32console.c and msdos.c.
13884
44f230aa
SM
13885 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13886 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13887
4b1ec863 138882011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13889
1714f52b 13890 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13891
4b1ec863
PE
13892 * fringe.c (update_window_fringes): Mark locals as initialized
13893 (Bug#8227).
13894 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13895
524c7aa6
PE
13896 * alloc.c (mark_fringe_data): Move decl from here ...
13897 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13898 to check its interface.
13899 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13900
a5c0af81 13901 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13902 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13903 (fontset_font): Mark local as initialized.
a9a06e0b 13904 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13905
b4716021
PE
13906 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13907
811e9bac 13908 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13909 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13910 (x_own_selection, Fx_disown_selection_internal): Rename locals
13911 to avoid shadowing.
13912 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13913
7e3ab302
PE
13914 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13915 so that the caller can use some name other than gcpro1.
13916 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13917 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13918 (Fx_backspace_delete_keys_p):
13919 Use them to avoid shadowing, and rename vars to avoid shadowing.
13920 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13921 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13922 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13923 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13924 Remove unused locals.
7e3ab302
PE
13925 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13926 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13927 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13928 macros.
f78faa98 13929
e2b13473
PE
13930 * xterm.h (x_mouse_leave): New decl.
13931
77f23912
PE
13932 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13933 Remove unused functions.
cdf4ba58
PE
13934 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13935 (x_calc_absolute_position): Now static.
7411c686 13936 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13937 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13938 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13939 unless they are used.
38d0b34a
PE
13940 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13941 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13942 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13943 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13944 (x_error_catcher, x_connection_closed, x_error_handler):
13945 (x_error_quitter, xembed_send_message, x_iconify_frame):
13946 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13947 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13948 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13949
44f230aa
SM
13950 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13951 Rename or move locals to avoid shadowing.
6b463e58 13952 (tty_defined_color, merge_face_heights): Now static.
5967d051 13953 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13954 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13955 does not deduce is never used uninitialized.
73719eba
PE
13956 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13957 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13958
426994c3 13959 * terminal.c (store_terminal_param): Now static.
5489860b 13960
032f1620 13961 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13962 (set_frame_menubar): Remove unused local.
d4323972 13963 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13964 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13965 since they might point to immutable storage.
281585b0
PE
13966 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13967 since it's unused otherwise.
032f1620 13968
367c19e5 13969 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13970 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13971 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13972 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13973 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13974 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13975 does not deduce are never used uninitialized.
70739cbe 13976
07b48fa9
PE
13977 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13978
8868a238 13979 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13980 * window.c (window_loop, size_window):
13981 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13982
7e5cf297 13983 * window.c (display_buffer): Now static.
d6550a9f
PE
13984 (size_window): Mark variables that gcc -Wuninitialized
13985 does not deduce are never used uninitialized.
a586633d
PE
13986 * window.h (check_all_windows): New decl, to forestall
13987 gcc -Wmissing-prototypes diagnostic.
5b555da1 13988 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13989
f6095868
PE
13990 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13991 shadowing.
13992 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13993 Include <limits.h>.
13994 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13995 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13996 (load_charset_map): Mark variables that gcc -Wuninitialized
13997 does not deduce are never used uninitialized.
53df7c11 13998 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13999
f38b440c
PE
14000 * coding.c (coding_set_source, coding_set_destination):
14001 Use "else { /* comment */ }" rather than "else /* comment */;"
14002 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
14003 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14004 a block, when the outer 'i' will do.
14005 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14006 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14007 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14008 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14009 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14010 Rename locals to avoid shadowing.
14011 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
14012 * coding.c (emacs_mule_char, encode_invocation_designation):
14013 Now static, since they're not used elsewhere.
413bb2db 14014 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 14015 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
14016 (decode_coding_emacs_mule): Mark variables that gcc
14017 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
14018 (detect_coding_iso_2022): Initialize a local variable that might
14019 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 14020 this initialization is needed. (Bug#8211)
5f58e762
PE
14021 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14022 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14023 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14024 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14025 Remove unused macros.
f38b440c 14026
232b38b9 14027 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 14028 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 14029 * character.c (string_count_byte8): Likewise.
232b38b9 14030
fb90da1b
PE
14031 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14032 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14033
fb93dbc2
PE
14034 * chartab.c (copy_sub_char_table): Now static, since it's not used
14035 elsewhere.
5c156ace
PE
14036 (sub_char_table_ref_and_range, char_table_ref_and_range):
14037 Rename locals to avoid shadowing.
bbcd0949 14038 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 14039
7d3b3862 14040 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 14041 (BIDI_BOB): Remove unused macro.
7d3b3862 14042
6be7d3da
PE
14043 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14044 deduce are never used uninitialized.
c2ed9c8b 14045 * term.c (encode_terminal_code): Likewise.
6be7d3da 14046
75f8807f 14047 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 14048
50938595
PE
14049 * tparam.h: New file.
14050 * term.c, tparam.h: Include it.
14051 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14052 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14053 Move these decls to tparam.h, and make them agree with what
14054 is actually in tparam.c. The previous trick of using incompatible
14055 decls in different modules does not conform to the C standard.
14056 All callers of tparam changed to use tparam's actual API.
14057 * tparam.c (tparam1, tparam, tgoto):
14058 Use const pointers where appropriate.
14059
fbceeba2
PE
14060 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14061 * cm.h (struct cm): Likewise.
14062 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14063 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14064 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14065 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14066 (turn_on_face, init_tty): Likewise.
14067 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 14068
7f3f1250
PE
14069 * term.c (term_mouse_position): Rename local to avoid shadowing.
14070
e6ca6543
PE
14071 * alloc.c (mark_ttys): Move decl from here ...
14072 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14073
c40f8d15
AS
140742011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14075
14076 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14077
cfe0661d
JB
140782011-03-09 Juanma Barranquero <lekktu@gmail.com>
14079
14080 * search.c (compile_pattern_1): Remove argument regp, unused since
14081 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14082 (compile_pattern): Don't pass it.
14083
0afb4571
J
140842011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14085
14086 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14087 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14088 for ! HAVE_GTK3.
14089 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14090
14091 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14092
14093 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14094 gdk_window_get_screen, gdk_window_get_geometry,
14095 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14096 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14097 (xg_get_pixbuf_from_pixmap): New function.
14098 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14099 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14100 Call xg_get_pixbuf_from_pixmap instead of
14101 gdk_pixbuf_get_from_drawable.
14102 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14103 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14104 (xg_check_special_colors): Use GtkStyleContext and its functions
14105 for HAVE_GTK3.
14106 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14107 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14108 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
14109 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14110 Call gtk_widget_get_preferred_size.
0afb4571
J
14111 (xg_frame_resized): gdk_window_get_geometry only takes 5
14112 parameters.
44f230aa
SM
14113 (xg_win_to_widget, xg_event_is_for_menubar):
14114 Call gdk_x11_window_lookup_for_display.
0afb4571
J
14115 (xg_set_widget_bg): New function.
14116 (delete_cb): New function.
895009e1 14117 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 14118 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
14119 (xg_set_background_color): Call xg_set_widget_bg.
14120 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14121 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14122 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14123 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14124 if ! HAVE_GTK3.
14125 (update_frame_tool_bar): Call gtk_widget_hide.
14126 (xg_initialize): Use GDK_KEY_g.
14127
14128 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
14129 if ! HAVE_GTK3
14130 (x_session_initialize): Call gdk_x11_set_sm_client_id.
14131
14132 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
14133 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
14134 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
14135
1c2cc4ef
JB
141362011-03-08 Juanma Barranquero <lekktu@gmail.com>
14137
14138 * w32xfns.c (select_palette): Check success of RealizePalette against
14139 GDI_ERROR, not zero.
14140
33383987 14141See ChangeLog.11 for earlier changes.
aac0c6e3
MR
14142
14143;; Local Variables:
14144;; coding: utf-8
aac0c6e3
MR
14145;; End:
14146
2f097256 14147 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
14148
14149 This file is part of GNU Emacs.
14150
14151 GNU Emacs is free software: you can redistribute it and/or modify
14152 it under the terms of the GNU General Public License as published by
14153 the Free Software Foundation, either version 3 of the License, or
14154 (at your option) any later version.
14155
14156 GNU Emacs is distributed in the hope that it will be useful,
14157 but WITHOUT ANY WARRANTY; without even the implied warranty of
14158 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14159 GNU General Public License for more details.
14160
14161 You should have received a copy of the GNU General Public License
14162 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.