progmodes/python.el: Set file local vars at end of file and clean tabs.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
d06714cb
PE
12012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2
83713154
PE
3 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4 when invoking (make-bool-vector N t) and N is a positive
5 multiple of 8 -- the last 8 bits were mistakenly cleared.
6
d06714cb
PE
7 Remove some struct layout assumptions in bool vectors.
8 * alloc.c (bool_header_size): New constant.
9 (header_size, word_size): Move earlier, as they're now used earlier.
10 Use 'word_size' in a few more places, where it's appropriate.
11 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
12 padding before the data member of a bool vector.
13 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
14 than doing the check by hand with an abort ().
15
464d5a5e
SM
162012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17
5fbc0409
SM
18 * eval.c (Fdefvar): Don't check constants since we only set the var if
19 it's not yet defined anyway (bug#11904).
20
464d5a5e
SM
21 * lisp.h (last_undo_boundary): Declare new var.
22 * keyboard.c (command_loop_1): Set it.
23 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
24 were auto-added by the command loop (bug#11774).
25
8dc2e44a
AS
262012-07-18 Andreas Schwab <schwab@linux-m68k.org>
27
28 * w32font.c (Qsymbol): Remove local definition.
29 (syms_of_w32font): Don't DEFSYM it.
30
169925ec
DA
312012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
32
33 Fix sweep_vectors to handle large bool vectors correctly.
34 * alloc.c (sweep_vectors): Account total_vector_bytes for
35 bool vectors larger than VBLOCK_BYTES_MAX.
36
5fbfb018
CY
372012-07-18 Chong Yidong <cyd@gnu.org>
38
39 * frame.c (x_set_frame_parameters): Revert bogus change introduced
40 in 2012-05-25 commit by Paul Eggert (Bug#11738).
41
3ab6e069
DA
422012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
43
44 Return more descriptive data from Fgarbage_collect.
45 Suggested by Stefan Monnier in
46 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
47 * alloc.c (bounded_number): New function.
48 (total_buffers, total_vectors): New variable.
49 (total_string_size): Rename to total_string_bytes, adjust users.
50 (total_vector_size): Rename to total_vector_bytes, adjust users.
51 (sweep_vectors): Account total_vectors and total_vector_bytes.
52 (Fgarbage_collect): New return value. Adjust documentation.
53 (gc_sweep): Account total_buffers.
54 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
55 (VECTOR_SIZE): Remove.
56 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
57 (Qinterval, Qmisc): New symbols.
58 (syms_of_data): Initialize them.
59 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
60 (Qcons, Qbuffer): New declarations.
61
6d02fe5b
PE
622012-07-17 Paul Eggert <eggert@cs.ucla.edu>
63
64 * alloc.c (Fmemory_free): Account for memory-free's own storage.
65 Round up, not down. Improve doc.
66
b7ffe040
DA
672012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
68
69 Restore old code in allocate_string_data to avoid Faset breakage.
70 Reported by Julien Danjou <julien@danjou.info> in
71 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
72 * alloc.c (allocate_string_data): Restore old code with minor
73 adjustments, fix comment to explain this subtle issue.
74
4dc7c8d5
SM
752012-07-17 Eli Zaretskii <eliz@gnu.org>
76
77 Remove FILE_SYSTEM_CASE.
78 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
79
80 * fileio.c (FILE_SYSTEM_CASE): Don't define.
81 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
82 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
83 call-process-region passes it through expand-file-name.
84
85 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
86
872012-07-17 Andreas Schwab <schwab@linux-m68k.org>
88
89 Fix crash when creating indirect buffer (Bug#11917)
90 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
91 Don't handle unbound variables specially if non-zero.
92 (Fbuffer_local_variables): Pass zero.
93 (clone_per_buffer_values): Pass non-zero.
94
952012-07-17 Andreas Schwab <schwab@linux-m68k.org>
96
97 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
98 to make the loop interruptible.
99
1002012-07-17 Andreas Schwab <schwab@linux-m68k.org>
101
102 * gnutls.c (emacs_gnutls_handshake): Only retry if
103 GNUTLS_E_INTERRUPTED.
104
1052012-07-17 Eli Zaretskii <eliz@gnu.org>
cce7fefc
DA
1062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
107
108 Cleanup and convert miscellaneous checks to eassert.
109 * alloc.c (mark_interval): Fix comment, partially rephrase
110 old comment from intervals.h (see below).
111 * intervals.c (find_interval, adjust_intervals_for_insertion)
112 (delete_interval, adjust_intervals_for_deletion)
113 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
114 Convert to eassert.
115 (adjust_intervals_for_insertion, make_new_interval):
116 Remove obsolete and unused code.
117 * intervals.h (struct interval): Remove obsolete comment.
118 * textprotp.c (erase_properties): Remove unused code.
119 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
120 (Fremove_list_of_text_properties): Convert to eassert.
121
9ea10cc3
CY
1222012-07-17 Chong Yidong <cyd@gnu.org>
123
124 * editfns.c (Finsert_char): Doc fix.
125
3900d5de
DA
1262012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
127
128 Fix previous change to make Fmemory_free always accurate.
129 * alloc.c (make_interval): Update total_free_intervals.
130 (make_float): Likewise for total_free_floats.
131 (free_cons, Fcons): Likewise for total_free_conses.
132 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
133 Likewise for total_free_vector_bytes.
134 (Fmake_symbol): Likewise for total_free_symbols.
135 (bytes_free): Remove.
136
7098646f
DA
1372012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
138
139 Simple free memory accounting feature.
140 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
141 (sweep_vectors): Accumulate size of free vectors.
142 (Fgarbage_collect): Setup bytes_free.
143 (Fmemory_free): New function.
144 (syms_of_alloc): Register it.
145
22657b40
DA
1462012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
147
148 Cleanup overlays checking.
149 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
150 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
151 eassert and OVERLAYP.
152 (sort_overlays): Change to use OVERLAYP.
153
ddfc8813
RK
1542012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
155
156 * editfns.c (Finsert_char): Make it interactive, and make the
157 second arg optional. Copy interactive spec and docstring from
158 ucs-insert.
159
7c26cf3c
PE
1602012-07-17 Paul Eggert <eggert@cs.ucla.edu>
161
162 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
163 Unlike the other wrapped functions, fabs has an unspecified
164 effect on errno.
165
5d127af9
JD
1662012-07-16 Jan Djärv <jan.h.d@swipnet.se>
167
168 * nsterm.m (keyDown): Interpret flags without left/right bits
169 as the left key (Bug#11670).
170
6a0dd1d7
DA
1712012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
172
173 Remove empty and useless init functions.
174 * lisp.h (init_character_once, init_fns, init_image)
175 (init_filelock, init_sound): Remove prototype.
176 * character.c (init_character_once): Remove.
177 * filelock.c (init_filelock): Likewise.
178 * fns.c (init_fns): Likewise.
179 * image.c (init_image): Likewise.
180 * sound.c (init_sound): Likewise.
181 * emacs.c (main): Adjust accordingly.
182
7a6136fd
DA
1832012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
184
185 * gtkutil.h: Tiny cleanups.
186 (use_old_gtk_file_dialog): Remove useless declaration.
187 (xg_uses_old_file_dialog): Add suggested const attribute.
188
ce811ad9
EZ
1892012-07-15 Eli Zaretskii <eliz@gnu.org>
190
191 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
192 (bidi_paragraph_init): Use it to limit search forward for a strong
193 directional character in abnormally large paragraphs full of
194 neutral or weak characters. (Bug#11943)
195
c9adfeaa
SF
1962012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
197
198 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
199 the toolbar (Bug#9451).
200 (xg_make_tool_item): Give the widget event box a transparent
201 background.
202
fff62aa9
DA
2032012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
204
205 Cleanup basic allocation variables and functions.
206 * alloc.c (ignore_warnings, init_intervals, init_float)
207 (init_cons, init_symbol, init_marker): Remove.
208 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
209 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
210 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
211 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
212 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
213 (staticidx, init_alloc_once, init_strings, free_ablock):
214 Remove redundant initialization.
215 * fns.c (init_weak_hash_tables): Remove.
216 * lisp.h (init_weak_hash_tables): Remove prototype.
217
9730daca
DA
2182012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
219
220 Use zero_vector where appropriate.
221 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
222 accordingly.
223 * lisp.h (zero_vector): New declaration.
224 * font.c (null_vector): Remove.
225 (syms_of_font): Remove initialization and staticpro.
226 (font_list_entities, font_find_for_lface): Change to use zero_vector.
227 * keymap.c (Faccessible_keymaps): Likewise.
228
2e2d2a13
LL
2292012-07-15 Leo Liu <sdl.web@gmail.com>
230
231 * fringe.c: Fix typo in comments.
232
cd276f6e
LL
2332012-07-14 Leo Liu <sdl.web@gmail.com>
234
235 * fringe.c: Add a new bitmap exclamation-mark.
236
5a1131d9
EZ
2372012-07-14 Eli Zaretskii <eliz@gnu.org>
238
239 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
240
241 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
242 (HAVE_MENUS): Don't define, defined by editing config.in with
243 msdos/sed2v2.inp.
244 (GMALLOC_INHIBIT_VALLOC): Don't define.
245 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
246
22e983b7
JB
2472012-07-14 Juanma Barranquero <lekktu@gmail.com>
248
249 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
250
5b3f250f
GM
2512012-07-14 Glenn Morris <rgm@gnu.org>
252
253 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
254 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
255 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
256
33d63ff4
GM
2572012-07-13 Glenn Morris <rgm@gnu.org>
258
5b633342
GM
259 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
260
33d63ff4
GM
261 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
262 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
263
b55b9f85
JD
2642012-07-13 Jan Djärv <jan.h.d@swipnet.se>
265
0dc8cf50
JD
266 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
267 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
268 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
269 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
270 where appropriate.
271 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
272 as boolean expression.
273 (x_set_window_size): Remove unused variable toolbar.
274 (ns_get_color_default, ns_mod_to_lisp): Remove.
275 (ns_mouse_position): Remove unused variables xchar and ychar.
276 (ns_compute_glyph_string_overhangs): Remove unused variable face.
277 (ns_set_vertical_scroll_bar): Remove unused variable count.
278 (ns_delete_terminal): Remove unused variable i.
279 (ns_term_init): Remove unused variables r, g and b.
280 (mouseDown): Remove unused variable window.
281 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
282 (initFrameFromEmacs): Remove unused variable vbextra.
283 (mouseEntered): Remove unused variables p and dpyinfo.
284 (mouseExited): Remove unused variables p and r.
285 (ns_define_frame_cursor, ns_clear_frame_area)
286 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
287 (menuDown): Assign [sender tag] to variable and cast the variable.
288
289 * nsterm.h (menuDown): Add id as type to argument sender.
290 (ns_display_info_for_name): Add Lisp_Object argument.
291 (ns_term_init): Add Lisp_Object argument.
292 (ns_map_event_to_object): Add void argument.
293 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
294 prototype with arguments and only declare if __OBJC__.
295 (nxatoms_of_nsselect): Add void argument.
296 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
297 (ns_alloc_autorelease_pool): Add void argument.
298 (ns_release_autorelease_pool): Add void* argument.
299 (ns_get_defaults_value): Add const char* argument.
300
301 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
302 (initFromContents): Use SSDATA where appropriate.
303 (ns_update_menubar): Add braces to ambigous if-else.
304 (initWithTitle): Put () around assignment in if statement.
305 (ns_menu_show): Remove unused variables window and keymap.
306 (update_frame_tool_bar): Remove unused variable selected_p.
307 (initWithContentRect): Remove unused variable this_cmd_name.
308
309 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
310 appropriate.
311 (setXBMColor): Remove unused variable len.
312 (setPixmapData): Put () around assignment in loop statement.
313
314 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
315 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
316 where appropriate.
317 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
318 around assignment in loop statement.
319 (nsfont_open): Remove unused variable i.
320 (nsfont_open): Remove unused variable len.
321 (nsfont_draw): Remove unused variable cs.
322
323 * nsfns.m (x_set_icon_name, ns_set_name_internal)
324 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
325 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
326 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
327 (Fns_font_name, Fns_perform_service)
328 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
329 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
330 (ns_set_name): Remove unused variable view.
331 (x_set_menu_bar_lines): Remove unused variable olines.
332 (x_set_tool_bar_lines): Remove unused variable root_window.
333 (Fns_list_colors): Put () around assignment in while statement.
334 (Fns_perform_service): Remove unused variable len.
335 (Fns_display_usable_bounds): Remove unused variable top.
336 (syms_of_nsfns): Remove unused variable i.
337
b55b9f85
JD
338 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
339 memcpy (Bug#11907).
340
ed9265fc 3412012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
342
343 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
344 and free it with DestroyExceptionInfo (Bug#11558).
345
ef099b57
JB
3462012-07-13 Juanma Barranquero <lekktu@gmail.com>
347
348 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
349 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
350 Set here, not in nt/config.nt.
351
ea814a5d
EZ
3522012-07-13 Eli Zaretskii <eliz@gnu.org>
353
354 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
355 cursor overflow into the last glyph on display line when the right
356 fringe is off. (Bug#11832)
357
1a952767
PE
3582012-07-13 Paul Eggert <eggert@cs.ucla.edu>
359
360 * xdisp.c (produce_special_glyphs): Now static.
361 * dispextern.h (produce_special_glyphs): Remove decl.
362
983188fd
GM
3632012-07-13 Glenn Morris <rgm@gnu.org>
364
32fb4bb6
GM
365 * s/bsd-common, s/cygwin.h: Remove empty files.
366 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
367
983188fd
GM
368 * s/usg5-4-common.h (USG, USG5):
369 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
370 * s/sol2-6.h (SOLARIS2):
371 * s/irix6-5.h (IRIX6_5):
372 * s/hpux10-20.h (USG, USG5, HPUX):
373 * s/gnu-linux.h (USG, GNU_LINUX):
374 * s/freebsd.h (BSD_SYSTEM):
375 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
376 * s/cygwin.h (CYGWIN):
377 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
378 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
379
d1e68667 3802012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
381
382 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 383
6de0e799
GM
3842012-07-13 Glenn Morris <rgm@gnu.org>
385
739ae010
GM
386 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
387
dbee5793
GM
388 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
389
6de0e799
GM
390 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
391 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
392
b82da769
GM
3932012-07-12 Glenn Morris <rgm@gnu.org>
394
4fae5a7a 395 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
396
397 * process.c (init_process_emacs): Rename from init_process.
398 The old name is also the name of a Mach system call.
399 * lisp.h, emacs.c: Update for this name change.
400 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
401 longer needed.
402
5a979817
EZ
4032012-07-12 Eli Zaretskii <eliz@gnu.org>
404
405 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
406 memmove call that removes glyphs covered by the left truncation
407 glyph. Improve commentary.
408 (display_line): Fix display of continuation glyphs on GUI frames
409 when the right fringe is turned off and variable-size fonts are
410 used in the window. Move the code that appends a stretch glyph to
411 produce_special_glyphs, so that it could be used for truncation
412 and continuation glyphs alike.
413 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
414 glyph of a suitably computed width, to align the special glyphs at
415 the window margin. Code moved from display_line. (Bug#11832)
416
3e91a053
GM
4172012-07-12 Glenn Morris <rgm@gnu.org>
418
ba9e4b84
GM
419 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
420
421 * s/gnu-linux.h, s/hpux10-20.h:
422 Do not unconditionally define HAVE_XRMSETDATABASE.
423
3e91a053
GM
424 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
425
b300b1f4
PE
4262012-07-12 Paul Eggert <eggert@cs.ucla.edu>
427
428 Fix typos that broke OS X build.
429 Reported by Randal L. Schwartz in
430 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
431 * nsterm.m (ns_timeout): Add missing local decl.
432 (ns_get_color): snprintf -> sprintf, to fix typo.
433
6e777848
GM
4342012-07-12 Glenn Morris <rgm@gnu.org>
435
3f922c37
GM
436 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
437 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
438 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
439 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
440
0ab7b23a
GM
441 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
442 Move PTY_OPEN to configure.
443
6e777848
GM
444 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
445 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
446 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
447
4a7edc24
DA
4482012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
449
450 Use empty_unibyte_string where applicable.
451 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
452 * lread.c (read1): Likewise.
453 * xsettings.c (syms_of_xsettings): Likewise.
454
308aab79
GM
4552012-07-12 Glenn Morris <rgm@gnu.org>
456
42bd1719
GM
457 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
458 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
459 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
460 * s/hpux10-20.h (RUN_TIME_REMAP):
461 * s/bsd-common.h (TABDLY): Move to configure.
462
463 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
464
465 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
466
ea0bbd17 467 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 468 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
469
470 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 471
308aab79
GM
472 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
473 * s/template.h: Move NARROWPROTO to configure.
474
ee1cf5cf
GM
4752012-07-11 Glenn Morris <rgm@gnu.org>
476
30fe9bf4
GM
477 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
478 unused since 2011-01-17 change to systty.h.
479
ee1cf5cf
GM
480 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
481 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
482 Move HAVE_PTYS and HAVE_SOCKETS to configure.
483
63e47e07
PE
4842012-07-11 Paul Eggert <eggert@cs.ucla.edu>
485
486 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
487
c43fb4c3
GM
4882012-07-11 Glenn Morris <rgm@gnu.org>
489
490 * s/darwin.h, s/gnu-linux.h, s/template.h:
491 Move INTERRUPT_INPUT to configure.
492
e8df9267
DA
4932012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
494
495 Minor adjustments to interning code.
496 * lisp.h (intern, intern_c_string): Redefine as static inline
497 wrappers for intern_1 and intern_c_string_1, respectively.
498 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
499 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
500 Vobarray checking.
e8df9267
DA
501 * font.c (font_intern_prop): Likewise. Adjust comment.
502 * w32font.c (intern_font_name): Likewise.
503
34348bd4
AS
5042012-07-11 Andreas Schwab <schwab@linux-m68k.org>
505
d96a1e0c
AS
506 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
507
34348bd4
AS
508 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
509 of Fcar/Fcdr if possible.
510 * font.c (check_otf_features): Likewise.
511 * fontset.c (Fnew_fontset): Likewise.
512 * gnutls.c (Fgnutls_boot): Likewise.
513 * minibuf.c (read_minibuf): Likewise.
514 * msdos.c (IT_set_frame_parameters): Likewise.
515 * xmenu.c (Fx_popup_dialog): Likewise.
516 * w32menu.c (Fx_popup_dialog): Likewise.
517
c8add24e
GM
5182012-07-11 Glenn Morris <rgm@gnu.org>
519
4b575b3c
GM
520 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
521 since nothing has defined it on these platforms.
522
09f4e3b0
GM
523 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
524 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
525
172bedef
GM
526 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
527 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
528 Move CLASH_DETECTION to configure.
529
249685df
GM
530 * s/gnu.h: Remove file, which is now empty.
531
c8add24e
GM
532 * s/gnu.h, s/gnu-linux.h:
533 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
534
b41253a3
JW
5352012-07-11 John Wiegley <johnw@newartisans.com>
536
537 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
538 function attribute, so we only use it if it exists in the
539 compiler.
540
d923b542
DA
5412012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
542
543 Avoid call to strlen in fast_c_string_match_ignore_case.
544 * search.c (fast_c_string_match_ignore_case): Change to use
545 length argument. Adjust users accordingly.
546 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
547
5ebbef1d
PE
5482012-07-11 Paul Eggert <eggert@cs.ucla.edu>
549
bb352260
PE
550 Assume mkdir, rmdir.
551 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
552 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
553
57054ddd
PE
554 Assume rename.
555 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
556
b747d3f7
PE
557 Assume perror.
558 * s/hpux10-20.h (HAVE_PERROR): Remove.
559 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
560 Remove dummy definition, as this problem was obsolete long ago.
561
5ebbef1d
PE
562 Assume strerror.
563 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
564
984e7f30
DA
5652012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
566
567 Avoid calls to strlen in font processing functions.
568 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 569 (font_open_by_name): Change to use length argument. Adjust
984e7f30 570 users accordingly.
d923b542
DA
571 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
572 Adjust prototypes.
573 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
574 Change to return ptrdiff_t.
984e7f30
DA
575 (xfont_list_pattern, xfont_match): Use length returned by
576 xfont_decode_coding_xlfd.
577 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
578
20e94fdd
GM
5792012-07-11 Glenn Morris <rgm@gnu.org>
580
9d596af3
GM
581 * s/darwin.h, s/freebsd.h, s/netbsd.h:
582 Move DONT_REOPEN_PTY to configure.
583
20e94fdd
GM
584 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
585 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
586
e99a530f
PE
5872012-07-10 Paul Eggert <eggert@cs.ucla.edu>
588
22ffb973
PE
589 Remove "#define unix" that is no longer needed (Bug#11905).
590 * s/aix4-2.h (unix): Remove; no longer needed.
591
e9a9ae03
PE
592 EMACS_TIME simplification (Bug#11875).
593 This replaces macros (which typically do not work in GDB)
594 with functions, typedefs and enums, making the code easier to debug.
595 The functional style also makes code easier to read and maintain.
596 * systime.h: Include <sys/time.h> on all hosts, not just if
597 WINDOWSNT, since 'struct timeval' is needed in general.
598 (EMACS_TIME): Now a typedef, not a macro.
599 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
600 not macros.
601 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
602 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
603 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
604 (EMACS_TIME_LE): Now functions, not macros.
605 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
606 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
607 which are not functions. All uses rewritten to use:
608 (make_emacs_time): New function.
609 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
610 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
611 not functions. All uses rewritten to use the following, respectively:
612 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
613 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 614 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
615 * fileio.c (Fcopy_file):
616 * xterm.c (XTflash): Get the current time closer to when it's used.
617 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
618
ffacb126
PE
619 * bytecode.c (targets): Suppress -Woverride-init warnings.
620
e99a530f
PE
621 Simplify by avoiding confusing use of strncpy etc.
622 * doc.c (Fsnarf_documentation):
623 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
624 * frame.c (Fmake_terminal_frame):
625 * gtkutil.c (get_utf8_string):
626 * lread.c (openp):
627 * nsmenu.m (ns_update_menubar):
628 * regex.c (regerror):
629 Prefer memcpy to strncpy and strncat when either will do.
630 * fileio.c (Fsubstitute_in_file_name):
631 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
632 (menu_separator_name_p):
633 * nsmenu.m (ns_update_menubar):
634 Prefer memcmp to strncmp when either will do.
635 * nsterm.m: Include <ftoastr.h>.
636 (ns_get_color):
637 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
638 Prefer snprintf to strncpy.
639 * nsterm.m (ns_term_init):
640 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
641 * nsterm.m (ns_term_init):
642 Avoid the need for strncpy, by using build_string or
643 make_unibyte_string directly. Use dtoastr, not snprintf.
644 * process.c (Fmake_network_process): Diagnose service names that
645 are too long, rather than silently truncating them or creating
646 non-null-terminated names.
647 (Fnetwork_interface_info): Likewise, for interface names.
648 * sysdep.c (system_process_attributes) [GNU_LINUX]:
649 Prefer sprintf to strncat.
650 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
651 Prefer vsnprintf to vsprintf + strncpy.
652
c59592b3
GM
6532012-07-10 Glenn Morris <rgm@gnu.org>
654
655 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
656 Clarify fallback case.
657
7d7bbefd
DA
6582012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
659
660 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
661 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
662 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 663 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
664 where argument type is known to be a Lisp_Cons.
665
3a4c8000
TT
6662012-07-10 Tom Tromey <tromey@redhat.com>
667
668 * bytecode.c (BYTE_CODE_THREADED): New macro.
669 (BYTE_CODES): New macro. Replaces all old byte-code defines.
670 (enum byte_code_op): New type.
671 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
672 (exec_byte_code): Use them. Use token threading when applicable.
673
2a0213a6
DA
6742012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
675
676 Optimize pure C strings initialization.
677 * lisp.h (make_pure_string): Fix prototype.
678 (build_pure_c_string): New function, defined as static inline. This
679 provides a better opportunity to optimize away calls to strlen when
680 the function is called with compile-time constant argument.
681 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
682 argument, adjust users accordingly. Use build_pure_c_string where
683 appropriate.
684 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
685 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
686 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
687
cb1caeaf
DA
6882012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
689
690 Avoid calls to strlen in miscellaneous functions.
691 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
692 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
693 * lread.c (openp): Likewise.
694
c293e30c
DA
6952012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
696
697 Avoid calls to strlen in path processing functions.
698 * fileio.c (file_name_as_directory): Add comment. Change to add
699 srclen argument and return the length of result. Adjust users
700 accordingly.
701 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 702 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
703 users accordingly.
704 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
705
9e059e3f
GM
7062012-07-10 Glenn Morris <rgm@gnu.org>
707
d02eb359
GM
708 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
709 Move PENDING_OUTPUT_COUNT definition to configure.
710
882cf227
GM
711 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
712 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
713 * s/gnu.h (DATA_START): Move definitions to configure.
714
af6e839f
GM
715 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
716 We include usg5-4-common.h, which defines them both.
717
40289a12
GM
718 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
719 O_RDONLY already includes it).
720
9e059e3f
GM
721 Stop ns builds setting the EMACSLOADPATH environment variable.
722 * nsterm.m (ns_load_path): Rename from ns_init_paths.
723 Now it does not set EMACSLOADPATH, just returns the load-path string.
724 * nsterm.h: Update accordingly.
725 * lread.c [HAVE_NS]: Include nsterm.h.
726 (init_lread) [HAVE_NS]: Use ns_load_path.
727 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
728
7c4e8ec0
GM
7292012-07-09 Glenn Morris <rgm@gnu.org>
730
d4f600ff
GM
731 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
732 since the included bsd-common.h does so.
733
cbb31951
GM
734 Stop ns builds setting the EMACSPATH environment variable.
735 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
736 (ns_init_paths): Do not set EMACSPATH.
737 * nsterm.h (ns_exec_path): Add it.
738 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
739 Use ns_exec_path.
740
7c4e8ec0
GM
741 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
742
26bccfae
PE
7432012-07-09 Paul Eggert <eggert@cs.ucla.edu>
744
a0bee46f
PE
745 * process.c (wait_reading_process_output): 'waitchannels' was unset
746 when read_kbd || !NILP (wait_for_cell); fix this.
747
5994c183
PE
748 Add GCC-style 'const' attribute to functions that can use it.
749 * character.h (char_resolve_modifier_mask):
750 * keyboard.h (make_ctrl_char):
751 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
752 (init_character_once, next_almost_prime, init_fns, init_image)
753 (flush_pending_output, init_sound):
754 * mem-limits.h (start_of_data):
755 * menu.h (finish_menu_items):
756 Add ATTRIBUTE_CONST.
757 * emacs.c (DEFINE_DUMMY_FUNCTION):
758 Declare the dummy function with ATTRIBUTE_CONST.
759 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
760 Add decls with ATTRIBUTE_CONST.
761
26bccfae
PE
762 Minor improvements to make_formatted_string.
763 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
764 where int is good enough, as vsprintf returns an int.
765 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
766
a8290ec3
DA
7672012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
768
769 Use make_formatted_string to avoid double length calculation.
770 * lisp.h (make_formatted_string): New prototype.
771 * alloc.c (make_formatted_string): New function.
772 * buffer.c (Fgenerate_new_buffer_name): Use it.
773 * dbus.c (syms_of_dbusbind): Likewise.
774 * editfns.c (Fcurrent_time_zone): Likewise.
775 * filelock.c (get_boot_time): Likewise.
776 * frame.c (make_terminal_frame, set_term_frame_name)
777 (x_report_frame_params): Likewise.
778 * image.c (gs_load): Likewise.
779 * minibuf.c (get_minibuffer): Likewise.
780 * msdos.c (dos_set_window_size): Likewise.
781 * process.c (make_process): Likewise.
782 * xdisp.c (ensure_echo_area_buffers): Likewise.
783 * xsettings.c (apply_xft_settings): Likewise.
784
d01ba2f1
GM
7852012-07-09 Glenn Morris <rgm@gnu.org>
786
787 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
788 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
789 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
790 * nsterm.h (ns_etc_directory): Add it.
791 * callproc.c [HAVE_NS]: Include nsterm.h.
792 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
793
f1f924b6
DA
7942012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
795
796 Move marker debugging code under MARKER_DEBUG.
797 * marker.c (MARKER_DEBUG): Move marker debugging code under
798 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
799 for bootstrap with --enable-checking (~3x slowdown reported
800 by Juanma Barranquero <lekktu@gmail.com>).
801 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
802
ab531b66
PE
8032012-07-08 Paul Eggert <eggert@cs.ucla.edu>
804
805 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
806 See <http://bugs.gnu.org/11825#29>.
807
c4b3bc8a
EZ
8082012-07-08 Eli Zaretskii <eliz@gnu.org>
809
810 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
811 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
812 (display_line): Add commentary about displaying truncation glyphs
813 on GUI frames.
814 (produce_special_glyphs): Move here from term.c.
815
816 * term.c (produce_special_glyphs): Move to xdisp.c.
817
818 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
819 section.
c4b3bc8a 820
b676b881
AS
8212012-07-07 Andreas Schwab <schwab@linux-m68k.org>
822
f17c5273
AS
823 * xdisp.c (display_line): Avoid warning about implicit declaration
824 of FRAME_FONT.
825
298819b9
AS
826 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
827
b676b881
AS
828 * lisp.h: Remove empty conditional.
829
6045c4fd
PE
8302012-07-07 Paul Eggert <eggert@cs.ucla.edu>
831
b3350bf9
PE
832 * lread.c (load_path_check): Now static.
833
6045c4fd
PE
834 Fix some minor --with-ns problems found by static checking.
835 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
836 (x_set_font) [!HAVE_X_WINDOWS]:
837 * image.c (xpm_load_image) [HAVE_NS]:
838 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
839 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
840 Remove unused local.
841 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
842 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
843 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
844 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
845 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
846 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
847 Fix pointer signedness problem.
848 * xfaces.c (FRAME_X_FONT_TABLE):
849 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
850
929e7845
GM
8512012-07-07 Glenn Morris <rgm@gnu.org>
852
853 * lread.c (load_path_check): New function, split from init_lread.
854 (init_lread): Reorganize. Motivation:
855 If EMACSLOADPATH is set, check/warn about that rather than the
856 defaults, which we are not going to use. Hence we can remove
857 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
858 Don't warn if site-lisp directories are missing.
859 If not installed, start from a blank load-path, since
860 PATH_LOADSEARCH refers to the eventual installation directories.
861
58dd0aa4
EZ
8622012-07-07 Eli Zaretskii <eliz@gnu.org>
863
864 Support truncation and continuation glyphs on GUI frames, when
865 fringes are disabled. (Bug#11832)
866 * xdisp.c (init_iterator): Get dimensions of truncation and
867 continuation glyphs even if on GUI frames. Adjust
868 it->last_visible_x on GUI frames when the left or right fringes,
869 or both, are absent.
870 (start_display, move_it_in_display_line_to): Handle the case of a
871 GUI frame without a fringe to display continuation or truncation
872 glyphs.
873 (insert_left_trunc_glyphs): Support GUI frames: make sure
874 truncation glyphs overwrite enough glyphs from the current line to
875 have sufficient space in pixels.
876 (display_line): Support truncation and continuation glyphs on GUI
877 frames. If some spare pixels are left on the line after inserting
878 the truncation glyphs, fill that space with a stretch glyph of a
879 suitably computed width.
880
881 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
882 produce_glyphs, to support GUI sessions.
883
31571fd7
PE
8842012-07-07 Paul Eggert <eggert@cs.ucla.edu>
885
5a16b9bc
PE
886 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
887
f3047c75
PE
888 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
889
31571fd7
PE
890 Do not require float-time's arg to fit in time_t (Bug#11825).
891 This works better on hosts where time_t is unsigned, and where
892 float-time is applied to the (negative) difference between two times.
893 * editfns.c (decode_time_components): Last arg is now double *,
894 not int *, and means to store all the result as a double, without
895 worrying about whether the seconds part fits in time_t.
896 All callers changed.
897 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
898 All callers changed.
899 (Ffloat_time): Do not fail merely because the specified time falls
900 outside of time_t range.
901
4516fbef
GM
9022012-07-07 Glenn Morris <rgm@gnu.org>
903
904 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
905 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
906 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
907
07adc2c6
JB
9082012-07-07 Juanma Barranquero <lekktu@gmail.com>
909
910 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
911 Update dependencies.
912
913 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
914
fd573f31
PE
9152012-07-06 Paul Eggert <eggert@cs.ucla.edu>
916
fee5959d
PE
917 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
918 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
919 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
920 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
921 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
922 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
923
fd573f31
PE
924 * xfont.c (compare_font_names): Redo to omit the need for casts.
925
ddadbc0e
AS
9262012-07-06 Andreas Schwab <schwab@linux-m68k.org>
927
fca8d6b6
AS
928 * xfns.c (Fx_change_window_property): Doc fix.
929 * w32fns.c (Fx_change_window_property): Doc fix.
930
ddadbc0e
AS
931 * w32fns.c (Fx_window_property): Accept the same arguments as the
932 X Windows version. Doc fix.
933 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
934
ed9265fc 9352012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
936 Eli Zaretskii <eliz@gnu.org>
937
938 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
939 Windows-specific code from nt/config.nt moved here.
940 Obsolete settings removed.
941
216ee680
PE
9422012-07-06 Paul Eggert <eggert@cs.ucla.edu>
943
944 * process.c: Avoid unnecessary calls to gettime.
945 (wait_reading_process_output): Don't get the time of day
946 when gobbling data immediately and not waiting, as there's no need
947 for it in that case. This removes a FIXME.
948
bdd091e4
JD
9492012-07-06 Jan Djärv <jan.h.d@swipnet.se>
950
951 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
952 is defined (Bug#11768).
953
9d44f8ce
DA
9542012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
955
956 Fix marker debugging code.
957 * marker.c (byte_char_debug_check): Do not perform the check
958 if buffer is not multibyte.
090bd7cb
JB
959 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
960 Call byte_char_debug_check with correct arguments.
9d44f8ce 961
90fc4786
DA
9622012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
963
964 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
965 * marker.c (byte_char_debug_check, count_markers):
966 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
967 (byte_debug_flag): Remove.
968 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
969 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
970
7b7ae965
DA
9712012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
972
4e57b342
DA
973 Avoid code repetition in marker-related functions.
974 * marker.c (attach_marker): New function.
975 (Fset_marker, set_marker_restricted, set_marker_both)
976 (set_marker_restricted_both): Use it.
977 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
978 Consistently rename charno to charpos.
979 (marker_position): Add eassert.
980 (marker_byte_position): Convert to eassert.
981
9822012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
983
984 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 985 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 986 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 987
657924ff
DA
9882012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
989
990 Introduce fast path for the widely used marker operation.
991 * alloc.c (build_marker): New function.
992 * lisp.h (build_marker): New prototype.
993 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
994 * composite.c (autocmp_chars): Likewise.
995 * editfns.c (buildmark): Remove.
996 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
997 (save_restriction_save): Use build_marker.
998 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
999 * window.c (save_window_save): Likewise.
1000
041a49a6
DA
10012012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1002
1003 Do not use Fdelete_overlay in delete_all_overlays
1004 to avoid redundant calls to unchain_overlay.
1005 * buffer.c (drop_overlay): New function.
1006 (delete_all_overlays, Fdelete_overlay): Use it.
1007 * minibuf.c (get_minibuffer): Fix comment.
1008
7dca65a4
PE
10092012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1010
1011 Port to OpenBSD 5.1 amd64.
1012 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
1013 This is needed for OpenBSD, and should be harmless on all BSD systems.
1014 Also, include <sys/sysctl.h>, as it should be available on all
1015 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
1016 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
1017 use p_pid member, not kp_proc.pid.
1018
8eb876e2
GM
10192012-07-06 Glenn Morris <rgm@gnu.org>
1020
1021 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
1022
38182d90
PE
10232012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1024
1025 More xmalloc and related cleanup.
1026 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
1027 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
1028 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
1029 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
1030 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
1031 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
1032 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
1033 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
1034 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
1035 * xterm.c:
1036 Omit needless casts involving void * pointers and allocation.
1037 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
1038 as the former is more robust if P's type is changed.
1039 Prefer xzalloc to xmalloc + memset 0.
1040 Simplify malloc-or-realloc to realloc.
1041 Don't worry about xmalloc returning a null pointer.
1042 Prefer xstrdup to xmalloc + strcpy.
1043 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
1044 growing it.
1045 * keyboard.c (apply_modifiers_uncached): Prefer local array to
1046 alloca of a constant.
1047
6dd5a677
EZ
10482012-07-05 Eli Zaretskii <eliz@gnu.org>
1049
1050 * xdisp.c (display_line): Fix horizontal pixel coordinates when
1051 hscroll is larger than the line width. Fixes long and futile
1052 looping inside extend_face_to_end_of_line (on a TTY) producing
1053 glyphs that are not needed and thrown away.
1054
6b312f0f
DA
10552012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1056
1057 * marker.c (set_marker_restricted_both): Simplify by using
1058 clip_to_bounds.
1059
f520ef9b
PE
10602012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1061
1062 * editfns.c (region_limit): Simplify by using clip_to_bounds.
1063
383b7c95
JD
10642012-07-05 Jan Djärv <jan.h.d@swipnet.se>
1065
1066 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
1067 not defined (Bug#11768).
1068 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
1069 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
1070 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
1071 followed by gtk_box_set_homogeneous (Bug#11768).
1072 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
1073 (update_theme_scrollbar_width, xg_create_scroll_bar):
1074 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
1075 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
1076 (is_box_type): New function (Bug#11768).
1077 (xg_tool_item_stale_p): Call is_box_type.
5293d758 1078 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
1079 with default display (Bug#11768).
1080
d6e7bf45
EZ
10812012-07-05 Eli Zaretskii <eliz@gnu.org>
1082
1083 * xdisp.c (window_hscroll_limited): New function.
1084 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
1085 coordinates when window's hscroll is set to insanely large
1086 values. (Bug#11857)
1087
431391ec
JB
10882012-07-05 Juanma Barranquero <lekktu@gmail.com>
1089
1090 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
1091 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
1092
23f86fce
DA
10932012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1094
1095 Cleanup xmalloc.
1096 * lisp.h (xzalloc): New prototype. Omit needless casts.
1097 * alloc.c (xzalloc): New function. Omit needless casts.
1098 * charset.c: Omit needless casts. Convert all calls to
1099 xmalloc with following memset to xzalloc.
1100 * dispnew.c: Likewise.
1101 * fringe.c: Likewise.
1102 * image.c: Likewise.
1103 * sound.c: Likewise.
1104 * term.c: Likewise.
1105 * w32fns.c: Likewise.
1106 * w32font.c: Likewise.
1107 * w32term.c: Likewise.
1108 * xfaces.c: Likewise.
1109 * xfns.c: Likewise.
1110 * xterm.c: Likewise.
1111 * atimer.c: Omit needless casts.
1112 * buffer.c: Likewise.
1113 * callproc.c: Likewise.
1114 * ccl.c: Likewise.
1115 * coding.c: Likewise.
1116 * composite.c: Likewise.
1117 * doc.c: Likewise.
1118 * doprnt.c: Likewise.
1119 * editfns.c: Likewise.
1120 * emacs.c: Likewise.
1121 * eval.c: Likewise.
1122 * filelock.c: Likewise.
1123 * fns.c: Likewise.
1124 * gtkutil.c: Likewise.
1125 * keyboard.c: Likewise.
1126 * lisp.h: Likewise.
1127 * lread.c: Likewise.
1128 * minibuf.c: Likewise.
1129 * msdos.c: Likewise.
1130 * print.c: Likewise.
1131 * process.c: Likewise.
1132 * region-cache.c: Likewise.
1133 * search.c: Likewise.
1134 * sysdep.c: Likewise.
1135 * termcap.c: Likewise.
1136 * terminal.c: Likewise.
1137 * tparam.c: Likewise.
1138 * w16select.c: Likewise.
1139 * w32.c: Likewise.
1140 * w32reg.c: Likewise.
1141 * w32select.c: Likewise.
1142 * w32uniscribe.c: Likewise.
1143 * widget.c: Likewise.
1144 * xdisp.c: Likewise.
1145 * xmenu.c: Likewise.
1146 * xrdb.c: Likewise.
1147 * xselect.c: Likewise.
1148
0497dc44
PE
11492012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1150
1151 * fileio.c (time_error_value): Check the right error number.
1152 Problem reported by Troels Nielsen in
1153 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
1154
356e7178
PE
11552012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1156
4e71fd89
PE
1157 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
1158 This should be fixed in a better way; see Eli Zaretskii in
1159 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
1160 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
1161
f0941253
PE
1162 * fileio.c (time_error_value): Rename from special_mtime.
1163 The old name's problems were noted by Eli Zaretskii in
1164 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
1165
065c9eb4
PE
1166 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
1167 This variable's comment says Emacs needs at least one GDB-visible
1168 symbol of type enum pvec_type, to work around GDB problems.
1169 The symbol's value doesn't matter.
1170
356e7178
PE
1171 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
1172 that causes compilation to fail on pre-C99 compilers.
1173
ed9265fc 11742012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
1175
1176 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
1177 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
1178
3884d954
DA
11792012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1180
d209e2fb 1181 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
1182 headers for buffer_defaults and buffer_local_symbols.
1183 Reported by Juanma Barranquero <lekktu@gmail.com>.
1184
ee28be33
SM
11852012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1186
1187 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
1188 * lisp.h (enum pvec_type): Use fewer bits.
1189 (PSEUDOVECTOR_SIZE_BITS): New constant.
1190 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
1191 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
1192 change in pvec_type.
1193 (PSEUDOVECTOR_TYPEP): New macro.
1194 (TYPED_PSEUDOVECTORP): Use it.
1195 * fns.c (internal_equal): Adapt code to extract pvectype.
1196 * emacs.c (gdb_pvec_type): Update type.
1197 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
1198 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
1199 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
1200 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
1201 (sweep_vectors): Use it. Use local var `total_bytes' instead of
1202 abusing vector->header.next.nbytes.
1203 (live_vector_p): Use PVEC_TYPE.
1204 (mark_object): Adapt code to extract pvectype. Use switch.
1205
c7f2cd7f
PE
12062012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1207
1208 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
1209 Tighten new eassert a bit.
1210
8ce70ed2
DA
12112012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1212
1213 Fix compilation with --enable-gcc-warnings and -O1
1214 optimization level.
1215 * doprnt.c (doprnt): Change type of tem to int, initialize
1216 to avoid compiler warning. Add eassert.
1217 * search.c (simple_search): Initialize match_byte to avoid
1218 compiler warning. Add eassert.
1219
dea7f1e5
PE
12202012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1221
24a212eb
PE
1222 Avoid weird behavior with large horizontal scrolls.
1223 Without this change, for example, large hscroll values would
1224 mess up Emacs's display on Fedora 15 x86, presumably due to
1225 overflows in int calculations in the display code.
1226 Also, if buffers had long lines, Emacs would freeze.
1227 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
1228 (set_window_hscroll): New function, containing the old guts of
1229 Fset_window_hscroll. Return the clipped value.
1230 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
1231 This avoids the need to check against PTRDIFF_MAX.
1232
dea7f1e5
PE
1233 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
1234
76046526
DA
12352012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1236
1237 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
1238
39adff0d
PE
12392012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1240
63807d47
PE
1241 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
1242 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
1243 since GCC 4.4.6 issues a bogus warning for them.
1244
39adff0d
PE
1245 Fix bugs in file timestamp newness comparisons.
1246 * fileio.c (Ffile_newer_than_file_p):
1247 * lread.c (Fload): Use full timestamp resolution of files,
1248 not just the 1-second resolution, so that files that are only
1249 slightly newer still count as newer.
1250 * fileio.c (Ffile_newer_than_file_p): Don't assume file
1251 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
1252
dbeed9a6
PE
12532012-07-03 Paul Eggert <eggert@cs.ucla.edu>
1254
1255 * fileio.c: Improve handling of file time marker. (Bug#11852)
1256 (special_mtime): New function.
1257 (Finsert_file_contents, Fverify_visited_file_modtime):
1258 Use it to set special mtime values consistently.
1259
636334d6
AS
12602012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1261
1262 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1263 marker for non-existing file. (Bug#11852)
1264
e2017fe2
GM
12652012-07-03 Glenn Morris <rgm@gnu.org>
1266
1267 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1268 and did not make it into globals.h).
1269
404dbd37
TT
12702012-07-03 Tom Tromey <tromey@redhat.com>
1271
1272 * window.c (Fset_window_margins, Fset_window_fringes)
1273 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1274 * textprop.c (Fprevious_property_change): No longer static.
1275 * syntax.c (Fsyntax_table_p): No longer static.
1276 * process.c (Fget_process, Fprocess_datagram_address): No longer
1277 static.
1278 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1279 * keyboard.c (Fcommand_execute): No longer static.
1280 Remove EXFUN.
1281 * insdel.c (Fcombine_after_change_execute): No longer static.
1282 * image.c (Finit_image_library): No longer static.
1283 * fileio.c (Fmake_symbolic_link): No longer static.
1284 * eval.c (Ffetch_bytecode): No longer static.
1285 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
1286 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1287 No longer static.
404dbd37
TT
1288 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1289 static.
1290 * dired.c (Ffile_attributes): No longer static.
1291 * composite.c (Fcomposition_get_gstring): No longer static.
1292 * callproc.c (Fgetenv_internal): No longer static.
1293
1294 * ccl.h: Remove EXFUNs.
1295 * buffer.h: Remove EXFUNs.
1296 * dispextern.h: Remove EXFUNs.
1297 * intervals.h: Remove EXFUNs.
1298 * fontset.h: Remove EXFUN.
1299 * font.h: Remove EXFUNs.
1300 * dosfns.c (system_process_attributes): Remove EXFUN.
1301 * keymap.h: Remove EXFUNs.
1302 * lisp.h: Remove EXFUNs.
1303 * w32term.h: Remove EXFUNs.
1304 * window.h: Remove EXFUNs.
1305 * xsettings.h: Remove EXFUN.
1306 * xterm.h: Remove EXFUN.
1307
8e4fd1e1
GM
13082012-07-03 Glenn Morris <rgm@gnu.org>
1309
1310 * lisp.h (Frandom): Make it visible to C.
1311 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1312 buffer for invisible buffers. (Bug#1229)
1313
ca95b3eb
DA
13142012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1315
1316 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1317 values which aren't power of 2.
1318 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1319 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1320 accordingly.
1321
7555c33f
SM
13222012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1323
1324 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1325
1326 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1327
d12e8f5a
DA
13282012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1329
1330 * alloc.c (allocate_vector_block): Remove redundant
1331 calls to mallopt if DOUG_LEA_MALLOC is defined.
1332 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1333 avoid calls to mallopt if zero_vector is returned.
1334
296094c3
DA
13352012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1336
1337 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
1338 is enabled, avoid dereferencing NULL current_sblock if
1339 running undumped.
1340
36429c89
DA
13412012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1342
1343 Cleanup basic buffer management.
1344 * buffer.h (struct buffer): Change layout to use generic vector
1345 marking code. Fix some comments. Change type of 'clip_changed'
1346 to bitfield. Remove unused #ifndef old.
1347 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1348 (GET_OVERLAYS_AT): Fix indentation.
1349 (for_each_per_buffer_object_at): New macro.
1350 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1351 (Fbuffer_local_variables): Use it.
1352 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1353 * alloc.c (allocate_buffer): Adjust to match new layout of
1354 struct buffer. Fix comment.
1355 (mark_overlay): New function.
1356 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1357 Lisp area of struct buffer.
1358 (mark_object): Use it. Adjust marking of misc objects
1359 and related comments.
1360
3b3e4cac
PE
13612012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1362
1363 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1364 wrapper that is not needed because the wrapped code is a no-op (zero
1365 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1366 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1367
cf5c0175
DA
13682012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1369
1370 * alloc.c (mark_buffer): Simplify. Remove prototype.
1371 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1372 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1373 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1374 redundant calls to mark_vectorlike for bool vectors.
1375
ca26824c
GM
13762012-06-30 Glenn Morris <rgm@gnu.org>
1377
2e4c5312
GM
1378 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1379
ca26824c
GM
1380 * epaths.in (PATH_SITELOADSEARCH): New.
1381 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1382 This is rather than relying on --enable-locallisppath elements
1383 having "site-lisp" in their names. (Bug#10208#25, 11658)
1384
0d23c240
EZ
13852012-06-30 Eli Zaretskii <eliz@gnu.org>
1386
c9240d7a
EZ
1387 * w32proc.c (sys_select): Accept and ignore one more argument.
1388
1389 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1390
0d23c240 1391 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1392 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1393
1394 * sysdep.c: Don't include dos.h and dosfns.h.
1395
1396 * process.c (sys_select):
1397 * msdos.c (sys_select): Accept one more argument and ignore it.
1398
1399 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1400 adapt data types and code to that.
1401
1402 * dosfns.c:
1403 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1404 which clashes with the gnulib function of the same name.
1405
af5a5a98
AS
14062012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1407
c5e4379c
AS
1408 * font.c (font_style_to_value, font_style_symbolic)
1409 (font_prop_validate_style): Add type checks for values in
1410 font_style_table.
1411
af5a5a98
AS
1412 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1413 argument.
1414 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1415 uses.
1416
8d38f461
EZ
14172012-06-29 Eli Zaretskii <eliz@gnu.org>
1418
2e5a6631
EZ
1419 * xdisp.c (try_window_id): Undo last change.
1420
8d38f461
EZ
1421 * w32.c (getwd): Adjust commentary about startup_dir.
1422 (init_environment): Always call sys_access, even in non-MSVC
1423 builds. Don't chdir to the directory of the Emacs executable.
1424 This undoes code from 1997 which was justified by the need to
1425 "avoid conflicts when removing and renaming directories". But its
1426 downside was that every relative file name was being interpreted
1427 relative to the directory of the Emacs executable, which can never
1428 be TRT. In particular, it broke sys_access when called with
1429 relative file names.
1430 (sys_access): Map GetLastError to errno.
1431
2af3565e
DA
14322012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1433
1434 * window.h (struct window): Change type of 'fringes_outside_margins'
1435 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1436 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1437 Adjust comment.
1438 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1439 to ptrdiff_t.
1440
c8d3a25c 14412012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1442
c8d3a25c
GM
1443 * gnutls.c (emacs_gnutls_handshake):
1444 Add QUIT to make the loop interruptible.
57570cd3 1445
c8d3a25c 14462012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1447
c8d3a25c
GM
1448 * charset.c (init_charset): Make lack of etc/charsets fatal.
1449
3e984ee8
DA
14502012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1451
1452 * editfns.c (region_limit): Fix type mismatch.
1453
ef884f23
DA
14542012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1455
1456 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1457 undefined. Convert from xassert to eassert.
1458 * nsmenu.m: Convert from xassert to eassert.
1459 * nsterm.m: Likewise.
1460
7d7e0027
SM
14612012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1462
1463 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1464
aa754e6a
PE
14652012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1466
1467 Avoid integer overflow on scroll-left and scroll-right.
1468 * window.c (HSCROLL_MAX): New macro.
1469 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1470 overflow when requested scroll falls outside ptrdiff_t range.
1471
80b00b08
DA
14722012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1473
1474 * window.h (struct window): Change type of 'hscroll',
1475 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1476 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1477 Adjust users accordingly.
1478 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1479 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1480 from EMACS_INT to ptrdiff_t.
1481 (make_window): Omit redundant initialization.
1482
62b2bcf6
JB
14832012-06-28 Juanma Barranquero <lekktu@gmail.com>
1484
1485 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1486
45942c7d
DA
14872012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1488
1489 * window.h (struct window): Change type of 'use_time' and
1490 'sequence_number' from Lisp_Object to int.
1491 * frame.c (make_frame): Adjust users accordingly.
1492 * print.c (print_object): Likewise.
1493 * window.c (select_window, Fwindow_use_time, make_parent_window)
1494 (make_window): Likewise.
1495
e509cfa6
DA
14962012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1497
1498 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1499 enabled with --enable-checking=[all,glyphs] configure option.
1500 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1501 adjust comments accordingly.
1502 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1503 undefined, adjust comments accordingly.
1504 * image.c: Likewise.
1505 * scroll.c: Likewise.
1506 * w32fns.c: Likewise.
1507 * w32term.c: Likewise.
1508 * xdisp.c: Likewise.
1509 * xfaces.c: Likewise.
1510 * xfns.c: Likewise.
1511 * xterm.c: Likewise.
1512
a54e2c05
DA
15132012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1514
1515 Generalize run-time debugging checks.
1516 * dispextern.h (XASSERTS): Remove.
1517 * fontset.c (xassert): Remove.
1518 Convert from xassert to eassert.
1519 * alloc.c: Convert from xassert to eassert.
1520 * bidi.c: Likewise.
1521 * dispnew.c: Likewise.
1522 * fns.c: Likewise.
1523 * fringe.c: Likewise.
1524 * ftfont.c: Likewise.
1525 * gtkutil.c: Likewise.
1526 * image.c: Likewise.
1527 * keyboard.c: Likewise.
1528 * menu.c: Likewise.
1529 * process.c: Likewise.
1530 * scroll.c: Likewise.
1531 * sound.c: Likewise.
1532 * term.c: Likewise.
1533 * w32console.c: Likewise.
1534 * w32fns.c: Likewise.
1535 * w32term.c: Likewise.
1536 * window.c: Likewise.
1537 * xdisp.c: Likewise.
1538 * xfaces.c: Likewise.
1539 * xfns.c: Likewise.
1540 * xselect.c: Likewise.
1541 * xterm.c: Likewise.
1542
1ec4b7b2
SM
15432012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1544
1545 * fns.c (maybe_resize_hash_table): Output message when growing the
1546 purify-hashtable.
1547
2014308a
DA
15482012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1549
1550 * alloc.c (allocate_string_data): Remove dead code.
1551 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1552 avoid GCC warning about unused macro.
1553
246155eb
DA
15542012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1555
1556 * alloc.c (allocate_string): Omit intervals initialization.
1557 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1558 as in make_pure_string and make_pure_c_string.
1559
43184b7b
DA
15602012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1561
d209e2fb 1562 * alloc.c (allocate_string): Fix last change.
43184b7b 1563
3fe6dd74
DA
15642012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1565
d209e2fb 1566 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1567 to memset, add explicit initialization where appropriate.
1568
1ba6038a
GM
15692012-06-27 Glenn Morris <rgm@gnu.org>
1570
1571 * lisp.mk (lisp): Remove paths.elc.
1572
c89926a5
CY
15732012-06-27 Chong Yidong <cyd@gnu.org>
1574
1575 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1576
ed6b3510
JW
15772012-06-26 John Wiegley <johnw@newartisans.com>
1578
1ec4b7b2 1579 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1580 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1581
ed6b3510
JW
1582 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1583 when building with Clang.
1584
8edd4a2b
SM
15852012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1586
1587 * eval.c (Fapply): Allow calling it with a single argument.
1588
f6f62d1b
EZ
15892012-06-26 Eli Zaretskii <eliz@gnu.org>
1590
1591 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1592 _stricmp and _strnicmp.
1593 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1594
62efea5e
DA
15952012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1596
1597 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1598 allocated window.
1599 (allocate_process): Likewise for new process.
8edd4a2b 1600 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1601 (allocate_frame): Likewise.
1602 * frame.c (make_frame): Omit redundant initialization.
1603 * window.c (make_parent_window): Use memset.
1604 (make_window): Omit redundant initialization.
1605 * process.c (make_process): Omit redundant initialization.
1606 * terminal.c (create_terminal): Likewise.
1607
42997f4d
DA
16082012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1609
1610 * term.c (delete_tty): Remove redundant call to memset.
1611
1130ecfc
DA
16122012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1613
1614 * alloc.c: Remove build_string.
1615 * lisp.h: Define build_string as static inline. This provides
1616 a better opportunity to optimize away calls to strlen when the
1617 function is called with compile-time constant argument.
1618 * image.c (imagemagick_error): Convert to build_string.
1619 * w32proc.c (sys_spawnve): Likewise.
1620 * xterm.c (x_term_init): Likewise.
1621
cf38a720
PE
16222012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1623
99027bdd
PE
1624 Use sprintf return value instead of invoking strlen on result.
1625 In the old days this wasn't portable, since some sprintf
1626 implementations returned char *. But they died out years ago and
1627 Emacs already assumes sprintf returns int.
1628 Similarly for float_to_string.
1629 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1630 * ccl.c (ccl_driver):
1631 * character.c (string_escape_byte8):
1632 * data.c (Fnumber_to_string):
1633 * doprnt.c (doprnt):
1634 * print.c (print_object):
1635 * xdisp.c (message_dolog):
1636 * xfns.c (syms_of_xfns):
1637 Use sprintf or float_to_string result to avoid need to call strlen.
1638 * data.c (Fnumber_to_string):
1639 Use make_unibyte_string, since the string must be ASCII.
1640 * lisp.h, print.c (float_to_string): Now returns int length.
1641 * term.c (produce_glyphless_glyph):
1642 Use sprintf result rather than recomputing it.
1643
cf38a720
PE
1644 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1645 * Makefile.in (ALL_CFLAGS):
1646 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1647 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1648
3511c784
DA
16492012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1650
0a08eb21 1651 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1652 strcasecmp if available.
1653 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1654
fb7da12e
AS
16552012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1656
1657 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1658 Avoid comma operator.
1659 * menu.c (push_submenu_start, push_submenu_end)
1660 (push_left_right_boundary, push_menu_pane): Likewise.
1661 * msdos.c (dos_rawgetc): Likewise.
1662
afa2ffd8
DA
16632012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1664
1665 * xfns.c (xic_create_fontsetname): Remove redundant calls
1666 to memset.
1667
b3b4476b
PE
16682012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1669
4495ff38
PE
1670 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1671 sprintf already null-terminates its output.
1672
b3b4476b
PE
1673 * xfns.c (x_window): Remove redundant cast.
1674
b00876c9
DA
16752012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1676
1677 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1678 `const char *' to `char *' to avoid compiler warning.
1679
d188e26b
PE
16802012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1681
885d1d74
PE
1682 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1683 instead of truncating it to 63 (admittedly a generous limit).
1684
d188e26b
PE
1685 * process.c: Fix spelling and caps in comments.
1686
e2f560b1
DN
16872012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1688
e86db54b 1689 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1690 * sysdep.c (setpgrp): Remove definition, not used in this file.
1691
7583a3a1
JB
16922012-06-24 Juanma Barranquero <lekktu@gmail.com>
1693
1694 * makefile.w32-in: Update dependencies.
1695
696056c2
EZ
16962012-06-24 Eli Zaretskii <eliz@gnu.org>
1697
1698 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1699 (SYSTIME_H): Add nt/inc/sys/time.h.
1700
1701 * systime.h [WINDOWSNT]: Include sys/time.h.
1702
1703 * s/ms-w32.h (struct timespec): Definition moved from
1704 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1705
845ca893
PE
17062012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1707
1708 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1709 * buffer.h (buffer_slot_type_mismatch):
1710 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1711 * eval.c (unwind_to_catch):
1712 * image.c (my_png_error, my_error_exit):
1713 * keyboard.c (quit_throw_to_read_char, user_error)
1714 (Fexit_recursive_edit, Fabort_recursive_edit):
1715 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1716 (wrong_type_argument, buffer_overflow, __executable_start)
1717 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1718 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1719 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1720 (fatal):
1721 (child_setup) [!DOS_NT]:
1722 * lread.c (end_of_file_error, invalid_syntax):
1723 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1724 * puresize.h (pure_write_error):
1725 * search.c (matcher_overflow):
1726 * sound.c (sound_perror, alsa_sound_perror):
1727 * sysdep.c, syssignal.h (croak):
1728 * term.c (maybe_fatal, vfatal):
1729 * textprop.c (text_read_only):
1730 * undo.c (user_error):
1731 * unexmacosx.c (unexec_error):
1732 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1733 Use _Noreturn rather than NO_RETURN.
1734 No need for separate decl merely because of _Noreturn.
1735 * sound.c (sound_warning, parse_sound):
1736 Remove unnecessary forward decls.
1737
f1dd8073
PE
17382012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1739
1740 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1741 * lisp.h (WAIT_READING_MAX): New macro.
1742 * dispnew.c (Fsleep_for, sit_for):
1743 * keyboard.c (kbd_buffer_get_event):
1744 * process.c (Faccept_process_output):
1745 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1746 This improves on the previous patch, which introduced a bug
1747 when time_t is unsigned and as wide as intmax_t.
1748 See <http://bugs.gnu.org/9000#51>.
1749
b82c1755
EZ
17502012-06-23 Eli Zaretskii <eliz@gnu.org>
1751
1752 * dispnew.c (sit_for, Fsleep_for):
1753 * keyboard.c (kbd_buffer_get_event):
1754 * process.c (Faccept_process_output): Avoid compiler warnings when
1755 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1756
ca300656
JB
17572012-06-23 Juanma Barranquero <lekktu@gmail.com>
1758
049ec95b
JB
1759 * makefile.w32-in: Update dependencies.
1760
ca300656
JB
1761 * w32.c (ltime): Add return type and declare static.
1762 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1763
db7b8d06
PE
17642012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1765
1766 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1767 Privately reported by Herbert J. Skuhra.
1768 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1769 All uses changed.
1770 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1771 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1772
0bd8297f
EZ
17732012-06-23 Eli Zaretskii <eliz@gnu.org>
1774
96512555
EZ
1775 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1776 last argument of make_unibyte_string.
1777
0bd8297f
EZ
1778 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1779 language ID in the event parameters.
1780
1781 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1782 event.code, not the obscure "character set ID".
1783
63def6b6
CY
17842012-06-23 Chong Yidong <cyd@gnu.org>
1785
1786 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1787
e8a02204
EZ
17882012-06-23 Eli Zaretskii <eliz@gnu.org>
1789
388cdec0
EZ
1790 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1791 * w32.c (fdutimens): New function.
1792
1793 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1794
1795 * s/ms-w32.h (pselect): Redirect to sys_select.
1796
1797 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1798
e8a02204
EZ
1799 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1800 in the logic of incrementing and decrementing the value of
1801 use_relocatable_buffers.
1802
d054f3fb
PE
18032012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1804
1805 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1806 Privately reported by Herbert J. Skuhra.
1807 [__FreeBSD__]: Remove "*/" typo after "#include".
1808 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1809 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1810 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1811 Don't assume EMACS_TIME and struct timeval are the same type.
1812
d35af63c
PE
18132012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1814
1815 Support higher-resolution time stamps (Bug#9000).
1816 The time stamps are only nanosecond-resolution at the C level,
1817 since that's the best that any real-world system supports now.
1818 But they are picosecond-resolution at the Lisp level, as that's
1819 easy, and leaves room for future OS improvements.
1820
1821 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1822 (LIBES): Use it.
1823
1824 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1825 Don't get current time unless it's needed.
1826
1827 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1828 now provides it if it's absent.
1829 (start_atimer): Port to higher-res time stamps.
1830 Check for time stamp overflow. Don't get current time more
1831 often than is needed.
1832
1833 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1834 Include systime.h, not time.h.
1835 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1836
1837 * dired.c: Include stat-time.h.
1838 (Ffile-attributes): File times now have higher resolution.
1839
1840 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1841 (struct image): Timestamp now has higher resolution.
1842
1843 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1844 has at least microseconds now. All uses removed.
1845 (update_frame, update_single_window, update_window, update_frame_1)
1846 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1847
1848 * editfns.c (time_overflow): Now extern.
1849 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1850 (float-time, Fformat_time_string, Fcurrent_time_string)
1851 (Fcurrent_time_zone): Accept and generate higher-resolution
1852 time stamps.
1853 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1854 (decode_time_components, lisp_seconds_argument): New functions.
1855 (make_time): Now static.
1856 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1857 Report an error if the time is invalid, rather than having the caller
1858 do that.
1859
1860 * fileio.c: Include <stat-time.h>
1861 (Fcopy_file): Copy higher-resolution time stamps.
1862 Prefer to set the time stamp via a file descriptor if that works.
1863 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1864 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1865 (Fvisited_file_modtime, Fset_visited_file_modtime):
1866 Support higher-resolution time stamps.
1867
1868 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1869
1870 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1871
1872 * image.c (prepare_image_for_display, clear_image_cache)
1873 (lookup_image): Port to higer-resolution time stamps.
1874
1875 * keyboard.c (start_polling, bind_polling_period):
1876 Check for time stamp overflow.
1877 (read_char, kbd_buffer_get_event, timer_start_idle)
1878 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1879 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1880 Port to higher-resolution time stamps. Do not assume time_t is signed.
1881 (decode_timer): New function. Timers are now vectors of length 9,
1882 not 8, to accommodate the picosecond component.
1883 (timer_check_2): Use it.
1884
1885 * nsterm.m (select_timeout, timeval_subtract): Remove.
1886 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1887 as they're a bit more accurate and handle overflow better.
1888 (ns_select): Change prototype to be compatible with pselect.
1889 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1890 * nsterm.h (ns_select): Adjust prototype.
1891
1892 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1893 us-resolution time stamps.
1894 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1895
1896 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1897
1898 * lisp.h (time_overflow): New decl.
1899 (wait_reading_process_output): First arg is now intmax_t, not int,
1900 to accommodate larger waits.
1901
1902 * process.h (struct Lisp_Process.read_output_delay):
1903 Now counts nanoseconds, not microseconds.
1904 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1905 EMACS_HAS_USECS.
1906 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1907 (wait_reading_process_output):
1908 Port to ns-resolution time stamps.
1909 (Faccept_process_output, wait_reading_process_output):
1910 Check for time stamp overflow. Do not assume time_t is signed.
1911 (select_wrapper): Remove; we now use pselect.
1912 (Fprocess_attributes): Now generates ns-resolution time stamps.
1913
1914 * sysdep.c: Include utimens.h. Don't include utime.h
1915 or worry about struct utimbuf; gnulib does that for us now.
1916 (gettimeofday): Remove; gnulib provides a substitute.
1917 (make_timeval): New function.
1918 (set_file_times): Now sets ns-resolution time stamps.
1919 New arg FD; all uses changed.
1920 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1921 (system_process_attributes):
1922 Now returns ns-resolution time stamp. All uses changed.
1923 Check for time stamp overflow.
1924
1925 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1926 provides a substitute now.
1927
1928 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1929 since it guarantees struct timespec.
1930 (EMACS_TIME): Now struct timespec, so that we can support
1931 ns-resolution time stamps.
1932 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1933 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1934 (EMACS_USECS): Remove.
1935 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1936 so multiply the arg by 1000 before storing it.
1937 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1938 New macros.
1939 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1940 Port to ns-resolution time stamps.
1941 (EMACS_TIME_NEG_P): Remove; replaced by....
1942 (EMACS_TIME_SIGN): New macro.
1943 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1944 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1945 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1946 (make_timeval, make_lisp_time, decode_time_components): New decls.
1947 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1948 that it mishandled time_t overflow. You can't compare by subtracting!
1949 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1950 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1951
1952 * term.c: Include <sys/time.h>.
1953 (timeval_to_Time): New function, for proper overflow wraparound.
1954 (term_mouse_position, term_mouse_click): Use it.
1955
1956 * undo.c (record_first_change): Support higher-resolution time stamps
1957 in the undo buffer.
1958 (Fprimitive_undo): Use them when restoring time stamps.
1959
1960 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1961 (w32_get_internal_run_time):
1962 Port to higher-resolution Emacs time stamps.
1963 (ltime): Now accepts single 64-bit integer, as that's more convenient
1964 for callers.
1965
1966 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1967
1968 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1969 for compatibility with pselect. Support ns-resolution time stamps.
1970
1971 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1972
1973 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1974 Check for time stamp overflow, and support ns-resolution time stamps.
1975
1976 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1977 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1978 (timeval_subtract): Remove; no longer needed.
1979 (XTflash, XTring_bell, x_wait_for_event):
1980 Port to ns-resolution time stamps. Don't assume time_t is signed.
1981
b6a92dfe
CY
19822012-06-22 Chong Yidong <cyd@gnu.org>
1983
1984 * xdisp.c (x_consider_frame_title): Revert last change.
1985
d251c37c
EZ
19862012-06-22 Eli Zaretskii <eliz@gnu.org>
1987
1988 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1989 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1990 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1991 staticidx goes up to 1597 out of 1600 = 0x640.)
1992
f10deafb
PE
19932012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1996 Otherwise, the umask might be mistakenly 0 while handling input signals.
1997
ec6de1e2
SM
19982012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1999
2000 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
2001
28be1ada
DA
20022012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
2003
2004 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
2005 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
2006 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
2007 access to `contents' member of Lisp_Vector objects with AREF and ASET
2008 where appropriate.
2009
c6bf3022
CY
20102012-06-19 Chong Yidong <cyd@gnu.org>
2011
2012 * frame.c (delete_frame): When selecting a frame on a different
2013 text terminal, do not alter the terminal's top-frame.
2014
2015 * xdisp.c (format_mode_line_unwind_data): Record the target
2016 frame's selected window and its terminal's top-frame.
2017 (unwind_format_mode_line): Restore them.
2018 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
2019 Callers changed.
2020 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
2021 since tty frames can be explicitly named.
2022 (prepare_menu_bars): Likewise.
2023
2024 * term.c (Ftty_top_frame): New function.
2025
defd4196
PE
20262012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2027
2028 Port byte-code-meter to modern targets.
2029 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
2030 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 2031 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
2032 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
2033 (METER_1, METER_2): Simplify.
2034
1053a871
SM
20352012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2036
2037 * data.c (Fdefalias): Return `symbol' (bug#11686).
2038
b7e8d081
MR
20392012-06-18 Martin Rudalics <rudalics@gmx.at>
2040
2041 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
2042 gets killed during executing of this function (Bug#11665).
2043 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
2044 (Vkill_buffer_query_functions): In doc-string say that functions
2045 run by this hook should not change the current buffer.
2046
7ea2b339
PE
20472012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2048
2049 Fix recently-introduced process.c problems found by static checking.
2050 * process.c (write_queue_push, write_queue_pop, send_process):
2051 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
2052 (write_queue_pop): Fix pointer signedness problem.
2053 (send_process): Remove unused local.
2054
96a313a1
CY
20552012-06-17 Chong Yidong <cyd@gnu.org>
2056
2057 * xdisp.c (redisplay_internal): No need to redisplay terminal
2058 frames that are not on top.
2059
20ca2e94
TN
20602012-06-17 Troels Nielsen <bn.troels@gmail.com>
2061
2062 * process.c (make_process): Initialize write_queue.
2063 (write_queue_push, write_queue_pop): New functions.
2064 (send_process): Use them to maintain correct ordering of process
2065 writes (Bug#10815).
2066
9a900ca9
PE
20672012-06-17 Paul Eggert <eggert@cs.ucla.edu>
2068
310fbfa8
PE
2069 * lisp.h (eassert): Assume C89 or later.
2070 This removes the need for CHECK.
2071 (CHECK): Remove. Its comments about always evaluating its
2072 argument were confusing, as 'eassert' typically does not evaluate
2073 its argument.
2074
27bb1ca4
PE
2075 * coding.c (produce_chars): Use ptrdiff_t, not int.
2076
9a900ca9
PE
2077 * xterm.c (x_draw_underwave): Check for integer overflow.
2078 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
2079
41b7f8bc 20802012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
2081
2082 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
2083 referenced (Bug#11583).
2084
9b0e3eba
AA
20852012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
2086
2087 Implement wave-style variant of underlining.
2088 * dispextern.h (face_underline_type): New enum.
2089 (face): Add field for underline type.
2090 * nsterm.m (ns_draw_underwave): New function.
2091 (ns_draw_text_decoration): Use it.
2092 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
2093 New functions.
2094 (x_draw_glyph_string): Use them.
2095 * xfaces.c (Qline, Qwave): New Lisp objects.
2096 (check_lface_attrs, merge_face_ref)
1053a871
SM
2097 (Finternal_set_lisp_face_attribute, realize_x_face):
2098 Handle wave-style underline face attributes.
9b0e3eba
AA
2099 * xterm.c (x_draw_underwave): New function.
2100 (x_draw_glyph_string): Use it.
2101
0fb52f11
JB
21022012-06-16 Juanma Barranquero <lekktu@gmail.com>
2103
2104 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
2105 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
2106 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
2107 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
2108 ($(BLD)/w32select.$(O)): Update dependencies.
2109
e5560ff7
AS
21102012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2111
2112 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
2113 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
2114 * character.c (_fetch_multibyte_char_p): Remove.
2115 * alloc.c: Include "character.h" before "buffer.h".
2116 * bidi.c: Likewise.
2117 * buffer.c: Likewise.
2118 * bytecode.c: Likewise.
2119 * callint.c: Likewise.
2120 * callproc.c: Likewise.
2121 * casefiddle.c: Likewise.
2122 * casetab.c: Likewise.
2123 * category.c: Likewise.
2124 * cmds.c: Likewise.
2125 * coding.c: Likewise.
2126 * composite.c: Likewise.
2127 * dired.c: Likewise.
2128 * dispnew.c: Likewise.
2129 * doc.c: Likewise.
2130 * dosfns.c: Likewise.
2131 * editfns.c: Likewise.
2132 * emacs.c: Likewise.
2133 * fileio.c: Likewise.
2134 * filelock.c: Likewise.
2135 * font.c: Likewise.
2136 * fontset.c: Likewise.
2137 * fringe.c: Likewise.
2138 * indent.c: Likewise.
2139 * insdel.c: Likewise.
2140 * intervals.c: Likewise.
2141 * keyboard.c: Likewise.
2142 * keymap.c: Likewise.
2143 * lread.c: Likewise.
2144 * macros.c: Likewise.
2145 * marker.c: Likewise.
2146 * minibuf.c: Likewise.
2147 * nsfns.m: Likewise.
2148 * nsmenu.m: Likewise.
2149 * print.c: Likewise.
2150 * process.c: Likewise.
2151 * regex.c: Likewise.
2152 * region-cache.c: Likewise.
2153 * search.c: Likewise.
2154 * syntax.c: Likewise.
2155 * term.c: Likewise.
2156 * textprop.c: Likewise.
2157 * undo.c: Likewise.
2158 * unexsol.c: Likewise.
2159 * w16select.c: Likewise.
2160 * w32fns.c: Likewise.
2161 * w32menu.c: Likewise.
2162 * window.c: Likewise.
2163 * xdisp.c: Likewise.
2164 * xfns.c: Likewise.
2165 * xmenu.c: Likewise.
2166 * xml.c: Likewise.
2167 * xselect.c: Likewise.
2168
2f07e6af
EZ
21692012-06-16 Eli Zaretskii <eliz@gnu.org>
2170
1053a871
SM
2171 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
2172 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 2173 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
2174 row.
2175 (handle_face_prop): Use chunk-relative overlay string index when
2176 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
2177 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
2178 the rightmost. (Bug#11720)
2f07e6af 2179
29b83cec
AS
21802012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2181
2182 * category.h (CHAR_HAS_CATEGORY): Define as inline.
2183 (CATEGORY_MEMBER): Enforce 1/0 value.
2184 * category.c (_temp_category_set): Remove.
2185
4c5501e9
EZ
21862012-06-16 Eli Zaretskii <eliz@gnu.org>
2187
2188 * window.c (Fdelete_other_windows_internal)
2189 (Fdelete_window_internal): Don't access frame's mouse highlight
2190 info of the initial frame. (Bug#11677)
2191
2b570124
PE
21922012-06-14 Paul Eggert <eggert@cs.ucla.edu>
2193
e93864f9
PE
2194 * .gdbinit (xgetint): Fix recently-introduced paren typo.
2195 Assume USE_2_TAGS_FOR_INTS.
2196 (xreload): Adjust $tagmask width to match recent lisp.h change.
2197
2b570124
PE
2198 Simplify lisp.h in minor ways that should not affect code.
2199 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
2200 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
2201 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
2202 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
2203 (INTTYPEBITS): New macro, for clarity.
2204 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
2205 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
2206 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
2207 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
2208 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
2209
81755f69
JB
22102012-06-13 Juanma Barranquero <lekktu@gmail.com>
2211
2212 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
2213
16192a57
GM
22142012-06-13 Glenn Morris <rgm@gnu.org>
2215
2216 * s/bsd-common.h (BSD4_3):
2217 * s/usg5-4-common.h (USG5_4): No longer define; unused.
2218
646b5f55
AS
22192012-06-13 Andreas Schwab <schwab@linux-m68k.org>
2220
2221 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
2222 instead of union.
2223 (XLI, XIL): Define.
1053a871
SM
2224 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
2225 Use them.
2226 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 2227 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 2228 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
2229 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
2230 * frame.c (delete_frame): Remove outdated comment.
2231 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
2232 USE_LISP_UNION_TYPE.
2233 (Fw32_unregister_hot_key): Likewise.
2234 (Fw32_toggle_lock_key): Likewise.
2235 * w32menu.c (add_menu_item): Likewise.
2236 (w32_menu_display_help): Use XIL instead of checking
2237 USE_LISP_UNION_TYPE.
2238 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
2239 (init_heap): Likewise.
2240 * w32term.c (w32_read_socket): Update comment.
2241
1d3823c9
GM
22422012-06-13 Glenn Morris <rgm@gnu.org>
2243
c62ff706
GM
2244 * s/usg5-4-common.h, src/s/unixware.h:
2245 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
2246
1d3823c9
GM
2247 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
2248
bfe3e0a2
PE
22492012-06-13 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
2252 * alloc.c (make_number) [!defined make_number]:
2253 Remove, as lisp.h always defines this now.
2254 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
2255 (roundup_size): Verify that it is a power of 2.
2256 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2257 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2258 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2259 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2260 USE_LSB_TAG now is always defined to be either 0 or 1.
2261 All uses changed.
2262 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2263 code works fine either way, and efficiency is not a concern here,
2264 as the union type is for debugging, not for production.
2265 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2266 Use an inline function on all platforms when using the union type,
2267 since this is simpler and 'static inline' can be used portably
2268 within Emacs now.
2269 (LISP_INITIALLY_ZERO): New macro.
2270 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2271 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2272
45fa9c0f
GM
22732012-06-12 Glenn Morris <rgm@gnu.org>
2274
b4492cba
GM
2275 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2276
2277 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 2278
45fa9c0f
GM
2279 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2280 Move BROKEN_SIGIO to configure.
2281
2282 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2283 Move NO_TERMIO to configure.
2284
0e25d334
CY
22852012-06-12 Chong Yidong <cyd@gnu.org>
2286
2287 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2288 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2289 MagickExportImagePixels is undefined.
2290
43682bb6
PE
22912012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2292
2293 * image.c (imagemagick_load_image): Remove unused label.
2294
a9be7d2b
GM
22952012-06-11 Glenn Morris <rgm@gnu.org>
2296
2297 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2298 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2299 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2300 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2301
3017f87f
SM
23022012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2303
2304 * alloc.c (make_byte_code): New function.
2305 (Fmake_byte_code): Use it. Don't purify here.
2306 * lread.c (read1): Use it as well to avoid extra allocation.
2307
1b9b4cf4
CY
23082012-06-11 Chong Yidong <cyd@gnu.org>
2309
2310 * image.c (imagemagick_load_image): Implement transparency.
2311
95988fcf
AS
23122012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2313
2314 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2315 account for preceding backslashes. (Bug#11663)
2316
cd4eb164
CY
23172012-06-09 Chong Yidong <cyd@gnu.org>
2318
2319 * term.c: Support italics in capable terminals (Bug#9652).
2320 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2321 (turn_on_face): Output using TS_enter_italic_mode if available.
2322 Don't handle unused blinking and alt-charset cases.
2323 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2324 and tty_alt_charset_p cases.
2325 (tty_capable_p, init_tty): Support italics.
2326
2327 * termchar.h (struct tty_display_info): Add field for italics.
2328 Remove unused blink field.
2329
2330 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2331 Handle slant.
2332
2333 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2334 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2335 tty_alt_charset_p. Add tty_italic_p.
2336
ff88beb8
MA
23372012-06-09 Michael Albinus <michael.albinus@gmx.de>
2338
2339 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
2340 dbus_type_is_basic if available.
2341 (xd_extract_signed, xd_extract_unsigned): Rename from
2342 extract_signed and extract_unsigned, respectively. Adapt callers.
2343
44286096
CY
23442012-06-09 Chong Yidong <cyd@gnu.org>
2345
1682701f
CY
2346 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2347
44286096
CY
2348 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2349 case (Bug#9752).
2350
d86feb17
PE
23512012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2352
2353 * xdisp.c (vmessage): Treat frame message as multibyte.
2354 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2355 would generate the diagnostic "Making \302\247 buffer-local while
2356 let-bound!".
2357
d5c20fe8
EZ
23582012-06-08 Eli Zaretskii <eliz@gnu.org>
2359
2360 * dispnew.c (showing_window_margins_p): Undo last change, which
2361 was done due to an inadvertent commit.
2362 (adjust_frame_glyphs_for_frame_redisplay): Do call
2363 showing_window_margins_p.
2364
513749ee
SM
23652012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2366
2367 * eval.c (Fmake_var_non_special): New primitive.
2368 (syms_of_eval): Defsubr it.
2369 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2370
d4a8f5c1
JB
23712012-06-08 Juanma Barranquero <lekktu@gmail.com>
2372
2373 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2374 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2375
8bbbc977
EZ
23762012-06-08 Eli Zaretskii <eliz@gnu.org>
2377
2378 * alloc.c (allocate_vectorlike): Fix last change.
2379
f3372c87
DA
23802012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2381
2382 Block-based vector allocation of small vectors.
2383 * lisp.h (struct vectorlike_header): New field `nbytes',
2384 adjust comment accordingly.
2385 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2386 to denote vector blocks. Adjust users (live_vector_p,
2387 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2388 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2389 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2390 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2391 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2392 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2393 (roundup_size): New constant.
2394 (struct vector_block): New data type.
2395 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2396 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2397 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2398 (sweep_vectors): New functions.
2399 (allocate_vectorlike): Return `zero_vector' as the only vector of
2400 0 items. Allocate new vector from block if vector size is less than
2401 or equal to VBLOCK_BYTES_MAX.
2402 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2403 (init_alloc_once): Add call to init_vectors.
2404
4f18a4ed
SM
24052012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2406
2407 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2408
86f158bc
PE
24092012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2410
2411 * doprnt.c (doprnt): Truncate multibyte char correctly.
2412 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2413 would mishandle a string argument "Xc" if X was a multibyte
2414 character of length 2: it would truncate after X's first byte
2415 rather than including all of X.
2416
c5cfcbe0
CY
24172012-06-06 Chong Yidong <cyd@gnu.org>
2418
2419 * buffer.c (word_wrap): Doc fix.
2420
c05cf390
PE
24212012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2422
2423 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2424
0c3461de
GM
24252012-06-03 Glenn Morris <rgm@gnu.org>
2426
2427 * xdisp.c (tool-bar-style): Doc fix.
2428
c71232db
UM
24292012-06-03 Ulrich Müller <ulm@gentoo.org>
2430
2431 * Makefile.in (PAXCTL): Define.
2432 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2433 binary via PaX flags if the paxctl utility is available.
2434 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2435 Restore PaX flags to their default. (Bug#11398)
2436
383f7350
CY
24372012-06-03 Chong Yidong <cyd@gnu.org>
2438
2439 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2440 buffer (Bug#11226).
2441
5f2c76c6
CY
24422012-06-03 Chong Yidong <cyd@gnu.org>
2443
2444 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2445 (note_mode_line_or_margin_highlight): If there is no help echo,
2446 use mode-line-default-help-echo. Handle the case where the mouse
2447 position is past the end of the mode line string.
2448
2449 * buffer.c (buffer_local_value_1): New function, split from
2450 Fbuffer_local_value; can return Qunbound.
2451 (Fbuffer_local_value): Use it.
2452 (Vmode_line_format): Docstring tweaks.
2453
773d47f6
PE
24542012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2455
2456 * sysdep.c (system_process_attributes): Improve comment.
2457
f2d6a3df
SM
24582012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2459
2460 * keyboard.c: Export real-this-command to Elisp.
2461 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2462 and DEFVAR it. Update all users.
2463
63810350
PE
24642012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2465
7bd5c1f4
PE
2466 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2467
63810350
PE
2468 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2469 Convert pctcpu and pctmem to Lisp float properly.
2470 Let the compiler fold better, as 100.0/0x8000 is exact.
2471
a2821611
AS
24722012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2473
2474 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2475 cons_block.
2476
5fceba1d
PE
24772012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2478
2479 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2480
c98ff5dd
DA
24812012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2482
2483 For a 'struct window', replace some Lisp_Object fields to
2484 bitfields where appropriate, remove unused fields.
2485 * window.h (struct window): Remove unused 'last_mark_x' and
2486 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2487 change it's type from Lisp_Object to bitfield.
2488 Change type of 'force_start', 'optional_new_start',
2489 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2490 fields from Lisp_Object to bitfield. Adjust users accordingly.
2491
ca34e0be
PE
24922012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2493
2494 Pacify gcc -Wdouble-precision when using Xaw.
2495 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2496 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2497 Use 'float' consistently, rather than 'float' in most places
2498 and 'double' in a couple of places.
2499
efc00ab1 25002012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2501
2502 * xdisp.c (handle_stop): Detect whether we have overlay strings
2503 loaded by testing it->current.overlay_string_index to be
2504 non-negative, instead of checking whether n_overlay_strings is
2505 positive. (Bug#11587)
2506
efc00ab1 25072012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2508
2509 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2510
2511 * doc.c (Fsubstitute_command_keys): Doc fix.
2512
efc00ab1 25132012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2514
2515 * search.c (search_buffer): Remove calls to
2516 r_alloc_inhibit_buffer_relocation, as it is now called by
2517 maybe_unify_char, which was the cause of relocation of buffer text
2518 in bug#11519.
2519
efc00ab1 25202012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2521
2522 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2523 for the duration of call to load_charset, to avoid problems with
2524 callers of maybe_unify_char that access buffer text through C
2525 pointers.
2526
2527 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2528 decrement the inhibition flag, instead of just setting or
2529 resetting it.
2530
ba93a187
PE
25312012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2532
2533 Remove obsolete '#define static' cruft.
2534 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2535 This #undef was "temporary" in 2000; it is no longer needed
2536 now that '#define static' has gone away.
2537 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2538 (gray_bitmap_bits): Remove; no longer needed.
2539 All uses replaced with definiens.
2540 * xterm.c: Include "bitmaps/gray.xbm".
2541
9e4bf381
PE
25422012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2543
2544 Clean up __executable_start, monstartup when --enable-profiling.
2545 The following changes affect the code only when profiling.
2546 * dispnew.c (__executable_start): Rename from safe_bcopy.
2547 Define only on platforms that need it.
2548 * emacs.c: Include <sys/gmon.h> when profiling.
2549 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2550 (__executable_start): Remove decl, since lisp.h does it now.
2551 (safe_bcopy): Remove decl; no longer has that name.
2552 (main): Coalesce #if into single bit of code, for simplicity.
2553 Cast pointers to uintptr_t, since standard libraries want integers
2554 and not pointers.
2555 * lisp.h (__executable_start): New decl.
2556
32d72c2f
GM
25572012-05-31 Glenn Morris <rgm@gnu.org>
2558
2559 * image.c (Fimagemagick_types): Doc fix.
2560
baac5bc7
JM
25612012-05-30 Jim Meyering <meyering@redhat.com>
2562
2563 * callproc.c (Fcall_process_region): Include directory component
2564 in mkstemp error message (Bug#11586).
2565
72cb32cf
PE
25662012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2567
2568 * alloc.c, lisp.h (make_pure_vector): Now static.
2569
61b108cc
SM
25702012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2571
2572 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2573 Move to byte-run.el.
2574 (Fautoload): Do the hash-doc more carefully.
2575 * data.c (Fdefalias): Purify definition, except for keymaps.
2576 (Qdefun): Move from eval.c.
2577 * lisp.h (Qdefun): Remove.
2578 * lread.c (read1): Tiny simplification.
2579
471fe23d
TN
25802012-05-29 Troels Nielsen <bn.troels@gmail.com>
2581
934f3f58 2582 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2583 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2584 Bug#9642, but explicitly check that the buffer the overlay would
2585 be moved to is live and rearrange lines to make sure that errors
2586 will not put the overlay in an inconsistent state.
2587 (Fdelete_overlay): Cosmetics.
2588
85d0efd1
EZ
25892012-05-28 Eli Zaretskii <eliz@gnu.org>
2590
2591 * w32term.c (my_bring_window_to_top): New function.
2592 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2593 could be different from the original one.
2594 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2595 (Bug#11513)
2596
2597 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2598 by calling BringWindowToTop.
2599
2600 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2601 (WM_EMACS_END): Increase by one.
2602
da92a98c
PE
26032012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2604
2605 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2606 This avoids undefined behavior that might cause the eassert
2607 to not catch an out-of-range value.
2608
74d1f848
JB
26092012-05-28 Juanma Barranquero <lekktu@gmail.com>
2610
2611 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2612 Update dependencies.
2613
9e1a06fc
EZ
26142012-05-27 Eli Zaretskii <eliz@gnu.org>
2615
2616 * bidi.c (bidi_mirror_char): Fix last change.
2617
f3dd7312
AS
26182012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2619
2620 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2621 when referring to sectname field in printf format.
2622
81899c91
PE
26232012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2624
57b81a9f
PE
2625 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2626 Only r_alloc_inhibit_buffer_relocation needed to be added;
2627 the others were already declared.
2628
81899c91
PE
2629 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2630 before checking whether it's out of range. Put the check inside
2631 eassert. See
2632 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2633
33017faf 26342012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2635
2636 * callproc.c (Fcall_process): Restore a line that was accidentally
2637 commented out in the 2011-02-13 change (bug#11547).
2638
33017faf 26392012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2640
2641 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2642 defined on ralloc.c.
2643
2644 * buffer.c [REL_ALLOC]: Remove prototypes of
2645 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2646 they are now on lisp.h.
2647
2648 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2649
2650 * search.c (search_buffer): Use it to inhibit relocation of buffer
2651 text while re_search_2 is doing its job, because re_search_2 is
2652 passed C pointers to buffer text. (Bug#11519)
2653
23415acf
EZ
2654 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2655 Update value to 24.
2656
44e27368
EZ
2657 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2658 state after an additional call to move_it_in_display_line_to, keep
2659 the values of it->max_ascent and it->max_descent found for the
2660 entire line.
2661 (pos_visible_p): Revert the comparison against bottom_y to what it
2662 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2663 (Bug#11464)
2664
c1892f11
PE
26652012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2666
2667 Fix coding-related core dumps with gcc -ftrapv.
2668 The code was computing A - B, where A and B are pointers, and B is
2669 random garbage. This can lead to core dumps on platforms that
2670 have special pointer registers, and it also leads to core dumps on
2671 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2672 A - B only when B is initialized properly.
2673 * coding.c (coding_set_source, coding_set_destination): Return void.
2674 (coding_change_source, coding_change_destinations): New functions,
2675 with the old behaviors of coding_set_source and coding_set_destination.
2676 All callers that need an offset changed to use these new functions.
2677
eb7afdad
GM
26782012-05-26 Glenn Morris <rgm@gnu.org>
2679
2680 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2681
f12fdf02
EZ
26822012-05-26 Eli Zaretskii <eliz@gnu.org>
2683
53a63be6 2684 Extend mouse support on W32 text-mode console.
61b108cc
SM
2685 * xdisp.c (draw_row_with_mouse_face):
2686 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2687
eb3f6f01 2688 * w32console.c: Include window.h.
61b108cc
SM
2689 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2690 New functions.
eb3f6f01
EZ
2691 (initialize_w32_display): Initialize mouse-highlight data.
2692
53a63be6
EZ
2693 * w32inevt.c: Include termchar.h and window.h.
2694 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2695 moves, call note_mouse_highlight. If help_echo changed, call
2696 gen_help_event to produce help-echo message in the echo area.
2697 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2698 highlight info.
2699
4cfd81f6
PE
27002012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2701
2702 * lread.c (read1): Simplify slightly to avoid an overflow warning
2703 with GCC 4.7.0 on x86-64.
2704
4446092a
EZ
27052012-05-26 Eli Zaretskii <eliz@gnu.org>
2706
2707 * bidi.c (bidi_mirror_char): Revert last change: an int is
2708 definitely wide enough here.
2709
42b2a986 27102012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2711
42b2a986 2712 Fix integer width and related bugs (Bug#9874).
eb106a49 2713 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2714 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2715 (string_bytes, check_sblock, allocate_string_data):
2716 (compact_small_strings, Fmake_bool_vector, make_string)
2717 (make_unibyte_string, make_multibyte_string)
2718 (make_string_from_bytes, make_specified_string)
2719 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2720 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2721 (mark_vectorlike):
2722 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2723 (allocate_pseudovector):
2724 Use int, not EMACS_INT, where int is wide enough.
2725 (inhibit_garbage_collection, Fgarbage_collect):
2726 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2727 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2728 int might not be wide enough.
2729 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2730 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2731 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2732 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2733 (bidi_level_of_next_char, bidi_move_to_visually_next):
2734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2735 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2736 (Fkill_buffer, Fset_buffer_major_mode)
2737 (advance_to_char_boundary, Fbuffer_swap_text)
2738 (Fset_buffer_multibyte, overlays_at, overlays_in)
2739 (overlay_touches_p, struct sortvec, record_overlay_string)
2740 (overlay_strings, recenter_overlay_lists)
2741 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2742 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2743 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2744 (Foverlay_recenter, last_overlay_modification_hooks_used)
2745 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2747 (validate_region): Omit unnecessary test for b <= e,
2748 since that's guaranteed by the previous test.
d311d28c
PE
2749 (adjust_overlays_for_delete): Avoid pos + length overflow.
2750 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2751 (report_overlay_modification):
2752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2753 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2754 Omit pointer cast, which isn't needed anyway, and doesn't work
2755 after the EMACS_INT -> ptrdiff_t change.
02481186 2756 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2757 * buffer.h: Adjust decls to match defn changes elsewhere.
2758 (struct buffer_text, struct buffer):
2759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2760 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2761 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2762 not int, to avoid needless 32-bit limit on 64-bit hosts.
2763 (exec_byte_code): Use tighter memory-full test, one that checks
2764 for alloca overflow. Don't compute the address of the object just
2765 before an array, as that's not portable. Use EMACS_INT, not
2766 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2767 * callint.c (Fcall_interactively):
2768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2769 * callproc.c (call_process_kill, Fcall_process):
2770 Don't assume pid_t fits into an Emacs fixnum.
2771 (call_process_cleanup, Fcall_process, child_setup):
2772 Don't assume pid_t fits into int.
2773 (call_process_cleanup, Fcall_process, delete_temp_file)
2774 (Fcall_process_region):
2775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2776 (Fcall_process): Simplify handling of volatile integers.
2777 Use int, not EMACS_INT, where int will do.
2778 * casefiddle.c (casify_object, casify_region, operate_on_word)
2779 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2781 (casify_object): Avoid integer overflow when overallocating buffer.
2782 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2783 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2784 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2785 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2786 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2787 integers are now checked earlier. All uses replaced with XINT.
2788 (ccl_driver):
2789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2790 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2791 (ccl_driver, Fregister_code_conversion_map):
2792 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2793 (resolve_symbol_ccl_program): Check that vector header is in range.
2794 Always copy the vector, so that we can check its contents reliably
2795 now rather than having to recheck each instruction as it's being
2796 executed. Check that vector words fit in 'int'.
2797 (ccl_get_compiled_code, Fregister_ccl_program)
2798 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2799 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2800 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2801 contents are in range.
2802 (Fccl_execute_on_string): Check that status is in range.
2803 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2804 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2805 Accept and return EMACS_INT, not int, because callers can pass values
2806 out of 'int' range.
2807 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2808 (multibyte_chars_in_text, parse_str_as_multibyte)
2809 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2810 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2811 (string_escape_byte8, Fget_byte):
2812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2813 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2814 avoid mishandling large integers.
2815 * character.h: Adjust decls to match defn changes elsewhere.
2816 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2817 (Ffind_charset_region):
2818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2819 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2820 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2821 Don't assume fixnum fits in int.
d311d28c
PE
2822 (load_charset_map_from_vector, Fmap_charset_chars):
2823 Remove now-unnecessary CHECK_NATNUMs.
2824 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2825 Don't rely on undefined behavior with signed left shift overflow.
2826 Don't assume unsigned int fits into fixnum, or that fixnum fits
2827 into unsigned int. Don't require max_code to be a valid fixnum;
2828 that's not true for gb10830 4-byte on a 32-bit host. Allow
2829 invalid_code to be a cons, for the same reason. Require code_offset
2830 to be a character. Avoid int overflow if max_char is close
2831 to INT_MAX.
2832 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2833 this is intended anyway and avoids some undefined behavior.
2834 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2835 INDEX_TO_CODE_POINT, as that's what it expects.
2836 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2837 * charset.h (DECODE_CHAR): Return int, not unsigned;
2838 this is what was intended anyway, and it avoids undefined behavior.
2839 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2840 integer-overflow issues.
2841 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2842 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2843 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2844 * chartab.c (Fmake_char_table, Fset_char_table_range)
2845 (uniprop_get_decoder, uniprop_get_encoder):
2846 Don't assume fixnum fits in int.
2847 * cmds.c (move_point): New function, that does the gist of
2848 Fforward_char and Fbackward_char, but does so while checking
2849 for integer overflow more accurately.
c96e5d6a 2850 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2851 (Fforward_line, Fend_of_line, internal_self_insert)
2852 (internal_self_insert):
2853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2854 Fix a FIXME, by checking for integer overflow when calculating
2855 target_clm and actual_clm.
2856 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2857 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2858 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2859 (coding_alloc_by_making_gap, alloc_destination)
2860 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2861 (encode_coding_utf_16, detect_coding_emacs_mule)
2862 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2863 (detect_coding_iso_2022, decode_coding_iso_2022)
2864 (encode_invocation_designation, encode_designation_at_bol)
2865 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2866 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2867 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2868 (encode_coding_ccl, encode_coding_raw_text)
2869 (detect_coding_charset, decode_coding_charset)
2870 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2871 (produce_composition, produce_charset, produce_annotation)
2872 (decode_coding, handle_composition_annotation)
2873 (handle_charset_annotation, consume_chars, decode_coding_gap)
2874 (decode_coding_object, encode_coding_object, detect_coding_system)
2875 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2876 (code_convert_region, code_convert_string)
8f50130c
PE
2877 (Fdefine_coding_system_internal)
2878 (coding_set_source, coding_set_destination):
d311d28c
PE
2879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2880 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2881 (Fdefine_coding_system_internal):
2882 Don't assume fixnums fit in int.
2883 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2884 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2885 (Funencodable_char_position, Fcheck_coding_systems_region)
2886 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2887 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2888 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2889 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2890 Don't access memory outside of the args array.
d311d28c 2891 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2892 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2893 result of ENCODE_CHAR.
d311d28c
PE
2894 * coding.h: Adjust decls to match defn changes elsewhere.
2895 (struct coding_system):
2896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2897 * composite.c (get_composition_id, find_composition)
2898 (run_composition_function, update_compositions)
2899 (compose_text, composition_gstring_put_cache)
2900 (composition_gstring_p, composition_gstring_width)
2901 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2902 (composition_compute_stop_pos, composition_reseat_it)
2903 (composition_update_it, struct position_record)
2904 (find_automatic_composition, composition_adjust_point)
2905 (Fcomposition_get_gstring, Ffind_composition_internal):
2906 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2907 (update_compositions):
2908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2909 * composite.h: Adjust decls to match defn changes elsewhere.
2910 (struct composition):
2911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2912 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2913 Do not attempt to compute the address of the object just before a
2914 buffer; this is not portable.
2915 (Faref, Faset):
2916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2917 (Faset): Use int, not EMACS_INT, where int is wide enough.
2918 (Fstring_to_number): Don't assume fixnums fit in int.
2919 (Frem): Don't assume arg is nonnegative.
2920 * dbusbind.c (xd_append_arg): Check for integers out of range.
2921 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2922 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2923 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2924 (xd_get_connection_references): Return ptrdiff_t, not int.
2925 All uses changed.
2926 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2927 (xd_read_message_1):
2928 Use int, not unsigned, where the dbus API uses int.
2929 (Fdbus_message_internal): Don't overflow mtype.
2930 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2931 * dired.c (directory_files_internal, file_name_completion, scmp)
2932 (file_name_completion_stat):
2933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2934 (file_name_completion): Don't overflow matchcount.
2935 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2936 * dispextern.h: Adjust decls to match defn changes elsewhere.
2937 (struct text_pos, struct glyph, struct bidi_saved_info)
2938 (struct bidi_string_data, struct bidi_it, struct composition_it)
2939 (struct it):
2940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2941 (struct display_pos, struct composition_it, struct it):
2942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2943 * dispnew.c (increment_matrix_positions)
2944 (increment_row_positions, mode_line_string)
2945 (marginal_area_string):
2946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2947 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2948 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2949 (duration_to_sec_usec): New function, to check for overflow better.
2950 (Fsleep_for, sit_for): Use it.
2951 * doc.c (get_doc_string, store_function_docstring):
2952 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2953 (get_doc_string, Fsnarf_documentation):
2954 Use int, not EMACS_INT, where int is wide enough.
2955 (get_doc_string):
2956 Use SAFE_ALLOCA, not alloca.
2957 Check for overflow when converting EMACS_INT to off_t.
2958 * doprnt.c (doprnt):
2959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2960 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2961 Don't assume uid_t fits into fixnum.
2962 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2963 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2964 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2965 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2966 (general_insert_function)
2967 (Finsert_char, make_buffer_string, make_buffer_string_both)
2968 (update_buffer_properties, Fbuffer_substring)
2969 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2970 (Fsubst_char_in_region, check_translation)
2971 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2972 (transpose_markers, Ftranspose_regions):
2973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2974 (clip_to_bounds): Move to lisp.h as an inline function).
2975 (Fconstrain_to_field): Don't assume integers are nonnegative.
2976 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2977 (Fsubst_char_in_region, Fsave_restriction):
2978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2979 (Femacs_pid): Don't assume pid_t fits into fixnum.
2980 (lo_time): Use int, not EMACS_INT, when int suffices.
2981 (lisp_time_argument): Check for usec out of range.
2982 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
2983 (Fuser_login_name, Fuser_full_name): Signal an error
2984 if a uid argument is out of range, rather than relying on
2985 undefined behavior.
c8d5c857
PE
2986 (Fformat_time_string): Remove now-unnecessary check.
2987 lisp_time_argument checks for out-of-range usec now.
243e0530 2988 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
2989 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2990 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2991 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2992 (init_cmdargs, Fdump_emacs):
2993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2994 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2995 the bottom (typically) 32 bits of the fixnum.
2996 * eval.c (specpdl_size, call_debugger):
2997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2998 (when_entered_debugger, Fbacktrace_debug):
2999 Don't assume fixnum can fit in int.
3000 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
3001 the object just before a buffer; this is not portable.
3002 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
3003 (grow_specpdl, unbind_to):
3004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3005 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
3006 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 3007 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
3008 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
3009 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
3010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3011 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
3012 (a_write, e_write):
3013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3014 (Fcopy_file, non_regular_nbytes, read_non_regular)
3015 (Finsert_file_contents):
3016 Use int, not EMACS_INT, where int is wide enough.
3017 (READ_BUF_SIZE): Verify that it fits in int.
3018 (Finsert_file_contents): Check that counts are in proper range,
3019 rather than assuming fixnums fit into ptrdiff_t etc.
3020 Don't assume fixnums fit into int.
125b3835 3021 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
3022 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
3023 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
3024 (string_char_to_byte, string_byte_to_char)
3025 (string_make_multibyte, string_to_multibyte)
3026 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
3027 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
3028 (substring_both, Fdelete, internal_equal, Ffillarray)
3029 (Fclear_string, mapcar1)
3030 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
3031 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
3032 (larger_vector, make_hash_table, maybe_resize_hash_table)
3033 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
3034 (Fmaphash, secure_hash):
3035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3036 (concat): Check for string index and length overflow.
3037 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
3038 (Frequire):
3039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3040 (larger_vector): New API (vec, incr_min, size_max) replaces old
3041 one (vec, new_size, init). This catches size overflow.
3042 INIT was removed because it was always Qnil.
3043 All callers changed.
3044 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
3045 the upper bound on a hash table index size.
3046 (make_hash_table, maybe_resize_hash_table): Use it.
3047 (secure_hash): Computer start_byte and end_byte only after
3048 they're known to be in ptrdiff_t range.
3049 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
3050 (Ffont_get_glyphs, Ffont_at):
3051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3052 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
3053 (Flist_fonts, Fopen_font):
3054 Don't assume fixnum can fit in int.
3055 (check_gstring): Don't assume index can fit in int.
3056 (font_match_p): Check that fixnum is a character, not a nonnegative
3057 fixnum, since the later code needs to stuff it into an int.
3058 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
3059 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
3060 conversion overflow issues.
3061 (Fopen_font): Check for integer out of range.
3062 (Ffont_get_glyphs): Don't assume index can fit in int.
3063 * font.h: Adjust decls to match defn changes elsewhere.
3064 * fontset.c (reorder_font_vector): Redo score calculation to avoid
3065 integer overflow.
3066 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
3067 printmax_t, where ptrdiff_t is wide enough.
3068 (Finternal_char_font):
3069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3070 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
3071 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
3072 (Fset_frame_position, x_set_frame_parameters)
3073 (x_set_line_spacing, x_set_border_width)
3074 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
3075 Check that fixnums are in proper range for system types.
3076 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
3077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3078 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
3079 Use SAFE_ALLOCA_LISP, not alloca.
3080 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
3081 intptr_t is wide enough.
3082 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
3083 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
3084 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
3085 Check for fixnum out of range.
3086 * ftfont.c (ftfont_list): Don't assume index fits in int.
3087 Check that fixnums are in proper range for system types.
3088 (ftfont_shape_by_flt):
3089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
3090 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3092 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
3093 Check that fixnums are in proper range for system types.
3094 * gnutls.h: Adjust decls to match defn changes elsewhere.
3095 * gtkutil.c (xg_dialog_run):
3096 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3097 (update_frame_tool_bar):
3098 Check that fixnums are in proper range for system types.
3099 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 3100 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
3101 * indent.c (last_known_column, last_known_column_point):
3102 (current_column_bol_cache):
3103 (skip_invisible, current_column, check_display_width):
3104 (check_display_width, scan_for_column, current_column_1)
3105 (Findent_to, Fcurrent_indentation, position_indentation)
3106 (indented_beyond_p, Fmove_to_column, compute_motion):
3107 (Fcompute_motion, Fvertical_motion):
3108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3109 (last_known_column_modified): Use EMACS_INT, not int.
3110 (check_display_width):
3111 (Fcompute_motion):
3112 Check that fixnums and floats are in proper range for system types.
3113 (compute_motion): Don't assume index or fixnum fits in int.
3114 (compute_motion, Fcompute_motion):
3115 Use int, not EMACS_INT, when it is wide enough.
3116 (vmotion): Omit local var start_hpos that is always 0; that way
3117 we don't need to worry about overflow in expressions involving it.
3118 * indent.h: Adjust decls to match defn changes elsewhere.
3119 (struct position):
3120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3121 Use int, not EMACS_INT, where int is wide enough.
3122 Remove unused members ovstring_chars_done and tab_offset;
3123 all uses removed.
3124 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
3125 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
3126 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
3127 (make_gap, copy_text, insert, insert_and_inherit)
3128 (insert_before_markers, insert_before_markers_and_inherit)
3129 (insert_1, count_combining_before, count_combining_after)
3130 (insert_1_both, insert_from_string)
3131 (insert_from_string_before_markers, insert_from_string_1)
3132 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
3133 (adjust_after_replace, adjust_after_insert, replace_range)
3134 (replace_range_2, del_range, del_range_1, del_range_byte)
3135 (del_range_both, del_range_2, modify_region)
3136 (prepare_to_modify_buffer, signal_before_change)
3137 (signal_after_change, Fcombine_after_change_execute):
3138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3139 * intervals.c (traverse_intervals, rotate_right, rotate_left)
3140 (balance_an_interval, split_interval_right, split_interval_left)
3141 (find_interval, next_interval, update_interval)
3142 (adjust_intervals_for_insertion, delete_node, delete_interval)
3143 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3144 (static_offset_intervals, offset_intervals)
3145 (merge_interval_right, merge_interval_left, make_new_interval)
3146 (graft_intervals_into_buffer, temp_set_point_both)
3147 (temp_set_point, set_point, adjust_for_invis_intang)
3148 (set_point_both, move_if_not_intangible, get_property_and_range)
3149 (get_local_map, copy_intervals, copy_intervals_to_string)
3150 (compare_string_intervals, set_intervals_multibyte_1):
3151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3152 * intervals.h: Adjust decls to match defn changes elsewhere.
3153 (struct interval):
3154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3155 * keyboard.c (this_command_key_count, this_single_command_key_start)
3156 (before_command_key_count, before_command_echo_length, echo_now)
3157 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
3158 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
3159 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
3160 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
3161 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3162 (last_non_minibuf_size, last_point_position, echo_truncate)
3163 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
3164 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
3165 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
3166 (stuff_buffered_input):
3167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3168 (last_auto_save, command_loop_1, read_char):
3169 Use EMACS_INT, not int, to avoid integer overflow.
3170 (record_char): Avoid overflow in total_keys computation.
3171 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
3172 * keyboard.h: Adjust decls to match defn changes elsewhere.
3173 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
3174 (Fkey_description, Fdescribe_vector, Flookup_key):
3175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3176 (click_position): New function, to check that positions are in range.
3177 (Fcurrent_active_maps):
3178 (describe_command):
3179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3180 (Faccessible_keymaps, Fkey_description):
3181 (preferred_sequence_p):
3182 Don't assume fixnum can fit into int.
3183 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
3184 Check for integer overflow in size calculations.
3185 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
3186 avoid mishandling large integers.
3187 * lisp.h: Adjust decls to match defn changes elsewhere.
3188 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
3189 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
3190 (struct Lisp_Marker):
3191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3192 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
3193 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
3194 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
3195 All callers changed.
3196 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
3197 Assume the arg has valid form, since it always does.
3198 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
3199 unsigned integer system type.
3200 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
3201 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
3202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3203 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
3204 (duration_to_sec_usec): New decl.
3205 * lread.c (read_from_string_index, read_from_string_index_byte)
3206 (read_from_string_limit, readchar, unreadchar, openp)
3207 (read_internal_start, read1, oblookup):
3208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3209 (Fload, readevalloop, Feval_buffer, Feval_region):
3210 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3211 (openp): Check for out-of-range argument to 'access'.
3212 (read1): Use int, not EMACS_INT, where int is wide enough.
3213 Don't assume fixnum fits into int.
6efdadfd 3214 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
3215 (read_filtered_event): Use duration_to_sec_usec
3216 to do proper overflow checking on durations.
d311d28c
PE
3217 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
3218 in size calculation.
3219 (Fexecute_kbd_macro):
3220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3221 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
3222 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
3223 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
3224 (set_marker_both, set_marker_restricted_both, marker_position)
3225 (marker_byte_position, Fbuffer_has_markers_at):
3226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3227 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 3228 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
3229 It now merely ensures that the menu is large enough, without
3230 necessarily growing it, as this avoids some integer overflow issues.
3231 All callers changed.
3232 (keymap_panes, parse_single_submenu, Fx_popup_menu):
3233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3234 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
3235 Use SAFE_ALLOCA_LISP, not alloca.
3236 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
3237 to EMACS_INT. Check that fixnums are in proper range for system types.
3238 * minibuf.c (minibuf_prompt_width, string_to_object)
3239 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
3240 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
3241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3242 (get_minibuffer, read_minibuf_unwind):
3243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3244 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
3245 this simplifies overflow checking. All callers changed.
3246 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
3247 (Ftest_completion):
3248 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3249 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
3250 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
3251 Check that fixnums are in proper range for system types.
3252 (Fx_create_frame, Fx_show_tip):
3253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3254 * nsfont.m (ns_findfonts, nsfont_list_family):
3255 Don't assume fixnum fits in long.
3256 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3257 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3258 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3259 wide enough.
17fdb222 3260 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
3261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3262 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3263 (PRINTDECLARE, PRINTPREPARE):
3264 (strout, print_string):
3265 (print, print_preprocess, print_check_string_charset_prop)
3266 (print_object):
3267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3268 (PRINTDECLARE):
3269 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3271 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 3272 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 3273 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
3274 (print_error_message): Use SAFE_ALLOCA, not alloca.
3275 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
3276 (print_depth, new_backquote_output, print_number_index):
3277 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
3278 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3279 (Fset_process_window_size, Fformat_network_address)
3280 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 3281 (sigchld_handler):
d311d28c 3282 Check that fixnums are in proper range for system types.
d44287d4 3283 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
3284 Check for process-ids out of pid_t range rather than relying on
3285 undefined behavior.
e4d81efc 3286 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
3287 (Fformat_network_address, read_process_output, send_process)
3288 (Fprocess_send_region, status_notify):
3289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3290 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3291 (wait_reading_process_output, read_process_output, exec_sentinel):
3292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3293 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3294 (Faccept_process_output): Use duration_to_sec_usec to do proper
3295 overflow checking on durations.
dde14581
PE
3296 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3297 Don't assume pid_t fits in int.
02481186
PE
3298 * process.h (struct Lisp_Process): Members tick and update_tick
3299 are now of type EMACS_INT, not int.
b62b53e8
PE
3300 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3301 configured --with-wide-int.
d311d28c
PE
3302 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3303 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3304 * search.c (looking_at_1, string_match_1):
3305 (fast_string_match, fast_c_string_match_ignore_case)
3306 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3307 (scan_newline, find_before_next_newline, search_command)
3308 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3309 (set_search_regs, wordify):
3310 (Freplace_match):
3311 (Fmatch_data):
3312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3313 (string_match_1, search_buffer, set_search_regs):
3314 (Fmatch_data):
3315 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3316 (wordify): Check for overflow in size calculation.
3317 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3318 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3319 Check that fixnums are in proper range for system types.
3320 * sound.c (struct sound_device)
3321 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3323 (Fplay_sound_internal):
3324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 3325 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
3326 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3327 (Fparse_partial_sexp):
3328 Don't assume fixnums can fit in int.
3329 (struct lisp_parse_state, find_start_pos, find_start_value)
3330 (find_start_value_byte, find_start_begv)
3331 (update_syntax_table, char_quoted, dec_bytepos)
3332 (find_defun_start, prev_char_comend_first, back_comment):
3333 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3334 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3336 (Finternal_describe_syntax_value): Check that match_lisp is a
3337 character, not an integer, since the code stuffs it into int.
3338 (scan_words, scan_sexps_forward):
3339 Check that fixnums are in proper range for system types.
3340 (Fforward_word):
3341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3342 (scan_sexps_forward):
3343 Use CHARACTERP, not INTEGERP, since the value must fit into int.
3344 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3345 * syntax.h: Adjust decls to match defn changes elsewhere.
3346 (struct gl_state_s):
3347 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3348 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3349 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3350 * sysdep.c (wait_for_termination_1, wait_for_termination)
3351 (interruptible_wait_for_termination, mkdir):
3352 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3353 (emacs_read, emacs_write):
3354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3355 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3356 and double all fit in int.
d311d28c
PE
3357 * term.c (set_tty_color_mode):
3358 Check that fixnums are in proper range for system types.
3359 * termhooks.h (struct input_event):
3360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3361 * textprop.c (validate_interval_range, interval_of)
3362 (Fadd_text_properties, set_text_properties_1)
3363 (Fremove_text_properties, Fremove_list_of_text_properties)
3364 (Ftext_property_any, Ftext_property_not_all)
3365 (copy_text_properties, text_property_list, extend_property_ranges)
3366 (verify_interval_modification):
3367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3368 (Fnext_single_char_property_change)
3369 (Fprevious_single_char_property_change):
3370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3371 (copy_text_properties):
3372 Check for integer overflow in index calculation.
d311d28c
PE
3373 * undo.c (last_boundary_position, record_point, record_insert)
3374 (record_delete, record_marker_adjustment, record_change)
3375 (record_property_change):
3376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3377 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3378 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3379 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3380 (Fx_hide_tip, Fx_file_dialog):
3381 * w32menu.c (set_frame_menubar):
3382 Use ptrdiff_t, not int, for consistency with rest of code.
3383 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3384 (select_window, Fdelete_other_windows_internal)
3385 (window_scroll_pixel_based, window_scroll_line_based)
3386 (Frecenter, Fset_window_configuration):
3387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3388 (Fset_window_hscroll, run_window_configuration_change_hook)
3389 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3390 (Fscroll_other_window, Frecenter):
d311d28c
PE
3391 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3392 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3393 Don't assume fixnum fits in int.
3394 (Fset_window_scroll_bars):
3395 Check that fixnums are in proper range for system types.
3396 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3397 (string_pos, c_string_pos, number_of_chars, init_iterator)
3398 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3399 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3400 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3401 (face_before_or_after_it_pos, handle_invisible_prop)
3402 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3403 (display_prop_intangible_p, string_buffer_position_lim)
3404 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3405 (get_overlay_strings_1, get_overlay_strings)
3406 (iterate_out_of_display_property, forward_to_next_line_start)
3407 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3408 (get_next_display_element, set_iterator_to_next)
3409 (get_visually_first_element, compute_stop_pos_backwards)
3410 (handle_stop_backwards, next_element_from_buffer)
3411 (move_it_in_display_line_to, move_it_in_display_line)
3412 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3413 (add_to_log, message_dolog, message_log_check_duplicate)
3414 (message2, message2_nolog, message3, message3_nolog
3415 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3416 (current_message_1, truncate_echo_area, truncate_message_1)
3417 (set_message, set_message_1, store_mode_line_noprop)
3418 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3419 (text_outside_line_unchanged_p, check_point_in_composition)
3420 (reconsider_clip_changes)
3421 (redisplay_internal, set_cursor_from_row, try_scrolling)
3422 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3423 (redisplay_window, find_last_unchanged_at_beg_row)
3424 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3425 (trailing_whitespace_p, find_row_edges, display_line)
3426 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3427 (display_mode_element, store_mode_line_string)
3428 (pint2str, pint2hrstr, decode_mode_spec)
3429 (display_count_lines, display_string, draw_glyphs)
3430 (x_produce_glyphs, x_insert_glyphs)
3431 (rows_from_pos_range, mouse_face_from_buffer_pos)
3432 (fast_find_string_pos, mouse_face_from_string_pos)
3433 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3435 (safe_call, init_from_display_pos, handle_fontified_prop)
3436 (handle_single_display_spec, load_overlay_strings)
3437 (with_echo_area_buffer, setup_echo_area_for_printing)
3438 (display_echo_area, echo_area_display)
3439 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3440 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3441 (redisplay_window, dump_glyph_row, display_mode_line)
3442 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3443 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3445 (handle_single_display_spec, build_desired_tool_bar_string)
3446 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3447 (get_specified_cursor_type):
3448 Check that fixnums are in proper range for system types.
3449 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3450 (Flookup_image_map):
3451 Don't assume fixnums fit in int.
3452 (compare_overlay_entries):
3453 Avoid mishandling comparisons due to subtraction overflow.
3454 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3455 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3456 (handle_tool_bar_click):
3457 Use int, not unsigned, since we prefer signed and the signedness
3458 doesn't matter here.
3459 (get_next_display_element, next_element_from_display_vector):
3460 Use int, not EMACS_INT, when int is wide enough.
3461 (start_hourglass): Use duration_to_sec_usec to do proper
3462 overflow checking on durations.
3463 * xfaces.c (Fbitmap_spec_p):
3464 Check that fixnums are in proper range for system types.
3465 (compare_fonts_by_sort_order):
3466 Avoid mishandling comparisons due to subtraction overflow.
3467 (Fx_family_fonts, realize_basic_faces):
3468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3469 (Fx_family_fonts):
3470 Don't assume fixnum fits in int.
3471 Use SAFE_ALLOCA_LISP, not alloca.
3472 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3473 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3474 (face_at_buffer_position, face_for_overlay_string)
3475 (face_at_string_position):
3476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3477 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3478 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3479 (Fx_show_tip):
3480 Check that fixnums are in proper range for system types.
3481 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3482 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3484 (Fx_change_window_property): Don't assume fixnums fit in int.
3485 * xfont.c (xfont_chars_supported):
3486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3487 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3488 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3490 * xml.c (parse_region):
3491 * xrdb.c (magic_file_p):
3492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3493 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3494 (x_get_local_selection, x_reply_selection_request)
3495 (x_handle_selection_request, wait_for_property_change):
3496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3497 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3498 short is wide enough.
3499 (x_send_client_event): Don't assume fixnum fits in int.
3500 * xterm.c (x_x_to_emacs_modifiers):
3501 Don't assume EMACS_INT overflows nicely into int.
3502 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3503 may come from Lisp.
3504 (handle_one_xevent): NATNUMP can eval its arg twice.
3505 (x_connection_closed):
3506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3507 * xterm.h: Adjust decls to match defn changes elsewhere.
3508 (struct scroll_bar): Use struct vectorlike_header
3509 rather than rolling our own approximation.
3510 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3511
c6574eb5
GM
35122012-05-25 Glenn Morris <rgm@gnu.org>
3513
3514 * lisp.mk (lisp): Update for more files being compiled now.
3515
e8d32c7e
SM
35162012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3517
48def666
SM
3518 * lread.c: Remove `read_pure' which makes no difference.
3519 (read_pure): Remove var.
3520 (unreadpure): Remove function.
3521 (readevalloop): Don't call read_list with -1 flag.
3522 (read1, read_vector): Don't test read_pure any more.
3523 (read_list): Simplify.
3524
e8d32c7e
SM
3525 * fileio.c, character.h: Minor style tweaks.
3526
4b2addb7
DA
35272012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3528
3529 * window.h (clip_changed): Remove useless declaration.
3530
584461b2
JB
35312012-05-22 Juanma Barranquero <lekktu@gmail.com>
3532
3533 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3534 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3535
34374650
PE
35362012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3537
3538 Remove src/m/*.
3539 This directory predates autoconf and is no longer needed nowadays.
3540 Move its few remaining bits of functionality to where they're needed.
3541 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3542 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3543 * m/template.h: Remove.
3544 * Makefile.in (M_FILE): Remove. All uses removed.
3545 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3546 * lisp.h (USE_LSB_TAG):
3547 * mem-limits.h (EXCEEDS_LISP_PTR):
3548 Use VAL_MAX, not VALBITS, in #if.
3549 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3550 (EMACS_UINT): Define unconditionally now.
3551 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3552 (BITS_PER_EMACS_INT): New constants, replacing
3553 what used to be in config.h, but not useful in #if.
3554 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3555 define them any more.
3556 (VAL_MAX): New macro.
3557 (VALMASK): Use it.
3558 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3559 BITS_PER_EMACS_INT, in #if.
3560 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3561 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3562 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3563 * s/ms-w32.h (DATA_START):
3564 Move here from removed file m/intel386.h.
3565 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3566 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3567
261cb4bb
PE
35682012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3569
3570 Assume C89 or later.
3571 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3572 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3573 (xrealloc):
3574 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3575 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3576 * textprop.c, tparam.c (NULL): Remove.
3577 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3578 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3579 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3580 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3581 * xterm.c (input_signal_count): Assume volatile works.
3582
ff23cd9f
KB
35832012-05-21 Ken Brown <kbrown@cornell.edu>
3584
3585 * xgselect.c (xg_select): Fix first argument in call to 'select'
3586 (bug#11508).
3587
1b170bc6
KB
35882012-05-20 Ken Brown <kbrown@cornell.edu>
3589
3590 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3591 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3592
b2f4d39f
KB
35932012-05-19 Ken Brown <kbrown@cornell.edu>
3594
3595 * xfns.c (x_in_use): Remove `static' qualifier.
3596 * xterm.h (x_in_use): Declare.
3597 * xgselect.c: Include xterm.h.
3598 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3599 and `display_arg' (bug#9754).
3600
003fdae2
PE
36012012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3602
9232a6d9
PE
3603 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3604
003fdae2
PE
3605 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3606 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3607
784b56e2
EZ
36082012-05-18 Eli Zaretskii <eliz@gnu.org>
3609
3610 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3611
3612 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3613 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3614
3615 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3616 reference to image_cache->refcount.
3617 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3618
a0a79cde
JL
36192012-05-17 Juri Linkov <juri@jurta.org>
3620
3621 * search.c (Fword_search_regexp, Fword_search_backward)
3622 (Fword_search_forward, Fword_search_backward_lax)
3623 (Fword_search_forward_lax): Move functions to isearch.el
3624 (bug#10145, bug#11381).
3625
b0572523
PE
36262012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3627
3628 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3629
9660f5fc
SM
36302012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3631
3632 * lread.c (init_obarray): Declare Qt and Qnil as special.
3633
4374de83
GM
36342012-05-14 Glenn Morris <rgm@gnu.org>
3635
3636 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3637 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3638
dc44c39a
PE
36392012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3640
078c97cb
PE
3641 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3642
dc44c39a
PE
3643 * unexaix.c: Port to more-recent AIX compilers.
3644 (report_error, report_error_1, make_hdr, copy_sym)
3645 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3646 Make arguments const char *, not char *, to avoid violations of C
3647 standard and to fix some AIX warnings reported by Gilles Pion.
3648
e18afed7 36492012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3650
3651 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3652 already have overlays loaded.
3653 (handle_single_display_spec): Before returning without displaying
3654 fringe bitmap, synchronize the bidi iterator with the main display
3655 iterator, by calling iterate_out_of_display_property.
3656 (iterate_out_of_display_property): Detect buffer iteration by
3657 testing that it->string is a Lisp string.
3658 (get_next_display_element): When the current object is exhausted,
3659 and there's something on it->stack, call set_iterator_to_next to
3660 proceed with what's on the stack, instead of returning zero.
3661 (set_iterator_to_next): If called at the end of a Lisp string,
3662 proceed to consider_string_end without incrementing string
3663 position. Don't increment display vector index past the end of
3664 the display vector. (Bug#11417)
c8fb9dc6
EZ
3665 (pos_visible_p): Don't report a position visible when move_it_to
3666 stopped at the last line of window, which happens to be scanned
3667 backwards by the bidi iteration. (Bug#11464)
ac268e67 3668
e18afed7 36692012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3670
3671 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3672 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3673 are on a TTY, and thus unable to display on the fringes.
3674 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3675 so we need to signal to the caller that this is a "replacing"
3676 display spec. This fixes display when the spec is invalid or we
3677 are on a TTY.
3678
e18afed7 36792012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3680
3681 * unexaix.c (make_hdr): Fix typo in prototype.
3682 This bug broke the build on AIX. Problem reported by Gilles Pion.
3683
9d0a235a
MA
36842012-05-14 Michael Albinus <michael.albinus@gmx.de>
3685
3686 * keyboard.c (kbd_buffer_get_event): Read special events also in
3687 batch mode. (Bug#11415)
3688
9e6b06ed
GM
36892012-05-12 Glenn Morris <rgm@gnu.org>
3690
3691 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3692
c1a1d7a3
EZ
36932012-05-12 Eli Zaretskii <eliz@gnu.org>
3694
3695 * lisp.mk (lisp): Add newcomment.elc.
3696
3fe7cdc8
GM
36972012-05-12 Glenn Morris <rgm@gnu.org>
3698
3699 * Makefile.in (MKDIR_P): New, set by configure.
3700 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3701
53f7d2c0
PE
37022012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3703
3704 Remove unused function hourglass_started.
3705 * dispextern.h (hourglass_started):
3706 * w32fns.c (hourglass_started):
3707 * xdisp.c (hourglass_started): Remove.
3708
75aafb17
JB
37092012-05-10 Juanma Barranquero <lekktu@gmail.com>
3710
3711 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3712 Update dependencies.
3713
12959e8e
PE
37142012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3715
97107e2e
PE
3716 * xgselect.c (xg_select): Put maxfds+1 into a var.
3717 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3718
12959e8e
PE
3719 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3720
836d29b3
DA
37212012-05-10 Dave Abrahams <dave@boostpro.com>
3722
3723 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3724 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3725
5cb67954
MA
37262012-05-09 Michael Albinus <michael.albinus@gmx.de>
3727
3728 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3729 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3730 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3731 Initialize xd_registered_buses.
3732
3478ec45
PE
37332012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3734
b263a6b0
PE
3735 Untag more efficiently if USE_LSB_TAG.
3736 This is based on a proposal by YAMAMOTO Mitsuharu in
3737 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3738 For an admittedly artificial (nth 8000 longlist) benchmark on
3739 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3740 Emacs's overall text size by 1%.
3741 * lisp.h (XUNTAG): New macro.
3742 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3743 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3744 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3745 * eval.c (Fautoload):
3746 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3747 * frame.h (XFRAME): Use XUNTAG.
3748
3478ec45
PE
3749 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3750 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3751 Remove unportable assumptions about print widths of types like
3752 dbus_uint32_t.
3753 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3754 intptr_t when converting between pointer and integer, to avoid GCC
3755 warnings about wrong width.
3756
666b903b 37572012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3758
3759 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3760 stack for each reader_thread, instead of defaulting to 8MB
3761 determined by the linker. This avoids failures in creating
3762 subprocesses on Windows 7, see the discussion in this thread:
3763 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3764
b120cc17
JC
37652012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3766
3767 Fix up display of the *Minibuf-0* buffer in the mini window.
3768 * keyboard.c (read_char): Don't clear the echo area if there's no
3769 message to clear.
3770 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3771 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3772
9a4b36f8
MA
37732012-05-07 Michael Albinus <michael.albinus@gmx.de>
3774
3775 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3776 batch mode.
3777
e5f9458f
CY
37782012-05-06 Chong Yidong <cyd@gnu.org>
3779
3780 * lisp.mk (lisp): Update.
3781
eceeb5fc 37822012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3783
3784 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3785
71873e2b
SM
37862012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3787
3788 * data.c (PUT_ERROR): New macro.
3789 (syms_of_data): Use it. Add new error type `user-error'.
3790 * undo.c (user_error): New function.
3791 (Fprimitive_undo): Use it.
3792 * print.c (print_error_message): Adjust print style for `user-error'.
3793 * keyboard.c (user_error): New function.
3794 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3795
ab0fa4e4
PE
37962012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3797
3798 Do not limit current-time-string to years 1000..9999.
3799 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3800 (Fcurrent_time_string): Support any year that is supported by the
3801 underlying localtime representation. Don't use asctime, as it
3802 has undefined behavior for years outside the range -999..9999.
3803
7ed806a7
PE
38042012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 Fix race conditions involving setenv, gmtime, localtime, asctime.
3807 Without this fix, interrupts could mess up code that uses these
3808 nonreentrant functions, since setting TZ invalidates existing
3809 tm_zone or tzname values, and since most of these functions return
3810 pointers to static storage.
3811 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3812 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3813 Grow the critical sections to include not just invoking
3814 localtime/gmtime, but also accessing these functions' results
3815 including their tm_zone values if any, and any related TZ setting.
3816 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3817 so that the struct tm is saved in the critical section.
3818 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3819 motivated by the fact that memory allocation needs to be outside
3820 the critical section.
3821
0c16dfed
DA
38222012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3823
3824 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3825 with RESET_INTERVAL.
3826
3827 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3828 Remove duplicated buffer name initialization.
3829
3f83ace8
JM
38302012-05-02 Jim Meyering <jim@meyering.net>
3831
3832 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3833
c7b8541e
JM
3834 * xfns.c (x_window): Use xstrdup (Bug#11375).
3835
90207a15 38362012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3837
3838 * xdisp.c (pos_visible_p): If already at a newline from the
3839 display string before the 'while' loop, don't walk back the glyphs
3840 from it3.glyph_row. Solves assertion violation when the display
3841 string begins with a newline (egg.el). (Bug#11367)
3842
b593d6a9
AH
38432012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3844
3845 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3846 Move to simple.el.
3847
4737362e
GM
38482012-05-01 Glenn Morris <rgm@gnu.org>
3849
99cf43f9
GM
3850 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3851 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3852 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3853 All were removed before 23.1.
3854
9311dcff
GM
3855 * dispnew.c: Remove HAVE_LIBNCURSES test;
3856 it is always true on relevant platforms.
3857
4d5c6349
GM
3858 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3859 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3860
4737362e
GM
3861 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3862
74dd3a6b
AS
38632012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3864
3865 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3866 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3867 Remove.
3868
13c379ee
PE
38692012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3870
3871 Do not avoid creating empty evaporating overlays (Bug#9642).
3872 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3873 That is, do not delete an evaporating overlay if it becomes
3874 empty after its bounds are adjusted to fit within its buffer.
3875 This fix caused other problems, and I'm reverting it until we get
3876 to the bottom of them.
3877
a8e7d6d7 38782012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3879
3880 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3881
a8e7d6d7 38822012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3883
3884 * xdisp.c (pos_visible_p): If the window start position is beyond
3885 ZV, start the display from buffer beginning. Prevents assertion
3886 violation in init_iterator when the minibuffer window is scrolled
3887 via the scroll bar.
3888
3889 * window.c (window_scroll_pixel_based): Likewise.
3890
a8e7d6d7 38912012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3892
3893 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3894
a8e7d6d7 38952012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3896
3897 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3898 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3899
a8e7d6d7 39002012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3901
b593d6a9
AH
3902 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3903 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3904
1c6900d9
EZ
39052012-04-26 Eli Zaretskii <eliz@gnu.org>
3906
4c3fa1d9
EZ
3907 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3908 display element, check also the underlying string or buffer
3909 character. (Bug#11341)
3910
1c6900d9
EZ
3911 * w32menu.c: Include w32heap.h.
3912 (add_menu_item): If the call to AppendMenuW (via
3913 unicode_append_menu) fails, disable Unicode menus only if we are
3914 running on Windows 9X/Me.
3915
42bf8205
AS
39162012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3917
3918 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3919 (xgetint): Add missing shift for LSB tags.
3920
b1bac16e
MR
39212012-04-24 Martin Rudalics <rudalics@gmx.at>
3922
3923 * keyboard.c (read_char): Don't wipe echo area for select window
3924 events: These might get delayed via `mouse-autoselect-window'
3925 (Bug#11304).
3926
d69621cc
JB
39272012-04-24 Juanma Barranquero <lekktu@gmail.com>
3928
3929 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3930 manipulation of :loaded-from data.
3931
02fd101b
JB
39322012-04-23 Juanma Barranquero <lekktu@gmail.com>
3933
3934 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3935 now a cons (bug#11311).
3936
888bec30
PE
39372012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3938
89a438bd
PE
3939 Do not create empty overlays with the evaporate property (Bug#9642).
3940 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3941 if it becomes empty after its bounds are adjusted to fit within
3942 its buffer. Without this fix, in a nonempty buffer (let ((o
3943 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3944 yields an empty overlay that has the evaporate property, which is
3945 not supposed to happen.
3946
1068fe4d
PE
3947 Fix minor GTK3 problems found by static checking.
3948 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3949 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3950 (struct _EmacsFixedClass, emacs_fixed_get_type):
3951 Move decls here from emacsgtkfixed.h, since they needn't be public.
3952 (emacs_fixed_get_type): Now static.
3953 (emacs_fixed_class_init): Omit unused local.
3954 (emacs_fixed_child_type): Remove; unused.
3955 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3956 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3957 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3958 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3959 (EMACS_FIXED_GET_CLASS): Remove; unused.
3960 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3961
888bec30
PE
3962 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3963 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3964
de85e130
PE
39652012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3966
d0baac98 3967 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 3968 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
3969 (__malloc_size_t, __malloc_ptrdiff_t):
3970 Remove. All uses removed, replaced by the definiens if needed,
3971 since we can assume C89 or better now.
3972 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3973 (protect_malloc_state, align, get_contiguous_space)
3974 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3975 (malloc_atfork_handler_child, malloc_enable_thread)
3976 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3977 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3978 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3979 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3980 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3981 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3982 Define using prototypes, not old style.
3983 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3984 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3985 (align): Don't assume that signed integer overflow wraps around.
3986 Omit unused local var.
3987 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3988 (_free_internal_nolock, memalign, mallochook, reallochook):
3989 Omit no-longer-needed casts.
3990 (valloc): Use getpagesize, not __getpagesize.
3991 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3992 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3993
de85e130
PE
3994 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3995
dcbf5805
MA
39962012-04-22 Michael Albinus <michael.albinus@gmx.de>
3997
3998 Move functions from C to Lisp. Make non-blocking method calls
3999 the default. Implement further D-Bus standard interfaces.
4000
4001 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
4002 (QCdbus_request_name_allow_replacement)
4003 (QCdbus_request_name_replace_existing)
4004 (QCdbus_request_name_do_not_queue)
4005 (QCdbus_request_name_reply_primary_owner)
4006 (QCdbus_request_name_reply_in_queue)
4007 (QCdbus_request_name_reply_exists)
4008 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
4009 (QCdbus_registered_serial, QCdbus_registered_method)
4010 (QCdbus_registered_signal): New Lisp objects.
4011 (XD_DEBUG_MESSAGE): Use sizeof.
4012 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
4013 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
4014 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
4015 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
4016 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
4017 (xd_signature, xd_append_arg): Allow float for integer types.
4018 (xd_get_connection_references): New function.
b593d6a9
AH
4019 (xd_get_connection_address): Rename from xd_initialize.
4020 Return cached address.
dcbf5805
MA
4021 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
4022 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
4023 level.
4024 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 4025 Return number of refcounts.
dcbf5805
MA
4026 (Fdbus_get_unique_name): Make stronger parameter check.
4027 (Fdbus_message_internal): New defun.
4028 (Fdbus_call_method, Fdbus_call_method_asynchronously)
4029 (Fdbus_method_return_internal, Fdbus_method_error_internal)
4030 (Fdbus_send_signal, Fdbus_register_service)
4031 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
4032 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
4033 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
4034 (Vdbus_compiled_version, Vdbus_runtime_version)
4035 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
4036 (Vdbus_message_type_method_return, Vdbus_message_type_error)
4037 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
4038 (Vdbus_registered_buses, Vdbus_registered_objects_table):
4039 Adapt docstring.
dcbf5805 4040
52828e02
PE
40412012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4042
da05bc4c
PE
4043 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
4044 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
4045 Do not assume ptrdiff_t is the same width as 'int'.
4046
52828e02
PE
4047 * alloc.c: Handle unusual debugging option combinations.
4048 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
4049 since the two debugging options are incompatible.
4050 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
4051 is defined.
4052 (mem_init, mem_insert, mem_insert_fixup):
4053 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
4054 (NEED_MEM_INSERT): Remove; no longer needed.
4055
f01769f9
LL
40562012-04-22 Leo Liu <sdl.web@gmail.com>
4057
4058 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
4059
5790543d
PE
40602012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4061
4062 * sysdep.c [__FreeBSD__]: Minor cleanups.
4063 (list_system_processes, system_process_attributes) [__FreeBSD__]:
4064 Use Emacs indenting style more consistently. Avoid some casts.
4065 Use 'double' consistently rather than mixing 'float' and 'double'.
4066
b91b7e4d
EW
40672012-04-21 Eduard Wiebe <usenet@pusto.de>
4068
b593d6a9
AH
4069 * sysdep.c (list_system_processes, system_process_attributes):
4070 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 4071
6114eb15
AS
40722012-04-21 Andreas Schwab <schwab@linux-m68k.org>
4073
4074 * lisp.mk (lisp): Update.
4075
2f38dff7
PE
40762012-04-20 Paul Eggert <eggert@cs.ucla.edu>
4077
4078 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
4079 It is never used otherwise.
4080
4ae29f89
SM
40812012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
4082
4083 * print.c (print_preprocess): Only check print_depth if print-circle
4084 is nil.
4085 (print_object): Check for cycles even when print-circle is nil and
4086 print-gensym is t, but only check print_depth if print-circle is nil.
4087
f30d612a
CY
40882012-04-20 Chong Yidong <cyd@gnu.org>
4089
4090 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4091 set the status to "failed" and ensure that sentinel is run.
4092
c07a4c0b 40932012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
4094
4095 * process.c (Fset_process_inherit_coding_system_flag)
4096 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 4097 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 4098
c07a4c0b 40992012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
4100
4101 * xdisp.c (string_buffer_position_lim): Limit starting position to
4102 BEGV.
4103 (set_cursor_from_row): If called for a mode-line or header-line
4104 row, return zero immediately.
4105 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
4106 farther than the first row after the header line, if any.
4107 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
4108 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
4109
c07a4c0b 41102012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4111
4ae29f89
SM
4112 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
4113 (bug#11238).
ad3a2b41 4114
c07a4c0b 41152012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 41162012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
4117
4118 configure: new option --enable-gcc-warnings (Bug#11207)
4119 * Makefile.in (C_WARNINGS_SWITCH): Remove.
4120 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
4121 (ALL_CFLAGS): Use new macros rather than old.
4122 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
4123 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
4124 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
4125 -Wunused-result, -Wunused-variable. This should go away once
4126 the Emacs and Gnulib regex code is merged.
4127 (xmalloc, xrealloc): Now static.
4128
aba027e8
PE
41292012-04-17 Paul Eggert <eggert@cs.ucla.edu>
4130
4131 * dired.c (Fsystem_groups): Remove unused local.
4132
e5a36063
GM
41332012-04-17 Glenn Morris <rgm@gnu.org>
4134
4135 * dired.c (Fsystem_users): Doc fix.
4136
316411f0
DA
41372012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
4138
4139 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
4140 (syms_of_dired): Add them.
4141
9426aba4
PE
41422012-04-16 Paul Eggert <eggert@cs.ucla.edu>
4143
b62a57be
PE
4144 Fix minor alloc.c problems found by static checking.
4145 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
4146 New extern decls, to avoid calling undeclared functions.
4147 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
4148 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
4149 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
4150 (NEED_MEM_INSERT): New macro.
4151 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 4152 Remove one incorrect comment and fix another.
b62a57be 4153
3539f31f
PE
4154 Fix minor ralloc.c problems found by static checking.
4155 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4156 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
4157 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
4158 (r_alloc_sbrk): Now static.
4159
a041960a
PE
4160 Improve ralloc.c interface checking.
4161 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4162 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
4163 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
4164 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
4165 [REL_ALLOC]: ... to here, to check interface.
4166 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
4167 Remove decls. This fixes an "It stinks!".
4168
9426aba4
PE
4169 * alloc.c (which_symbols): Fix alignment issue / type clash.
4170
d55c12ed
AS
41712012-04-15 Andreas Schwab <schwab@linux-m68k.org>
4172
4173 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
4174 (struct Lisp_Misc_Any): Likewise.
4175 (struct Lisp_Free): Likewise.
4176 * alloc.c (union aligned_Lisp_Symbol): Define.
4177 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
4178 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
4179 (union aligned_Lisp_Misc): Define.
4180 (MARKER_BLOCK_SIZE, struct marker_block): Use union
4181 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 4182 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 4183
b948ce8b
PE
41842012-04-14 Paul Eggert <eggert@cs.ucla.edu>
4185
4186 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
4187 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
4188 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
4189 * s/netbsd.h, s/sol2-6.h:
4190 Remove definition of GC_MARK_STACK, since the default now works.
4191 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
4192 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
4193 no longer the default.
4194 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
4195
35dc09a1 41962012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4197
35dc09a1
GM
4198 * lread.c (lisp_file_lexically_bound_p):
4199 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 4200
35dc09a1
GM
42012012-04-14 Eli Zaretskii <eliz@gnu.org>
4202
4203 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
4204 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
4205
42062012-04-14 Jan Djärv <jan.h.d@swipnet.se>
4207
4208 * nsterm.m (constrainFrameRect): Always constrain when there is only
4209 one screen (Bug#10962).
4210
bcd86815
KB
42112012-04-13 Ken Brown <kbrown@cornell.edu>
4212
4213 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
4214
c25df26e
RT
42152012-04-13 Reuben Thomas <rrt@sc3d.org>
4216
4217 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
4218
0fc59f1e
DC
42192012-04-11 Daniel Colascione <dancol@dancol.org>
4220
4221 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
4222 against is gone. It's better to use vfork now so that when Cygwin
4223 gains a new, working vfork, we use it automatically (bug#10398).
4224
de8c03dc
SM
42252012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4226
4227 * window.c (save_window_save): Obey window-point-insertion-type.
4228
2f097256
GM
42292012-04-11 Glenn Morris <rgm@gnu.org>
4230
4231 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
4232
453b951e
SM
42332012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4234
4235 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
4236
75f1671a 42372012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
4238
4239 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
4240 (force_quit_count): New var.
4241 (handle_interrupt): Use it.
4242
2a8ce227
JB
42432012-04-10 Juanma Barranquero <lekktu@gmail.com>
4244
4245 * w32.c (w32_delayed_load): Record the full path of the library
4246 being loaded (bug#10424).
4247
935396c0
GM
42482012-04-09 Glenn Morris <rgm@gnu.org>
4249
05920a43
GM
4250 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
4251 not just in the obarray, before snarfing them. (Bug#11036)
4252
935396c0
GM
4253 * Makefile.in ($(leimdir)/leim-list.el):
4254 Pass EMACS rather than BUILT_EMACS.
4255
a18ecafa
TZ
42562012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4257
4258 * process.c (make_process):
4259 * process.h: Add integer `gnutls_handshakes_tried' member to
4260 process struct.
4261
6bbef4e5
JC
4262 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4263 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
4264
4265 * gnutls.c (gnutls_log_function2i): Convenience log function.
4266 (emacs_gnutls_read): Use new log functions,
4267 `gnutls_handshakes_tried' process member, and
4268 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4269 attempts per process (connection).
4270
b4d3bc10
CY
42712012-04-09 Chong Yidong <cyd@gnu.org>
4272
4273 * eval.c (Fuser_variable_p, user_variable_p_eh)
4274 (lisp_indirect_variable): Functions deleted.
4275 (Fdefvar): Caller changed.
4276
4277 * callint.c (Finteractive, Fcall_interactively):
4278 * minibuf.c (Fread_variable): Callers changed.
4279
70f4d973
EZ
42802012-04-09 Eli Zaretskii <eliz@gnu.org>
4281
4282 * xdisp.c (set_cursor_from_row): If the display string appears in
4283 the buffer at position that is closer to point than the position
4284 after the display string, display the cursor on the first glyph of
4285 the display string. Fixes cursor display when a 'display' text
4286 property immediately follows invisible text. (Bug#11094)
4287
cb3c2e3e
PE
42882012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4289
4290 composite.c: use 'double' consistently
4291 * composite.c (get_composition_id): Use 'double' consistently
4292 instead of converting 'float' to 'double' and vice versa; this is
4293 easier to understand and avoids a GCC warning.
4294
fd06db5d
GM
42952012-04-09 Glenn Morris <rgm@gnu.org>
4296
50fe702a
GM
4297 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4298 preparation for dumping it with emacs. (Bug#4789)
4299 (leimdir): New variable.
4300 ($(leimdir)/leim-list.el): New rule.
4301 (emacs$(EXEEXT)): Depend on leim-list.el.
4302
fd06db5d
GM
4303 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4304 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4305 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4306
55c131ee
AS
43072012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4308
4309 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4310 proper alignment.
4311
9209588f
JB
43122012-04-07 Juanma Barranquero <lekktu@gmail.com>
4313
4314 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4315 Remove unused local variable.
4316
e3fb2efb
PE
43172012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4320 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4321 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4322 objects, as mark_maybe_pointer will catch them otherwise.
4323 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4324 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4325
b5385551
PE
43262012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4327
4328 Fix typo that broke non-Windows builds.
4329 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4330
9078ead6
EZ
43312012-04-07 Eli Zaretskii <eliz@gnu.org>
4332
4333 Support building on MS-Windows with libxml2.
4334
4335 * makefile.w32-in (OBJ2): Add xml.$(O).
4336 (GLOBAL_SOURCES): Add xml.c.
4337 ($(BLD)/xml.$(O)): New dependency list.
4338
4339 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
4340 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
4341 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
4342 [!WINDOWSNT]: New macros.
4343 (init_libxml2_functions, libxml2_loaded_p): New functions.
4344 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4345 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4346 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4347 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4348 linked in).
6bbef4e5
JC
4349 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4350 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4351 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4352
4353 * emacs.c: Don't include libxml/parser.h.
4354 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4355 xmlCleanupParser directly.
4356
4357 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4358
3811fdf3
EZ
43592012-04-07 Eli Zaretskii <eliz@gnu.org>
4360
4361 * indent.c (Fvertical_motion): If there is a display string at
4362 point, use it.vpos to compute how many lines to backtrack after
4363 move_it_to point. (Bug#11133)
4364
2f8e16b2
EZ
43652012-04-06 Eli Zaretskii <eliz@gnu.org>
4366
4367 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4368 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4369 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4370 macros related to unification of CJK characters. For the details,
4371 see the discussion following the message here:
4372 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4373
3d439cd1
CY
43742012-04-04 Chong Yidong <cyd@gnu.org>
4375
4376 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4377
8bc53d00
EZ
43782012-04-01 Eli Zaretskii <eliz@gnu.org>
4379
4380 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4381 instead of alloca. (Bug#11138)
4382
3b0512a3
AS
43832012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4384
4385 * w32menu.c (is_simple_dialog): Properly check lisp types.
4386 (Bug#11141)
4387
8427ddd2
EZ
43882012-03-31 Eli Zaretskii <eliz@gnu.org>
4389
979022ef
EZ
4390 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4391 position we get to after a call to move_it_to fails the
4392 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4393 only if we wind up in a string from display property. (Bug#11063)
4394
a6b1c7cc
EZ
4395 * window.c (Fdelete_other_windows_internal): Invalidate the row
4396 and column information about mouse highlight, so that redisplay
4397 restores it after reallocating the glyph matrices. (Bug#7464)
4398
8427ddd2
EZ
4399 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4400 string comes from a `display' text property, use the buffer
4401 position of that property as if we actually saw that position in
4402 the row's glyphs.
697ba24b
EZ
4403 (move_it_by_lines): Remove the assertion that
4404 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4405 violated when there's a before-string at the beginning of a line.
4406 (Bug#11063)
8427ddd2 4407
65a0a738
EZ
44082012-03-30 Eli Zaretskii <eliz@gnu.org>
4409
4410 * xdisp.c (append_space_for_newline): If the default face was
4411 remapped, use the remapped face for the appended newline.
4412 (extend_face_to_end_of_line): Use the remapped default face for
4413 extending the face to the end of the line.
4414 (display_line): Call extend_face_to_end_of_line when the default
4415 face was remapped. (Bug#11068)
4416
581355cc
EZ
44172012-03-29 Eli Zaretskii <eliz@gnu.org>
4418
4419 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4420
e8fc049f
SM
44212012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4422
4423 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4424
4fb9a543
GM
44252012-03-27 Glenn Morris <rgm@gnu.org>
4426
4427 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4428 Doc fixes.
4429
679910f1
KH
44302012-03-26 Kenichi Handa <handa@m17n.org>
4431
4432 * dispextern.h (struct glyph): Fix previous change. Change the
4433 bit length of glyphless.ch to 25 (Bug#11082).
4434
90d49b7f
CY
44352012-03-26 Chong Yidong <cyd@gnu.org>
4436
4437 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4438 (command_loop_1): Use it; inhibit selection update for
4439 handle-select-window too (Bug#8996).
4440
f514f6f0
FP
44412012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4442
e8fc049f 4443 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4444
bf43fa51
KH
44452012-03-25 Kenichi Handa <handa@m17n.org>
4446
4447 * dispextern.h (struct glyph): Change the bit length of
4448 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4449
8a0c01dd
EZ
44502012-03-24 Eli Zaretskii <eliz@gnu.org>
4451
4452 * s/ms-w32.h (tzname): Include time.h before redirecting to
4453 _tzname. Fixes the MSVC build. (Bug#9960)
4454
7d1c3a76
AS
44552012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4456
8ed79523
AS
4457 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4458 characters.
4459
7d1c3a76
AS
4460 * xterm.c (XTread_socket): Only modify handling_signal if
4461 !SYNC_INPUT. (Bug#11080)
4462
e99a9b8b
EZ
44632012-03-23 Eli Zaretskii <eliz@gnu.org>
4464
4465 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4466 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4467 when fetching a multibyte character consumes more bytes than
4468 CHAR_BYTES returns, due to unification of CJK characters in
4469 string_char. (Bug#11073)
4470
5063c0e1
TN
44712012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4472
4473 * process.c (wait_reading_process_output): Handle pty disconnect
4474 by refraining from sending oneself a SIGCHLD (bug#10933).
4475
9f851fbd
CY
44762012-03-22 Chong Yidong <cyd@gnu.org>
4477
4478 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4479
5063c0e1 4480 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4481 Mark string as coming from a prefix property.
4482 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4483 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4484
fb5b8aca
CY
44852012-03-21 Chong Yidong <cyd@gnu.org>
4486
4487 * xfaces.c (Vface_remapping_alist): Doc fix.
4488
62356a1b
EZ
44892012-03-20 Eli Zaretskii <eliz@gnu.org>
4490
4491 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4492 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4493 Doc fixes.
62356a1b 4494
025de85b
CY
44952012-03-20 Chong Yidong <cyd@gnu.org>
4496
4497 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4498 to reflect default non-nil value of redisplay-dont-pause.
4499
4827f94e
KH
45002012-03-19 Kenichi Handa <handa@m17n.org>
4501
4502 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4503 it fit in a valid range (Bug#11003).
4504
e50a24a2
EZ
45052012-03-18 Eli Zaretskii <eliz@gnu.org>
4506
4507 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4508 that is not from display property, accept the row as a "cursor
4509 row" if one of the string's character has a non-nil `cursor'
4510 property. Fixes cursor positioning when there are newlines in
4511 overlay strings, e.g. in icomplete.el. (Bug#11035)
4512
9af5ed87
PE
45132012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4514
4515 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4516
d1f55f16
CY
45172012-03-12 Chong Yidong <cyd@gnu.org>
4518
4519 * eval.c (inhibit_lisp_code): Rename from
4520 inhibit_window_configuration_change_hook; move from window.c.
4521
4522 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4523 * window.c (run_window_configuration_change_hook)
4524 (syms_of_window): Callers changed.
4525
66c5eebd
CY
45262012-03-11 Chong Yidong <cyd@gnu.org>
4527
413df973
CY
4528 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4529
66c5eebd
CY
4530 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4531
1de11f56
CY
45322012-03-10 Chong Yidong <cyd@gnu.org>
4533
4534 * frame.c (other_visible_frames): Don't assume the selected frame
4535 is visible (Bug#10955).
4536
cae07000
SM
45372012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4538
4539 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4540
89c94350
JD
45412012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4542
4543 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4544 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4545 zero (Bug#10954).
4546
999dd333
GM
45472012-03-03 Glenn Morris <rgm@gnu.org>
4548
01a6dcc8 4549 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4550
de0100f2
EZ
45512012-03-02 Eli Zaretskii <eliz@gnu.org>
4552
4553 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4554 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4555 (redisplay_window, next_element_from_string): Fix typos in
4556 comments.
3e441275
EZ
4557 (redisplay_window): Pass to move_it_vertically the margin in
4558 pixels, not in screen lines.
de0100f2 4559
96a72ee9
GM
45602012-03-02 Glenn Morris <rgm@gnu.org>
4561
4562 * buffer.c (buffer-list-update-hook): Doc fix.
4563
312508d7
EZ
45642012-02-29 Eli Zaretskii <eliz@gnu.org>
4565
4566 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4567 push_it before setting up the iterator for the first overlay
4568 string, even if we have an empty string loaded.
4569 (next_overlay_string): If there's an empty string on the iterator
4570 stack, pop the stack. (Bug#10903)
4571
27f3c637
PE
45722012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4573
4574 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4575 Suggested by Stefan Monnier in
4576 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4577 * alloc.c (widen_to_Lisp_Object): New static function.
4578 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4579 and widening them to Lisp_Objects. This would work even if
4580 USE_LSB_TAG is defined and wide integers are used, which might
4581 happen in a future version of Emacs.
4582
3c9dfce6
CY
45832012-02-25 Chong Yidong <cyd@gnu.org>
4584
fa74b241
CY
4585 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4586 Doc fix.
4587
3c9dfce6
CY
4588 * xselect.c (Fx_selection_exists_p): Doc fix.
4589 (x_clipboard_manager_save_all): Print an informative message
4590 before saving to clipboard manager.
4591
9486df08
CY
45922012-02-24 Chong Yidong <cyd@gnu.org>
4593
4594 * keyboard.c (process_special_events): Handle all X selection
4595 requests in kbd_buffer, not just the next one (Bug#8869).
4596
f01d3321
CY
45972012-02-23 Chong Yidong <cyd@gnu.org>
4598
4599 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4600 call when setting menu-bar-lines and tool-bar-lines parameters.
4601 (unwind_create_frame_1): New helper function.
4602
4603 * window.c (inhibit_window_configuration_change_hook): New var.
4604 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4605 (syms_of_window): Initialize it.
f01d3321 4606
86b847b6
CY
46072012-02-22 Chong Yidong <cyd@gnu.org>
4608
4609 * xterm.c (x_draw_image_relief): Add missing type check for
4610 Vtool_bar_button_margin (Bug#10743).
4611
a59225b1
CY
46122012-02-21 Chong Yidong <cyd@gnu.org>
4613
4614 * fileio.c (Vfile_name_handler_alist): Doc fix.
4615
4616 * buffer.c (Fget_file_buffer): Protect against invalid file
4617 handler return value.
4618
310f5bd4
PE
46192012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4620
cb3a28cc
PE
4621 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4622 when computing $valmask.
4623
310f5bd4
PE
4624 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4625 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4626 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4627 It's useless in that case, and it can cause problems on hosts
4628 that allocate halves of EMACS_INT values separately.
4629 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4630 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4631 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4632 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4633 it avoids undefined behavior on hosts where shifting right by more
4634 than the word width has undefined behavior.
4635
2375c96a
CY
46362012-02-19 Chong Yidong <cyd@gnu.org>
4637
4638 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4639 (Funhandled_file_name_directory, Ffile_name_as_directory)
4640 (Fdirectory_file_name, Fexpand_file_name)
4641 (Fsubstitute_in_file_name): Protect against invalid file handler
4642 return values (Bug#10845).
4643
3eb49e71
EZ
46442012-02-18 Eli Zaretskii <eliz@gnu.org>
4645
4646 * .gdbinit (pitx): Fix incorrect references to fields of the
4647 iterator stack.
4648
7b926f3f
CY
46492012-02-17 Chong Yidong <cyd@gnu.org>
4650
4651 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4652
11273115
PE
46532012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4654
4655 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4656 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4657
c3a70e2b
CY
46582012-02-15 Chong Yidong <cyd@gnu.org>
4659
4660 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4661 marked as special. Also, starting docstrings with * is obsolete.
4662
0ca43699
AS
46632012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4664
4665 * gnutls.c (emacs_gnutls_write): Fix last change.
4666
2e8f3c56
LI
46672012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4668
4669 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4670 send_process.
4671
af70074f
SM
46722012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4673
4674 * keymap.c (Fsingle_key_description): Handle char ranges.
4675
95986d52
CY
46762012-02-12 Chong Yidong <cyd@gnu.org>
4677
afd83bd1
CY
4678 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4679 as that creates a dangerous corner case.
4680
95986d52
CY
4681 * window.c (Fdelete_window_internal): Invalidate the mouse
4682 highlight (Bug#9904).
4683
bd7da63e
GM
46842012-02-12 Glenn Morris <rgm@gnu.org>
4685
4686 * xselect.c (Fx_own_selection_internal)
4687 (Fx_get_selection_internal, Fx_disown_selection_internal)
4688 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4689 * nsselect.m (Fx_own_selection_internal)
4690 (Fx_disown_selection_internal, Fx_selection_exists_p)
4691 (Fx_selection_owner_p, Fx_get_selection_internal):
4692 Sync docs and argument specs with the xselect.c versions.
4693
77abcbc2
LI
46942012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4695
4696 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4697
90b671e2
EZ
46982012-02-11 Eli Zaretskii <eliz@gnu.org>
4699
1c0ca0b7
EZ
4700 * w32select.c (Fx_selection_exists_p): Sync doc string and
4701 argument list with xselect.c. (Bug#10783)
4702
4703 * w16select.c (Fx_selection_exists_p): Sync doc string and
4704 argument list with xselect.c. (Bug#10783)
90b671e2 4705
49241268
GM
47062012-02-10 Glenn Morris <rgm@gnu.org>
4707
4708 * fns.c (Fsecure_hash): Doc fix.
4709
f998bbe7 47102012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4711
4712 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4713
0992bd9c
CY
47142012-02-07 Chong Yidong <cyd@gnu.org>
4715
4716 * buffer.c (Fbuffer_local_variables)
4717 (buffer_lisp_local_variables): Handle unbound vars correctly;
4718 don't let Qunbound leak into Lisp.
4719
af008560
GM
47202012-02-07 Glenn Morris <rgm@gnu.org>
4721
dd605cc4
GM
4722 * image.c (Fimagemagick_types): Doc fix.
4723
af008560
GM
4724 * image.c (imagemagick-render-type): Change it from a lisp object
4725 to an integer. Move the doc here from the lisp manual.
4726 Treat all values not equal to 0 the same.
4727
1449fa1d
CY
47282012-02-06 Chong Yidong <cyd@gnu.org>
4729
4730 * doc.c (store_function_docstring): Avoid applying docstring of
4731 alias to base function (Bug#2603).
4732
3723ec07
AS
47332012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4734
4735 * .gdbinit (pp1, pv1): Remove redundant defines.
4736 (pr): Use pp.
4737
79c1cc1e
CY
47382012-02-04 Chong Yidong <cyd@gnu.org>
4739
4740 * nsterm.m: Declare a global (Bug#10694).
4741
d7f29f8e
EZ
47422012-02-04 Eli Zaretskii <eliz@gnu.org>
4743
cae07000
SM
4744 * w32.c (get_emacs_configuration_options):
4745 Include --enable-checking, if specified, in the return value.
d7f29f8e 4746
3b95a6f9
MR
47472012-02-04 Martin Rudalics <rudalics@gmx.at>
4748
4749 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4750 after rounding frame sizes. (Bug#9723)
4751
d6fa96a6
EZ
47522012-02-04 Eli Zaretskii <eliz@gnu.org>
4753
4754 * keyboard.c (adjust_point_for_property): Don't position point
4755 before BEGV. (Bug#10696)
4756
df0b2940
PE
47572012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4758
4759 Handle overflow when computing char display width (Bug#9496).
4760 * character.c (char_width): Return EMACS_INT, not int.
4761 (char_width, c_string_width): Check for overflow when
4762 computing the width; this is possible now that individual
4763 characters can have unbounded width. Problem introduced
4764 by merge from Emacs 23 on 2012-01-19.
4765
6bee44d6
MA
47662012-02-02 Michael Albinus <michael.albinus@gmx.de>
4767
4768 * dbusbind.c (Fdbus_register_method): Mention the return value
4769 :ignore in the docstring.
4770
44f92739
GM
47712012-02-02 Glenn Morris <rgm@gnu.org>
4772
1b9f60cc
GM
4773 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4774
44f92739
GM
4775 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4776 Unconditionally set to t. (Bug#10673)
4777 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4778 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4779 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4780
c5d3843c
KH
47812012-02-02 Kenichi Handa <handa@m17n.org>
4782
4783 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4784 0, do not call append_composite_glyph.
4785
159462d4 47862012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4787
4788 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4789 NULL (Bug#6988).
4790 (x_produce_glyphs): If the component of a composition is a null
4791 string, set it->pixel_width to 1 to avoid zero-width glyph.
4792
78cef877
EZ
47932012-02-01 Eli Zaretskii <eliz@gnu.org>
4794
4795 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4796 first 2 arguments are identical. This makes inserting large
4797 output from a subprocess an order of magnitude faster on
4798 MS-Windows, where all sbrk'ed memory is always contiguous.
4799
97897668
GM
48002012-01-31 Glenn Morris <rgm@gnu.org>
4801
4802 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4803 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4804 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4805
31fd3586
GM
48062012-01-29 Glenn Morris <rgm@gnu.org>
4807
4808 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4809
0e24a8b2
CY
48102012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4811
4812 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4813
cc0adcb0
CY
48142012-01-28 Chong Yidong <cyd@gnu.org>
4815
4816 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4817
acc28cb9
CY
48182012-01-26 Chong Yidong <cyd@gnu.org>
4819
9c69cfb7
CY
4820 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4821
acc28cb9
CY
4822 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4823 repeat counts (Bug#10507).
4824
48da7392
GM
48252012-01-26 Glenn Morris <rgm@gnu.org>
4826
4827 * lread.c (syms_of_lread): Doc fix.
4828
14af5f7f
CY
48292012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4830
4831 * coding.c (encode_designation_at_bol): Change return value to
4832 EMACS_INT.
4833
0b21c100
CY
48342012-01-25 Chong Yidong <cyd@gnu.org>
4835
4836 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4837
3c2907f7
CY
48382012-01-21 Chong Yidong <cyd@gnu.org>
4839
4840 * floatfns.c (Fcopysign): Make the second argument non-optional,
4841 since nil is not allowed anyway.
4842
959ad23f
AS
48432012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4844
4845 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4846 (send_process): Likewise.
4847
34a02f46
MR
48482012-01-19 Martin Rudalics <rudalics@gmx.at>
4849
4850 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4851 (Vwindow_persistent_parameters): Do not use Qstate.
4852 Rewrite doc-strings.
34a02f46 4853
1259009a 48542012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4855
4856 * character.c (char_width): New function.
70d4fdf6
GM
4857 (Fchar_width, c_string_width, lisp_string_width):
4858 Use char_width (Bug#9496).
25ed9e61 4859
6a6ee00d
MR
48602012-01-16 Martin Rudalics <rudalics@gmx.at>
4861
4862 * window.c (Vwindow_persistent_parameters): New variable.
4863 (Fset_window_configuration, save_window_save): Handle persistent
4864 window parameters.
4865
c85efaf7
EZ
48662012-01-14 Eli Zaretskii <eliz@gnu.org>
4867
4868 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4869 thrashing the stack of the thread. (Bug#9087)
4870
5944709e
PE
48712012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4872
4873 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4874
e71f5d99
EZ
48752012-01-11 Eli Zaretskii <eliz@gnu.org>
4876
4877 * xdisp.c (rows_from_pos_range): Handle the case where the
4878 highlight ends on a newline. (Bug#10464)
4879 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4880 he end column for display of highlight that ends on a newline
4881 before a R2L line.
4882
ce316182
GM
48832012-01-11 Glenn Morris <rgm@gnu.org>
4884
4885 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4886 from load-path also when installation-directory is nil. (Bug#10208)
4887
5b43da69
GM
48882012-01-10 Glenn Morris <rgm@gnu.org>
4889
74cc8ff9
GM
4890 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4891
7d8d6e4e
GM
4892 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4893 Update template values to be closer to their typical values these days.
5b43da69 4894
a0db8d43
EZ
48952012-01-09 Eli Zaretskii <eliz@gnu.org>
4896
4897 * xdisp.c (rows_from_pos_range): Accept additional argument
4898 DISP_STRING, and accept any glyph in a row whose object is that
4899 string as eligible for mouse highlight. Fixes mouse highlight of
4900 display strings from overlays. (Bug#10464)
4901
9a0115ab 49022012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4903
b9110d6a 4904 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4905 * fileio.c (auto_saving_dir_umask): New static var.
4906 (Fmake_directory_internal): Use it.
4907 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4908 creating the directory. The old code temporarily assigns
4909 too-generous permissions to the directory.
4910 (do_auto_save_eh): Clear it.
b9110d6a 4911 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4912 that the var is always cleared.
4913
6c1bd3f3
EZ
49142012-01-07 Eli Zaretskii <eliz@gnu.org>
4915
4916 * search.c (scan_buffer): Pass character positions to
4917 know_region_cache, not byte positions. (Bug#6540)
4918
069d2b50
L
49192012-01-07 LynX <_LynX@bk.ru> (tiny change)
4920
4921 * w32.c (sys_rename): Report EXDEV when rename of a directory
4922 fails because the target is on another logical disk. (Bug#10284)
4923
75bf0d33
DB
49242012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4925
4926 * xterm.c (x_embed_request_focus): New function.
4927
4928 * xterm.h: Add prototype.
4929
4930 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4931
1c6e5a32
GM
49322012-01-05 Glenn Morris <rgm@gnu.org>
4933
4934 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4935
651e947e
EZ
49362012-01-01 Eli Zaretskii <eliz@gnu.org>
4937
4938 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4939 Load gnutls_transport_set_lowat only if GnuTLS version is below
4940 2.11.1.
4941 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4942 GnuTLS versions below 2.11.1.
4943
3778cdd8
AL
49442011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4945
4946 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4947 to the doc string advising against its use for altering the way
4948 windows are scrolled.
4949
0e5317f7
KH
49502011-12-28 Kenichi Handa <handa@m17n.org>
4951
4952 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4953 coding-system ASCII compatible only when it does not produce BOM
4954 on encoding (Bug#10383).
4955
93d5ca1f
JD
49562011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4957
4958 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4959 can scroll.
4960 (create_and_show_popup_menu): Always use menu_position_func for
4961 Gtk3 (Bug#10361).
4962
ca22b785
AS
49632011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4964
4965 * callint.c (Fcall_interactively): Don't truncate prompt string.
4966
d048e1e6
EZ
49672011-12-23 Eli Zaretskii <eliz@gnu.org>
4968
4969 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4970 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 4971 resumed from there (after widening). (Bug#10360)
d048e1e6 4972
5ccaba1f
JD
49732011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4974
4975 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4976
204ee57f
JD
49772011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4978
b81d40f0
JB
4979 * nsterm.m (x_free_frame_resources):
4980 Release f->output_data.ns->miniimage.
204ee57f
JD
4981 (ns_index_color): Fix indentation. Do not retain
4982 color_table->colors[i].
4983
4984 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4985 before returning.
4986
4987 * nsfns.m (x_set_background_color): Assign return value from
4988 ns_index_color to face-background instead of NSColor*.
4989 (ns_implicitly_set_icon_type): Fix indentation.
4990 Change assignment in for loop to comparison.
4991
4992 * emacs.c (ns_pool): New variable.
4993 (main): Assign ns_pool.
4994 (Fkill_emacs): Call ns_release_autorelease_pool.
4995
4996 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4997 autorelease fdesc, release fdAttrs and tdict.
4998 (ns_get_covering_families): Release charset.
4999 (ns_findfonts): Release NSFontDescriptor created with new.
5000 (ns_uni_to_glyphs): Fix indentation.
5001 (setString): Release attrStr before assigning new value.
5002
c803b2b7
JD
50032011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5004
678f4426
JD
5005 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
5006 and NS_IMPL_COCOA.
5007 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
5008 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
5009
cd394be1 50102011-12-18 David Reitter <reitter@cmu.edu>
678f4426 5011
5fecd5fc
JD
5012 * nsterm.m (ns_term_init): Subscribe for notifications
5013 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
5014 to method trackingNotification in EmacsMenu.
5015
5016 * nsmenu.m (trackingMenu): New variable.
3771cb17 5017 (trackingNotification): New method (from Aquamacs).
5fecd5fc 5018 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 5019 from Aquamacs (Bug#7030).
678f4426
JD
5020
50212011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 5022
c803b2b7
JD
5023 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
5024 (symbol_to_nsstring): Fix indentation.
5025 (ns_symbol_to_pb): New function.
cae07000
SM
5026 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
5027 (Fns_rotate_cut_buffers_internal): Remove.
5028 (Fns_store_selection_internal): Rename from
c803b2b7
JD
5029 Fns_store_cut_buffer_internal.
5030 (ns_get_foreign_selection, Fx_own_selection_internal)
5031 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
5032 (Fns_get_selection_internal, Fns_store_selection_internal):
5033 Use ns_symbol_to_pb and check if return value is nil.
5034 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
5035 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
5036 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
5037 renamed to Sns_store_selection_internal.
5038 (ns_handle_selection_request): Move code to Fx_own_selection_internal
5039 and remove this function.
5040 (ns_handle_selection_clear): Remove, never used.
5041 (Fx_own_selection_internal): Move code from ns_handle_selection_request
5042 here.
5043
e1b01a3a
KB
50442011-12-17 Ken Brown <kbrown@cornell.edu>
5045
5046 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
5047 GID is unknown (Bug#10257).
5048
2adb6e85
PE
50492011-12-17 Paul Eggert <eggert@cs.ucla.edu>
5050
5051 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
5052 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
5053 which caused a build failure on GNU/Linux IA-64. This problem was
5054 introduced by my 2011-10-07 patch.
5055
d1d7b339
JL
50562011-12-15 Juri Linkov <juri@jurta.org>
5057
5058 * image.c (imagemagick_error): New function. (Bug#10112)
5059 (imagemagick_load_image): Comment out `MagickSetResolution' call.
5060 Use `imagemagick_error' where ImageMagick functions return
5061 `MagickFalse'.
5062 (Fimagemagick_types): Add `Fnreverse' to return the list in the
5063 proper order.
5064
100d5755
KH
50652011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5066
5067 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
5068 fill background (Bug#8992).
5069
454592a6
MR
50702011-12-13 Martin Rudalics <rudalics@gmx.at>
5071
5072 * window.c (Vwindow_combination_resize)
5073 (Vwindow_combination_limit): Use t instead of non-nil in
5074 doc-strings.
61d4b438
MR
5075 (Vrecenter_redisplay): Add first sentence of doc-string on
5076 separate line.
53524d93 5077 (Frecenter): Fix doc-string typo.
454592a6 5078
3633e3aa
KH
50792011-12-11 Kenichi Handa <handa@m17n.org>
5080
5081 * coding.c (Funencodable_char_position): Pay attention to the
5082 buffer text relocation (Bug#9389).
5083
7b9d523a 50842011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 5085
7b9d523a
JD
5086 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
5087 gtk_init (Bug#10100).
5088
b73189c6
EZ
50892011-12-10 Eli Zaretskii <eliz@gnu.org>
5090
5091 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
5092 IT->string is nil. (Bug#10263)
5093
f7dfe5d6
JD
50942011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5095
83faebb4
JD
5096 * nsterm.h (x_free_frame_resources): Declare.
5097
f7dfe5d6
JD
5098 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
5099 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
5100
5101 * nsterm.h (ns_get_defaults_value): Declare.
5102
5103 * nsterm.m (ns_default): Call ns_get_defaults_value.
5104
7cd4e72c
EZ
51052011-12-09 Eli Zaretskii <eliz@gnu.org>
5106
5107 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
5108 (Bug#10170)
5109
b34d7317
YM
51102011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5111
5112 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
5113 that where the value of an _OBJC_* symbol points to is in the .bss
5114 section (Bug#10240).
5115
76470ad1
KH
51162011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5117
5118 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 5119 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 5120
745fff94
KH
51212011-12-08 Kenichi Handa <handa@m17n.org>
5122
5123 * ftfont.c (get_adstyle_property): Fix previous change
5124 (Bug#10233).
5125
6e44397c
JB
51262011-12-07 Juanma Barranquero <lekktu@gmail.com>
5127
5128 * w32.c (init_environment): If no_site_lisp, remove site-lisp
5129 dirs from the default value of EMACSLOADPATH (bug#10208).
5130
7efa6272
GM
51312011-12-07 Glenn Morris <rgm@gnu.org>
5132
5133 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
5134 installation and source directories as well. (Bug#10208)
5135
f6fc4d87
CY
51362011-12-06 Chong Yidong <cyd@gnu.org>
5137
5138 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
5139
2bf26180
GM
51402011-12-06 Glenn Morris <rgm@gnu.org>
5141
5142 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
5143 as an error, not just -1. (Bug#10217)
5144
3a6ad4f0
CY
51452011-12-05 Chong Yidong <cyd@gnu.org>
5146
5147 * keyboard.c (process_special_events): New function.
5148 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5149
75a3b399
PE
51502011-12-05 Paul Eggert <eggert@cs.ucla.edu>
5151
5152 * coding.c (encode_designation_at_bol): Don't use uninitialized
5153 local variable (Bug#9318).
5154
c3c9e25e
KH
51552011-12-05 Kenichi Handa <handa@m17n.org>
5156
5157 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
5158 return Qnil (Bug#8046, Bug#10193).
5159
5eb05ea3
KH
51602011-12-05 Kenichi Handa <handa@m17n.org>
5161
5162 * coding.c (encode_designation_at_bol): New args charbuf_end and
5163 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
5164 (coding_set_source): Return how many bytes coding->source was
5165 relocated.
5166 (coding_set_destination): Return how many bytes
5167 coding->destination was relocated.
5168 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 5169 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
5170
51712011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5172
5173 * coding.c (CODING_CHAR_CHARSET_P): New macro.
5174 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
5175 macro (Bug#9318).
5176
51772011-12-05 Andreas Schwab <schwab@linux-m68k.org>
5178
5179 The following changes are to fix Bug#9318.
5180
a79703f5 5181 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
5182 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
5183 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 5184 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 5185
7dbda6df
JB
51862011-12-05 Juanma Barranquero <lekktu@gmail.com>
5187
5188 * lisp.h (process_quit_flag): Fix external declaration.
5189
6d5eb5b0
SM
51902011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
5191
5192 Don't macro-inline non-performance-critical code.
5193 * eval.c (process_quit_flag): New function.
5194 * lisp.h (QUIT): Use it.
5195
a0c3fad0
JD
51962011-12-04 Jan Djärv <jan.h.d@swipnet.se>
5197
5198 * nsfns.m (get_geometry_from_preferences): New function.
5199 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
5200
6c07aac2
AS
52012011-12-04 Andreas Schwab <schwab@linux-m68k.org>
5202
5203 * emacs.c (Qkill_emacs): Define.
5204 (syms_of_emacs): Initialize it.
5205 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
5206 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
5207 (quit_throw_to_read_char): Add parameter `from_signal'.
5208 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
5209 * lisp.h (QUIT): Call Fkill_emacs if requested.
5210
c052ead4
JD
52112011-12-03 Jan Djärv <jan.h.d@swipnet.se>
5212
5213 * widget.c (update_wm_hints): Return if wmshell is null.
5214 (widget_update_wm_size_hints): New function.
5215
5216 * widget.h (widget_update_wm_size_hints): Declare.
5217
5218 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
5219 widget_update_wm_size_hints (Bug#10104).
5220
9e49252b
EZ
52212011-12-03 Eli Zaretskii <eliz@gnu.org>
5222
5223 * xdisp.c (handle_invisible_prop): If the invisible text ends just
5224 before a newline, prepare the bidi iterator for consuming the
5225 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 5226 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 5227
02b16839
JL
52282011-12-02 Juri Linkov <juri@jurta.org>
5229
5230 * search.c (Fword_search_regexp): New Lisp function created from
5231 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
5232 (Fword_search_backward, Fword_search_forward)
5233 (Fword_search_backward_lax, Fword_search_forward_lax):
5234 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
5235 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
5236
0068070e
SM
52372011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
5238
5239 * fileio.c (Finsert_file_contents): Move after-change-function call
5240 to before the "handled:" label, since all "goto handled" appear in
5241 cases where the *-change-functions have already been properly called
5242 (bug#10117).
5243
3360a3fc
AS
52442011-12-01 Andreas Schwab <schwab@linux-m68k.org>
5245
5246 * keyboard.c (interrupt_signal): Don't call kill-emacs when
5247 waiting for input. (Bug#10169)
5248
73d6c093
EZ
52492011-11-30 Eli Zaretskii <eliz@gnu.org>
5250
5251 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
5252 verifies glyph row's hash code--we have just reallocated the
5253 glyphs, so their contents can be complete garbage. (Bug#10164)
5254
febe6bea
JB
52552011-11-30 Juanma Barranquero <lekktu@gmail.com>
5256
5257 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5258
801a4313
EZ
52592011-11-30 Eli Zaretskii <eliz@gnu.org>
5260
5261 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5262 attributes are tested _before_ calling verify_row_hash, to protect
5263 against GCC re-ordering of the tests. (Bug#10164)
5264
2b56b87e
JD
52652011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5266
5267 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5268
5269 * xterm.c (handle_one_xevent): Only set async_visible and friends
5270 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 5271 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
5272 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5273
dbf31225
PE
52742011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5275
5276 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5277 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5278 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5279 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5280 All uses changed to use GCPRO1 etc.
5281 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5282 Revert to old implementation (i.e., before 2011-03-11).
5283
1305621b
YM
52842011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5285
5286 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5287 of scroll runs so as to avoid assigning disabled bogus rows and
5288 unnecessary graphics copy operations.
5289
8c9afb46
EZ
52902011-11-27 Eli Zaretskii <eliz@gnu.org>
5291
5292 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5293 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5294 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5295 (malloc, free, realloc, calloc): Redirect to e_* only when
5296 compiling Emacs.
5297
5298 * lisp.h (GCTYPEBITS): Move before first use.
5299 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5300 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5301 this macro definition.
5302
5303 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5304 _MSC_VER.
5305
54e9e3bf
JD
53062011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5307
6d5eb5b0
SM
5308 * gtkutil.c (xg_create_frame_widgets):
5309 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
5310 present with Gtk+ 2.0.
5311
83aca1cb
PE
53122011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5313
5314 * fileio.c (Finsert_file_contents): Undo previous change; see
5315 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5316
5b76caa4
PE
53172011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 Rename locals to avoid shadowing.
5320 * fileio.c (Finsert_file_contents):
5321 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5322 * process.c (wait_reading_process_output):
5323 Rename inner 'proc' to 'p' to avoid shadowing.
5324 Indent for consistency with usual Emacs style.
5325
8c535114
EZ
53262011-11-25 Eli Zaretskii <eliz@gnu.org>
5327
5328 * xdisp.c (redisplay_window): If cursor row is not fully visible
5329 after recentering, and scroll-conservatively is set to a large
5330 number, scroll window by a few more lines to make the cursor fully
5331 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
5332 (start_display): Don't move to the next line if the display should
5333 start at a newline that is part of a display vector or an overlay
5334 string. (Bug#10119)
8c535114 5335
fa4fdb5c
JL
53362011-11-24 Juri Linkov <juri@jurta.org>
5337
5338 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
5339 after the `MagickPingImage' call. (Bug#10112)
5340
90ec88df
CY
53412011-11-23 Chong Yidong <cyd@gnu.org>
5342
5343 * window.c (Fcoordinates_in_window_p): Accept only live windows.
5344
56e2e794
MR
53452011-11-23 Martin Rudalics <rudalics@gmx.at>
5346
5347 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5348 making another buffer current. (Bug#10114)
5349
b6e64c41
GM
53502011-11-23 Glenn Morris <rgm@gnu.org>
5351
5352 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5353
6b21de18
CY
53542011-11-23 Chong Yidong <cyd@gnu.org>
5355
5356 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5357 using it (Bug#5984).
5358
b12cd789
EZ
53592011-11-22 Eli Zaretskii <eliz@gnu.org>
5360
5361 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5362 and header-lines, as they don't have one computed for them.
5363 (Bug#10098)
5364
5365 * .gdbinit (prow): Make displayed values more self-explaining.
5366 Add row's hash code.
5367
261b6fd4
LMI
53682011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5369
5370 * process.c (wait_reading_process_output): Fix asynchrounous
5371 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5372 (wait_reading_process_output): Add comment and URL.
261b6fd4 5373
e7cfd277
JD
53742011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5375
5376 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5377
a9b9b7f5
CY
53782011-11-21 Chong Yidong <cyd@gnu.org>
5379
5380 * window.c (Fnext_window, Fprevious_window): Doc fix.
5381
b0d15b4f
SM
53822011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5383
5384 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5385
fe7a3057
JB
53862011-11-20 Juanma Barranquero <lekktu@gmail.com>
5387
5388 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5389
d2999b1a
MR
53902011-11-20 Martin Rudalics <rudalics@gmx.at>
5391
5392 * window.c (Fset_window_combination_limit): Rename argument
5393 STATUS to LIMIT.
5394 (Vwindow_combination_limit): Remove "status" from doc-string.
5395
d5ff9cd0
AS
53962011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5397
5398 * m/ibms390.h: Remove.
5399 * m/ibms390x.h: Don't include "ibms390.h".
5400
a5bb9bd3
SM
54012011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5402
5403 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5404 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5405
cd1181db
JB
54062011-11-20 Juanma Barranquero <lekktu@gmail.com>
5407
5408 * casetab.c (Fset_case_table):
5409 * charset.c (Fcharset_after): Fix typos.
5410
615a3b8d 54112011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5412
17e845af
PE
5413 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5414 Otherwise, valgrind does not work on some platforms.
5415 Problem reported by Andreas Schwab in
6a0bf43d
PE
5416 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5417 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5418 is set, removing the need for VIRT_ADDRESS_VARIES.
5419 (PURE_P): Use a more-efficient implementation that needs just one
5420 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5421 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5422 to 4 (xorl, subq, cmpq, setbe).
5423 * alloc.c (pure): Always extern now, since that's the
5424 VIRT_ADDR_VARIES behavior.
5425 (PURE_POINTER_P): Use a single comparison, not two, for
5426 consistency with the new puresize.h.
5427 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5428 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5429 Remove VIRT_ADDR_VARIES no longer needed.
5430
f8fe6f96
EZ
54312011-11-19 Eli Zaretskii <eliz@gnu.org>
5432
5433 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5434 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5435 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5436 behave as if the cursor position were at the window margin.
5437
5438 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5439 and the cursor position is out of bounds, behave as if the cursor
5440 position were at the window margin. (Bug#10075)
5441
df05a53c
CY
54422011-11-18 Chong Yidong <cyd@gnu.org>
5443
5444 * window.c (Fwindow_combination_limit): Make first argument
5445 non-optional, since it is meaningless for live windows like the
5446 selected window.
61ccba97 5447
2071918e
DA
54482011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5449
5450 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5451
b50a28de
SM
54522011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5453
5454 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5455 (graft_intervals_into_buffer): Simplify.
5456
015137db
EZ
54572011-11-18 Eli Zaretskii <eliz@gnu.org>
5458
5459 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5460 hash values of the two rows.
5461 (copy_row_except_pointers): Preserve the used[] arrays and the
5462 hash values of the two rows. (Bug#10035)
68c95424 5463 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5464
5465 * xdisp.c (row_hash): New function, body extracted from
5466 compute_line_metrics.
5467 (compute_line_metrics): Call row_hash, instead of computing the
5468 hash code inline.
5469
5470 * dispnew.c (verify_row_hash): Call row_hash for computing the
5471 hash code of a row, instead of duplicating code from xdisp.c.
5472
5473 * dispextern.h (row_hash): Add prototype.
5474
a2addb04
TH
54752011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5476
5477 * frame.c (delete_frame): Don't delete the terminal when the last
5478 X frame is closed if emacs is built with GTK toolkit.
5479
df85d315
JB
54802011-11-17 Juanma Barranquero <lekktu@gmail.com>
5481
5482 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5483
a0c2d0ae
MR
54842011-11-17 Martin Rudalics <rudalics@gmx.at>
5485
5486 * window.c (Vwindow_splits): Rename to
5487 Vwindow_combination_resize. Suggested by Juri Linkov.
5488 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5489 of Vwindow_splits.
5490
58179cce
JB
54912011-11-16 Juanma Barranquero <lekktu@gmail.com>
5492
7877f373
JB
5493 * nsfns.m (Fns_font_name):
5494 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5495
b6f67890
MR
54962011-11-16 Martin Rudalics <rudalics@gmx.at>
5497
5498 * window.h (window): Rename slot "nest" to "combination_limit".
5499 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5500 (Fset_window_nest): Rename to Fset_window_combination_limit.
5501 (Vwindow_nest): Rename to Vwindow_combination_limit.
5502 (recombine_windows, make_parent_window, make_window)
5503 (Fsplit_window_internal, saved_window)
5504 (Fset_window_configuration, save_window_save): Rename all
5505 occurrences of window_nest to window_combination_limit.
5506
c7015153
JB
55072011-11-15 Juanma Barranquero <lekktu@gmail.com>
5508
5509 * image.c (imagemagick_load_image): Fix typo.
5510
322ad6ec
EZ
55112011-11-14 Eli Zaretskii <eliz@gnu.org>
5512
5513 * xdisp.c (display_line): Move the call to
5514 highlight_trailing_whitespace before the call to
5515 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5516 faces of all the glyphs to compute ROW's hash value.
5517 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5518
f067b8ec
JB
55192011-11-14 Juanma Barranquero <lekktu@gmail.com>
5520
5521 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5522 just return (bug#10044).
5523
1e5b2111
EZ
55242011-11-12 Eli Zaretskii <eliz@gnu.org>
5525
7ef3cbd5
EZ
5526 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5527 with user-defined heap size. Bump the default size of the temacs
5528 heap to 27MB, to avoid memory warning when running temacs.
5529 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5530
1e5b2111
EZ
5531 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5532 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5533 (verify_row_hash) [XASSERTS]: New function.
5534 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5535 that the hash value of glyph rows is correct.
1e5b2111 5536
89d61221
MR
55372011-11-12 Martin Rudalics <rudalics@gmx.at>
5538
5539 * window.h (window): Remove splits slot.
5540 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5541 (Fdelete_other_windows_internal, make_parent_window)
5542 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5543 (Fset_window_configuration, save_window_save): Don't deal with
5544 split status of windows.
5545 (saved_window): Remove splits slot.
5546 (Vwindow_splits): Rewrite doc-string.
5547
97f18cc8
JD
55482011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5549
5550 * xfns.c (unwind_create_frame):
5551 * nsfns.m (unwind_create_frame):
5552 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5553 Vframe_list (Bug#9999).
5554
22a648b4
DA
55552011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5556
0b381c7e 5557 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5558
659afede
KH
55592011-11-11 Kenichi Handa <handa@m17n.org>
5560
5561 * callproc.c (Fcall_process): Set the member dst_multibyte of
5562 process_coding.
5563
9ac0394b
KH
55642011-11-11 Johan Bockgård <bojohan@gnu.org>
5565
5566 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5567 avoid a crash (bug#9496).
5568
2fbdc249
CY
55692011-11-09 Chong Yidong <cyd@gnu.org>
5570
5571 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5572 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5573
ac6b1f81
PE
55742011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5575
5576 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5577
09db192c
PE
55782011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5579
5580 Avoid some portability problems by eschewing 'extern inline' functions.
5581 The trivial performance wins aren't worth the portability hassles; see
5582 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5583 et seq.
5584 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5585 (window_box_width, window_box_left, window_box_left_offset)
5586 (window_box_right, window_box_right_offset): Undo previous change,
5587 by removing the "extern"s.
5588 * intervals.c (adjust_intervals_for_insertion)
5589 (adjust_intervals_for_deletion): Undo previous change,
5590 making these static again.
5591 (offset_intervals, temp_set_point_both, temp_set_point)
5592 (copy_intervals_to_string): No longer inline.
5593 * xdisp.c (window_text_bottom_y, window_box_width)
5594 (window_box_height, window_box_left_offset)
5595 (window_box_right_offset, window_box_left, window_box_right)
5596 (window_box): No longer inline.
5597
105216ed
CY
55982011-11-08 Chong Yidong <cyd@gnu.org>
5599
5600 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5601 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5602 Signal an error if not a live window.
105216ed
CY
5603 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5604 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5605
ae9e237f
JB
56062011-11-07 Juanma Barranquero <lekktu@gmail.com>
5607
5608 * lisp.h (syms_of_abbrev): Remove declaration.
5609 Reported by CHENG Gao <chenggao@royau.me>.
5610
c7aa8333
EZ
56112011-11-07 Eli Zaretskii <eliz@gnu.org>
5612
5613 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5614 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5615 of temacs in GUI mode.
5616
be7f5545
MR
56172011-11-07 Martin Rudalics <rudalics@gmx.at>
5618
5619 * window.h: Declare delete_all_child_windows instead of
5620 delete_all_subwindows.
5621 * window.c (Fwindow_nest, Fset_window_nest)
5622 (Fset_window_new_total, Fset_window_new_normal)
5623 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5624 (delete_all_subwindows): Rename to delete_all_child_windows.
5625 (Fdelete_other_windows_internal, Fset_window_configuration):
5626 Call delete_all_child_windows instead of delete_all_subwindows.
5627 * frame.c (delete_frame): Call delete_all_child_windows instead
5628 of delete_all_subwindows.
5629
ca78dc43
PE
56302011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5631
5632 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5633 This is also needed for porting to any host where GC_MARK_STACK is
5634 not GC_MAKE_GCPROS_NOOPS.
5635 (which_symbols): Use it.
5636
a0241d01
KH
56372011-11-07 Kenichi Handa <handa@m17n.org>
5638
5639 * coding.c (coding_set_destination): Check coding->src_pos only
5640 when coding->src_object is a buffer (bug#9910).
5641
5642 * process.c (send_process): Set the member src_multibyte of coding
5643 to 0 (bug#9911) when sending a unibyte text.
5644
5645 * callproc.c (Fcall_process): Set the member src_multibyte of
5646 process_coding to 0 (bug#9912).
5647
a64bfdfa 56482011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5649
5650 * xmenu.c (cleanup_widget_value_tree): New function.
5651 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5652 calling free_menubar_widget_value_tree directly (Bug#9830).
5653
cb41b32a
PE
56542011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5655
5656 Fix some portability problems with 'inline'.
5657 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5658 (window_box_width, window_box_left, window_box_left_offset)
5659 (window_box_right, window_box_right_offset): Declare extern.
5660 Otherwise, these inline functions do not conform to C99 and
5661 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5662 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5663 * intervals.c (adjust_intervals_for_insertion)
5664 (adjust_intervals_for_deletion): Now extern, because otherwise the
5665 extern inline functions 'offset_intervals' couldn't refer to it.
5666 (static_offset_intervals): Remove.
5667 (offset_intervals): Rewrite using the old contents of
5668 static_offset_intervals. The old version didn't conform to C99
5669 because an extern inline function contained a reference to an
5670 identifier with static linkage.
5671
b7041366
AS
56722011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5673
5674 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5675 GC.
5676
88a37c4d
EZ
56772011-11-06 Eli Zaretskii <eliz@gnu.org>
5678
5679 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5680 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5681 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5682 return Qleft_to_right.
5683
49745b39
CY
56842011-11-06 Chong Yidong <cyd@gnu.org>
5685
5686 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5687 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5688 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5689 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5690 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5691 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5692 (Fwindow_vscroll): Doc fix.
5693 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5694 argument, since it makes no sense to pass a live window and for
5695 consistency with window-child.
5696
1f05cd82
CS
56972011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5698
5699 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5700 support MSVC.
5701
22610910
JR
57022011-11-05 Jason Rumney <jasonr@gnu.org>
5703
5704 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5705 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5706 fonts (Bug#6029).
5707 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5708 bitwise arithmetic preventing use of unicode-sip and non-truetype
5709 opentype fonts.
5710
a06776b2
EZ
57112011-11-05 Eli Zaretskii <eliz@gnu.org>
5712
3ad924ba
EZ
5713 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5714 "emacs"-only part.
5715
a06776b2
EZ
5716 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5717 initialization code to keep similarity to xfns.c after changes
5718 from 2011-11-05.
5719
c9e7db78
JD
57202011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5721
a97f8f3f
JD
5722 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5723 (unwind_create_frame): New function (Bug#9943).
5724 (Fx_create_frame): Restructure code to be more similar to the one in
5725 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5726 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5727 Move terminal->reference_count++ just before making the frame official
5728 (Bug#9943).
5729
5730 * nsterm.m (x_free_frame_resources): New function.
5731 (x_destroy_window): Move code to x_free_frame_resources.
5732
c9e7db78 5733 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5734 (Fx_create_frame, x_create_tip_frame):
5735 Move terminal->reference_count++ just before making the frame
75f1671a 5736 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5737 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5738
a6fc3b5c
EZ
57392011-11-05 Eli Zaretskii <eliz@gnu.org>
5740
5741 Support MSVC build with newer versions of Visual Studio.
5742 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5743 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5744 nt/gmake.defs.
5745
5746 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5747 which are not supported by MSVC.
5748 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5749 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5750 bitfields.
5751 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5752 types in bitfields.
5753 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5754
5755 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5756
58179cce 57572011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5758
5759 Support MSVC build with newer versions of Visual Studio.
5760 * w32.c: Don't include w32api.h for MSVC.
5761 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5762
5763 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5764 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5765 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5766 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5767 e_* cousins.
5768 (alloca) [_MSC_VER]: Define to _alloca.
5769
5770 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5771
5772 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5773
a58c13ed
EZ
57742011-11-04 Eli Zaretskii <eliz@gnu.org>
5775
5776 * xdisp.c (note_mouse_highlight): If either of
5777 previous/next-single-property-change returns nil, treat that as
5778 the beginning or the end of the buffer. (Bug#9955)
5779
fe0b6370
JD
57802011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5781
a58c13ed 5782 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5783 label is not null (Bug#9951).
5784 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5785 may be NULL.
5786
89bd5ee1
EZ
57872011-11-04 Eli Zaretskii <eliz@gnu.org>
5788
5789 * window.c (Fwindow_body_size): Mention in the doc string that the
5790 return value is in frame's canonical units. (Bug#9949)
5791
84c3edb9
EZ
57922011-11-03 Eli Zaretskii <eliz@gnu.org>
5793
4e2fb5c7
EZ
5794 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5795
84c3edb9 5796 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5797 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5798 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5799
bc17a887
EZ
58002011-11-01 Eli Zaretskii <eliz@gnu.org>
5801
5802 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5803 Don't stop backward scan on the continuation glyph, even though
5804 its CHARPOS is positive.
6d5eb5b0
SM
5805 (mouse_face_from_buffer_pos, note_mouse_highlight):
5806 Rename cover_string to disp_string.
bc17a887 5807
4ee88440
MR
58082011-11-01 Martin Rudalics <rudalics@gmx.at>
5809
5810 * window.c (temp_output_buffer_show): Don't use
5811 Vtemp_buffer_show_specifiers.
5812 (Vtemp_buffer_show_specifiers): Remove unused variable.
5813
c2ff3c02
EZ
58142011-10-30 Eli Zaretskii <eliz@gnu.org>
5815
5816 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5817 past the beginning of the current glyph matrix.
5818
58179cce 58192011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5820
5821 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5822 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5823 HAVE_GTK3 (Bug#9869).
b77a6a7f 5824
3b574623
JD
5825 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5826 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5827
b77a6a7f
JD
5828 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5829
5830 * xterm.c: Declare x_handle_net_wm_state to return int.
5831 (handle_one_xevent): Check if we are iconified but don't have
5832 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5833 (get_current_wm_state): Return non-zero if not hidden,
5834 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5835 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5836 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5837 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5838
196e41e4
PE
58392011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5840
5841 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5842 so that this new function doesn't get optimized away by a
5843 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5844
021f2e1a
AS
58452011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5846
5847 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5848
8b058d44
EZ
58492011-10-29 Eli Zaretskii <eliz@gnu.org>
5850
5851 Fix the `xbytecode' command.
5852 * .gdbinit (xprintbytestr): New command.
b50a28de 5853 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5854 (xbytecode): Print the byte-code string as well.
5855
4452fb80
EZ
58562011-10-29 Kim Storm <storm@cua.dk>
5857
8b058d44
EZ
5858 * alloc.c (which_symbols): New function.
5859
21b72067
AS
58602011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5861
5862 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5863 line. (Bug#9903)
5864
83ed7b5c
GM
58652011-10-29 Glenn Morris <rgm@gnu.org>
5866
5867 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5868 Not clear what it was for, and it causes various bugs. (Bug#9839)
5869
5a7a728b
EZ
58702011-10-28 Eli Zaretskii <eliz@gnu.org>
5871
5872 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5873 possible random value that matches one of those tested as
5874 condition to clear the mouse face.
5875
d3d0842f
CY
58762011-10-28 Chong Yidong <cyd@gnu.org>
5877
5878 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5879
31b39d13
DN
58802011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5881
5882 * window.c (make_window): Initialize phys_cursor_on_p.
5883
9aba6043
SM
58842011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5885
5886 * lisp.h (struct Lisp_Symbol): Update comments.
5887
c20992f4
JB
58882011-10-28 Juanma Barranquero <lekktu@gmail.com>
5889
5890 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5891
db4f02f2
EZ
58922011-10-28 Eli Zaretskii <eliz@gnu.org>
5893
5894 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5895 <oslsachem@gmail.com> for helping to debug this.
5896
5897 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5898 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5899 (g_b_init_get_glyph_outline_w): New static variables.
5900 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5901 (GetGlyphOutlineW_Proc): New typedefs.
5902 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5903 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5904 New functions.
5905 (w32font_open_internal, compute_metrics):
5906 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5907 instead of calling the "wide" APIs directly.
5908
5909 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5910
5911 * w32.h (syms_of_w32font): Add prototype.
5912
87e68db4
JB
59132011-10-27 Juanma Barranquero <lekktu@gmail.com>
5914
5915 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5916 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5917 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5918 (Fmove_to_window_line): Doc fix.
5919
435c1d67
CY
59202011-10-27 Chong Yidong <cyd@gnu.org>
5921
5922 * process.c (make_process): Set gnutls_state to NULL.
5923
5924 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5925 non-NULL, regardless of GNUTLS_INITSTAGE.
5926 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5927 an error. Set process slots as soon as we allocate them.
5928
5929 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5930
9c6c6f49
CY
59312011-10-27 Chong Yidong <cyd@gnu.org>
5932
9aba6043
SM
5933 * gnutls.c (emacs_gnutls_deinit): New function.
5934 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5935 (Fgnutls_deinit, Fgnutls_boot): Use it.
5936
5937 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5938 (deactivate_process): Call emacs_gnutls_deinit.
5939
657d08d3
JB
59402011-10-27 Juanma Barranquero <lekktu@gmail.com>
5941
5942 * image.c (x_create_x_image_and_pixmap):
5943 * w32.c (sys_rename, w32_delayed_load):
5944 * w32font.c (fill_in_logfont):
5945 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5946
5430d399
JB
59472011-10-26 Juanma Barranquero <lekktu@gmail.com>
5948
5949 * w32fns.c (w32_default_color_map): New function,
5950 extracted from Fw32_default_color_map.
a7ef684b 5951 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5952
fe0055fa
PE
59532011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5956
e6346438
SM
59572011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5958
5959 * keyboard.c (test_undefined): New function (bug#9751).
5960 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5961
e112cc37
ET
59622011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5963
5964 * sysdep.c (init_sys_modes): Fix the check for the controlling
5965 terminal (Bug#6649).
5966
7b5d6677
EZ
59672011-10-20 Eli Zaretskii <eliz@gnu.org>
5968
5969 * dispextern.h (struct bidi_it): New member next_en_type.
5970
5971 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5972 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5973 current character, check also for next_en_type being WEAK_EN.
5974 (bidi_resolve_weak): Don't enter the expensive loop if the current
5975 position is before next_en_pos. Record the bidi type of the first
5976 non-ET, non-BN character we find, in addition to its position.
5977 (bidi_level_of_next_char): Invalidate next_en_type when
5978 next_en_pos is over-stepped.
5979
7da0b018
PE
59802011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5981
5982 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5983 * editfns.c: Rewrite current-time-zone so that it invokes
5984 the equivalent of (format-time-string "%Z") to get the time zone name.
5985 This fixes a bug when the time zone name contains characters that
5986 need converting from the system time locale to Emacs internal format.
5987 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5988 that patch fixed format-time-string to do the conversion, but
5989 I forgot to fix current-time-zone.
5990 (format_time_string): New function, containing most of
5991 what Fformat_time_string used to contain.
5992 (Fformat_time_string): Rewrite in terms of format_time_string.
5993 This doesn't change this function's behavior.
5994 (current-time-zone): Rewrite to use format_time_string.
5995 This fixes the bug reported by Michael Schierl in
5996 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5997 Jason Rumney's 2007-06-07 change worked around this bug, but
5998 didn't fix it.
5999 * systime.h (tzname, timezone): Remove no-longer-used declarations.
6000
8547b010
EZ
60012011-10-19 Eli Zaretskii <eliz@gnu.org>
6002
6003 * xdisp.c (start_display): If the character at POS is displayed
6004 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
6005 (try_window_reusing_current_matrix): If a line ends in a display
6006 vector or the next line starts in a display vector, continue
6007 redrawing the window even though the character position of
6008 start_row was reached.
8547b010
EZ
6009 (Bug#9771, part 2)
6010
4e948d15
CY
60112011-10-18 Chong Yidong <cyd@gnu.org>
6012
6013 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
6014 with nobreak-char-display too.
6015
4787455f
EZ
60162011-10-18 Eli Zaretskii <eliz@gnu.org>
6017
6018 Fix part 3 of bug#9771.
6019 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
6020 (bidi_resolve_neutral): Don't enter the expensive loop looking for
6021 non-neutral characters if the current character is a paragraph
6022 separator (a.k.a. Newline). This avoids running the same
6023 expensive loop twice, once when we consume the preceding newline
6024 and the other time when the line actually needs to be displayed.
6025 Avoid the loop when we see neutrals on the base embedding level
6026 following a character whose directionality is the same as the
6027 paragraph's. This avoids running the expensive loop when a line
6028 ends in a long sequence of neutrals, like control characters.
6029 Add assertion against STRONG_AL type. Slightly rearrange code
6030 that determines the type of a neutral given the first non-neutral
6031 that follows it.
6032 (bidi_level_of_next_char): Set next_en_pos to zero when
6033 invalidating its info.
6034
2c91f553
EZ
60352011-10-17 Eli Zaretskii <eliz@gnu.org>
6036
6037 * xdisp.c (push_display_prop): Determine whether to record string
6038 or buffer position by IT->string, not by IT->method. Allow
6039 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
6040 (move_it_vertically_backward): Don't look for character position
6041 immediately after the newline when in a continuation line.
6042 (Bug#9771, part 1)
2c91f553 6043
c7b08b0d
MR
60442011-10-15 Martin Rudalics <rudalics@gmx.at>
6045
6046 * window.c (coordinates_in_window): Rewrite and delabelize
6047 vertical border check. (Bug#5357) (Bug#9618)
6048
6b02f655
SM
60492011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
6050
6051 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
6052 errors in XSetWindowBorder (bug#9310).
6053
81d40c92
DA
60542011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
6055
6056 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
6057 avoid crash when xmalloc overrun checking is enabled.
6058
d4172c3b
EZ
60592011-10-13 Eli Zaretskii <eliz@gnu.org>
6060
6061 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
6062 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
6063 cursor motion with <left> and <right> arrow keys.
6064
6065 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
6066 some callers set that themselves.
6067
b00eea75
EZ
60682011-10-12 Eli Zaretskii <eliz@gnu.org>
6069
6070 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
6071 display string and the previous row comes from the same string and
6072 is empty. (Bug#9739) (Bug#9738)
6073
8fe012c4
SM
60742011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
6075
6076 * doc.c (get_doc_string): Encode file name (bug#9735).
6077
0074aef2
EZ
60782011-10-12 Eli Zaretskii <eliz@gnu.org>
6079
79beb178
EZ
6080 * bidi.c (bidi_level_of_next_char):
6081 * xdisp.c (get_visually_first_element): Remove old incorrect
6082 comments regarding the Unicode Line Separator character.
6083
0074aef2
EZ
6084 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
6085
6e4b3fbe
DA
60862011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
6087
6088 * alloc.c (Fgc_status): Do not access beyond zombies array
6089 boundary if nzombies > MAX_ZOMBIES.
6090 * alloc.c (dump_zombies): Add missing format specifier.
6091
0324f3af
PE
60922011-10-12 Paul Eggert <eggert@cs.ucla.edu>
6093
b5525cac
PE
6094 * xdisp.c (set_cursor_from_row): Simplify conditionals,
6095 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
6096
0324f3af
PE
6097 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
6098 Some packages use them to denote characters with modifiers.
6099
e9b5f888
AS
61002011-10-11 Andreas Schwab <schwab@linux-m68k.org>
6101
6102 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
6103 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
6104 matching a pp-number. Rename parameter var to var1.
6105
127827c0
SM
61062011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
6107
6108 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
6109
c8fd3bd0
GM
61102011-10-08 Glenn Morris <rgm@gnu.org>
6111
6112 * callint.c (Fcall_interactively): Give a more explicit error for the
6113 'c' case with a non-character input. (Bug#8479)
6114
352ec8ff
EZ
61152011-10-08 Eli Zaretskii <eliz@gnu.org>
6116
03669ccb
EZ
6117 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
6118 lines.
7061c986
EZ
6119 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
6120 lines that are hscrolled on the left.
03669ccb 6121
352ec8ff
EZ
6122 * dispnew.c (buffer_posn_from_coords): Account for a possible
6123 presence of header-line. (Bug#4426)
6124
a66cfb1c
SM
61252011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
6126
6b02f655
SM
6127 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
6128 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 6129
7c5ee88e
PE
61302011-10-07 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
6133 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
6134 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
6135 this makes Emacs dump core during garbage collection on rare
6136 occasions. sizeof is obviously inferior to offsetof here, so
6137 stick with offsetof.
6138 (GC_POINTER_ALIGNMENT): New macro.
6139 (mark_memory): Omit 3rd (offset) arg; caller changed.
6140 Don't assume EMACS_INT alignment is the same as pointer alignment.
6141
df1bbe5b
SM
61422011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
6143
6144 * keyboard.c (read_key_sequence_remapped): New var.
6145 (read_key_sequence): Compute remapping in the right buffer.
6146 (command_loop_1): Use read_key_sequence's remapping directly.
6147
51553db6
SM
61482011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6149
32c1fffd
SM
6150 * dired.c (file_name_completion): Don't expand file name.
6151 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
6152 before checking file name handler.
6153
51553db6
SM
6154 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
6155 they've been requested explicitly (bug#9591).
6156
b6bd1599 61572011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
6158
6159 * keymap.c (Fsingle_key_description): Use make_specified_string
6160 instead of build_string to build string from push_key_description.
6161 (Bug#5193)
6162
f701dc2a
PE
61632011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6164
4222c55d
PE
6165 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
6166 This fixes a Y2038 bug on 64-bit hosts.
6167 * buffer.c (reset_buffer):
6168 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
6169 (Fclear_buffer_auto_save_failure):
6170 Use 0, not -1, to represent an unset failure time, since time_t
6171 might not be signed.
6172
f701dc2a
PE
6173 Remove dependency on glibc malloc internals.
6174 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6175 Move back here from lisp.h, but with their new implementations.
6176 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6177 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
6178 * charset.c (charset_table_init): New static var.
6179 (syms_of_charset): Use it instead of xmalloc. This removes a
6180 dependency on glibc malloc internals. See Eli Zaretskii's comment in
6181 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
6182 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6183 Move back to alloc.c.
6184 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6185 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
6186
9ceebf39
JD
61872011-09-30 Jan Djärv <jan.h.d@swipnet.se>
6188
6189 * nsterm.m (windowDidResize): Call x_set_window_size only when
6190 ns_in_resize is true. Otherwise set pixelwidth/height and
6191 call change_frame_size (Bug#9628).
6192
cb993c58
PE
61932011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6194
3930c88b
PE
6195 Port --enable-checking=all to Fedora 14 x86-64.
6196 * charset.c (syms_of_charset): Also account for glibc malloc's
6197 internal overhead when calculating the initial malloc maximum.
6198
cb993c58
PE
6199 Port --enable-checking=all to Fedora 14 x86.
6200 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6201 Move to lisp.h.
6202 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
6203 (overrun_check_realloc, overrun_check_free):
6204 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
6205 That way, xmalloc returns a properly-aligned pointer even if
6206 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
6207 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
6208 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
6209 into account when calculating the initial malloc maximum.
6210 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6211 Move here from alloc.c, so that charset.c can use it too.
6212 Properly align; the old code wasn't right for common 32-bit hosts
6213 when configured with --enable-checking=all.
6214 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6215 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
6216
31bed486
EZ
62172011-09-29 Eli Zaretskii <eliz@gnu.org>
6218
04c70788 6219 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
6220 use EDOM.
6221
fbcaa2f3
EZ
62222011-09-28 Eli Zaretskii <eliz@gnu.org>
6223
6224 * xdisp.c (compute_display_string_end): If there's no display
6225 string at CHARPOS, return -1.
6226
6227 * bidi.c (bidi_fetch_char): When compute_display_string_end
6228 returns a negative value, treat the character as a normal
6229 character not covered by a display string. (Bug#9624)
6230
a239d4e9
JB
62312011-09-28 Juanma Barranquero <lekktu@gmail.com>
6232
6233 * lread.c (Fread_from_string): Fix typo in docstring.
6234
88652fd5
EZ
62352011-09-27 Eli Zaretskii <eliz@gnu.org>
6236
6237 * xdisp.c (handle_invisible_prop): If invisible text ends on a
6238 newline, reseat the iterator instead of bidi-iterating there one
6239 character at a time. (Bug#9610)
32c1fffd
SM
6240 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
6241 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 6242
ed497dd4
AS
62432011-09-27 Andreas Schwab <schwab@linux-m68k.org>
6244
6245 * lread.c (readevalloop): Use correct code for NBSP.
6246 (read1): Likewise. (Bug#9608)
6247
b2bf61aa
MA
62482011-09-25 Michael Albinus <michael.albinus@gmx.de>
6249
6250 * dbusbind.c (Fdbus_register_signal): When service is not
6251 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
6252
32bbb17c
GM
62532011-09-25 Glenn Morris <rgm@gnu.org>
6254
6255 * buffer.c (truncate-lines): Doc fix.
6256
94e0933e
CY
62572011-09-24 Chong Yidong <cyd@stupidchicken.com>
6258
6259 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6260 (Fset_window_next_buffers): Doc fix.
6261
cddde921
GM
62622011-09-24 Glenn Morris <rgm@gnu.org>
6263
6264 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6265
1260aef1
PE
62662011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6267
25b4bfa0
PE
6268 Fix minor problems found by static checking.
6269 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
6270 * indent.c (Fvertical_motion): Fix == vs = typo.
6271
e3cbd34b
EZ
62722011-09-24 Eli Zaretskii <eliz@gnu.org>
6273
a66cfb1c
SM
6274 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6275 Default value is now t. Doc fix.
6bf7006f 6276
e3cbd34b 6277 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 6278 logic when moving up, not only when moving down. Fix the
e3cbd34b 6279 confusing name and values of the it_overshoot_expected variable;
32c1fffd 6280 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
6281
6282 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6283 CHARPOS is covered by a display string which includes newlines.
6284 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6285 is covered by a display string with embedded newlines.
6286
a3de0cbd
MA
62872011-09-24 Michael Albinus <michael.albinus@gmx.de>
6288
6289 * dbusbind.c (Fdbus_register_signal): Add match rule to
6290 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
6291 (Fdbus_register_method, Vdbus_registered_objects_table):
6292 Fix docstring.
a3de0cbd 6293
b260039d
JM
62942011-09-24 Jim Meyering <meyering@redhat.com>
6295
32c1fffd 6296 do not ignore write error for any output size
b260039d
JM
6297 The previous change was incomplete.
6298 While it makes emacs --batch detect the vast majority of stdout
6299 write failures, errors were still ignored whenever the output size is
6300 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6301 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6302 && echo FAIL: ignored write error
6303 FAIL: ignored write error
6304 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6305 && echo FAIL: ignored write error
6306 FAIL: ignored write error
6307 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6308
8eca8a7c
AS
63092011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6310
6311 * emacs.c (Fkill_emacs): In noninteractive mode exit
6312 non-successfully if a write error occurred on stdout. (Bug#9574)
6313
3341db62
EZ
63142011-09-21 Eli Zaretskii <eliz@gnu.org>
6315
6316 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6317 the xassert test.
6318
6319 * dispextern.h (struct it): Update the comment documenting what
6320 can it->OBJECT be.
6321
8c203dbf
EZ
63222011-09-20 Eli Zaretskii <eliz@gnu.org>
6323
6324 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6325 a display string, extend search for cursor position to end of row.
6326 (find_row_edges): If the row ends in a newline from a display
6327 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6328 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
6329 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6330 non-empty line. Fixes confusing cursor motion with arrow keys at
6331 the beginning of a line that starts with whitespace.
8c203dbf 6332
a4824228
LMI
63332011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6334
6335 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
6336 (bug#9493).
6337
33ed493b
CY
63382011-09-18 Chong Yidong <cyd@stupidchicken.com>
6339
6340 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
6341 boolean (Bug#9154).
6342
56cd55c8
EZ
63432011-09-18 Eli Zaretskii <eliz@gnu.org>
6344
6345 * xdisp.c (display_line): Record maximum and minimum buffer
6346 positions even if no glyphs were produced (e.g., by a zero-width
6347 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6348 buffer positions that will be removed from the glyph row because
6349 they don't fit.
c02dcedf
EZ
6350 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6351 column is beyond frame width: don't subtract 1 "pixel" when
6352 computing width of the stretch.
3e62b7e0
EZ
6353 (reseat_at_next_visible_line_start): Undo the change made on
6354 2011-09-17 that saved paragraph information and restored it after
6355 the call to `reseat'. (Bug#9545)
56cd55c8 6356
5ed99d36 63572011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6358
6359 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6360 and turn window cursor on if cleared (Bug#9415).
6361
5ed99d36 63622011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6363
6364 * search.c (boyer_moore): Take unibyte characters from pattern
6365 literally. (Bug#9458)
6366
9bade7b2
EZ
63672011-09-18 Eli Zaretskii <eliz@gnu.org>
6368
6369 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6370
e5e9d610
PE
63712011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6372
87e4427a
PE
6373 Fix minor problem found by static checking.
6374 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6375 initialized, to pacify gcc -Wuninitialized.
6376
e5e9d610
PE
6377 * fileio.c: Report proper errno when syscall falls.
6378 (Finsert_file_contents): Save and restore errno,
6379 so that report_file_error outputs the correct diagnostic.
6380 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6381
a1674f0b
EZ
63822011-09-18 Eli Zaretskii <eliz@gnu.org>
6383
6384 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6385
fbfb6dd4
EZ
63862011-09-17 Eli Zaretskii <eliz@gnu.org>
6387
6388 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6389 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6390
bb187662
EZ
63912011-09-17 Eli Zaretskii <eliz@gnu.org>
6392
1137e8b8 6393 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6394 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6395
6396 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6397 (bidi_find_paragraph_start): Search back for paragraph beginning
6398 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6399 (bidi_move_to_visually_next): Only trigger paragraph-related
6400 computations when the last character is a newline or at EOB, not
6401 just any NEUTRAL_B. (Bug#9470)
6402
bb187662
EZ
6403 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6404 truncated lines if point is covered by a display string. (Bug#9524)
6405
2e621251
PE
64062011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6407
6408 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6409 (cons_to_x_long): New function.
6410 (lisp_data_to_selection_data): Use it. Correct the test for
6411 short-versus-long data; it was negated. Break out of vector
6412 loop, for efficiency, when a long datum is discovered.
6413
91a15bc6
SM
64142011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6415
6416 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6417
b41c3a35
EZ
64182011-09-16 Eli Zaretskii <eliz@gnu.org>
6419
6420 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6421 GCC PR/17406) by declaring this function with external scope.
6422
7812ba2d
PE
64232011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6426 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6427
cf7edc2a
AS
64282011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6429
6430 * editfns.c (Fformat): Correctly handle text properties on "%%".
6431
bd01620e
EZ
64322011-09-15 Eli Zaretskii <eliz@gnu.org>
6433
6434 * xterm.c (x_draw_composite_glyph_string_foreground):
6435 * w32term.c (x_draw_composite_glyph_string_foreground):
6436 * term.c (encode_terminal_code):
6437 * composite.c (composition_update_it, get_composition_id):
6438 * xdisp.c (get_next_display_element)
6439 (fill_composite_glyph_string): Add comments about special meaning
6440 of TAB characters in a composition.
6441
a02719a3
PE
64422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6443
6444 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6445 This occurs when processing a multibyte format.
6446 Problem reported by Wolfgang Jenker.
a02719a3 6447
72589a3c
JB
64482011-09-15 Johan Bockgård <bojohan@gnu.org>
6449
6450 * xdisp.c (try_cursor_movement): Only check for exact match if
6451 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6452
1c14176c
PE
64532011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6454
6455 Remove unused external symbols.
6456 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6457 * xdisp.c (calc_pixel_width_or_height): Now static.
6458 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6459 * indent.c (check_display_width):
6460 * w32term.c: Fix comment to match code.
6461 * xterm.c, xterm.h (x_catching_errors): Remove.
6462
d2eea5b5
PE
64632011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 * xselect.c: Use signed conversions more consistently (Bug#9498).
6466 (selection_data_to_lisp_data): Assume incoming selection data are
6467 signed integers, not unsigned. This is to be consistent with
6468 outgoing selection data, which was modified to use signed integers
6469 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6470 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6471 expects long, not unsigned long.
6472
46888499
EZ
64732011-09-14 Eli Zaretskii <eliz@gnu.org>
6474
6475 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6476 computation of loop end. Reported by Johan Bockgård
6477 <bojohan@gnu.org>.
6478
ef8ef9fb
CY
64792011-09-13 Chong Yidong <cyd@stupidchicken.com>
6480
6481 * frame.c (Fother_visible_frames_p): Function deleted.
6482
fa819fed
EZ
64832011-09-12 Eli Zaretskii <eliz@gnu.org>
6484
6485 * indent.c (compute_motion): Process display vector front to back
6486 rather than the other way around. (Bug#2496)
6487
2ba8e008
SM
64882011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6489
6490 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6491
20f53c69
CY
64922011-09-11 Chong Yidong <cyd@stupidchicken.com>
6493
6494 * minibuf.c (Fread_from_minibuffer): Doc fix.
6495
d562d7a4
EZ
64962011-09-11 Eli Zaretskii <eliz@gnu.org>
6497
6498 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6499 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6500
1c4d7f3d
LMI
65012011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6502
6503 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6504 value for non-existent files.
6505
b885bf36
EZ
65062011-09-11 Eli Zaretskii <eliz@gnu.org>
6507
6508 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6509 set its "size" to -1. This will set the modtime_size field of
6510 the corresponding buffer to -1, which is what
6511 verify-visited-file-modtime expects for files that do not exist.
6512 (Bug#9139)
6513
6612f0bf
PE
65142011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6515
6516 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6517 here ...
6518 * lisp.h: ... from here. push_key_description is no longer
6519 defined in keyboard.c, so its declaration should not be in
6520 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6521 logically belongs with push_key_description.
6522
dfb3f755
PE
65232011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6524
6525 * buffer.h: Include <sys/types.h> instead of <time.h>.
6526 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6527 Problem reported by Herbert J. Skuhra.
6528
3134906c
LMI
65292011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6530
6531 * xml.c (parse_region): Make the parsing work for
6532 non-comment-starting XML files again (bug#9144).
6533
8d903f4e
AS
65342011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6535
6536 * image.c (gif_load): Fix calculation of bottom and right corner.
6537 (Bug#9468)
6538
80ad64f4
EZ
65392011-09-10 Eli Zaretskii <eliz@gnu.org>
6540
6541 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6542 redisplay in small windows.
6543
208a048d
EZ
65442011-09-09 Eli Zaretskii <eliz@gnu.org>
6545
6546 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6547
9b1c252e
MR
65482011-09-08 Martin Rudalics <rudalics@gmx.at>
6549
6550 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6551 Operate on live windows only.
6552
2949f33b
JB
65532011-09-08 Juanma Barranquero <lekktu@gmail.com>
6554
6555 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6556
e08dcafd
EZ
65572011-09-07 Eli Zaretskii <eliz@gnu.org>
6558
6559 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6560 only under bidi iteration.
6561
115b96bd
JD
65622011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6563
6564 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6565
c8199d0f
PE
65662011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6567
6568 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6569 Without this fix, the command to link temacs failed due to an
6570 undefined symbol __builtin_isnan. This is because
6571 /usr/include/iso/math_c99.h #defines isnan(x) to
6572 __builtin_isnan(x), but the bundled gcc, which identifies itself
6573 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6574 a __builtin_isnan.
6575 * floatfns.c (isnan): #undef, and then #define to a clone of
6576 what's in data.c.
6577 (Fisnan): Always define, since it's always available now.
6578 (syms_of_floatfns): Always define isnan at the Lisp level.
6579
e39b275c 65802011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6581
6582 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6583
b2db44d9 65842011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6585
f4af5137 6586 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6587 The previous code assumed that file offsets (off_t values) fit in
6588 EMACS_INT variables, which is not true on typical 32-bit hosts.
6589 The code messed up by falsely reporting buffer overflow in cases
6590 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6591 when "big" contains more than 2**29 bytes, even though this
6592 inserts just one byte and does not overflow the buffer.
6593 (Finsert_file_contents): Store file offsets as off_t
6594 values, not as EMACS_INT values. Check for overflow when
6595 converting between EMACS_INT and off_t. When checking for
6596 buffer overflow or for overlap, take the offsets into account.
6597 Don't use EMACS_INT for small values where int suffices.
6598 When checking for overlap, fix a typo: ZV was used where
6599 ZV_BYTE was intended.
6600 (Fwrite_region): Don't assume off_t fits into 'long'.
6601 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6602
ecfc0a49
MA
66032011-09-05 Michael Albinus <michael.albinus@gmx.de>
6604
6605 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6606
6511acf2 66072011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6608
0999621a 6609 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6610
6611 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6612 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6613 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6614 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6615 (modify_event_symbol): Do not assume that the length of
6616 name_alist_or_stem is safe to alloca and fits in int.
6617 (Fexecute_extended_command): Likewise for function name and binding.
6618 (Frecursion_depth): Wrap around reliably on integer overflow.
6619 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6620 since some callers pass EMACS_INT values.
6621 (Fsingle_key_description): Don't crash if symbol name contains more
6622 than MAX_ALLOCA bytes.
6623 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6624 (get_minibuffer): Arg is now EMACS_INT, not int.
6625 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6626 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6627 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6628
2be7d702
PE
6629 * dbusbind.c (signature_cat): New function.
6630 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6631 Do not overrun buffer; instead, report string overflow.
6632
9d1df220
PE
6633 * dispnew.c (add_window_display_history): Don't overrun buffer.
6634 Truncate instead; this is OK since it's just a log.
6635
33ef5c64
PE
6636 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6637 even if the time zone offset is outlandishly large.
6638 Don't mishandle offset == INT_MIN.
6639
66c6fdd5
PE
6640 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6641 when creating daemon; the previous buffer-overflow check was incorrect.
6642
d749b01b
PE
6643 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6644 which has the guts of the old verror function.
6645
b5cd1905
PE
6646 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6647 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6648
6e1a67fb
PE
6649 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6650 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6651 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6652 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6653 length of string rather than counting it via multiple sprintfs;
6654 that's simpler and more reliable.
c21721cc
PE
6655 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6656 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6657 sprintf, in case result does not fit in int.
6658
c57b67fc
PE
6659 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6660 (fontset_from_font): Print it.
6661
8a401434
PE
6662 * frame.c (tty_frame_count): Now printmax_t, not int.
6663 (make_terminal_frame, set_term_frame_name): Print it.
6664 (x_report_frame_params): In X, window IDs are unsigned long,
6665 not signed long, so print them as unsigned.
6666 (validate_x_resource_name): Check for implausibly long names,
6667 and don't assume name length fits in 'int'.
6668 (x_get_resource_string): Don't blindly alloca invocation name;
6669 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6670 not fit in int.
6671
6e1a67fb
PE
6672 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6673 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6674 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6675
0df02bf3
PE
6676 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6677 Use esprintf, not sprintf, in case result does not fit in int.
6678
48e30793
PE
6679 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6680 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6681 it as a large positive number.
6682 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6683 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6684
a66ff6d8
PE
6685 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6686 in case result does not fit in int.
6687
aca216ff
PE
6688 * print.c (float_to_string): Detect width overflow more reliably.
6689 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6690 buffer overrun. Don't assume list length fits in 'int'. Treat
6691 print length of 0 as 0, not as infinity; to be consistent with other
6692 uses of print length in this function. Don't overflow print length
6693 index. Don't assume hash table size fits in 'long', or that
6694 vectorlike size fits in 'unsigned long'.
6695
31c286f7
PE
6696 * process.c (make_process): Use printmax_t, not int, to format
6697 process-name gensyms.
6698
55e5faa1
PE
6699 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6700
80f2e268
PE
6701 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6702 to avoid potential buffer overrun.
6703
670741ab
PE
6704 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6705 if X resource line is longer than 512 bytes.
6706
b7163a50
PE
6707 * xfns.c (x_window): Make sprintf buffer a bit bigger
6708 to avoid potential buffer overrun.
6709
ae58ff1f
PE
6710 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6711
c43c8a6a
PE
6712 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6713
3f8236f4
PE
67142011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6715
53e9fe90 6716 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6717 Without these, Emacs silently mishandles large integers sometimes.
6718 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6719 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6720
6511acf2
PE
6721 * xdisp.c (try_window_id): Check Emacs fixnum range before
6722 converting to 'int'.
806add1d 6723
6511acf2 6724 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6725 Check that an Emacs fixnum is in range before assigning it to 'int'.
6726 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6727 values converted from Emacs fixnums.
6728 (Frecenter): Don't wrap around a line count if it is out of 'int'
6729 range; instead, treat it as an extreme value.
6730 (Fset_window_configuration, compare_window_configurations):
6731 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6732
6511acf2
PE
6733 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6734 that can exceed INT_MAX. Check that EMACS_INT value is in range
6735 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6736 (match_limit): Don't assume that a fixnum can fit in 'int'.
6737
6511acf2 6738 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6739 exceed INT_MAX.
6740
6511acf2 6741 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6742 (Fvertical_motion): Don't wrap around LINES values that don't fit
6743 in 'int'. Instead, treat them as extreme values. This is good
6744 enough for windows, which can't have more than INT_MAX lines anyway.
6745
fcb901a7
LMI
67462011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6747
0f2f6b6d
LMI
6748 * Require libxml/parser.h to avoid compilation warning.
6749
fcb901a7
LMI
6750 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6751
6752 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6753 since this reportedly can destroy thread storage.
6754
6e20a0d4
CY
67552011-08-30 Chong Yidong <cyd@stupidchicken.com>
6756
6757 * syntax.c (find_defun_start): Update all cache variables if
6758 exiting early (Bug#9401).
6759
148ae00e
EZ
67602011-08-30 Eli Zaretskii <eliz@gnu.org>
6761
f6cfbd8f
EZ
6762 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6763
148ae00e
EZ
6764 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6765 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6766 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6767
6768 * term.c (tty_append_glyph): New function.
6769 (produce_stretch_glyph): Static function and its prototype deleted.
6770
a66cfb1c
SM
6771 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6772 Add prototypes.
148ae00e 6773
c4a07a4c
PE
67742011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6777 when checking :margin (Bug#9390).
6778 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6779 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6780 so that the name doesn't mislead. All uses changed.
6781
6bc8cd65
JB
67822011-08-28 Johan Bockgård <bojohan@gnu.org>
6783
6784 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6785 set_tty_hooks.
6786
dca4927e
EZ
67872011-08-27 Eli Zaretskii <eliz@gnu.org>
6788
6789 * xdisp.c (move_it_to): Don't bail out early when reaching
6790 position beyond to_charpos, if we are scanning backwards.
6791 (move_it_vertically_backward): When DY == 0, make sure we get to
6792 the first character in the line after the newline.
6793
f2cad773
PE
67942011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6797 (ccl_driver): Do not generate an out-of-range pointer.
6798 (Fccl_execute_on_string): Remove unnecessary check for
6799 integer overflow, noted by Stefan Monnier in
6800 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6801 Remove a FIXME that didn't need fixing.
6802 Simplify the newly-introduced buffer reallocation code.
6803
0cae2cdb
JB
68042011-08-27 Juanma Barranquero <lekktu@gmail.com>
6805
6806 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6807
5fc295a4 68082011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6809
70c60eb2 6810 Integer and memory overflow issues (Bug#9196).
726e0ab1 6811
d31850da
PE
6812 * doc.c (get_doc_string): Rework so that
6813 get_doc_string_buffer_size is the actual buffer size, rather than
6814 being 1 less than the actual buffer size; this makes xpalloc more
6815 convenient.
6816
a69fbedb
PE
6817 * image.c (x_allocate_bitmap_record, cache_image):
6818 * xselect.c (Fx_register_dnd_atom):
6819 Simplify previous changes by using xpalloc.
6820
fe5c5d37
PE
6821 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6822 since either will do and ptrdiff_t is convenient with xpalloc.
6823
0065d054
PE
6824 * charset.c (charset_table_size)
6825 (struct charset_sort_data.priority): Now ptrdiff_t.
6826 (charset_compare): Don't overflow if priorities differ greatly.
6827 (Fsort_charsets): Don't assume list length fits in int.
6828 Check for size-calculation overflow when allocating sort data.
6829 (syms_of_charset): Allocate an initial charset table that is
6830 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6831
6832 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6833
6834 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6835 The actual value is always <= INT_MAX, and leaving it unsigned made
6836 overflow checking harder.
6837
6838 * dispextern.h (struct glyph_matrix.rows_allocated)
6839 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6840 with xpalloc. The values are still always <= INT_MAX.
6841
6842 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6843
6844 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6845 (SAFE_NALLOCA): New macro.
6846
6847 * region-cache.c (struct boundary.pos, find_cache_boundary)
6848 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6849 (set_cache_region, invalidate_region_cache)
6850 (revalidate_region_cache, know_region_cache, region_cache_forward)
6851 (region_cache_backward, pp_cache):
6852 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6853 so that ptrdiff_t * can be passed to xpalloc.
6854 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6855 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6856 (pp_cache): Don't assume cache_len fits in int.
6857 * region-cache.h: Adjust extern decls to match.
6858
6859 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6860 EMACS_INT, since either will do, for xpalloc.
6861
6862 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6863 (xnmalloc, xnrealloc, xpalloc): New functions.
6864
726e0ab1
PE
6865 * bidi.c (bidi_shelve_header_size): New constant.
6866 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6867 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6868
51f30bc5 6869 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6870 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6871 (overlay_strings):
6872 Don't update size of array until after memory allocation succeeds,
6873 because xmalloc/xrealloc may not return.
0065d054
PE
6874 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6875 now that we have proper integer overflow checking.
6876 (record_overlay_string, overlay_strings): Catch overflows when
6877 calculating size of overlay_str_buf.
726e0ab1 6878
0065d054
PE
6879 * callproc.c (Fcall_process): Check for size overflow when
6880 calculating size of args2.
6881 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6882 Normally we prefer signed values, but sticking with ptrdiff_t would
6883 require adding more-complicated checks.
726e0ab1
PE
6884
6885 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6886 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6887 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6888 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6889
6890 * character.c (Fstring): Check for size-calculation overflow.
6891
6892 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6893 unnecessary integer overflow. Check for size overflow.
6894 (encode_coding_object): Don't update size until xmalloc succeeds.
6895
6896 * composite.c (get_composition_id): Check for overflow in glyph
6897 length calculations.
6898
6899 Integer and memory overflow fixes for display code.
6900 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6901 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6902 (scrolling_window): Check for overflow in size calculations.
6903 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6904 Don't assume glyph table len fits in int.
6905 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6906 (row_table_size): Now ptrdiff_t, not int.
6907 (scrolling_window): Avoid overflow in size calculations.
6908 Don't update size until allocation succeeds.
6909 * fns.c (concat): Check for overflow in size calculations.
6910 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6911 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6912 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6913
6914 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6915 (get_doc_string): Check for size calculation overflow.
6916 Don't update size until allocation succeeds.
6917 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6918 EMACS_INT, where ptrdiff_t will do.
6919 (Fsubstitute_command_keys): Check for string overflow.
6920
6921 * editfns.c (set_time_zone_rule): Don't assume environment length
6922 fits in int.
6923 (message_length): Now ptrdiff_t, not int.
6924 (Fmessage_box): Don't update size until allocation succeeds.
6925 Don't assume message length fits in int.
6926 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6927
0065d054
PE
6928 * emacs.c (main): Do not reallocate argv, since there is a null at
6929 the end that can be overwritten, and this way there's no need to
6930 worry about size-calculation overflow.
6931 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6932
6933 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6934 alloc succeeds.
6935 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6936
6937 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6938 (x_set_scroll_bar_width, x_figure_window_size):
6939 Check for integer overflow.
6940 (x_set_alpha): Do not assume XINT fits in int.
6941
6942 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6943 This is for the members text_lines, text_cols, total_lines, total_cols,
6944 where the system imposes an 'int' limit.
6945
6946 * fringe.c (Fdefine_fringe_bitmap):
6947 Don't update size until alloc works.
6948
6949 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6950 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6951
6952 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6953 Check for size-calculation overflow.
6954 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6955 do, as we prefer signed integers.
6956 (id_to_widget.max_size, id_to_widget.used)
6957 (xg_store_widget_in_map, xg_remove_widget_from_map)
6958 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6959 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6960 Use and return ptrdiff_t, not int.
6961 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6962 * gtkutil.h: Change prototypes to match the above.
6963
6964 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6965 are duplicate now that they've been promoted to lisp.h.
6966 (x_allocate_bitmap_record, x_alloc_image_color)
6967 (make_image_cache, cache_image, xpm_load):
6968 Don't update size until alloc is done.
6969 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6970 (x_detect_edges):
3256efce 6971 Check for size calculation overflow.
726e0ab1
PE
6972 (ct_colors_allocated_max): New constant.
6973 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6974 overflow.
3256efce 6975
726e0ab1
PE
6976 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6977 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6978 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6979 Use ptrdiff_t, not int, to count maps.
6980 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
6981 calculations. Don't update size until allocation succeeds.
6982 Redo calculations to avoid overflow.
726e0ab1
PE
6983 * keyboard.h: Change prototypes to match the above.
6984
6985 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6986 to count maps.
6987 (current_minor_maps): Check for size calculation overflow.
6988 * keymap.h: Change prototypes to match the above.
6989
6990 * lread.c (read1, init_obarray): Don't update size until alloc done.
6991
6992 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6993 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6994
726e0ab1
PE
6995 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6996 Now ptrdiff_t, not int.
6997 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6998 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6999
7000 * process.c (Fnetwork_interface_list): Check for overflow
7001 in size calculation.
7002
7003 * region-cache.c (move_cache_gap): Check for size calculation overflow.
7004
7005 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
7006 overflow. Don't bother calling xmalloc when xrealloc will do.
7007
7008 * search.c (Freplace_match): Check for size calculation overflow.
7009 (Fset_match_data): Don't assume list lengths fit in 'int'.
7010
7011 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
7012 for command line length. Do not attempt to address one before the
7013 beginning of an array, as that's not portable.
7014
7015 * term.c (max_frame_lines): Remove; unused.
7016 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
7017 not int.
7018 (encode_terminal_code, calculate_costs): Check for size
7019 calculation overflow.
7020 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
7021 table lengths and related sizes. Don't update size until alloc
7022 done. Redo calculations to avoid overflow.
7023 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
7024
7025 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
7026 subtracting pointers.
7027 (gobble_line): Check for overflow more carefully. Don't update size
7028 until alloc done.
7029
7030 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
7031 Don't update size until alloc done.
7032 Redo size calculations to avoid overflow.
7033 Check for size calculation overflow.
0065d054 7034 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
7035
7036 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
7037 Use ptrdiff_t, not int, for sizes.
7038 (store_mode_line_noprop_char): Don't update size until alloc done.
7039
0065d054
PE
7040 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
7041 Use ptrdiff_t, not int, for sizes.
7042 (Finternal_make_lisp_face, cache_face):
7043 Check for size calculation overflow.
7044 (cache_face): Treat size calculation overflows as if they were
7045 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
7046
7047 * xfns.c (x_encode_text, x_set_name_internal)
7048 (Fx_change_window_property): Use ptrdiff_t, not int, to count
7049 sizes, since they can exceed INT_MAX in size. Check for size
7050 calculation overflow.
7051
0065d054
PE
7052 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
7053 (xg_select): Check for size calculation overflow.
726e0ab1
PE
7054 Don't update size until alloc done.
7055
0065d054 7056 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 7057 as sprintf is limited to int lengths.
1d526e2f 7058
252c5ee1
PE
7059 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
7060 (X_LONG_MIN): New macros.
864d7ce7
PE
7061 Use them to make the following changes clearer.
7062 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
7063 This change doesn't affect the value now, but it may help remind
7064 future maintainers not to raise the value too much later.
7065 (SELECTION_QUANTUM): Remove, replacing with ...
7066 (selection_quantum): ... new function, which avoids overflow.
7067 All uses changed.
7068 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
7069 assumption that selection length fits in 'int'.
7070 (x_reply_selection_request, x_handle_selection_request)
7071 (x_get_window_property, receive_incremental_selection)
7072 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
7073 (lisp_data_to_selection_data, clean_local_selection_data):
7074 Use ptrdiff_t, not int, to record length of selection.
7075 (x_reply_selection_request, x_get_window_property)
7076 (receive_incremental_selection, x_property_data_to_lisp):
7077 Redo calculations to avoid overflow.
7078 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 7079 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
7080 something.
7081 (x_get_window_property, receive_incremental_selection)
7082 (lisp_data_to_selection_data, x_property_data_to_lisp):
7083 Check for size-calculation overflow.
7084 (x_get_window_property, receive_incremental_selection)
7085 (lisp_data_to_selection_data, Fx_register_dnd_atom):
7086 Don't store size until memory allocation succeeds.
7087 (x_get_window_property): Plug memory leak on memory exhaustion.
7088 Don't double-block input; malloc is safe here. Don't assume 2**34
7089 - 4 fits in unsigned long. Add an xassert to check
7090 XGetWindowProperty overflow. Be more careful about overflow
7091 calculations, and distinguish size from memory overflow better.
7092 (receive_incremental_selection): When tracing, don't assume
7093 unsigned int is less than INT_MAX.
7094 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
7095 harmful) conversions of unsigned short to int.
7096 (lisp_data_to_selection_data): Don't assume that integers
7097 in the range -65535 through -1 fit in an X unsigned short.
7098 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
7099 result parameters unless successful. Rely on cons_to_unsigned
7100 to report problems with elements; the old code wasn't right anyway.
7101 (x_check_property_data): Check for int overflow; we cannot use
7102 a wider type due to X limits.
7103 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
7104
726e0ab1 7105 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 7106
0065d054
PE
7107 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
7108 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
7109 (x_color_cells): Don't store size until memory allocation succeeds.
7110 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 7111 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
7112 (x_term_init): Don't assume length fits in int (sprintf is limited
7113 to int size).
bc18e09d 7114
ebfa62c0
PE
7115 Use ptrdiff_t for composition IDs.
7116 * character.c (lisp_string_width):
7117 * composite.c (composition_table_size, n_compositions)
7118 (get_composition_id, composition_gstring_from_id):
7119 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
7120 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
7121 * window.c (Frecenter):
7122 Use ptrdiff_t, not int, for composition IDs.
7123 * composite.c (get_composition_id): Check for integer overflow.
7124 * composite.h: Adjust prototypes to match the above changes.
7125
d3411f89
PE
7126 Use ptrdiff_t for hash table indexes.
7127 * category.c (hash_get_category_set):
7128 * ccl.c (ccl_driver):
7129 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
7130 * coding.c (coding_system_charset_list, detect_coding_system):
7131 * coding.h (struct coding_system.id):
7132 * composite.c (get_composition_id, gstring_lookup_cache):
7133 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
7134 * image.c (xpm_get_color_table_h):
7135 * lisp.h (hash_lookup, hash_put):
7136 * minibuf.c (Ftest_completion):
7137 Use ptrdiff_t for hash table indexes, not int (which is too
7138 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
7139 32-bit --with-wide-int hosts).
7140
e097a6fa
PE
7141 * charset.c (Fdefine_charset_internal): Check for integer overflow.
7142 Add a FIXME comment about memory leaks.
7143 (syms_of_charset): Don't assume xmalloc returns.
7144
5637687f
PE
7145 Don't assume that stated character widths fit in int.
7146 * character.c (Fchar_width, c_string_width, lisp_string_width):
7147 * character.h (CHAR_WIDTH):
7148 * indent.c (MULTIBYTE_BYTES_WIDTH):
7149 Use sanitize_char_width to avoid undefined and/or bad behavior
7150 with outlandish widths.
a66cfb1c 7151 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
7152 now that we have two such functions. All uses changed.
7153 (sanitize_char_width): New inline function.
7154
a2271ba2
PE
7155 Don't assume that tab-width fits in int.
7156 * character.h (sanitize_width): New inline function.
7157 (SANE_TAB_WIDTH): New macro.
7158 (ASCII_CHAR_WIDTH): Use it.
7159 * indent.c (sane_tab_width): Remove. All uses replaced by
7160 SANE_TAB_WIDTH (current_buffer).
7161 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
7162
18c52557
PE
7163 * fileio.c: Integer overflow issues with file modes.
7164 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
7165
caeeedc1
PE
7166 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
7167 Remove unreachable code.
7168 (read_hex, load_charset_map_from_file): Check for integer overflow.
7169
6df6ae42 7170 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
7171 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
7172 (x_send_scroll_bar_event): Likewise. Check that the size does not
7173 exceed limits imposed by XClientMessageEvent, as well as the usual
7174 ptrdiff_t and size_t limits.
7175
b13995db
PE
7176 * keyboard.c: Overflow, signedness and related fixes.
7177 (make_lispy_movement): Use same integer type in forward decl
7178 that is used in the definition.
7179 (read_key_sequence, keyremap_step):
7180 Change bufsize argument back to int, undoing my 2011-03-30 change.
7181 We prefer signed types, and int is wide enough here.
7182 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
7183 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
7184 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
7185 length, not size_t. Use ptrdiff_t for index, not int.
7186 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
7187 possibility of integer overflow.
7188
13464394
PE
7189 Overflow, signedness and related fixes for images.
7190
7191 * dispextern.h (struct it.stack[0].u.image.image_id)
7192 (struct_it.image_id, struct image.id, struct image_cache.size)
7193 (struct image_cache.used, struct image_cache.ref_count):
7194 * gtkutil.c (update_frame_tool_bar):
7195 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
7196 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
7197 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
7198 * nsmenu.m (update_frame_tool_bar):
7199 * xdisp.c (calc_pixel_width_or_height):
7200 * xfns.c (image_cache_refcount):
7201 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
7202 on typical 64-bit hosts.
7203
7204 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7205 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
7206 Omit unnecessary casts to int.
7207 (parse_image_spec): Check that integers fall into 'int' range
7208 when the callers expect that.
7209 (image_ascent): Redo ascent calculation to avoid int overflow.
7210 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
7211 (lookup_image): Remove unnecessary tests.
7212 (xbm_image_p): Locals are now of int, not EMACS_INT,
7213 since parse_image_check makes sure they fit into int.
7214 (png_load, gif_load, svg_load_image):
7215 Prefer int to unsigned where either will do.
7216 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
7217 old tiff_error_handler and tiff_warning_handler.
7218 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
7219 stack buffer overflows. It uses only the features of vsnprintf
7220 that are common to both POSIX and native Microsoft.
7221 (tiff_error_handler, tiff_warning_handler): Use it.
7222 (tiff_load, gif_load, imagemagick_load_image):
7223 Don't assume :index value fits in 'int'.
7224 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
7225 (imagemagick_load_image): Check that crop parameters fit into
7226 the integer types that MagickCropImage accepts. Don't assume
7227 Vimagemagick_render_type has a nonnegative value. Don't assume
7228 size_t fits in 'long'.
7229 (gs_load): Use printmax_t to print the widest integers possible.
7230 Check for integer overflow when computing image height and width.
7231
c11821d4
EZ
72322011-08-26 Eli Zaretskii <eliz@gnu.org>
7233
7234 * xdisp.c (redisplay_window): Don't force window start if point
7235 will be invisible in the resulting window. (Bug#9324)
7236
0c95fcf7
EZ
72372011-08-25 Eli Zaretskii <eliz@gnu.org>
7238
7239 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
7240 the display spec is of the form `(space ...)'.
7241 (handle_display_spec): Return the value returned by
7242 handle_single_display_spec, not just 1 or zero.
7243 (handle_single_display_spec): If the display spec is of the form
7244 `(space ...)', and specifies display in the text area, return 2
7245 rather than 1.
fee65a97 7246 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
7247 accurately, and prefer exact match for point under bidi.
7248 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
7249
7250 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
7251 into disp_prop; all users changed.
7252
7253 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
7254 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
7255 for the text covered by the display property.
7256
e4ed06f1
CY
72572011-08-25 Chong Yidong <cyd@stupidchicken.com>
7258
7259 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7260 Change return value to nil.
7261 (Frecord_buffer): Delete unused function.
7262
f67cdd7f
EZ
72632011-08-24 Eli Zaretskii <eliz@gnu.org>
7264
5980d4c6
EZ
7265 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7266 buffers, return left-to-right.
8610fe8b
EZ
7267 (set_cursor_from_row): Consider candidate row a win if its glyph
7268 represents a newline and point is on that newline. Fixes cursor
7269 positioning on the newline at EOL of R2L text within L2R
7270 paragraph, and vice versa.
7271 (try_cursor_movement): Check continued rows, in addition to
7272 continuation rows. Fixes unwarranted scroll when point enters a
7273 continued line of R2L text within an L2R paragraph, or vice versa.
7274 (cursor_row_p): Consider the case of point being equal to
7275 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7276 from the end of a short line to the beginning of a continued line
7277 of R2L text within L2R paragraph.
7278 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7279 composed characters.
5980d4c6 7280
f67cdd7f
EZ
7281 * bidi.c (bidi_check_type): Use xassert.
7282 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7283 members.
7284
bca633fb
EZ
72852011-08-23 Eli Zaretskii <eliz@gnu.org>
7286
7287 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7288 a character.
7289
4a5885a7
CY
72902011-08-23 Chong Yidong <cyd@stupidchicken.com>
7291
7292 * nsfont.m (ns_otf_to_script): Fix typo.
7293
0902a04e
KH
72942011-08-22 Kenichi Handa <handa@m17n.org>
7295
7296 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7297 extra slot even if the purpose is char-code-property-table.
7298
1a2e6670
EZ
72992011-08-23 Eli Zaretskii <eliz@gnu.org>
7300
8ddde651
EZ
7301 * xdisp.c (redisplay_window): When computing centering_position,
7302 account for the height of the header line. (Bug#8874)
7303
425cc014
EZ
7304 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7305 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7306 candidate is selected by the mouse, and that candidate has a
7307 composed character under the mouse.
7308
1a2e6670
EZ
7309 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7310 coordinates reported by pos-visible-in-window-p for a composed
7311 character in column zero.
7312
8b76d6f8
SM
73132011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7314
7315 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7316
dac347dd
EZ
73172011-08-22 Eli Zaretskii <eliz@gnu.org>
7318
7319 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7320 consider it a hit if to_charpos is anywhere in the range of the
7321 composed buffer positions.
7322
e013fb34
CY
73232011-08-22 Chong Yidong <cyd@stupidchicken.com>
7324
7325 * image.c (gif_load): Don't assume that each subimage has the same
7326 dimensions as the base image. Handle disposal method that is
7327 "undefined" by the gif spec (Bug#9335).
7328
bd1ba3e8
CY
73292011-08-20 Chong Yidong <cyd@stupidchicken.com>
7330
7331 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 7332 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 7333
54a1215b
EZ
73342011-08-19 Eli Zaretskii <eliz@gnu.org>
7335
823564e5
EZ
7336 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
7337 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
7338 from an Org mode buffer to a Speedbar frame.
7339
54a1215b
EZ
7340 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
7341 a composition, take its buffer position from IT->cmp_it.charpos.
7342 Fixes cursor positioning at the beginning of a line that begins
7343 with a composed character.
7344
9778ebcc
EZ
73452011-08-18 Eli Zaretskii <eliz@gnu.org>
7346
0be6ee06
EZ
7347 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7348 character bidirectional type, use STRONG_L instead. Fixes crashes
7349 in a buffer produced by `describe-categories'.
7350
9778ebcc
EZ
7351 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7352 members before the level stack, so they would be saved and
7353 restored when copying iterator state. Fixes incorrect reordering
7354 around TABs covered by display properties.
7355
156bffbe
AS
73562011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7357
6b02f655 7358 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7359
72ad093b
CY
73602011-08-17 Chong Yidong <cyd@stupidchicken.com>
7361
7362 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7363 (internal_condition_case_2, internal_condition_case_n):
7364 Remove unnecessary aborts (Bug#9081).
72ad093b 7365
35774242
EZ
73662011-08-17 Eli Zaretskii <eliz@gnu.org>
7367
7368 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7369 has no `load' handler, try opening the file locally. (Bug#9311)
7370
db76dd85
KB
73712011-08-16 Ken Brown <kbrown@cornell.edu>
7372
7373 * gmalloc.c: Expand comment.
7374
b215eee5
EZ
73752011-08-16 Eli Zaretskii <eliz@gnu.org>
7376
7377 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7378 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7379
a4579d33
KB
73802011-08-16 Ken Brown <kbrown@cornell.edu>
7381
7382 Fix memory allocation problems in Cygwin build (Bug#9273).
7383
7384 * unexcw.c ( __malloc_initialized): Declare external variable.
7385 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7386
8b76d6f8
SM
7387 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7388 New variables.
a4579d33
KB
7389 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7390 dumped emacs.
7391 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7392 in the static heap.
7393 [CYGWIN] (special_realloc): New function.
7394 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7395 requests to realloc storage in the static heap.
7396
3ebec551
PE
73972011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * bidi.c (bidi_initialize): Remove unused local.
7400
9fd8be00
EZ
74012011-08-15 Eli Zaretskii <eliz@gnu.org>
7402
6b02f655
SM
7403 * bidimirror.h:
7404 * biditype.h: Remove file.
7405 * makefile.w32-in ($(BLD)/bidi.$(O)):
7406 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7407
7408 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7409
7410 * chartab.c: Improve commentary for the uniprop_table API.
7411
32413314
EZ
7412 * bidi.c (bidi_paragraph_init): Support zero value of
7413 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7414 (bidi_initialize): Use uniprop_table instead of including
7415 biditype.h and bidimirror.h.
32413314 7416
9fd8be00
EZ
7417 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7418 coordinates of the iterator when restoring from ppos_it.
7419 (Bug#9296)
7420
5cf2b69b
KH
74212011-08-14 Kenichi Handa <handa@m17n.org>
7422
7423 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7424 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7425
daf17d00
EZ
74262011-08-14 Eli Zaretskii <eliz@gnu.org>
7427
7428 * xdisp.c (move_it_in_display_line_to): Don't invoke
7429 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7430 ppos_it. Fixes vertical cursor motion when line beginning is
7431 covered by an image. (Bug#9296)
7432
08e3161a
JD
74332011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7434
7435 * nsterm.h (ns_run_ascript): Declare.
7436 (NSAPP_DATA2_RUNASSCRIPT): Define.
7437
7438 * nsfns.m (as_script, as_result, as_status): New static variables.
7439 (ns_run_ascript): New function.
5e617bc2 7440 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7441 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7442 the event loop. Get status from as_status (Bug#7276).
7443
7444 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7445 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7446 the event loop (Bug#7276).
7447
a3720aa2
AS
74482011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7449
7450 * gnutls.c (QCgnutls_bootprop_priority)
7451 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7452 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7453 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7454 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7455 (QCgnutls_bootprop_verify_hostname_error)
7456 (QCgnutls_bootprop_callbacks_verify): Rename from
7457 Qgnutls_bootprop_..., all uses changed.
7458
7459 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7460 uses changed.
7461
0a0d27fb
PE
74622011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7463
19d5c50c
PE
7464 * xfaces.c (Qframe_set_background_mode): Now static.
7465 * dispextern.h (Qframe_set_background_mode): Remove decl.
7466
0a0d27fb
PE
7467 * process.c (Fnetwork_interface_info): Declare local only if needed.
7468
377538cb
JD
74692011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7470
7471 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7472 (Fnetwork_interface_list): Allocate in increments of bytes instead
7473 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7474 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7475 sockaddr.
7476 (struct ifflag_def): notrailers is smart on OSX.
7477 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7478 Get hardware address with getifaddrs if available.
7479
08fff70c
EZ
74802011-08-12 Eli Zaretskii <eliz@gnu.org>
7481
7482 * xdisp.c (iterate_out_of_display_property): xassert that
7483 IT->position is set to within IT->object's boundaries. Break from
7484 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7485 when IT->position is set up wrongly due to some bug.
7486 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7487 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7488 entry. Force push_it to save on the stack the current
7489 buffer/string position, to be restored by pop_it. Fix flags in
7490 the iterator structure wrt the object coming from a display
7491 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7492 properties. (Bug#9284)
7493
7be1c708 74942011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7495
7be1c708
CY
7496 * fontset.c (fontset_get_font_group): Add proper type checks.
7497 (Bug#9172)
aac0c6e3 7498
7be1c708 74992011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7500
7be1c708
CY
7501 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7502 and LC_VERSION_MIN_MACOSX.
7503 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7504 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7505
97bb72a6
EZ
75062011-08-08 Eli Zaretskii <eliz@gnu.org>
7507
7508 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7509 no-display-properties-and-no-overlays under bidi display.
7510 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7511 properties and overlays.
97bb72a6 7512
d5617611
CY
75132011-08-08 Chong Yidong <cyd@stupidchicken.com>
7514
37e11a63
CY
7515 * editfns.c (Fset_time_zone_rule): Document relationship with the
7516 setenv function.
7517
d5617611
CY
7518 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7519 the font entity extracted from the cache (Bug#8109).
7520
58872834
CY
75212011-08-07 Chong Yidong <cyd@stupidchicken.com>
7522
7523 * composite.c (autocmp_chars): Don't reset point. That is done by
7524 restore_point_unwind (Bug#5984).
7525
75bfc667
JL
75262011-08-07 Juri Linkov <juri@jurta.org>
7527
7528 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7529 to show the arg `TIME' instead of `TIMEVAL'.
7530
d1410150
EZ
75312011-08-06 Eli Zaretskii <eliz@gnu.org>
7532
7533 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7534 display property strides EOL and includes a newline, as in
7535 longlines-mode. (Bug#9254)
75b771e4
EZ
7536 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7537 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7538
7539 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7540 is non-zero, even if the data buffer is NULL. Fixes a crash in
7541 vertical-motion with longlines-mode. (Bug#9254)
7542
35928349
EZ
75432011-08-05 Eli Zaretskii <eliz@gnu.org>
7544
ec7cc85b
EZ
7545 * bidi.c <bidi_cache_total_alloc>: Now static.
7546 (bidi_initialize): Initialize bidi_cache_total_alloc.
7547
8b76d6f8 7548 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7549 cache. (Bug#9221)
7550
7551 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7552 amount allocated this far in `bidi_cache_total_alloc'.
7553 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7554 non-zero, only free the data buffer without restoring the cache
7555 contents. All callers changed.
7556
7557 * dispextern.h (bidi_unshelve_cache): Update prototype.
7558
7559 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7560 (move_it_in_display_line, move_it_to)
7561 (move_it_vertically_backward, move_it_by_lines): Replace the call
7562 to xfree to an equivalent call to bidi_unshelve_cache.
7563 (move_it_in_display_line_to): Fix logic of returning
412b6358 7564 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7565
e2e2423b
EZ
75662011-08-05 Eli Zaretskii <eliz@gnu.org>
7567
7568 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7569 came from a string character with a `cursor' property. (Bug#9229)
7570
ae9e757a
JD
75712011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7572
7573 * Makefile.in (LIB_PTHREAD): New variable.
7574 (LIBES): Add LIB_PTHREAD (Bug#9216).
7575
7576 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7577 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7578
213bd7f2
AS
75792011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7580
6b02f655 7581 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7582
99aaf75f
JD
75832011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7584
7585 * xterm.c (x_find_topmost_parent): New function.
7586 (x_set_frame_alpha): Find topmost parent window with
7587 x_find_topmost_parent and set the property there also (bug#9181).
7588 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7589
c74e9d86
PE
75902011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7591
7592 * callproc.c (Fcall_process): Avoid vfork clobbering
7593 the local vars buffer, coding_systems, current_dir.
7594
640c8776
SM
75952011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7596
7597 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7598
f26d0e4c
PE
75992011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7600
8a10d76c
PE
7601 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7602 so that it is not optimized away.
7603
f26d0e4c
PE
7604 * xdisp.c (compute_display_string_pos): Remove unused local.
7605
55439c61
EZ
76062011-08-02 Eli Zaretskii <eliz@gnu.org>
7607
7608 Fix slow cursor motion and scrolling in large buffers with
7609 selective display, like Org Mode buffers. (Bug#9218)
7610
7611 * dispextern.h (struct bidi_it): New member disp_prop_p.
7612
7613 * xdisp.c: Remove one-slot cache of display string positions.
7614 (compute_display_string_pos): Accept an additional argument
5e617bc2 7615 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7616 for a display string or property. If found, set DISP_PROP_P
7617 non-zero.
7618
7619 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7620 DISP_PROP_P, and pass it to compute_display_string_pos.
7621 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7622 non-zero. All callers of bidi_fetch_char changed.
7623
fb33fa43
SM
76242011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7625
7626 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7627
b099e063
DM
76282010-12-03 Don March <don@ohspite.net>
7629
7630 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7631 last character M-[char] is translated to ESC [char] (bug#7541).
7632
5cc7f7af
KH
76332011-08-02 Kenichi Handa <handa@m17n.org>
7634
d0fffa3f 7635 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7636
7637 * chartab.c (uniprop_table): Make it non-static.
7638
525d5e6e
EZ
76392011-08-01 Eli Zaretskii <eliz@gnu.org>
7640
7641 * xdisp.c (forward_to_next_line_start): Accept additional argument
7642 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7643 on the newline.
7644 (reseat_at_next_visible_line_start): Use the bidi iterator state
7645 returned by forward_to_next_line_start to restore the state of
7646 it->bidi_it after backing up to previous newline. (Bug#9212)
7647
31011111
AS
76482011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7649
7650 * regex.c (re_comp): Protoize.
7651 (re_exec): Fix return type.
7652 (regexec): Fix type of `ret'. (Bug#9203)
7653
476371c4
PE
76542011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7655
e5d76069
PE
7656 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7657 This is needed if max-image-size is a floating-point number.
7658
9a79b20c
AS
76592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7660
7661 * print.c (print_object): Print empty symbol as ##.
7662
7663 * lread.c (read1): Read ## as empty symbol.
7664
d8c2fa78
AA
76652011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7666
7667 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7668 setting frame foreground color (Bug#9175).
7669 (x_set_background_color): Likewise.
7670
ffe57a7a
AA
7671 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7672 contents (Bug#9176).
7673 (EmacsTooltip -init): Remove bezels and add shadows to
7674 tooltip windows.
7675
bf3492a5
AA
7676 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7677 or scroll bar (Bug#8470).
7678
d55e9c53
AA
7679 * nsfont.m (nsfont_open): Remove assignment to voffset and
7680 unnecessary vars hshink, expand, hd, full_height, min_height.
7681 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7682
7683 * nsterm.h (nsfont_info): Remove voffset field.
7684
d8c2fa78 76852011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7686
7687 Implement strike-through and overline on NextStep (Bug#8863).
7688
7689 * nsfont.m (nsfont_open): Use underline position provided by font,
7690 instead of hard-coded value of 2.
7691 (nsfont_draw): Call ns_draw_text_decoration instead.
7692
7693 * nsterm.h: Add declaration for ns_draw_text_decoration.
7694
7695 * nsterm.m (ns_draw_text_decoration): New function for drawing
7696 underline, overline, and strike-through.
7697 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7698 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7699 accommodate underlining, etc.
4843aac3 7700
4cc60b9b
EZ
77012011-07-28 Eli Zaretskii <eliz@gnu.org>
7702
bc7ece87
EZ
7703 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7704 default.
4cc60b9b 7705
476371c4
PE
77062011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7707
66606eea
PE
7708 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7709 Without this fix, if a signal arrives just after memory fills up,
7710 'malloc' might be invoked reentrantly.
7711
476371c4
PE
7712 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7713 In other words, assume that every image size is allowed, on non-X
7714 hosts. This assumption is probably wrong, but it lets Emacs compile.
7715
f3fcc40d
AS
77162011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7717
7718 * regex.c (re_iswctype): Convert return values to boolean.
7719
350c992f
EZ
77202011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7721
7722 * xdisp.c (compute_display_string_pos): Don't use cached display
7723 string position if the buffer had its restriction changed.
7724 (Bug#9184)
7725
5266b4bb
PE
77262011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7727
7728 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7729
2573a837 77302011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7731
41f55ccd 7732 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7733
39e378da
PE
7734 * bidi.c: Integer size and overflow fixes.
7735 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7736 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7737 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7738 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7739 (bidi_find_other_level_edge):
7740 Use ptrdiff_t instead of EMACS_INT where either will do.
7741 This works better on 32-bit hosts configured --with-wide-int.
7742 (bidi_cache_ensure_space): Check for size-calculation overflow.
7743 Use % rather than repeated addition, for better worst-case speed.
7744 Don't set bidi_cache_size until after xrealloc returns, because it
7745 might not return.
7746 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7747 (bidi_cache_ensure_space): Also check that the bidi cache size
7748 does not exceed that of the largest Lisp string or buffer. See Eli
7749 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7750
5e927815
PE
7751 * alloc.c (__malloc_size_t): Remove.
7752 All uses replaced by size_t. See Andreas Schwab's note
7753 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7754
ca4aa935
PE
7755 * image.c: Improve checking for integer overflow.
7756 (check_image_size): Assume that f is nonnull, since
7757 it is always nonnull in practice. This is one less thing to
7758 worry about when checking for integer overflow later.
7759 (x_check_image_size): New function, which checks for integer
7760 overflow issues inside X.
7761 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7762 This removes the need for a memory_full check.
7763 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7764 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7765 (xbm_read_bitmap_data): Change locals back to 'int', since
7766 their values must fit in 'int'.
7767 (xpm_load_image, png_load, tiff_load):
7768 Invoke x_create_x_image_and_pixmap earlier,
7769 to avoid much needless work if the image is too large.
7770 (tiff_load): Treat overly large images as if
7771 x_create_x_image_and_pixmap failed, not as malloc failures.
7772 (gs_load): Use x_check_image_size.
7773
5f8f9cc2
PE
7774 * gtkutil.c: Omit integer casts.
7775 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7776 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7777
5adf60bc
PE
7778 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7779
c8907a93
PE
7780 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7781 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7782 would wrongly return t on a 64-bit host.
7783
e3c25c68
PE
7784 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7785 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7786 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7787 and therefore cause GCC to emit a bogus diagnostic in some cases.
7788
3f791afe
PE
7789 * image.c: Integer signedness and overflow and related fixes.
7790 This is not an exhaustive set of fixes, but it's time to
7791 record what I've got.
7792 (lookup_pixel_color, check_image_size): Remove redundant decls.
7793 (check_image_size): Don't assume that arbitrary EMACS_INT values
7794 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7795 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7796 (tiff_load, imagemagick_load_image):
7797 Check for overflow in size calculations.
7798 (x_create_x_image_and_pixmap): Remove unnecessary test for
7799 xmalloc returning NULL; that can't happen.
7800 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7801 (xpm_color_bucket): Use better integer hashing function.
7802 (xpm_cache_color): Don't possibly over-allocate memory.
7803 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7804 (gif_memory_source):
7805 Use ptrdiff_t, not int or size_t, to record sizes.
7806 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7807 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7808 either works, as we prefer signed integers.
7809 (tiff_read_from_memory, tiff_write_from_memory):
7810 Return tsize_t, not size_t, since that's what the TIFF API wants.
7811 (tiff_read_from_memory): Don't fail simply because the read would
7812 go past EOF; instead, return a short read.
7813 (tiff_load): Omit no-longer-needed casts.
7814 (Fimagemagick_types): Don't assume size fits into 'int'.
7815
3cc5a532
PE
7816 Improve hashing quality when configured --with-wide-int.
7817 * fns.c (hash_string): New function, taken from sxhash_string.
7818 Do not discard information about ASCII character case; this
7819 discarding is no longer needed.
7820 (sxhash-string): Use it. Change sig to match it. Caller changed.
7821 * lisp.h: Declare it.
7822 * lread.c (hash_string): Remove, since we now use fns.c's version.
7823 The fns.c version returns a wider integer if --with-wide-int is
7824 specified, so this should help the quality of the hashing a bit.
7825
b312a492
PE
7826 * emacs.c: Integer overflow minor fix.
7827 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7828 Define only if GNU_LINUX.
7829 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7830
dfd153ae
PE
7831 * dispnew.c: Integer signedness and overflow fixes.
7832 Remove unnecessary forward decls, that were a maintenance hassle.
7833 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7834 All uses changed.
7835 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7836 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7837 (prepare_desired_row, line_draw_cost):
7838 Use int, not unsigned, where either works.
7839 (save_current_matrix, restore_current_matrix):
7840 Use ptrdiff_t, not size_t, where either works.
7841 (init_display): Check for overflow more accurately, and without
7842 relying on undefined behavior.
7843
a81d11a3
PE
7844 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7845 Remove, replacing with the new symbols in lisp.h. All uses changed.
7846 * fileio.c (make_temp_name):
7847 * filelock.c (lock_file_1, lock_file):
7848 * xdisp.c (message_dolog):
7849 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7850 Use pMd etc. instead.
7851 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7852 replacing the pWIDE etc. symbols removed from editfns.c.
7853
3300e6fd
PE
7854 * keyboard.h (num_input_events): Now uintmax_t.
7855 This is (very slightly) less likely to mess up due to wraparound.
7856 All uses changed.
7857
fd05c7e9
PE
7858 * buffer.c: Integer signedness fixes.
7859 (alloc_buffer_text, enlarge_buffer_text):
7860 Use ptrdiff_t rather than size_t when either will do, as we prefer
7861 signed integers.
7862
903fe15d
PE
7863 * alloc.c: Integer signedness and overflow fixes.
7864 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7865 (__malloc_size_t): Default to size_t, not to int.
7866 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7867 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7868 Prefer ptrdiff_t to size_t when either would do, as we prefer
7869 signed integers.
7870 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7871 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7872 Now const. Initialize with values that are in range even if char
7873 is signed.
7874 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7875 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7876 These functions do the right thing with sizes > 2**32.
7877 (check_depth): Now ptrdiff_t, not int.
7878 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7879 Adjust to new way of storing sizes. Check for size overflow bugs
7880 in rest of code.
7881 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7882 slightly wrong anyway, as it missed one instance of
7883 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7884 (refill_memory_reserve): Omit needless cast to size_t.
7885 (mark_object_loop_halt): Mark as externally visible.
7886
ac82cc6a
PE
7887 * xselect.c: Integer signedness and overflow fixes.
7888 (Fx_register_dnd_atom, x_handle_dnd_message):
7889 Use ptrdiff_t, not size_t, since we prefer signed.
7890 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7891 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7892 x_dnd_atoms_size and x_dnd_atoms_length.
7893
c2d1e36d
PE
7894 * doprnt.c: Prefer signed to unsigned when either works.
7895 * eval.c (verror):
7896 * doprnt.c (doprnt):
7897 * lisp.h (doprnt):
7898 * xdisp.c (vmessage):
7899 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7900 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7901 prefer signed arithmetic to avoid comparison confusion.
7902 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7903 but is a bit tricky.
7904
0e926e56
PE
7905 Assume freestanding C89 headers, string.h, stdlib.h.
7906 * data.c, doprnt.c, floatfns.c, print.c:
7907 Include float.h unconditionally.
7908 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7909 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7910 * regex.c: Likewise for stddef.h, string.h.
7911 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7912 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7913 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7914 (STDC_HEADERS): Remove obsolete defines.
7915 * sysdep.c: Include limits.h unconditionally.
7916
9cfdb3ec
PE
7917 Assume support for memcmp, memcpy, memmove, memset.
7918 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7919 * regex.c (memcmp, memcpy):
7920 Remove; we assume C89 now.
7921
7922 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7923 (__malloc_safe_bcopy): Remove; no longer needed.
7924
cf950e6b 7925 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7926 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7927 well either way, and we prefer signed to unsigned.
7928
dbf38e02
LMI
79292011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7930
7931 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7932 closes the connection while we're reading (bug#9182).
7933
d6f0886c 79342011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7935
d6f0886c
JD
7936 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7937 are specified (Bug#9168).
24e0f6b1 7938
2eb1f9e6
PE
79392011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7940
7941 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7942 Found by GCC static checking and --with-wide-int on a 32-bit host.
7943
22381272 79442011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7945
7946 * xdisp.c (compute_display_string_pos): Fix logic of caching
7947 previous display string position. Initialize cached_prev_pos to
7948 -1. Fixes slow-down at the beginning of a buffer.
7949
f25e39b4
EZ
79502011-07-24 Eli Zaretskii <eliz@gnu.org>
7951
7952 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7953 for attrs[LFACE_FONTSET_INDEX].
7954
04c4b52e
PE
79552011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7956
7957 * xml.c (parse_region): Remove unused local
7958 that was recently introduced.
7959
c1734fbd
EZ
79602011-07-23 Eli Zaretskii <eliz@gnu.org>
7961
be18c5a5
EZ
7962 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7963 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7964
c1734fbd
EZ
7965 * xdisp.c (move_it_in_display_line_to): Record the best matching
7966 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
7967 exit if none of the characters scanned was an exact match.
7968 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
7969 when exact match is impossible due to invisible text, and the
7970 lines are truncated.
7971
a258d627
JD
79722011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7973
7974 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7975 for OSX >= 10.7.
7976
b6d5a689
EZ
79772011-07-22 Eli Zaretskii <eliz@gnu.org>
7978
0f74f785
EZ
7979 Fix a significant slow-down of cursor motion with C-n, C-p,
7980 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7981 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 7982 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
7983 (next_element_from_buffer): Call compute_stop_pos_backwards to
7984 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
7985 base_level_stop.
7986 (reseat): Don't look for prev_stop, as that could mean a very long
7987 run.
7988 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7989 <cached_disp_overlay_modiff>: Cache for last found display string
7990 position.
551918c1 7991 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
7992 about the same buffer in the same area of character positions, and
7993 the buffer wasn't changed since the time the display string
7994 position was cached.
551918c1 7995
b2d0c91a
EZ
79962011-07-22 Eli Zaretskii <eliz@gnu.org>
7997
7998 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7999 is an integer, which is important for empty lines. (Bug#9149)
8000
043604ee
CY
80012011-07-22 Chong Yidong <cyd@stupidchicken.com>
8002
8003 * frame.c (Fmodify_frame_parameters): In tty case, update the
8004 default face if necessary (Bug#4238).
8005
da4adb04
CY
80062011-07-21 Chong Yidong <cyd@stupidchicken.com>
8007
8008 * editfns.c (Fstring_to_char): No need to explain what a character
8009 is in the docstring (Bug#6576).
8010
9abd0532
LMI
80112011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8012
8013 * xml.c (parse_region): Make sure we always return a tree.
8014
36881d16
HK
80152011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
8016
8017 * xml.c (parse_region): If a document contains only comments,
8018 return that, too.
8019
1e98674d
LMI
80202011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8021
8022 * xml.c (make_dom): Return comments, too.
8023
590bd467
PE
80242011-07-19 Paul Eggert <eggert@cs.ucla.edu>
8025
8026 Port to OpenBSD.
8027 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
8028 and the surrounding thread.
8029 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
8030 rather than fgets, and retry after EINTR. Otherwise, 'emacs
8031 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
8032 timer goes off.
8033 * s/openbsd.h (BROKEN_SIGIO): Define.
8034 * unexelf.c (unexec) [__OpenBSD__]:
8035 Don't update the .mdebug section of the Alpha COFF symbol table.
8036
f41628b2
LMI
80372011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8038
8039 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
8040 (bug#8460).
8041
b59b67c5
PE
80422011-07-18 Paul Eggert <eggert@cs.ucla.edu>
8043
15e3a074
PE
8044 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
8045 This fixes some race conditions on the permissions of any newly
8046 created file.
8047
41bed37d
PE
8048 * alloc.c (valid_pointer_p): Use pipe, not open.
8049 This fixes some permissions issues when debugging.
8050
b59b67c5
PE
8051 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
8052 If fchown fails to set both uid and gid, try to set just gid,
8053 as that is sometimes allowed. Adjust the file's mode to eliminate
8054 setuid or setgid bits that are inappropriate if fchown fails.
8055
925a6be7
SM
80562011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8057
8058 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
8059 to compare Lisp_Objects.
8060 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
8061 global_gnutls_log_level, don't mistake it for a Lisp_Object.
8062 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
8063
52968808
AS
80642011-07-17 Andreas Schwab <schwab@linux-m68k.org>
8065
0a6a104b
AS
8066 * lread.c (read_integer): Unread even EOF character.
8067 (read1): Likewise. Properly record start position of symbol.
8068
52968808
AS
8069 * lread.c (read1): Read `#:' as empty uninterned symbol if no
8070 symbol character follows.
8071
9e381cdd
PE
80722011-07-17 Paul Eggert <eggert@cs.ucla.edu>
8073
8074 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
8075 This works around a problem with the previous change to Fcopy_file.
8076 Recent glibc declares fchown with __attribute__((warn_unused_result)),
8077 and without this change, GCC might complain about discarding
8078 fchown's return value.
8079
b5641435
JB
80802011-07-16 Juanma Barranquero <lekktu@gmail.com>
8081
8082 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
8083
a8031457
PE
80842011-07-16 Paul Eggert <eggert@cs.ucla.edu>
8085
8086 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
8087
dd889327
LMI
80882011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
8089
750c33f7
LMI
8090 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
8091 it's used from the C level.
8092
dd889327
LMI
8093 * process.c: Use the same condition for POLL_FOR_INPUT in both
8094 keyboard.c and process.c (bug#1858).
8095
87e86684
LM
80962011-07-09 Lawrence Mitchell <wence@gmx.li>
8097
8098 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
8099 (Fgnutls_boot): Use it.
8100
64348f40
AS
81012011-07-15 Andreas Schwab <schwab@linux-m68k.org>
8102
8103 * doc.c (Fsubstitute_command_keys): Revert last change.
8104
1d698799
LMI
81052011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
8106
f863868c
LMI
8107 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
8108 quotes the next character, and doesn't affect other longer
8109 sequences (bug#8935).
8110
1d698799
LMI
8111 * lread.c (syms_of_lread): Clarify that is isn't only
8112 `eval-buffer' and `eval-defun' that's affected by
8113 `lexical-binding' (bug#8460).
8114
aa4b6df6
EZ
81152011-07-15 Eli Zaretskii <eliz@gnu.org>
8116
8117 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 8118 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 8119
5d856da6
PE
81202011-07-14 Paul Eggert <eggert@cs.ucla.edu>
8121
ad6042bb
PE
8122 Fix minor problems found by static checking.
8123 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
8124 (elsz): Now a signed constant, not a size_t var. We prefer signed
8125 types to unsigned, to avoid integer comparison confusion. Without
8126 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
8127 "cannot optimize loop, the loop counter may overflow", a symptom
8128 of the confusion.
f00bbb22 8129 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
8130 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
8131
6468f31c
LMI
81322011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8133
49080b10
LMI
8134 * search.c (Fre_search_backward): Mention `case-fold-search' in
8135 all the re_search_* functions (bug#8138).
8136
6468f31c
LMI
8137 * keyboard.c (Fopen_dribble_file): Document when the file is
8138 closed (bug#8056).
8139
c965adc5
EZ
81402011-07-14 Eli Zaretskii <eliz@gnu.org>
8141
df9733bf
EZ
8142 * bidi.c (bidi_dump_cached_states): Fix format of displaying
8143 bidi_cache_idx.
8144
0bb23927
EZ
8145 Support bidi reordering of display and overlay strings.
8146 * xdisp.c (compute_display_string_pos)
8147 (compute_display_string_end): Accept additional argument STRING.
8148 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
8149 (reseat_to_string): Initialize bidi_it->string.s and
8150 bidi_it->string.schars.
8151 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
8152 NULL (avoids a crash in bidi_paragraph_init).
8153 Initialize itb.string.lstring.
0bb23927
EZ
8154 (init_iterator): Call bidi_init_it only of a valid
8155 buffer position was specified. Initialize paragraph_embedding to
8156 L2R.
8157 (reseat_to_string): Initialize the bidi iterator.
8158 (display_string): If we need to ignore text properties of
8159 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
8160 original value of -1 will not work with bidi.)
8161 (compute_display_string_pos): First arg is now struct
8162 `text_pos *'; all callers changed. Support display properties on
8163 Lisp strings.
8164 (compute_display_string_end): Support display properties on Lisp
8165 strings.
8166 (init_iterator, reseat_1, reseat_to_string): Initialize the
8167 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
8168 when iterating on a string not from display properties).
640c8776
SM
8169 (compute_display_string_pos, compute_display_string_end):
8170 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
8171 arrow keys.
8172 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
8173 base_level_stop; instead, set base_level_stop to BEGV.
8174 Fixes crashes in vertical-motion.
0bb23927
EZ
8175 (next_element_from_buffer): Improve commentary for when
8176 the iterator is before prev_stop.
8177 (init_iterator): Initialize bidi_p from the default value of
8178 bidi-display-reordering, not from buffer-local value. Use the
8179 buffer-local value only if initializing for buffer iteration.
8180 (handle_invisible_prop): Support invisible properties on strings
8181 that are being bidi-reordered.
8182 (set_iterator_to_next): Support bidi reordering of C strings and
8183 Lisp strings.
8184 (next_element_from_string): Support bidi reordering of Lisp
8185 strings.
8186 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
8187 (display_string): Support display of R2L glyph rows.
8188 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
8189 (init_iterator): Don't initialize it->bidi_p for strings
8190 here.
8191 (reseat_to_string): Initialize it->bidi_p for strings here.
8192 (next_element_from_string, next_element_from_c_string)
8193 (next_element_from_buffer): Add xassert's for correspondence
8194 between IT's object being iterated and it->bidi_it.string
8195 structure.
8196 (face_before_or_after_it_pos): Support bidi iteration.
8197 (next_element_from_c_string): Handle the case of the first string
8198 character that is not the first one in the visual order.
8199 (get_visually_first_element): New function, refactored from common
8200 parts of next_element_from_buffer, next_element_from_string, and
8201 next_element_from_c_string.
8202 (tool_bar_lines_needed, redisplay_tool_bar)
8203 (display_menu_bar): Force left-to-right direction. Add a FIXME
8204 comment for making that be controlled by a user option.
8205 (push_it, pop_it): Save and restore the state of the
8206 bidi iterator. Save and restore the bidi_p flag.
8207 (pop_it): Iterate out of display property for string iteration as
8208 well.
8209 (iterate_out_of_display_property): Support iteration over strings.
8210 (handle_single_display_spec): Set up it->bidi_it for iteration
8211 over a display string, and call bidi_init_it.
8212 (handle_single_display_spec, next_overlay_string)
8213 (get_overlay_strings_1, push_display_prop): Set up the bidi
8214 iterator for displaying display or overlay strings.
8215 (forward_to_next_line_start): Don't use the shortcut if
8216 bidi-iterating.
8217 (back_to_previous_visible_line_start): If handle_display_prop
8218 pushed the iterator stack, restore the internal state of the bidi
8219 iterator by calling bidi_pop_it same number of times.
8220 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
8221 and we are bidi-iterating, don't decrement the iterator position;
8222 instead, set the first_elt flag in the bidi iterator, to produce
8223 the same effect.
8224 (reseat_1): Remove redundant setting of string_from_display_prop_p.
8225 (push_display_prop): xassert that we are iterating a buffer.
8226 (push_it, pop_it): Save and restore paragraph_embedding member.
8227 (handle_single_display_spec, next_overlay_string)
8228 (get_overlay_strings_1, reseat_1, reseat_to_string)
8229 (push_display_prop): Set up the `unibyte' member of bidi_it.string
8230 correctly. Don't assume unibyte strings are not bidi-reordered.
8231 (compute_display_string_pos)
8232 (compute_display_string_end): Fix handling the case of C string.
8233 (push_it, pop_it): Save and restore from_disp_prop_p.
8234 (handle_single_display_spec, push_display_prop): Set the
8235 from_disp_prop_p flag.
8236 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
8237 (pop_it): Call iterate_out_of_display_property only if we are
8238 popping after iteration over a string that came from a display
8239 property. Fix a typo in popping stretch info. Add an assertion
8240 for verifying that the iterator position is in sync with the bidi
8241 iterator.
8242 (handle_single_display_spec, get_overlay_strings_1)
8243 (push_display_prop): Fix initialization of paragraph direction for
8244 string when that of the parent object is not yet determined.
8245 (reseat_1): Call bidi_init_it to resync the bidi
8246 iterator with IT's position. (Bug#7616)
8247 (find_row_edges): If ROW->start.pos gives position
8248 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
8249 (handle_stop, back_to_previous_visible_line_start, reseat_1):
8250 Reset the from_disp_prop_p flag.
8251 (SAVE_IT, RESTORE_IT): New macros.
8252 (pos_visible_p, face_before_or_after_it_pos)
8253 (back_to_previous_visible_line_start)
8254 (move_it_in_display_line_to, move_it_in_display_line)
8255 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8256 (try_scrolling, redisplay_window, display_line): Use them when
8257 saving a temporary copy of the iterator and restoring it back.
8258 (back_to_previous_visible_line_start, reseat_1)
8259 (init_iterator): Empty the bidi cache "stack".
8260 (move_it_in_display_line_to): If iterator ended up at
8261 EOL, but we never saw any buffer positions smaller than
8262 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8263 motion in bidi-reordered lines.
8264 (move_it_in_display_line_to): Record prev_method and prev_pos
8265 immediately before the call to set_iterator_to_next. Fixes cursor
8266 motion in bidi-reordered lines with stretch glyphs and strings
8267 displayed in margins. (Bug#8133) (Bug#8867)
8268 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8269 TO_CHARPOS.
640c8776
SM
8270 (pos_visible_p): Support positions in bidi-reordered lines.
8271 Save and restore bidi cache.
0bb23927
EZ
8272
8273 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8274 (bidi_paragraph_info): Delete unused struct.
8275 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8276 (bidi_cache_start): New variable.
8277 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8278 to zero.
8279 (bidi_cache_fetch_state, bidi_cache_search)
8280 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8281 (bidi_cache_find, bidi_peek_at_next_level)
8282 (bidi_level_of_next_char, bidi_find_other_level_edge)
8283 (bidi_move_to_visually_next): Compare cache index with
8284 bidi_cache_start rather than with zero.
8285 (bidi_fetch_char): Accept new argument STRING; all callers
8286 changed. Support iteration over a string. Support strings with
8287 display properties. Support unibyte strings. Fix the type of
8288 `len' according to what STRING_CHAR_AND_LENGTH expects.
8289 (bidi_paragraph_init, bidi_resolve_explicit_1)
8290 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
8291 (bidi_level_of_next_char, bidi_move_to_visually_next):
8292 Support iteration over a string.
0bb23927
EZ
8293 (bidi_set_sor_type, bidi_resolve_explicit_1)
8294 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8295 can now be zero (for strings); special values 0 and -1 were
8296 changed to -1 and -2, respectively.
8297 (bidi_char_at_pos): New function.
8298 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8299 Call it instead of FETCH_MULTIBYTE_CHAR.
8300 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8301 initialized to valid values.
8302 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8303 values.
8304 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8305 the test for valid cached positions. Fix the logic for looking up
8306 the sentinel state in the cache. GCPRO the Lisp string we are
8307 iterating.
8308 (bidi_push_it, bidi_pop_it): New functions.
8309 (bidi_initialize): Initialize the bidi cache start stack pointer.
8310 (bidi_cache_ensure_space): New function, refactored from part of
8311 bidi_cache_iterator_state. Don't assume the required size is just
8312 one BIDI_CACHE_CHUNK away.
8313 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8314 (bidi_count_bytes, bidi_char_at_pos): New functions.
8315 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8316 always valid if bidi_cache_idx is valid.
8317 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8318 is valid if it's going to be used.
8319 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8320 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
8321 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8322 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
8323 (bidi_find_other_level_edge, bidi_cache_start_stack):
8324 All variables related to cache indices are now EMACS_INT.
c965adc5 8325
0bb23927
EZ
8326 * dispextern.h (struct bidi_string_data): New structure.
8327 (struct bidi_it): New member `string'. Make flag members be 1-bit
8328 fields, and put them last in the struct.
640c8776
SM
8329 (compute_display_string_pos, compute_display_string_end):
8330 Update prototypes.
0bb23927
EZ
8331 (bidi_push_it, bidi_pop_it): Add prototypes.
8332 (struct iterator_stack_entry): New members bidi_p,
8333 paragraph_embedding, and from_disp_prop_p.
8334 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
8335 (bidi_shelve_cache, bidi_unshelve_cache):
8336 Declare prototypes.
0bb23927
EZ
8337
8338 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
8339 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
8340 and vector-like objects.
8341
8342 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
8343 cache around display iteration.
8344
8345 * window.c (Fwindow_end, window_scroll_pixel_based)
8346 (displayed_window_lines, Frecenter): Save and restore the bidi
8347 cache around display iteration.
8348
3bbd2265
LMI
83492011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8350
8351 * editfns.c (Fdelete_region): Clarify the use of the named
8352 parameters (bug#6788).
8353
adc47434
MR
83542011-07-14 Martin Rudalics <rudalics@gmx.at>
8355
8356 * indent.c (Fvertical_motion): Set and restore w->pointm when
8357 saving and restoring the window's buffer (Bug#9006).
8358
837c31f8
LMI
83592011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8360
8361 * editfns.c (Fstring_to_char): Clarify just what is returned
8362 (bug#6576). Text by Eli Zaretskii.
8363
ac389d0c
JB
83642011-07-13 Juanma Barranquero <lekktu@gmail.com>
8365
8366 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8367
0be0ce47
EZ
83682011-07-13 Eli Zaretskii <eliz@gnu.org>
8369
8370 * buffer.c (mmap_find): Fix a typo.
8371
cd18e7e3
JB
83722011-07-13 Johan Bockgård <bojohan@gnu.org>
8373
8374 Fix execution of x selection hooks.
8375 * xselect.c (Qx_lost_selection_functions)
8376 (Qx_sent_selection_functions): New vars.
8377 (syms_of_xselect): DEFSYM them.
8378 (x_handle_selection_request): Pass Qx_sent_selection_functions
8379 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8380 (x_handle_selection_clear,x_clear_frame_selections):
8381 Pass Qx_lost_selection_functions rather than
8382 Vx_lost_selection_functions to Frun_hook_with_args.
8383
47ea7f44
PE
83842011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8385
ac389d0c 8386 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8387 The old code sometimes used this field without initializing it.
8388
47ea7f44
PE
8389 * alloc.c (gc_sweep): Don't read past end of array.
8390 In theory, the old code could also have corrupted Emacs internals,
8391 though it'd be very unlikely.
8392
bc985c87
AS
83932011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8394
8395 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8396 argument. (Bug#4026)
bc985c87 8397
0cf34688
LMI
83982011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8399
b3dadd76
LMI
8400 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8401 key" (bug#4257).
8402
0cf34688
LMI
8403 * window.c (Fset_window_start): Doc fix (bug#4199).
8404 (Fset_window_hscroll): Ditto.
8405
270768cd
PE
84062011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8407
077e3dda 8408 Fix minor new problems caught by GCC 4.6.1.
270768cd 8409 * term.c (init_tty): Remove unused local.
490011a6 8410 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8411 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8412 not used otherwise.
270768cd 8413
b1f58454
CY
84142011-07-12 Chong Yidong <cyd@stupidchicken.com>
8415
8416 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8417
22b9578d
LMI
84182011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8419
6e70ab07
LMI
8420 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8421 are the mini-buffer and the echo area (bug#3320).
8422
22b9578d
LMI
8423 * term.c (init_tty): Remove support for supdup, c10 and perq
8424 terminals, which are no longer supported (bug#1482).
8425
8974cc9f
JB
84262011-07-10 Johan Bockgård <bojohan@gnu.org>
8427
8428 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8429
a560d974
JD
84302011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8431
8432 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8433 for non-popups (Bug#3642).
8434
1dae0f0a
AS
84352011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8436
268c2c36 8437 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8438 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8439 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8440 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8441 * data.c (fmod): Likewise.
8442 * dispnew.c (swap_glyphs_in_rows): Likewise.
8443 * emacs.c (memory_warning_signal): Likewise.
8444 * floatfns.c (float_error): Likewise.
8445 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8446 (otf_open, font_otf_capability, generate_otf_features)
8447 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8448 Likewise.
8449 * image.c (pbm_read_file): Likewise.
8450 * indent.c (string_display_width): Likewise.
8451 * intervals.c (check_for_interval, search_for_interval)
8452 (inc_interval_count, count_intervals, root_interval)
8453 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8454 * lread.c (defalias): Likewise.
268c2c36 8455 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8456 * regex.c (set_image_of_range_1, set_image_of_range)
8457 (regex_grow_registers): Likewise.
8458 * sysdep.c (strerror): Likewise.
8459 * termcap.c (valid_filename_p, tprint, main): Likewise.
8460 * tparam.c (main): Likewise.
8461 * unexhp9k800.c (run_time_remap, save_data_space)
8462 (update_file_ptrs, read_header, write_header, calculate_checksum)
8463 (copy_file, copy_rest, display_header): Likewise.
8464 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8465 Likewise.
8466 * xdisp.c (check_it): Likewise.
8467 * xfaces.c (register_color, unregister_color, unregister_colors):
8468 Likewise.
8469 * xfns.c (print_fontset_result): Likewise.
8470 * xrdb.c (member, fatal, main): Likewise.
8471
99033785
PE
84722011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8473
8474 Fix minor problems found by static checking (Bug#9031).
8475 * chartab.c (char_table_set_range, map_sub_char_table):
8476 Remove unused locals.
8477 (uniprop_table): Now static.
8478 * composite.c (_work_char): Remove unused static var.
8479
9cb2ac56
JB
84802011-07-09 Juanma Barranquero <lekktu@gmail.com>
8481
8482 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8483
f25661f0
JD
84842011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8485
8486 * gtkutil.c (qttip_cb): Remove code without function.
8487
8278c4fe
EZ
84882011-07-09 Eli Zaretskii <eliz@gnu.org>
8489
8490 * w32.c (pthread_sigmask): New stub.
8491
1692ae2d 84922011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8493
8a6ebd58 8494 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8495 sigprocmask is portable only for single-threaded applications, and
8496 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8497 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8498 (LIBES): Use it.
8499 * callproc.c (Fcall_process):
8500 * process.c (create_process):
8501 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8502 Use pthread_sigmask, not sigprocmask.
123403e4 8503
1b854618
JD
85042011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8505
8506 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8507 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8508 wrong (Bug#8591).
8509
3fe4b549
JD
85102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8511
0ce7e563
JD
8512 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8513 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8514 (xg_hide_tooltip): Fix comment.
8515
3fe4b549
JD
8516 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8517 in registerServicesMenuSendTypes.
8518 (validRequestorForSendType): Don't check ns_return_types.
8519
8520 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8521 ns_return_type.
8522
5df75e47
JR
85232011-07-08 Jason Rumney <jasonr@gnu.org>
8524
22610910
JR
8525 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8526 SH_SHOW for hidden windows (Bug#5482).
8527
5df75e47
JR
8528 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8529 frame struct members of non-existent frames (Bug#6284).
8530
699c10bd
JD
85312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8532
4393663b
JD
8533 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8534 variable firstTime not needed on OSX >= 10.6.
8535 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8536 >= 10.5. Use setKnobProportion, setDoubleValue.
8537
8538 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8539 (MAC_OS_X_VERSION_10_5): Define if not defined.
8540 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8541 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8542 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8543
8544 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8545 cString and lossyCString on OSX >= 10.4.
4393663b 8546
58179cce 8547 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8548 sizeToFit on OSX >= 10.2.
8549
8550 * nsimage.m (allocInitFromFile): Don't use deprecated method
8551 bestRepresentationForDevice on OSX >= 10.6.
8552
8553 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8554 to avoid warning.
8555
8556 * emacs.c: Declare unexec_init_emacs_zone.
8557
a63e0781
JD
8558 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8559
699c10bd
JD
8560 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8561
8562 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8563 on svcsMenu (Bug#8842).
8564
8565 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8566 ns_return_types.
8567 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8568
8569 * nsterm.m (QUTF8_STRING): Declare.
8570 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8571 (validRequestorForSendType): Return type is (id).
8572 Change indexOfObjectIdenticalTo to indexOfObject.
8573 Check if we have local selection before returning self (Bug#8842).
8574 (writeSelectionToPasteboard): Put local selection into paste board
8575 if we have a local selection (Bug#8842).
8576 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8577
8578 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8579 (ns_get_local_selection): Declare.
8580
54e10184
LMI
85812011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8582
9888ff71
LMI
8583 * keymap.c (describe_map_tree): Don't insert a double newline at
8584 the end of the buffer (bug#1169) and return whether we inserted
8585 something.
8586
54e10184
LMI
8587 * callint.c (Fcall_interactively): Change "reading args" to
8588 "providing args" to try to clarify what it does (bug#1010).
8589
15fa4783
KH
85902011-07-07 Kenichi Handa <handa@m17n.org>
8591
8592 * composite.c (composition_compute_stop_pos): Ignore a static
8593 composition starting before CHARPOS (Bug#8915).
8594
8595 * xdisp.c (handle_composition_prop): Likewise.
8596
a8815b00
EZ
85972011-07-07 Eli Zaretskii <eliz@gnu.org>
8598
8599 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8600 (Bug#9015)
8601
ef7b981d 86022011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8603
8604 * character.h (unicode_category_t): New enum type.
8605
8606 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8607 (Qchar_code_property_table): New variable.
8608 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8609 (UNIPROP_COMPRESSED_FORM_P): New macros.
8610 (char_table_ascii): Uncompress the compressed values.
8611 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8612 Uncompress the compressed values.
ac389d0c 8613 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8614 (char_table_ref_and_range): Uncompress the compressed values.
8615 (sub_char_table_set): New arg is_uniprop. Callers changed.
8616 Uncompress the compressed values.
8617 (sub_char_table_set_range): Args changed. Callers changed.
8618 (char_table_set_range): Adjuted for the above change.
8619 (map_sub_char_table): Delete args default_val and parent. Add arg
8620 top. Give decoded values to a Lisp function.
640c8776 8621 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8622 values to a Lisp function. Gcpro more variables.
8623 (uniprop_table_uncompress)
8624 (uniprop_decode_value_run_length): New functions.
8625 (uniprop_decoder, uniprop_decoder_count): New variables.
8626 (uniprop_get_decoder, uniprop_encode_value_character)
8627 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8628 New functions.
8629 (uniprop_encoder, uniprop_encoder_count): New variables.
8630 (uniprop_get_encoder, uniprop_table)
8631 (Funicode_property_table_internal, Fget_unicode_property_internal)
8632 (Fput_unicode_property_internal): New functions.
8633 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8634 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8635 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8636 char-code-property-alist.
8637
640c8776 8638 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8639 Vunicode_category_table.
8640
640c8776 8641 * font.c (font_range): Adjust for the change of
c805dec0
KH
8642 Vunicode_category_table.
8643
76b397fb
DN
86442011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8645
8646 * m/iris4d.h: Remove file, move contents ...
8647 * s/irix6-5.h: ... here.
8648
22b4128e
PE
86492011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8650
8651 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8652 * alloc.c (mark_buffer):
8653 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8654 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8655 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8656 This isn't true in general, and it's particularly not true
8657 if Emacs is configured with --with-wide-int.
8658 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8659 New macros, used in the buffer.c change.
8660
869795d6
JD
86612011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8662
8663 * xsettings.c: Use both GConf and GSettings if both are available.
8664 (store_config_changed_event): Add comment.
8665 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8666 (store_tool_bar_style_changed): New functions.
5e617bc2 8667 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8668 (struct xsettings): Move font inside HAVE_XFT.
8669 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8670 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8671 Move inside HAVE_XFT.
640c8776 8672 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8673 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8674 also.
8675 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8676 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8677 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8678 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8679 (parse_settings): Move check for font inside HAVE_XFT.
8680 (read_settings, apply_xft_settings): Add comment.
8681 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8682 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8683 call store_font_name_changed.
8684 (xft_settings_event): Add comment.
8685 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8686 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8687 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8688 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8689 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8690 (xsettings_get_system_font, xsettings_get_system_normal_font):
8691 Add comment.
869795d6 8692
d8ed26bd
PE
86932011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8694
8695 Random fixes. E.g., (random) never returned negative values.
8696 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8697 subseconds part to the entropy, as that's a bit more random.
8698 Prefer signed to unsigned, since the signedness doesn't matter and
8699 in general we prefer signed. When given a limit, use a
8700 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8701 latter isn't right if USE_2_TAGS_FOR_INTS.
8702 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8703 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8704
cabf1cac
SM
87052011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8706
8707 * textprop.c (text_property_stickiness):
8708 Obey Vtext_property_default_nonsticky.
8709 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8710 * w32fns.c (syms_of_w32fns):
8711 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8712
6e9b2be9
PE
87132011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8714
8715 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8716 This is more efficient than Ffile_directory_p and avoids a minor race.
8717
90186c68
LMI
87182011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8719
7c301272
LMI
8720 * buffer.c (Foverlay_put): Say what the return value is
8721 (bug#7835).
8722
c4f2d8d4
LMI
8723 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8724 is a directory before asking whether to use the file name
8725 (bug#7564).
ad637907
LMI
8726 (barf_or_query_if_file_exists): Make the "File is a directory"
8727 error be more correct.
c4f2d8d4 8728
90186c68
LMI
8729 * fns.c (Frequire): Remove the mention of the .gz files, since
8730 that's installation-specific, but keep the mention of
8731 `get-load-suffixes'.
8732
da64016e
PE
87332011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8736 Report string overflow if the output is too long.
8737
7d47b580
JB
87382011-07-04 Juanma Barranquero <lekktu@gmail.com>
8739
a555cb87
JB
8740 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8741 (syms_of_gnutls): Remove duplicate DEFSYM for
8742 Qgnutls_bootprop_verify_hostname_error, an error for
8743 Qgnutls_bootprop_verify_error (which is no longer used).
8744
7d47b580
JB
8745 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8746 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8747 Also (re)move comments that are misplaced or no longer relevant.
8748
1e49bfab
LMI
87492011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8750
8751 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8752
1485f4c0
CY
87532011-07-03 Chong Yidong <cyd@stupidchicken.com>
8754
8755 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8756 and background color parameters if they have been changed.
8757
a9ab721e
LMI
87582011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8759
8760 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8761
cf7cff57
PE
87622011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8763
2e13213d
PE
8764 * xsettings.c (SYSTEM_FONT): Define only when used.
8765 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8766
cf7cff57
PE
8767 * keymap.c (access_keymap_1): Now static.
8768
7a8e04f7
CY
87692011-07-02 Chong Yidong <cyd@stupidchicken.com>
8770
8771 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8772 leave any prefix arg for the up event (Bug#1586).
8773
61352f62
LMI
87742011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8775
69bb1ef7
LMI
8776 * lread.c (syms_of_lread): Mention single symbols defined by
8777 `defvar' or `defconst' (bug#7154).
8778
61352f62 8779 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8780 (Frequire): Mention get-load-suffixes.
61352f62 8781
28545e04
MR
87822011-07-02 Martin Rudalics <rudalics@gmx.at>
8783
8784 * window.h (window): Remove clone_number slot.
8785 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8786 Remove.
8787 (make_parent_window, make_window, saved_window)
8788 (Fset_window_configuration, save_window_save): Don't deal with
8789 clone numbers.
8790 * buffer.c (Qclone_number): Remove declaration.
8791 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8792
3349e122
SM
87932011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8794
8795 Add multiple inheritance to keymaps.
8796 * keymap.c (Fmake_composed_keymap): New function.
8797 (Fset_keymap_parent): Simplify.
8798 (fix_submap_inheritance): Remove.
8799 (access_keymap_1): New function extracted from access_keymap to handle
8800 embedded parents and handle lists of maps.
8801 (access_keymap): Use it.
8802 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8803 (Fcopy_keymap): Handle embedded parents.
8804 (Fcommand_remapping, define_as_prefix): Simplify.
8805 (Fkey_binding): Simplify.
8806 (syms_of_keymap): Move minibuffer-local-completion-map,
8807 minibuffer-local-filename-completion-map,
8808 minibuffer-local-must-match-map, and
8809 minibuffer-local-filename-must-match-map to Elisp.
8810 (syms_of_keymap): Defsubr make-composed-keymap.
8811 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8812 (parse_menu_item): Trivial simplification.
8813
3279eb87
GM
88142011-07-01 Glenn Morris <rgm@gnu.org>
8815
8816 * Makefile.in (SETTINGS_LIBS): Fix typo.
8817
4550efdf
KI
88182011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8819
8820 * coding.c (Fencode_coding_string): Record the last coding system
8821 used, as the function doc string says (bug#8738).
8822
0949d2b6
JD
88232011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8824
8825 * xsettings.c (store_monospaced_changed): Take new font as arg and
8826 check for change against current_mono_font.
8827 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8828 (emacs_settings_constructor, emacs_settings_get_property)
8829 (emacs_settings_set_property, emacs_settings_class_init)
8830 (emacs_settings_init, gsettings_obj): Remove.
8831 (something_changedCB): New function for HAVE_GSETTINGS.
8832 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8833 with value as argument.
8834 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8835 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8836 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8837 "changed".
8838
8839 * xgselect.c: Add defined (HAVE_GSETTINGS).
8840 (xgselect_initialize): Ditto.
8841
8842 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8843 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8844 xg_select.
8845
bbc6b304
PE
88462011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8847
8848 * eval.c (struct backtrace): Simplify and port the data structure.
8849 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8850 signed bit field, as this assumption is not portable and it makes
8851 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8852 "char debug_on_exit : 1" as this is not portable either; instead,
8853 use the portable "unsigned int debug_on_exit : 1". Remove unused
8854 member evalargs. Remove obsolete comments about cc bombing out.
8855
9851bfc5
JD
88562011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8857
51bb811f 8858 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8859 Let HAVE_GSETTINGS override HAVE_GCONF.
8860 (store_monospaced_changed): New function.
8861 (EMACS_SETTINGS): A new type derived from GObject to handle
8862 GSettings notifications.
8863 (emacs_settings_constructor, emacs_settings_get_property)
8864 (emacs_settings_set_property, emacs_settings_class_init):
8865 New functions.
8866 (gsettings_client, gsettings_obj): New variables.
8867 (GSETTINGS_SCHEMA): New define.
8868 (something_changedCB): Call store_monospaced_changed.
8869 (init_gsettings): New function.
8870 (xsettings_initialize): Call init_gsettings.
8871 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8872 to NULL.
8873
640c8776 8874 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8875 GCONF_CFLAGS/LIBS.
8876
5386012d
MR
88772011-06-29 Martin Rudalics <rudalics@gmx.at>
8878
8879 * window.c (resize_root_window, grow_mini_window)
8880 (shrink_mini_window): Rename Qresize_root_window to
8881 Qwindow_resize_root_window and Qresize_root_window_vertically to
8882 Qwindow_resize_root_window_vertically.
8883
f13e0b08
PE
88842011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8885
8886 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8887
94515237
JB
88882011-06-27 Juanma Barranquero <lekktu@gmail.com>
8889
8890 * makefile.w32-in: Redesign dependencies so they reflect more
8891 clearly which files are directly included by each source file,
8892 and not through other includes.
8893
e43b6e43
MR
88942011-06-27 Martin Rudalics <rudalics@gmx.at>
8895
8896 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8897 (sort_overlays, overlay_strings): When an overlay's clone number
8898 matches the window's clone number process the overlay even if
8899 the overlay's window property doesn't match the current window.
8900
d68443dc
MR
8901 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8902 (Fwindow_hchild): Rename to Fwindow_left_child.
8903 (Fwindow_next): Rename to Fwindow_next_sibling.
8904 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8905 (resize_window_check): Rename to window_resize_check.
8906 (resize_window_apply): Rename to window_resize_apply.
8907 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8908 (Fdelete_other_windows_internal, resize_frame_windows)
8909 (Fsplit_window_internal, Fdelete_window_internal)
8910 (grow_mini_window, shrink_mini_window)
8911 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8912
c7e73be5
JD
89132011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8914
8915 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8916 (emacs_fixed_set_min_size): Remove.
8917 (emacs_fixed_new): Take frame as argument.
8918
8919 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8920 (_EmacsFixedPrivate): Remove minwidth/height.
8921 Add struct frame *f.
8922 (emacs_fixed_init): Initialize priv->f.
8923 (get_parent_class, emacs_fixed_set_min_size): Remove.
8924 (emacs_fixed_new): Set priv->f to argument.
8925 (emacs_fixed_get_preferred_width)
8926 (emacs_fixed_get_preferred_height): Use min_width/height from
8927 frames size_hint to set minimum and natural (Bug#8919).
8928 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8929 and use min_width/height from frames size_hint to set
8930 min_width/height (Bug#8919).
8931
8932 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8933 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8934 Fix indentation.
c7e73be5 8935
cf99dcf8
EZ
89362011-06-26 Eli Zaretskii <eliz@gnu.org>
8937
8938 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8939 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8940 called at ZV.
8941
029529ac
CY
89422011-06-26 Chong Yidong <cyd@stupidchicken.com>
8943
8944 * process.c (wait_reading_process_output): Bypass select if
8945 waiting for a cell while ignoring keyboard input, and input is
8946 pending. Suggested by Jan Djärv (Bug#8869).
8947
7a7ef429
PE
89482011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8949
8950 Use gnulib's dup2 module instead of rolling our own.
8951 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8952
11fdef7d 89532011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8954
8955 * dispnew.c (scrolling_window): Before scrolling, turn off a
8956 mouse-highlight in the window being scrolled.
8957
cd3520a4
JB
89582011-06-24 Juanma Barranquero <lekktu@gmail.com>
8959
8960 Move DEFSYM to lisp.h and use everywhere.
8961
8962 * character.h (DEFSYM): Move declaration...
8963 * lisp.h (DEFSYM): ...here.
8964
8965 * gnutls.c:
8966 * minibuf.c:
8967 * w32menu.c:
8968 * w32proc.c:
8969 * w32select.c: Don't include character.h.
8970
8971 * alloc.c (syms_of_alloc):
8972 * buffer.c (syms_of_buffer):
8973 * bytecode.c (syms_of_bytecode):
8974 * callint.c (syms_of_callint):
8975 * casefiddle.c (syms_of_casefiddle):
8976 * casetab.c (init_casetab_once):
8977 * category.c (init_category_once, syms_of_category):
8978 * ccl.c (syms_of_ccl):
8979 * cmds.c (syms_of_cmds):
8980 * composite.c (syms_of_composite):
8981 * dbusbind.c (syms_of_dbusbind):
8982 * dired.c (syms_of_dired):
8983 * dispnew.c (syms_of_display):
8984 * doc.c (syms_of_doc):
8985 * editfns.c (syms_of_editfns):
8986 * emacs.c (syms_of_emacs):
8987 * eval.c (syms_of_eval):
8988 * fileio.c (syms_of_fileio):
8989 * fns.c (syms_of_fns):
8990 * frame.c (syms_of_frame):
8991 * fringe.c (syms_of_fringe):
8992 * insdel.c (syms_of_insdel):
8993 * keymap.c (syms_of_keymap):
8994 * lread.c (init_obarray, syms_of_lread):
8995 * macros.c (syms_of_macros):
8996 * msdos.c (syms_of_msdos):
8997 * print.c (syms_of_print):
8998 * process.c (syms_of_process):
8999 * search.c (syms_of_search):
9000 * sound.c (syms_of_sound):
9001 * syntax.c (init_syntax_once, syms_of_syntax):
9002 * terminal.c (syms_of_terminal):
9003 * textprop.c (syms_of_textprop):
9004 * undo.c (syms_of_undo):
9005 * w32.c (globals_of_w32):
9006 * window.c (syms_of_window):
9007 * xdisp.c (syms_of_xdisp):
9008 * xfaces.c (syms_of_xfaces):
9009 * xfns.c (syms_of_xfns):
9010 * xmenu.c (syms_of_xmenu):
9011 * xsettings.c (syms_of_xsettings):
9012 * xterm.c (syms_of_xterm): Use DEFSYM.
9013
4228cf16
TZ
90142011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
9015
cd3520a4 9016 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 9017
7fcccf1e
PE
90182011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9019
7efb4e0e
PE
9020 Integer and buffer overflow fixes (Bug#8873).
9021
ff5844ad
PE
9022 * print.c (printchar, strout): Check for string overflow.
9023 (PRINTPREPARE, printchar, strout):
9024 Don't set size unless allocation succeeds.
9025
90532f02
PE
9026 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
9027 for sizes. Check for string overflow more accurately.
9028 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
9029
6d84508d
PE
9030 * macros.c: Integer and buffer overflow fixes.
9031 * keyboard.h (struct keyboard.kbd_macro_bufsize):
9032 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
9033 Use ptrdiff_t, not int, for sizes.
9034 Don't increment bufsize until after realloc succeeds.
9035 Check for size-calculation overflow.
9036 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
9037
437b2cb4
PE
9038 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
9039
8b9ac8b4
PE
9040 * lread.c: Integer overflow fixes.
9041 (read_integer): Radix is now EMACS_INT, not int,
9042 to improve quality of diagnostics for out-of-range radices.
9043 Calculate buffer size correctly for out-of-range radices.
9044 (read1): Check for integer overflow in radices, and in
9045 read-circle numbers.
82cb60d3
PE
9046 (read_escape): Avoid int overflow.
9047 (Fload, openp, read_buffer_size, read1)
9048 (substitute_object_recurse, read_vector, read_list, map_obarray):
9049 Use ptrdiff_t, not int, for sizes.
9050 (read1): Use EMACS_INT, not int, for sizes.
20270765 9051 Check for size overflow.
8b9ac8b4 9052
7fcccf1e
PE
9053 * image.c (cache_image): Check for size arithmetic overflow.
9054
bfbbd7e7
PE
9055 * lread.c: Integer overflow issues.
9056 (saved_doc_string_size, saved_doc_string_length)
9057 (prev_saved_doc_string_size, prev_saved_doc_string_length):
9058 Now ptrdiff_t, not int.
9059 (read1): Don't assume doc string length fits in int. Check for
9060 out-of-range doc string lengths.
9061 (read_list): Don't assume file position fits in int.
39019e54 9062 (read_escape): Check for hex character overflow.
bfbbd7e7 9063
4e323265
LL
90642011-06-22 Leo Liu <sdl.web@gmail.com>
9065
9066 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
9067 Move to minibuffer.el.
9068
85fece3e
PE
90692011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9070
20b84ce9 9071 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
9072 The following patches are for when GLYPH_DEBUG && !XASSERT.
9073 * dispextern.h (trace_redisplay_p, dump_glyph_string):
9074 * dispnew.c (flush_stdout):
9075 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
9076 Mark as externally visible.
9077 * dispnew.c (check_window_matrix_pointers): Now static.
9078 * dispnew.c (window_to_frame_vpos):
9079 * xfns.c (unwind_create_frame):
9080 * xterm.c (x_check_font): Remove unused local.
9081 * scroll.c (CHECK_BOUNDS):
9082 * xfaces.c (cache_fache): Rename local to avoid shadowing.
9083 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
9084 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
9085 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
9086 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
9087 Now static.
9088 (debug_method_add): Use va_list and vsprintf rather than relying
9089 on undefined behavior with wrong number of arguments.
9090 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
9091 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
9092 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
9093 since we're not interested in debugging glyphs with old libraries.
9094 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
9095 GCC 4.6.0's static checking.
9096
0766b489
PE
90972011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9098
31fd4b32
PE
9099 Integer overflow and signedness fixes (Bug#8873).
9100 A few related buffer overrun fixes, too.
9101
b79e8648
PE
9102 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
9103
0766b489
PE
9104 * dispextern.h (struct face.stipple):
9105 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
9106 (x_bitmap_mask, x_allocate_bitmap_record)
9107 (x_create_bitmap_from_data, x_create_bitmap_from_file)
9108 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
9109 (x_create_bitmap_from_xpm_data):
9110 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
9111 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
9112 (.bitmaps_last):
9113 * xfaces.c (load_pixmap):
9114 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
9115 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
9116 (.bitmaps_last, struct x_output.icon_bitmap):
9117 Use ptrdiff_t, not int, for bitmap indexes.
9118 (x_allocate_bitmap_record): Check for size overflow.
9119 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
9120
b081724f
PE
9121 Use ptrdiff_t, not int, for overlay counts.
9122 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
9123 * editfns.c (overlays_around, get_pos_property):
9124 * textprop.c (get_char_property_and_overlay):
9125 * xdisp.c (next_overlay_change, note_mouse_highlight):
9126 * xfaces.c (face_at_buffer_position):
21514da7
PE
9127 * buffer.c (OVERLAY_COUNT_MAX): New macro.
9128 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
9129 (Fnext_overlay_change, Fprevious_overlay_change)
9130 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 9131 Use ptrdiff_t, not int, for sizes.
21514da7 9132 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 9133
3de73e5e
PE
9134 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
9135
2606c57b
PE
9136 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
9137 (x_session_initialize): Do not assume string length fits in int.
9138
aaafe47a
PE
9139 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
9140 This is unlikely, but can occur if DPI is outlandish.
9141
2674ddc8 9142 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
9143 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
9144
28154962
PE
9145 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
9146 * xrdb.c (magic_file_p, search_magic_path):
9147 Omit last arg SUFFIX; it was always 0. All callers changed.
9148 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
9149
7de51af5
PE
9150 * xfont.c (xfont_match): Avoid need for strlen.
9151
25ed6cc3
PE
9152 * xfns.c: Don't assume strlen fits in int.
9153 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
9154
4eab31dd
PE
9155 * xdisp.c (message_log_check_duplicate): Return intmax_t,
9156 not unsigned long, as we prefer signed integers. All callers changed.
9157 Detect integer overflow in repeat count.
9158 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 9159 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 9160
171e2a58
PE
9161 * termcap.c: Don't assume sizes fit in int and never overflow.
9162 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
9163 (gobble_line): Check for size-calculation overflow.
9164
ad39faca 9165 * minibuf.c (Fread_buffer):
6e5bb2dc 9166 * lread.c (intern, intern_c_string):
74ca2eb3
PE
9167 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
9168 Don't assume string length fits in int.
9169
52c61c22 9170 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
9171 * gtkutil.c (style_changed_cb): Avoid need for strlen.
9172
b5b8c9e5
PE
9173 * font.c: Don't assume string length fits in int.
9174 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
9175 Use ptrdiff_t, not int.
ccd6111c
PE
9176 (font_intern_prop): Don't assume string length fits in int.
9177 Don't assume integer property fits in fixnum.
9178 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 9179
882f0d81 9180 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 9181 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
9182 Reformulate so as not to need the command string.
9183 Invoke gzip -cd rather than gunzip, as it's more portable.
9184 (lock_info_type, lock_file_1, lock_file):
9185 Don't assume pid_t and time_t fit in unsigned long.
9186 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
9187 (current_lock_owner): Prefer signed type for sizes.
9188 Use memcpy, not strncpy, where memcpy is what is really wanted.
9189 Don't assume (via atoi) that time_t and pid_t fit in int.
9190 Check for time_t and/or pid_t out of range, e.g., via a network share.
9191 Don't alloca where an auto var works fine.
9192
93f4cf88
PE
9193 * fileio.c: Fix some integer overflow issues.
9194 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
9195 Don't assume string length fits in int.
9196 (directory_file_name): Don't assume string length fits in long.
9197 (make_temp_name): Don't assume pid fits in int, or that its print
9198 length is less than 20.
9199
f3e92b69
PE
9200 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
9201
1bfdaf10
PE
9202 * coding.c (make_subsidiaries): Don't assume string length fits in int.
9203
35016e9a
PE
9204 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
9205
3d1e65a1
PE
9206 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
9207 We prefer signed integers, even for size calculations.
9208
0b963a93
PE
9209 * emacs.c: Don't assume string length fits in 'int'.
9210 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
9211 (main): Don't invoke strlen when not needed.
9212
573f4b54
PE
9213 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
9214 (XD_DEBUG_MESSAGE): Don't waste a byte.
9215
989f33ba
PE
9216 * callproc.c (getenv_internal_1, getenv_internal)
9217 (Fgetenv_internal):
965d34eb
PE
9218 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
9219
e4d29b33
PE
9220 * lread.c (invalid_syntax): Omit length argument.
9221 All uses changed. This doesn't fix a bug, but it simplifies the
9222 code away from its former Hollerith-constant appearance, and it's
9223 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 9224 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 9225
eb49b136
PE
9226 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
9227 This didn't break anything, but it didn't help either.
9228 It's confusing to put a bogus integer in a place where the actual
9229 value does not matter.
9f62aeb1 9230 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 9231 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 9232
15375a22
PE
9233 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
9234 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
9235 implementation.
b61cc01c
PE
9236 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
9237 We prefer signed types, and the value cannot exceed the EMACS_INT
9238 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
9239 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
9240 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
9241 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 9242
53b2623d
PE
9243 * indent.c (sane_tab_width): New function.
9244 (current_column, scan_for_column, Findent_to, position_indentation)
9245 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 9246 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 9247
51cab52b 9248 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 9249
f2ed8a70
PE
9250 * lisp.h (lint_assume): New macro.
9251 * composite.c (composition_gstring_put_cache):
9252 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
9253
abe80cc6
PE
9254 * editfns.c, insdel.c:
9255 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 9256
b02c740e
PE
9257 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9258
ebc96716
PE
9259 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9260
b4e50fa0 9261 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 9262 Use much-faster test for byte-length change.
311d5d7c 9263 Don't assume string byte-length fits in 'int'.
a4cf38e4 9264 Check that character arg fits in 'int'.
85461888 9265 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 9266
c0c1ee9f
PE
9267 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9268
a498d7f4
PE
9269 * fns.c (concat): Catch string overflow earlier.
9270 Do not rely on integer wraparound.
9271
51cab52b
PE
9272 * dispextern.h (struct it.overlay_strings_charpos)
9273 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
9274 * xdisp.c (forward_to_next_line_start)
9275 (back_to_previous_visible_line_start)
9276 (reseat_at_next_visible_line_start, next_element_from_buffer):
9277 Don't arbitrarily truncate the value of 'selective' to int.
9278
76031fad
PE
9279 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9280
5eb55db9
PE
9281 * composite.c: Don't truncate sizes to 'int'.
9282 (composition_gstring_p, composition_reseat_it)
9283 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
9284 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9285 not EMACS_UINT, for indexes.
5eb55db9 9286
0703a717
PE
9287 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9288
d6202519
PE
9289 * buffer.c: Include <verify.h>.
9290 (struct sortvec.priority, struct sortstr.priority):
8961a454 9291 Now EMACS_INT, not int.
c20998a7 9292 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
9293 (struct sortstr.size, record_overlay_string)
9294 (struct sortstrlist.size, struct sortlist.used):
9295 Don't truncate size to int.
9296 (record_overlay_string): Check for size-calculation overflow.
d6202519 9297 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 9298
d5a19415
JM
92992011-06-22 Jim Meyering <meyering@redhat.com>
9300
029529ac 9301 Don't leak an XBM-image-sized buffer
d5a19415
JM
9302 * image.c (xbm_load): Free the image buffer after using it.
9303
a9041e6c
PE
93042011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9305
9306 Port to Sun C.
9307 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9308 that Sun C diagnosed.
9309 * fns.c (secure_hash): Fix pointer signedness issue.
9310 * intervals.c (static_offset_intervals): New function.
9311 (offset_intervals): Use it.
9312
7f3f739f
LL
93132011-06-21 Leo Liu <sdl.web@gmail.com>
9314
9315 * deps.mk (fns.o):
9316 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9317 sha512.h.
9318
9319 * fns.c (secure_hash): Rename from crypto_hash_function and change
9320 the first arg to accept symbols.
5b66d427 9321 (Fsecure_hash): New primitive.
7f3f739f
LL
9322 (syms_of_fns): New symbols.
9323
76147d94
DD
93242011-06-20 Deniz Dogan <deniz@dogan.se>
9325
9326 * process.c (Fset_process_buffer): Clarify return value in
9327 docstring.
9328
7d7d0045
CY
93292011-06-18 Chong Yidong <cyd@stupidchicken.com>
9330
9331 * dispnew.c (add_window_display_history): Use BVAR.
9332
9333 * xdisp.c (debug_method_add): Use BVAR.
9334 (check_window_end, dump_glyph_matrix, dump_glyph)
9335 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
9336
9337 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
9338 Likewise.
9339
9340 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
9341 check till after the cache is created in init_frame_faces.
9342
ff2bc410
SM
93432011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
9344
9345 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9346
28177add
PE
93472011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9348
dd3482fe
PE
9349 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9350 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9351 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9352
393d71f3 9353 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9354 * fileio.c (Finsert_file_contents):
9355 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9356 Remove the old (too-loose) buffer overflow checks.
9357 They weren't needed, since make_gap checks for buffer overflow.
9358 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9359 The old code merely checked for Emacs fixnum overflow, and relied
9360 on undefined (wraparound) behavior. The new code avoids undefined
9361 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9362
2e6813b0 9363 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9364 Tune. Don't use wider integers than needed. Don't use alloca.
9365 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9366
599a9e4f
PE
9367 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9368
99561444
PE
9369 * insdel.c, lisp.h (buffer_overflow): New function.
9370 (insert_from_buffer_1, replace_range, replace_range_2):
9371 * insdel.c (make_gap_larger):
9372 * editfns.c (Finsert_char):
9373 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9374
28177add
PE
9375 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9376
e69dafad
PE
93772011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9378
4baa020d 9379 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9380
b1c46f02
PE
9381 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9382 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9383
e69dafad
PE
9384 * fileio.c: Don't assume EMACS_INT fits in off_t.
9385 (emacs_lseek): New static function.
9386 (Finsert_file_contents, Fwrite_region): Use it.
9387 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9388
566684ea
PE
9389 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9390
e6966cd6
PE
9391 * fns.c: Don't overflow int when computing a list length.
9392 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9393 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9394 truncation on 64-bit hosts. Check for QUIT every
9395 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9396 faster and is responsive enough.
9397 (Flength): Report an error instead of overflowing an integer.
9398 (Fsafe_length): Return a float if the value is not representable
9399 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9400 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9401 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9402
dd0b0efb
PE
9403 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9404 (header_size, word_size): New constants.
9405 (allocate_vectorlike): Don't check size overflow here.
9406 (allocate_vector): Check it here instead, since this is the only
9407 caller of allocate_vectorlike that could cause overflow.
9408 Check that the new vector's length is representable as a fixnum.
9409
86fe5cfe
PE
9410 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9411 The previous code was bogus. For example, next_almost_prime (32)
9412 returned 39, which is undesirable as it is a multiple of 3; and
9413 next_almost_prime (24) returned 25, which is a multiple of 5 so
9414 why was the code bothering to check for multiples of 7?
9415
80e88859
PE
9416 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9417
4a2f0ad6
PE
9418 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9419
f66c7cf8
PE
9420 Variadic C functions now count arguments with ptrdiff_t.
9421 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9422 Back then I didn't know that the Emacs coding style prefers signed int.
9423 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9424 were being counted with int, which may truncate counts on 64-bit
9425 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9426 * lisp.h (struct Lisp_Subr.function.aMANY)
9427 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9428 Arg counts are now ptrdiff_t, not size_t.
9429 All variadic functions and their callers changed accordingly.
9430 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9431 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9432 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9433 * callint.c (Fcall_interactively): Check arg count for overflow,
9434 to avoid potential buffer overrun. Use signed char, not 'int',
9435 for 'varies' array, so that we needn't bother to check its size
9436 calculation for overflow.
9437 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9438 * eval.c (apply_lambda):
9439 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9440 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9441 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9442
a1759b76
PE
9443 * callint.c (Fcall_interactively): Don't use index var as event count.
9444
d96be9fc
PE
9445 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9446 * mem-limits.h (SIZE): Remove; no longer used.
9447
a690a978 9448 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9449
578c21e6
PE
9450 Remove unnecessary casts.
9451 * xterm.c (x_term_init):
9452 * xfns.c (x_set_border_pixel):
9453 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9454 These aren't needed now that we assume ANSI C.
9455
96f53c6c
PE
9456 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9457 It's more likely to cause problems (due to unsigned overflow)
9458 than to cure them.
9459
83c77d31
PE
9460 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9461
ee2079f1
PE
9462 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9463
6da65536
PE
9464 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9465
7147c4a4
PE
9466 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9467
193e32d9
PE
9468 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9469
e5533da6
PE
9470 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9471
9910e595
PE
9472 GLYPH_CODE_FACE returns EMACS_INT, not int.
9473 * dispextern.h (merge_faces):
9474 * xfaces.c (merge_faces):
01103c44
PE
9475 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9476 Don't assume EMACS_INT fits in int.
9910e595 9477
2638320e
PE
9478 * character.h (CHAR_VALID_P): Remove unused parameter.
9479 * fontset.c, lisp.h, xdisp.c: All uses changed.
9480
045eb8d9
PE
9481 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9482
c1f134b5
PE
9483 * fns.c (concat): Minor tuning based on overflow analysis.
9484 This doesn't fix any bugs. Use int to hold character, instead
9485 of constantly refetching from Emacs object. Use XFASTINT, not
9486 XINT, for value known to be a character. Don't bother comparing
9487 a single byte to 0400, as it's always less.
9488
395fcb93 9489 * floatfns.c (Fexpt):
327eeec8
PE
9490 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9491
abbd3d23
PE
9492 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9493 for characters.
9494
684a03ef
PE
9495 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9496
0fed43f3
PE
9497 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9498 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9499 incorrectly succeed when S was a string, because 4294967386 was
9500 truncated before it was used.
9501
8fd02eb7
PE
9502 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9503 Otherwise, an out-of-range integer could cause undefined behavior
9504 on a 64-bit host.
9505
f8c86b69
PE
9506 * composite.c: Use int, not EMACS_INT, for characters.
9507 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9508 EMACS_INT, for values that are known to be in character range.
9509 This doesn't fix any bugs but is the usual style inside Emacs and
9510 may generate better code on 32-bit machines.
9511
34206dd2
PE
9512 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9513 This is for reasons similar to the recent CHAR_STRING fix.
9514 * charset.c (Fencode_char): Check that character arg is actually
9515 a character. Pass an int to ENCODE_CHAR.
9516 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9517 wider than 'int', as a compile-time check to prevent future regressions
9518 in this area.
9519
c5958d4c 9520 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9521
9522 Make sure a 64-bit char is never passed to CHAR_STRING.
9523 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9524 by silently ignoring the top 32 bits, allowing some values
9525 that were far too large to be valid characters.
9526 * character.h: Include <verify.h>.
9527 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9528 arguments are no wider than unsigned, as a compile-time check
9529 to prevent future regressions in this area.
9530 * data.c (Faset):
01103c44 9531 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9532 (Fsubst_char_in_region):
9533 * fns.c (concat):
9534 * xdisp.c (decode_mode_spec_coding):
9535 Adjust to CHAR_STRING's new requirement.
9536 * editfns.c (Finsert_char, Fsubst_char_in_region):
9537 * fns.c (concat): Check that character args are actually
9538 characters. Without this test, these functions did the wrong
9539 thing with wildly out-of-range values on 64-bit hosts.
9540
d37ca623
PE
9541 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9542 These casts should not be needed on 32-bit hosts, either.
9543 * keyboard.c (read_char):
9544 * lread.c (Fload): Remove casts to unsigned.
9545
ea204efb
PE
9546 * lisp.h (UNSIGNED_CMP): New macro.
9547 This fixes comparison bugs on 64-bit hosts.
9548 (ASCII_CHAR_P): Use it.
9549 * casefiddle.c (casify_object):
01103c44 9550 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9551 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9552 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9553 * dispextern.h (FACE_FROM_ID):
9554 * keyboard.c (read_char): Use UNSIGNED_CMP.
9555
41cb286c
PE
9556 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9557 not to EMACS_INT, to avoid GCC warning.
9558
4a1b9832
PE
9559 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9560
55daad71
PE
9561 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9562 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9563 isn't needed on 32-bit machines.
8f95c75c 9564
01103c44
PE
9565 * buffer.c (Fgenerate_new_buffer_name):
9566 Use EMACS_INT for count, not int.
0ceccced 9567 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9568
9569 * data.c (Qcompiled_function): Now static.
9570
c6f072e7
PE
9571 * window.c (window_body_lines): Now static.
9572
20ce5912
PE
9573 * image.c (gif_load): Rename local to avoid shadowing.
9574
9c4c5f81
PE
9575 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9576 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9577 * alloc.c (make_save_value): Integer argument is now of type
9578 ptrdiff_t, not int.
9579 (mark_object): Use ptrdiff_t, not int.
9580 * lisp.h (pD): New macro.
9581 * print.c (print_object): Use it.
9582
c0c5c8ae
PE
9583 * alloc.c: Use EMACS_INT, not int, to count objects.
9584 (total_conses, total_markers, total_symbols, total_vector_size)
9585 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9586 (total_free_floats, total_floats, total_free_intervals)
9587 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9588 Now EMACS_INT, not int. All uses changed.
9589 (Fgarbage_collect): Compute overall total using a double, so that
9590 integer overflow is less likely to be a problem. Check for overflow
9591 when converting back to an integer.
5a25e253
PE
9592 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9593 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9594 These were 'int' variables that could overflow on 64-bit hosts;
9595 they were never used, so remove them instead of repairing them.
211a0b2a 9596 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9597 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9598 Previously, this ceilinged at INT_MAX, but that doesn't work on
9599 64-bit machines.
e46bb31a 9600 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9601
c78baabf 9602 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9603 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9604 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9605 when a (possibly-narrower) signed value would do just as well.
9606 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9607
c9d624c6
PE
9608 * alloc.c: Catch some string size overflows that we were missing.
9609 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9610 for convenience in STRING_BYTES_MAX.
9611 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9612 The definition here is exact; the one in lisp.h was approximate.
9613 (allocate_string_data): Check for string overflow. This catches
9614 some instances we weren't catching before. Also, it catches
9615 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9616 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9617 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9618
c9d624c6
PE
9619 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9620 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9621 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9622
353032ce
PE
9623 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9624
2bccce07
PE
9625 * alloc.c (Fmake_string): Check for out-of-range init.
9626
0ac30604
SM
96272011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9628
9629 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9630
c195f2de
JD
96312011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9632
9633 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9634 xg_get_default_scrollbar_width.
9635
9636 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9637 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9638 (style_changed_cb): Call update_theme_scrollbar_width and call
9639 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9640 all frames (Bug#8505).
9641 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9642 Call gtk_window_set_resizable if HAVE_GTK3.
9643 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9644 and height if HAVE_GTK3 (Bug#8505).
9645 (scroll_bar_width_for_theme): New variable.
9646 (update_theme_scrollbar_width): New function.
9647 (xg_get_default_scrollbar_width): Move code to
9648 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9649 (xg_initialize): Call update_theme_scrollbar_width.
9650
9651 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9652
9653 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9654
e10ac9f1
MR
96552011-06-12 Martin Rudalics <rudalics@gmx.at>
9656
9657 * frame.c (make_frame): Call other_buffer_safely instead of
9658 other_buffer.
9659
9660 * window.c (temp_output_buffer_show): Call display_buffer with
9661 second argument Vtemp_buffer_show_specifiers and reset latter
9662 immediately after the call.
9663 (Vtemp_buffer_show_specifiers): New variable.
9664 (auto_window_vscroll_p, next_screen_context_lines)
9665 (Vscroll_preserve_screen_position): Remove leading asterisks from
9666 doc-strings.
9667
2d3c217e 96682011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9669
7b7f97e8 9670 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9671 * buffer.c (Qclone_number): Remove for now, as it's unused.
9672 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9673 (record_buffer): Remove unused local.
9674 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9675 (set_frame_buffer_list): Remove; unused.
9676 * frame.h (other_visible_frames): Remove decl.
9677 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9678 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9679 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9680 if HAVE_GPM.
9681 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9682 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9683 Define only if HAVE_GPM.
9684 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9685 (update_hints_inhibit): Remove; never set. All uses removed.
9686 * widgetprv.h (emacsFrameClassRec): Remove decl.
9687 * window.c (delete_deletable_window): Now returns void, since it
9688 wasn't returning anything.
9689 (compare_window_configurations): Remove unused locals.
9690 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9691 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9692 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9693 the same widths as pointers. This follows up on the 2011-05-06 patch.
9694 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9695 * xterm.h: Likewise.
9696 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9697
1384b89e
JB
96982011-06-12 Juanma Barranquero <lekktu@gmail.com>
9699
9700 * makefile.w32-in: Update dependencies.
9701 (LISP_H): Add lib/intprops.h.
9702
1100a63c
CY
97032011-06-11 Chong Yidong <cyd@stupidchicken.com>
9704
9705 * image.c (gif_load): Add animation frame delay to the metadata.
9706 (syms_of_image): Use DEFSYM. New symbol `delay'.
9707
6198ccd0
MR
97082011-06-11 Martin Rudalics <rudalics@gmx.at>
9709
9710 * window.c (delete_deletable_window): Re-add.
9711 (Fset_window_configuration): Rewrite to handle dead buffers and
9712 consequently deletable windows.
9713 (window_tree, Fwindow_tree): Remove. Supply functionality in
9714 window.el.
9715 (compare_window_configurations): Simplify code.
9716
b6e3633c
AS
97172011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9718
1ab0dee5
AS
9719 * image.c (imagemagick_load_image): Fix type mismatch.
9720 (Fimagemagick_types): Likewise.
9721
b6e3633c
AS
9722 * window.h (replace_buffer_in_windows): Declare.
9723
9397e56f
MR
97242011-06-11 Martin Rudalics <rudalics@gmx.at>
9725
9726 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9727 Qclone_number. Remove external declaration of Qdelete_window.
9728 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9729 code.
640c8776
SM
9730 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9731 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9732 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9733 buffer list implementation.
9734 (other_buffer_safely): New function.
9735 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9736 calls to replace_buffer_in_windows and
9737 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9738 if allowed.
9739 (record_buffer): Inhibit quitting and rewrite using quittable
9740 functions. Run Qbuffer_list_update_hook if allowed.
9741 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9742 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9743 Move switch-to-buffer to window.el.
9397e56f
MR
9744 (bury-buffer): Move to window.el.
9745 (Vbuffer_list_update_hook): New variable.
9746
9747 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9748 section.
9749
9750 * window.h (resize_frame_windows): Move up in code.
9751 (Fwindow_frame): Remove EXFUN.
9752 (replace_buffer_in_all_windows): Remove prototype.
9753 (replace_buffer_in_windows_safely): Add prototype.
9754
9755 * window.c: Declare Qdelete_window static again. Move down
9756 declaration of select_count.
9757 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9758 (Fother_window): Move to window.el.
9759 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9760 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9761 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9762 window.el.
9763 (replace_buffer_in_windows): Implement by calling
9764 Qreplace_buffer_in_windows.
9765 (replace_buffer_in_all_windows): Remove with some functionality
9766 moved into replace_buffer_in_windows_safely.
9767 (replace_buffer_in_windows_safely): New function.
9768 (select_window_norecord, select_frame_norecord): Move in front
9769 of run_window_configuration_change_hook. Remove now obsolete
9770 declarations.
640c8776
SM
9771 (Fset_window_buffer): Rewrite doc-string.
9772 Call Qrecord_window_buffer.
9397e56f
MR
9773 (keys_of_window): Move binding for other-window to window.el.
9774
b50691aa
CY
97752011-06-11 Chong Yidong <cyd@stupidchicken.com>
9776
9777 * dispextern.h (struct image): Replace data member, whose int_val
9778 and ptr_val fields were not used by anything, with a single
9779 lisp_val object.
9780
9781 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9782 (gif_clear_image, gif_load, imagemagick_load_image)
9783 (gs_clear_image, gs_load): Callers changed.
9784
3f754b86
PE
97852011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9786
cca69397
PE
9787 * buffer.h: Include <time.h>, for time_t.
9788 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9789
109e28d0
PE
9790 Fix minor problems found by static checking.
9791
60737f02
PE
9792 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9793
4b66faf3
PE
9794 Make identifiers static if they are not used in other modules.
9795 * data.c (Qcompiled_function, Qframe, Qvector):
9796 * image.c (QimageMagick, Qsvg):
9797 * minibuf.c (Qmetadata):
9798 * window.c (resize_window_check, resize_root_window): Now static.
9799 * window.h (resize_window_check, resize_root_window): Remove decls.
9800
109e28d0
PE
9801 * window.c (window_deletion_count, delete_deletable_window):
9802 Remove; unused.
46a4ce9e
PE
9803 (window_body_lines): Now static.
9804 (Fdelete_other_windows_internal): Mark vars as initialized.
9805 Make sure 'resize_failed' is initialized.
9806 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9807 (resize_window_apply): Remove unused local.
9808 * window.h (delete_deletable_window): Remove decl.
9809
109e28d0 9810 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9811 (imagemagick_load_image): Fix pointer signedness problem by changing
9812 last arg from unsigned char * to char *. All uses changed.
9813 Also, fix a local for similar reasons.
9814 Remove unused locals. Remove locals to avoid shadowing.
9815 (fn_rsvg_handle_free): Remove; unused.
9816 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9817 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9818
3f754b86
PE
9819 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9820
2547adb1
CY
98212011-06-10 Chong Yidong <cyd@stupidchicken.com>
9822
9823 * image.c (gif_load): Fix omitted cast error introduced by
9824 2011-06-06 change.
9825
2c8e37d4
MR
98262011-06-10 Martin Rudalics <rudalics@gmx.at>
9827
9828 * window.h (resize_proportionally, orig_total_lines)
9829 (orig_top_line): Remove from window structure.
9830 (set_window_height, set_window_width, change_window_heights)
9831 (Fdelete_window): Remove prototypes.
9832 (resize_frame_windows): Remove duplicate declaration.
9833
440a42e3
EZ
98342011-06-10 Eli Zaretskii <eliz@gnu.org>
9835
9836 * window.h (resize_frame_windows, resize_window_check)
9837 (delete_deletable_window, resize_root_window)
9838 (resize_frame_windows): Declare prototypes.
9839
9840 * window.c (resize_window_apply): Make definition be "static" to
9841 match the prototype.
9842
562dd5e9
MR
98432011-06-10 Martin Rudalics <rudalics@gmx.at>
9844
9845 * window.c: Remove declarations of Qwindow_size_fixed,
9846 window_min_size_1, window_min_size_2, window_min_size,
9847 size_window, window_fixed_size_p, enlarge_window, delete_window.
9848 Remove static from declaration of Qdelete_window, it's
9849 temporarily needed by Fbury_buffer.
9850 (replace_window): Don't assign orig_top_line and
9851 orig_total_lines.
9852 (Fdelete_window, delete_window): Remove. Window deletion is
9853 handled by window.el.
640c8776
SM
9854 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9855 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9856 (Fdelete_other_windows): Remove. Deleting other windows is
9857 handled by window.el.
9858 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9859 handled in window.el.
9860 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9861 Window minimum sizes are handled in window.el.
9862 (shrink_windows, size_window, set_window_height)
9863 (set_window_width, change_window_heights, window_height)
9864 (window_width, CURBEG, CURSIZE, enlarge_window)
9865 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9866 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9867 handled in window.el.
9868 (make_dummy_parent): Rename to make_parent_window and give it a
9869 second argument horflag.
9870 (make_window): Don't set resize_proportionally any more.
9871 (Fsplit_window): Remove. Windows are split in window.el.
9872 (save_restore_action, save_restore_orig_size)
9873 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9874 Resize mini windows in window.el.
9875 (grow_mini_window, shrink_mini_window): Implement by calling
9876 Qresize_root_window_vertically, resize_window_check and
9877 resize_window_apply.
640c8776
SM
9878 (saved_window, Fset_window_configuration, save_window_save):
9879 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9880 resize_proportionally.
9881 (window_min_height, window_min_width): Move to window.el.
9882 (keys_of_window): Move bindings for delete-other-windows,
9883 split-window, delete-window and enlarge-window to window.el.
9884
9885 * buffer.c: Temporarily extern Qdelete_window.
9886 (Fbury_buffer): Temporarily call Qdelete_window instead of
9887 Fdelete_window (Fbury_buffer will move to window.el soon).
9888
9889 * frame.c (set_menu_bar_lines_1): Remove code handling
9890 orig_top_line and orig_total_lines.
9891
9892 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9893 set_window_height but set heights directly.
9894 (change_frame_size_1): Use resize_frame_windows.
9895
9896 * xdisp.c (init_xdisp): Don't use set_window_height but set
9897 heights directly.
9898
640c8776
SM
9899 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9900 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9901 run_window_configuration_change_hook.
9902
9903 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9904 instead of change_window_heights and run
9905 run_window_configuration_change_hook.
9906
1a13852e
MR
99072011-06-09 Martin Rudalics <rudalics@gmx.at>
9908
9909 * window.c (replace_window): Rename second argument REPLACEMENT to
9910 NEW. New third argument SETFLAG. Rewrite.
9911 (delete_window, make_dummy_parent): Call replace_window with
9912 third argument 1.
9913 (window_list_1): Move down in code.
9914 (run_window_configuration_change_hook): Move set_buffer part
9915 before select_frame_norecord part in order to unwind correctly.
9916 Rename count1 to count.
9917 (recombine_windows, delete_deletable_window, resize_root_window)
9918 (Fdelete_other_windows_internal)
9919 (Frun_window_configuration_change_hook, make_parent_window)
9920 (resize_window_check, resize_window_apply, Fresize_window_apply)
9921 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9922 (Fdelete_window_internal, Fresize_mini_window_internal):
9923 New functions.
1a13852e
MR
9924 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9925
f3d1777e
MR
99262011-06-08 Martin Rudalics <rudalics@gmx.at>
9927
496e208e
MR
9928 * window.h (window): Add some new members to window structure -
9929 normal_lines, normal_cols, new_total, new_normal, clone_number,
9930 splits, nest, prev_buffers, next_buffers.
9931 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9932 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9933
f3d1777e
MR
9934 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9935 Remove.
496e208e
MR
9936 (make_dummy_parent): Set new members of windows structure.
9937 (make_window): Move down in code. Handle new members of window
9938 structure.
9939 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9940 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9941 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9942 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9943 (Fset_window_next_buffers, Fset_window_clone_number):
9944 New functions.
496e208e
MR
9945 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9946 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9947 Doc-string fixes.
9948 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9949 Argument WINDOW can be now internal window too.
9950 (Fwindow_use_time): Move up in code.
9951 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9952 Rewrite doc-string.
9953 (Fset_window_configuration, saved_window)
9954 (Fcurrent_window_configuration, save_window_save): Handle new
9955 members of window structure.
b9e809c2
MR
9956 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9957 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9958 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9959 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9960 Qget_mru_window, Qresize_root_window,
9961 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9962 Qauto_buffer_name; staticpro them.
f3d1777e 9963
abde8f8c
MR
99642011-06-07 Martin Rudalics <rudalics@gmx.at>
9965
9966 * window.c (Fwindow_total_size, Fwindow_left_column)
9967 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9968 (Fwindow_list_1): New functions.
9969 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
9970 (Fwindow_width, Fscroll_left, Fscroll_right):
9971 Use window_body_cols instead of window_box_text_cols.
9972 (delete_window, Fset_window_configuration):
9973 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
9974 (delete_all_subwindows): Take a window as argument and not a
9975 structure. Rewrite.
190b47e6
MR
9976 (window_loop): Remove handling of GET_LRU_WINDOW and
9977 GET_LARGEST_WINDOW.
9978 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
9979
9980 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
9981 window_box_text_cols. delete_all_subwindows now takes a
9982 Lisp_Object as argument.
abde8f8c 9983
640c8776
SM
9984 * indent.c (compute_motion, Fcompute_motion):
9985 Use window_body_cols instead of window_box_text_cols.
abde8f8c 9986
fa8a67e6
MR
9987 * frame.c (delete_frame): Call delete_all_subwindows with root
9988 window as argument.
9989
a54e3482
DC
99902011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9991
9992 * fns.c (Fputhash): Document return value.
9993
60002bf5
CY
99942011-06-06 Chong Yidong <cyd@stupidchicken.com>
9995
9996 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9997
0c671da6 99982011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 9999
b862a52a 10000 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 10001
be44ca6c
PE
10002 Check for overflow when converting integer to cons and back.
10003 * charset.c (Fdefine_charset_internal, Fdecode_char):
10004 Use cons_to_unsigned to catch overflow.
10005 (Fencode_char): Use INTEGER_TO_CONS.
10006 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
10007 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
10008 * data.c (long_to_cons, cons_to_long): Remove.
10009 (cons_to_unsigned, cons_to_signed): New functions.
10010 These signal an error for invalid or out-of-range values.
10011 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
10012 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
10013 * font.c (Ffont_variation_glyphs):
10014 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
10015 * lisp.h: Include <intprops.h>.
10016 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
10017 (cons_to_signed, cons_to_unsigned): New decls.
10018 (long_to_cons, cons_to_long): Remove decls.
10019 * undo.c (record_first_change): Use INTEGER_TO_CONS.
10020 (Fprimitive_undo): Use CONS_TO_INTEGER.
10021 * xfns.c (Fx_window_property): Likewise.
10022 * xselect.c: Include <limits.h>.
10023 (x_own_selection, selection_data_to_lisp_data):
10024 Use INTEGER_TO_CONS.
10025 (x_handle_selection_request, x_handle_selection_clear)
10026 (x_get_foreign_selection, Fx_disown_selection_internal)
10027 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
10028 (lisp_data_to_selection_data): Use cons_to_unsigned.
10029 (x_fill_property_data): Use cons_to_signed.
10030 Report values out of range.
10031
d1f3d2af
PE
10032 Check for buffer and string overflow more precisely.
10033 * buffer.h (BUF_BYTES_MAX): New macro.
10034 * lisp.h (STRING_BYTES_MAX): New macro.
10035 * alloc.c (Fmake_string):
10036 * character.c (string_escape_byte8):
10037 * coding.c (coding_alloc_by_realloc):
10038 * doprnt.c (doprnt):
10039 * editfns.c (Fformat):
10040 * eval.c (verror):
10041 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
10042 since they may not be the same number.
10043 * editfns.c (Finsert_char):
10044 * fileio.c (Finsert_file_contents):
10045 Likewise for BUF_BYTES_MAX.
10046
dd52fcea
PE
10047 * image.c: Use ptrdiff_t, not int, for sizes.
10048 (slurp_file): Switch from int to ptrdiff_t.
10049 All uses changed.
10050 (slurp_file): Check that file size fits in both size_t (for
10051 malloc) and ptrdiff_t (for sanity and safety).
10052
7f9bbdbb
PE
10053 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
10054 if b->modtime has its maximal value.
10055
dfe18f82
PE
10056 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
10057
84acfcf0
PE
10058 Don't assume time_t can fit into int.
10059 * buffer.h (struct buffer.modtime): Now time_t, not int.
10060 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
10061 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
10062
ccd9a01a
PE
10063 Minor fixes for signed vs unsigned integers.
10064 * character.h (MAYBE_UNIFY_CHAR):
10065 * charset.c (maybe_unify_char):
10066 * keyboard.c (read_char, reorder_modifiers):
10067 XINT -> XFASTINT, since the integer must be nonnegative.
10068 * ftfont.c (ftfont_spec_pattern):
10069 * keymap.c (access_keymap, silly_event_symbol_error):
10070 XUINT -> XFASTINT, since the integer must be nonnegative.
10071 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
10072 since it makes no difference and we prefer signed.
10073 * keyboard.c (record_char): Use XUINT when all the neighbors do.
10074 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
10075 nonnegative.
10076
d6d100dd
SM
100772011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
10078
10079 * window.h (Fwindow_frame): Declare.
10080
2b6148e4
PE
100812011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10082
10083 * alloc.c: Simplify handling of large-request failures (Bug#8800).
10084 (SPARE_MEMORY): Always define.
10085 (LARGE_REQUEST): Remove.
10086 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
10087
f230ecc9
MR
100882011-06-06 Martin Rudalics <rudalics@gmx.at>
10089
727e958e
MR
10090 * lisp.h: Move EXFUNS for Fframe_root_window,
10091 Fframe_first_window and Fset_frame_selected_window to window.h.
10092
10093 * window.h: Move EXFUNS for Fframe_root_window,
10094 Fframe_first_window and Fset_frame_selected_window here from
10095 lisp.h.
10096
10097 * frame.c (Fwindow_frame, Fframe_first_window)
10098 (Fframe_root_window, Fframe_selected_window)
10099 (Fset_frame_selected_window): Move to window.c.
10100 (Factive_minibuffer_window): Move to minibuf.c.
10101 (Fother_visible_frames_p): New function.
10102
10103 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
10104
f230ecc9
MR
10105 * window.c (decode_window, decode_any_window): Move up in code.
10106 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
10107 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
10108 (Fwindow_buffer): Move up and rewrite doc-string.
10109 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
10110 (Fwindow_prev): New functions.
727e958e
MR
10111 (Fwindow_frame): Move here from frame.c. Accept any window as
10112 argument.
10113 (Fframe_root_window, Fframe_first_window)
10114 (Fframe_selected_window): Move here from frame.c. Accept frame
10115 or arbitrary window as argument. Update doc-strings.
10116 (Fminibuffer_window): Move up in code.
10117 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
10118 (Fset_frame_selected_window): Move here from frame.c.
10119 Marginal rewrite.
727e958e
MR
10120 (Fselected_window, select_window, Fselect_window): Move up in
10121 code. Minor doc-string fixes.
f230ecc9 10122
4d09bcf6
PE
101232011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10124
10125 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
10126 Do not assume that spare memory exists; that assumption is valid
10127 only if SYSTEM_MALLOC.
10128 (LARGE_REQUEST): New macro, so that the issue of large requests
10129 is separated from the issue of spare memory.
10130
810928a2
AS
101312011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10132
172418ad
AS
10133 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
10134 format. (Bug#8806)
10135
43f862f7
AS
10136 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
10137
810928a2
AS
10138 * xfns.c (x_set_scroll_bar_default_width): Move declarations
10139 before statements.
10140
a059fe24
JD
101412011-06-05 Jan Djärv <jan.h.d@swipnet.se>
10142
10143 * gtkutil.c (xg_get_default_scrollbar_width): New function.
10144
10145 * gtkutil.h: Declare xg_get_default_scrollbar_width.
10146
10147 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
10148 min width by calling x_set_scroll_bar_default_width (Bug#8505).
10149
989bf368
JB
101502011-06-05 Juanma Barranquero <lekktu@gmail.com>
10151
10152 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
10153
4b80f674
CY
101542011-06-04 Chong Yidong <cyd@stupidchicken.com>
10155
10156 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
10157 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
10158 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
10159 New error handlers.
4b80f674
CY
10160 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
10161 Obey Vx_select_enable_clipboard_manager. Catch errors in
10162 x_clipboard_manager_save (Bug#8779).
10163 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 10164 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 10165
99a33b77 101662011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
10167
10168 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
10169
99a33b77 101702011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
10171
10172 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
10173 in the current matrix if keep_current_p is non-zero.
10174
8264569d
EZ
101752011-06-04 Eli Zaretskii <eliz@gnu.org>
10176
10177 * bidi.c (bidi_level_of_next_char): Fix last change.
10178
57f97249
EZ
101792011-06-03 Eli Zaretskii <eliz@gnu.org>
10180
fec2107c 10181 Support bidi reordering of text covered by display properties.
57f97249 10182
fec2107c
EZ
10183 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
10184 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
10185 (bidi_cache_search, bidi_cache_iterator_state)
10186 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
10187 (bidi_level_of_next_char, bidi_move_to_visually_next):
10188 Support character positions inside a run of characters covered by a
fec2107c
EZ
10189 display string.
10190 (bidi_paragraph_init, bidi_resolve_explicit_1)
10191 (bidi_level_of_next_char): Call bidi_fetch_char and
10192 bidi_fetch_char_advance instead of FETCH_CHAR and
10193 FETCH_CHAR_ADVANCE.
10194 (bidi_init_it): Initialize new members.
10195 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
10196 definitions.
10197 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
10198 instead of using explicit *_CHAR codes.
d6d100dd
SM
10199 (bidi_resolve_explicit, bidi_resolve_weak):
10200 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
10201 bidirectional text is supported only in multibyte buffers.
10202 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
10203 it to initialize the frame_window_p member of struct bidi_it.
10204 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
10205 (bidi_resolve_explicit, bidi_resolve_weak)
10206 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
10207 bidi_it->nchars is non-positive.
10208 (bidi_level_of_next_char): Don't try to lookup the cache for the
10209 next/previous character if nothing is cached there yet, or if we
10210 were just reseat()'ed to a new position.
c40e2fb2 10211
0e14fe90
EZ
10212 * xdisp.c (set_cursor_from_row): Set start and stop points
10213 according to the row's direction when priming the loop that looks
10214 for the glyph on which to display cursor.
10215 (single_display_spec_intangible_p): Function deleted.
10216 (display_prop_intangible_p): Reimplement to call
10217 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
10218 Accept 3 additional arguments needed by handle_display_spec.
10219 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
10220 values: lists, `(when COND...)' forms, etc.
10221 (single_display_spec_string_p): Support property values that are
10222 lists with the argument STRING its top-level element.
10223 (display_prop_string_p): Fix the condition for processing a
10224 property that is a list to be consistent with handle_display_spec.
fec2107c 10225 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
10226 last portion of handle_display_prop.
10227 (compute_display_string_pos): Accept additional argument
10228 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
10229 value of a `display' property is a "replacing spec".
10230 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
10231 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
10232 the display property, but just return a value indicating whether
10233 the display property will replace the characters it covers.
10234 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
10235 frame_window_p members of struct bidi_it.
d6d100dd
SM
10236 (compute_display_string_pos, compute_display_string_end):
10237 New functions.
fec2107c
EZ
10238 (push_it): Accept second argument POSITION, where pop_it should
10239 jump to continue iteration.
10240 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 10241
fec2107c
EZ
10242 * keyboard.c (adjust_point_for_property): Adjust the call to
10243 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
10244
10245 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
10246 (bidi_init_it): Update prototypes.
10247 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
10248 (compute_display_string_pos, compute_display_string_end):
10249 Declare prototypes.
fec2107c
EZ
10250 (struct bidi_it): New members nchars and disp_pos. ch_len is now
10251 EMACS_INT.
fc6f18ce 10252
40087514 102532011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 10254
57f53182
PE
10255 Malloc failure behavior now depends on size of allocation.
10256 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10257 * lisp.h: Change signatures accordingly.
10258 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10259 All callers changed. (Bug#8762)
10260
10261 * gnutls.c: Use Emacs's memory allocators.
10262 Without this change, the gnutls library would invoke malloc etc.
10263 directly, which causes problems on non-SYNC_INPUT hosts, and which
10264 runs afoul of improving memory_full behavior. (Bug#8761)
10265 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10266 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10267 xfree instead of the default malloc, realloc, free.
10268 (Fgnutls_boot): No need to check for memory allocation failure,
10269 since xmalloc does that for us.
10270
ac32cd99 10271 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
10272 * category.c (hash_get_category_set):
10273 * ccl.c (ccl_driver):
10274 * charset.c (Fdefine_charset_internal):
10275 * charset.h (struct charset.hash_index):
10276 * composite.c (get_composition_id, gstring_lookup_cache)
10277 (composition_gstring_put_cache):
10278 * composite.h (struct composition.hash_index):
10279 * dispextern.h (struct image.hash):
10280 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10281 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10282 (hashfn_equal, hashfn_user_defined, make_hash_table)
10283 (maybe_resize_hash_table, hash_lookup, hash_put)
10284 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10285 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10286 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10287 * image.c (make_image, search_image_cache, lookup_image)
10288 (xpm_put_color_table_h):
10289 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 10290 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 10291 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 10292 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
10293 * alloc.c (allocate_vectorlike):
10294 Check for overflow in vector size calculations.
10295 * ccl.c (ccl_driver):
10296 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
10297 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10298 need to be updated by these changes.
40087514
PE
10299 * fns.c (make_hash_table, maybe_resize_hash_table):
10300 Check for integer overflow with large hash tables.
0de4bb68
PE
10301 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10302 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10303 (SXHASH_REDUCE): New macro.
10304 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10305 Use it instead of discarding useful hash info with large hash values.
10306 (sxhash_float): New function.
10307 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10308 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
10309 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10310 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
10311 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10312 Adjust signatures to match updated version of code.
10313 (consing_since_gc): Now EMACS_INT, since a single hash table can
10314 use more than INT_MAX bytes.
10315
698d32e2
DN
103162011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10317
10318 Make it possible to build with GCC-4.6+ -O2 -flto.
10319
10320 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10321
fd6fa53f
SM
103222011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10323
10324 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10325 Call minibuffer-inactive-mode.
10326
864db017
JB
103272011-05-31 Juanma Barranquero <lekktu@gmail.com>
10328
10329 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10330 Update dependencies.
10331
2ad0baf4
DN
103322011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10333
10334 * data.c (init_data): Remove code for UTS, this system is not
10335 supported anymore.
10336
4fcc2638
DN
103372011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10338
10339 Don't force ./temacs to start in terminal mode.
10340
10341 * frame.c (make_initial_frame): Initialize faces in all cases, not
10342 only when CANNOT_DUMP is defined.
10343 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
10344
c56e0fd5
DN
103452011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10346
10347 * dispnew.c (add_window_display_history): Use const for the string
10348 pointer. Remove declaration, not needed.
10349
333d54da 103502011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10351
55d4c1b2 10352 Use 'inline', not 'INLINE'.
333d54da 10353 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10354 * alloc.c, fontset.c (INLINE): Remove.
10355 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10356 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10357 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10358 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10359 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10360
738db178
DN
103612011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10362
10363 Make it possible to run ./temacs.
10364
10365 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10366 syms_of_callproc does the same thing. Remove test for
10367 "initialized", do it in the caller.
10368 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10369
620c53a6
SM
103702011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10371
10372 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10373 (read_minibuf): Use get_minibuffer.
10374 (syms_of_minibuf): Use DEFSYM.
10375 (Qmetadata): New var.
10376 * data.c (Qbuffer): Don't make it static.
10377 (syms_of_data): Use DEFSYM.
10378
e003a292
PE
103792011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10380
10381 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10382 (CCL_CODE_MIN): New macro.
10383
ed008a6d
PE
103842011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10385
3687c2ef
PE
10386 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10387
ed008a6d
PE
10388 * eval.c (Qdebug): Now static.
10389 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10390 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10391 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10392
d66c4c7c
CY
103932011-05-29 Chong Yidong <cyd@stupidchicken.com>
10394
10395 * image.c: Various fixes to ImageMagick code comments.
10396 (Fimagemagick_types): Doc fix.
10397
5fbc2025
PE
103982011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10399
0196f88a
PE
10400 Minor fixes prompted by GCC 4.6.0 warnings.
10401
10402 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10403
5fbc2025
PE
10404 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10405 (x_clipboard_manager_save_all): Move extern decl to ...
10406 * xterm.h: ... here, so that it can be checked for consistency.
10407
1dd3c2d9
CY
104082011-05-29 Chong Yidong <cyd@stupidchicken.com>
10409
10410 * xselect.c (x_clipboard_manager_save_frame)
10411 (x_clipboard_manager_save_all): New functions.
10412 (Fx_clipboard_manager_save): Lisp function deleted.
10413
10414 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10415 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10416
10417 * xterm.h: Update prototype.
10418
5ba6571d
WX
104192011-05-28 William Xu <william.xwl@gmail.com>
10420
10421 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10422 exiting (Bug#8239).
10423
3eaff834
JM
104242011-05-28 Jim Meyering <meyering@redhat.com>
10425
e1900994 10426 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10427 * fns.c (to_uchar): Define.
10428 (crypto_hash_function): Use it to convert some newly-signed
10429 variables to unsigned, to avoid sign-extension bugs. For example,
10430 without this change, (md5 "truc") would evaluate to
10431 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10432 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10433 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10434
0f6990a7
PE
104352011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10436
10437 Integer overflow fixes.
c8a9ca5a 10438
08686060
PE
10439 * dbusbind.c: Serial number integer overflow fixes.
10440 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10441 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10442 to hold a serial number that is too large for a fixnum.
10443 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10444 Check for serial numbers out of range. Decode any serial number
59568bf0 10445 that was so large that it became a float. (Bug#8722)
08686060 10446
2d1fc3c7
PE
10447 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10448 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10449 Use XFASTINT rather than XUINT when numbers are nonnegative.
10450 (xd_append_arg, Fdbus_method_return_internal):
10451 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10452 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10453 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10454 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10455 (Bug#8722)
2d1fc3c7 10456
c8a9ca5a
PE
10457 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10458
519e1d69
PE
10459 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10460
6df6ae42 10461 ccl: Add integer overflow checks.
30569699
PE
10462 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10463 (IN_INT_RANGE): New macros.
10464 (ccl_driver): Use them to check for integer overflow when
10465 decoding a CCL program. Many of the new checks are whether XINT (x)
10466 fits in int; it doesn't always, on 64-bit hosts. The new version
10467 doesn't catch all possible integer overflows, but it's an
847044ea 10468 improvement. (Bug#8719)
30569699 10469
c11285dc
PE
10470 * alloc.c (make_event_array): Use XINT, not XUINT.
10471 There's no need for unsigned here.
10472
fdccd48e
PE
10473 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10474 This follows up to the 2011-05-06 change that substituted uintptr_t
10475 for EMACS_INT. This case wasn't caught back then.
10476
37910ab2
PE
10477 Rework Fformat to avoid integer overflow issues.
10478 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10479 now (part of C89). Include <verify.h>.
10480 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10481 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10482 (Fformat): Avoid the prepass trying to compute sizes; it was only
10483 approximate and thus did not catch overflow reliably. Instead, walk
10484 through the format just once, formatting and computing sizes as we go,
10485 checking for integer overflow at every step, and allocating a larger
10486 buffer as needed. Keep track separately whether the format is
10487 multibyte. Keep only the most-recently calculated precision, rather
10488 than them all. Record whether each argument has been converted to
10489 string. Use EMACS_INT, not int, for byte and char and arg counts.
10490 Support field widths and precisions larger than INT_MAX. Avoid
10491 sprintf's undefined behavior with conversion specifications such as %#d
10492 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10493 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10494 formatting out-of-range floating point numbers with int
9173deec 10495 formats. (Bug#8668)
37910ab2 10496
2e6578fb
PE
10497 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10498
0ae6bdee
PE
10499 * data.c: Avoid integer truncation in expressions involving floats.
10500 * data.c: Include <intprops.h>.
10501 (arith_driver): When there's an integer overflow in an expression
10502 involving floating point, convert the integers to floating point
10503 so that the resulting value does not suffer from catastrophic
10504 integer truncation. For example, on a 64-bit host (* 4
10505 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10506 Do not rely on undefined behavior after integer overflow.
10507
de883a70
PE
10508 merge count_size_as_multibyte, parse_str_to_multibyte
10509 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10510 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10511 Check for integer overflow.
10512 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10513 since it's now a duplicate of the other. This is more of
10514 a character than a buffer op, so better that it's in character.c.
10515 * fns.c, print.c: Adjust to above changes.
10516
2ff916cb
PE
105172011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10518
10519 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10520
f1b54466
PE
105212011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10522
fb1ac845
PE
10523 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10524 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10525 (x_clipboard_manager_save): Now static.
10526 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10527
f1b54466
PE
10528 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10529 (crypto_hash_function): Now static.
10530 Fix pointer signedness problems. Avoid unnecessary initializations.
10531
a9f737ee
CY
105322011-05-27 Chong Yidong <cyd@stupidchicken.com>
10533
10534 * termhooks.h (Vselection_alist): Make it terminal-local.
10535
10536 * terminal.c (create_terminal): Initialize it.
10537
10538 * xselect.c: Support for clipboard managers.
10539 (Vselection_alist): Move to termhooks.h as terminal-local var.
10540 (LOCAL_SELECTION): New macro.
10541 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10542 (symbol_to_x_atom): Remove gratuitous arg.
10543 (x_handle_selection_request, lisp_data_to_selection_data)
10544 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10545 (x_own_selection, x_get_local_selection, x_convert_selection):
10546 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10547 (some_frame_on_display): Delete unused function.
10548 (Fx_own_selection_internal, Fx_get_selection_internal)
10549 (Fx_disown_selection_internal, Fx_selection_owner_p)
10550 (Fx_selection_exists_p): New optional frame arg.
10551 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10552 (x_handle_selection_clear): Don't treat other terminals with the
10553 same keyboard specially. Use the terminal-local Vselection_alist.
10554 (x_clear_frame_selections): Use Frun_hook_with_args.
10555
10556 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10557
10558 * xterm.h: Add support for those atoms.
10559
e067f0c1
CY
105602011-05-26 Chong Yidong <cyd@stupidchicken.com>
10561
10562 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10563 (converted_selections, conversion_fail_tag): New global variables.
10564 (x_selection_request_lisp_error): Free the above.
10565 (x_get_local_selection): Remove unnecessary code.
10566 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10567 of converted selections stored in converted_selections.
10568 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10569 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10570 (x_convert_selection): New function.
10571 (x_handle_selection_event): Simplify.
10572 (x_get_foreign_selection): Don't ignore incoming requests while
10573 waiting for an answer; this will fail when we implement
10574 SAVE_TARGETS, and seems unnecessary anyway.
10575 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10576 (Vx_sent_selection_functions): Doc fix.
10577
0f4aebc0
LL
105782011-05-26 Leo Liu <sdl.web@gmail.com>
10579
10580 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10581
e61124cd
YM
105822011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10583
10584 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10585
10586 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10587 for fringe update if it has periodic bitmap.
ac389d0c 10588 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10589 and fringe_bitmap_periodic_p.
10590
10591 * fringe.c (get_fringe_bitmap_data): New function.
10592 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10593 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10594 row. Mark glyph row for fringe update if periodicity changed.
10595
10596 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10597 for fringe update unless it has periodic bitmap.
10598
f16d9837
KH
105992011-05-25 Kenichi Handa <handa@m17n.org>
10600
10601 * xdisp.c (get_next_display_element): Set correct it->face_id for
10602 a static composition.
10603
e1b90ef6
LL
106042011-05-24 Leo Liu <sdl.web@gmail.com>
10605
10606 * deps.mk (fns.o):
10607 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10608
10609 * fns.c (crypto_hash_function, Fsha1): New function.
10610 (Fmd5): Use crypto_hash_function.
10611 (syms_of_fns): Add Ssha1.
10612
7400048f
PE
106132011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10614
10615 * gnutls.c: Remove unused macros.
10616 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10617 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10618 Remove macros that are defined and never used.
10619 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10620
abb71cf4
CY
106212011-05-22 Chong Yidong <cyd@stupidchicken.com>
10622
10623 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10624 (Fx_get_selection_internal): Minor cleanup.
10625 (Fx_own_selection_internal): Rename arguments for consistency with
10626 select.el.
10627
6307db39
PE
106282011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10629
10630 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10631
f3d4e0a4
CY
106322011-05-22 Chong Yidong <cyd@stupidchicken.com>
10633
10634 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10635
4d8ade89
YM
106362011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10637
10638 * dispnew.c (scrolling_window): Don't exclude the case that the
10639 last enabled row in the desired matrix touches the bottom boundary.
10640
32078c8d
GM
106412011-05-21 Glenn Morris <rgm@gnu.org>
10642
10643 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10644 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10645 and add some more files.
32078c8d 10646
7285dc67
EZ
106472011-05-20 Eli Zaretskii <eliz@gnu.org>
10648
10649 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10650 report_file_error introduced by the change from 2011-05-07.
10651
89d1bd22
PE
106522011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10653
10654 * systime.h (Time): Define only if emacs is defined.
10655 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10656 where the include path doesn't have X11/X.h by default. See
10657 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10658
cd394be1 106592011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10660
10661 * composite.c (find_automatic_composition): Fix previous change.
10662
b9704ad9
GM
106632011-05-20 Glenn Morris <rgm@gnu.org>
10664
10665 * lisp.mk: New file, split from Makefile.in.
10666 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10667 (shortlisp): Remove.
10668 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10669
4a720484
GM
106702011-05-19 Glenn Morris <rgm@gnu.org>
10671
10672 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10673 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10674 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10675 (lisp): Set the order to that of loadup.el.
10676 (shortlisp): Make it a copy of $lisp.
10677 (SOME_MACHINE_LISP): Remove.
10678 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10679 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10680
a28d4396
KH
106812011-05-18 Kenichi Handa <handa@m17n.org>
10682
10683 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10684 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10685 (find_automatic_composition): Mostly rewrite for efficiency.
10686
a2b1fa8e
JB
106872011-05-18 Juanma Barranquero <lekktu@gmail.com>
10688
10689 * makefile.w32-in: Update dependencies.
10690
8e1f5610
CS
106912011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10692
10693 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10694 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10695
7025ee00 106962011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10697
cdfa6eab
PE
10698 Fix some integer overflow issues, such as string length overflow.
10699
06d6db33
PE
10700 * insdel.c (count_size_as_multibyte): Check for string overflow.
10701
2b4560a8
PE
10702 * character.c (lisp_string_width): Check for string overflow.
10703 Use EMACS_INT, not int, for string indexes and lengths; in
10704 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10705 the resulting string length overflows an EMACS_INT; instead,
10706 report a string overflow if no precision given. When checking for
10707 precision exhaustion, use a check that cannot possibly have
10708 integer overflow. (Bug#8675)
10709 * character.h (lisp_string_width): Adjust to new signature.
10710
cb93f9be
PE
10711 * alloc.c (string_overflow): New function.
10712 (Fmake_string): Use it. This doesn't change behavior, but saves
10713 a few bytes and will simplify future changes.
10714 * character.c (string_escape_byte8): Likewise.
10715 * lisp.h (string_overflow): New decl.
10716
1a1f3366
PE
10717 Fixups, following up to the user-interface timestamp change.
10718 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10719 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10720 * msdos.c (mouse_get_pos): Likewise.
10721 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10722 * w32gui.h (Time): Define by including "systime.h" rather than by
10723 declaring it ourselves. (Bug#8664)
10724
d4e3e4d3
PE
10725 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10726 * image.c (clear_image_cache): Likewise.
10727
f6a24d19
PE
10728 * term.c (term_mouse_position): Don't assume time_t wraparound.
10729
08dc5ae6
PE
10730 Be more systematic about user-interface timestamps.
10731 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10732 and sometimes 'EMACS_UINT', to represent these timestamps.
10733 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10734 This makes the code easier to follow, and makes it easier to catch
10735 integer overflow bugs such as Bug#8664.
10736 * frame.c (Fmouse_position, Fmouse_pixel_position):
10737 Use Time, not unsigned long, for user-interface timestamps.
10738 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10739 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10740 * keyboard.h (last_event_timestamp): Likewise.
10741 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10742 * menu.h (xmenu_show): Likewise.
10743 * term.c (term_mouse_position): Likewise.
10744 * termhooks.h (struct input_event.timestamp): Likewise.
10745 (struct terminal.mouse_position_hook): Likewise.
10746 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10747 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10748 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10749 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10750 what it was before.
10751 * menu.h, termhooks.h: Include "systime.h", for Time.
10752
8e55734a
PE
10753 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10754 Don't assume that the difference between two unsigned long values
10755 can fit into an integer. At this point, we know button_down_time
10756 <= event->timestamp, so the difference must be nonnegative, so
10757 there's no need to cast the result if double-click-time is
10758 nonnegative, as it should be; check that it's nonnegative, just in
10759 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10760 apart (about 25 days). (Bug#8664)
8e55734a 10761
841f1b75 10762 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10763 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10764
3e26f69c
PE
10765 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10766 that always fit in int. Use a sentinel instead of a counter, to
10767 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10768 * frame.h (struct frame): Use int for menu_bar_items_used
10769 instead of EMACS_INT, since it always fits in int.
3e26f69c 10770
5cc152c0
PE
10771 * menu.c (grow_menu_items): Check for int overflow.
10772
d89eb65e
PE
10773 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10774
5235bd3e
PE
10775 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10776 Before, the code was not consistent. These values cannot exceed
10777 2**31 - 1 so there's no need to make them unsigned.
10778 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10779 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10780 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10781 as modifiers.
10782 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10783
bc827e23
PE
10784 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10785 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10786 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10787 presumably because the widths might not match.
10788
78eb494e
PE
10789 * window.c (size_window): Avoid needless test at loop start.
10790
04f2d78b
CB
107912011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10792
10793 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10794
d2fc7e3d 107952011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10796
10797 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10798
d2fc7e3d 107992011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10800
10801 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10802 `width' to `bar_area_x' and `bar_area_width', respectively.
10803 (x_scroll_run): Take account of fringe background extension.
10804
04f2d78b
CB
10805 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10806 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10807 `bar_area_width', respectively.
10808 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10809 background extension.
10810
79b70037
GM
108112011-05-10 Jim Meyering <meyering@redhat.com>
10812
10813 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10814
2f142cc5
JB
108152011-05-10 Juanma Barranquero <lekktu@gmail.com>
10816
10817 * image.c (Finit_image_library): Return t for built-in image types,
10818 like pbm and xbm. (Bug#8640)
10819
57679c86
AS
108202011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10821
10822 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10823
888c9e86
EZ
108242011-05-07 Eli Zaretskii <eliz@gnu.org>
10825
b0512a1d
EZ
10826 * w32console.c (Fset_screen_color): Doc fix.
10827 (Fget_screen_color): New function.
10828 (syms_of_ntterm): Defsubr it.
10829
7285dc67
EZ
10830 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10831 unlink the temporary file if Fcall_process didn't create it in the
10832 first place.
10833 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10834 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10835 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10836 cue to call_process_cleanup not to close that handle.
10837
4d3fcc8e
BK
108382011-05-07 Ben Key <bkey76@gmail.com>
10839
10840 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10841 one of two shell specific rules, either bootstrap-temacs-CMD or
10842 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10843 to the previous implementation of the bootstrap-temacs rule.
10844 The bootstrap-temacs-CMD rule is similar to the previous
10845 implementation of the bootstrap-temacs rule except that it
10846 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10847 variable.
10848
10849 These changes, along with some changes to nt/configure.bat,
10850 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10851 earlier fix to add support for --cflags and --ldflags options
10852 that include quotes so that it works whether make uses cmd or
10853 sh as the shell.
10854
b4289b64
MA
108552011-05-06 Michael Albinus <michael.albinus@gmx.de>
10856
10857 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10858 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10859 is a constant.
10860 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10861 a string. Handle both cases.
10862 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10863 (Fdbus_register_method): Use Qinvalid_function.
10864
af4c0e28
JB
108652011-05-06 Juanma Barranquero <lekktu@gmail.com>
10866
10867 * makefile.w32-in: Update dependencies.
10868 (LISP_H): Add inttypes.h and stdin.h.
10869 (PROCESS_H): Add unistd.h.
10870
c51453d9
EZ
108712011-05-06 Eli Zaretskii <eliz@gnu.org>
10872
10873 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10874 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10875
8ff0ac3c 108762011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10877
4c4b566b
PE
10878 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10879
aab2b9b5
PE
10880 * term.c (vfatal): Remove stray call to va_end.
10881 It's not needed and the C Standard doesn't allow it here anyway.
10882
c378da0b
PE
10883 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10884 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10885
288b08c7
PE
10886 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10887 bytes.
10888
e3601888
PE
10889 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10890
db6c0e74
PE
10891 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10892
dd5963ea
PE
10893 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10894
88c9450f
PE
10895 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10896
2f9442b8
PE
10897 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10898
c032b5f8
PE
10899 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10900 * charset.c (Fdefine_charset_internal): Don't initialize
10901 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10902 32-bit int (Bug#8600).
a108c10b
PE
10903
10904 * lread.c (read_integer): Be more consistent with string-to-number.
10905 Use string_to_number to do the actual conversion; this avoids
10906 rounding errors and fixes some other screwups. Without this fix,
10907 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10908 (digit_to_number): Move earlier, for benefit of read_integer.
10909 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10910 not a digit in any supported base. (Bug#8602)
a108c10b 10911
ad5f9eea
PE
10912 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10913
aec1708a
PE
10914 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10915 to match comment at start of function. This also removes a
10916 GCC warning about overflow in a 32+64-bit port.
10917
47be4ab5
PE
10918 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10919
371cac43
PE
10920 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10921 Reported by Stefan Monnier in
10922 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10923 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10924 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10925
d01a7826
PE
10926 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10927 (EMACS_UINTPTR): Likewise, with uintptr_t.
10928
7fd47d5c
PE
10929 * lisp.h: Prefer 64-bit EMACS_INT if available.
10930 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10931 on 32-bit hosts that have 64-bit int, so that they can access
10932 large files.
122b0c86
PE
10933 However, temporarily disable this change unless the temporary
10934 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10935
8727937b
PE
10936 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10937
8ac068ac
PE
10938 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10939 This removes an assumption that EMACS_INT and long are the same
10940 width as pointers. The assumption is true for Emacs porting targets
10941 now, but we want to make other targets possible.
10942 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10943 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10944 In the rest of the code, change types of integers that hold casted
10945 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10946 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10947 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10948 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10949 No need to cast type when ORing.
10950 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10951 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10952 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10953 assume EMACS_INT is the same width as char *.
10954 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10955 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10956 Remove no-longer-needed casts.
10957 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10958 (xg_tool_bar_help_callback, xg_make_tool_item):
10959 Use EMACS_INTPTR to hold an integer
10960 that will be cast to void *; this can avoid a GCC warning
10961 if EMACS_INT is not the same width as void *.
10962 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10963 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10964 (current_message_1, set_message_1):
10965 Use a local to convert to proper width without a cast.
10966 * xmenu.c (dialog_selection_callback): Likewise.
10967
ede49d71
PE
10968 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10969 Also, don't assume VALBITS / RAND_BITS is less than 5,
10970 and don't rely on undefined behavior when shifting a 1 left into
10971 the sign bit.
10972 * lisp.h (get_random): Change signature to match.
10973
2f30ecd0
PE
10974 * lread.c (hash_string): Use size_t, not int, for hash computation.
10975 Normally we prefer signed values; but hashing is special, because
10976 it's better to use unsigned division on hash table sizes so that
10977 the remainder is nonnegative. Also, size_t is the natural width
10978 for hashing into memory. The previous code used 'int', which doesn't
10979 retain enough info to hash well into very large tables.
10980 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10981
2a866e7b
PE
10982 * dbusbind.c: Don't possibly lose pointer info when converting.
10983 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10984 Use XPNTR rather than XHASH, so that the high-order bits of
10985 the pointer aren't lost when converting through void *.
10986
51639eac
PE
10987 * eval.c (Fautoload): Don't double-shift a pointer.
10988
92394119
PE
10989 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10990
dbdb9a7c
JB
109912011-05-06 Juanma Barranquero <lekktu@gmail.com>
10992
10993 * gnutls.c (DEF_GNUTLS_FN):
10994 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10995
db7a0b4f
AS
109962011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10997
10998 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10999 marker. (Bug#8610)
11000
cd394be1 110012011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
11002
11003 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
11004 New version that can reserve upto 2GB of heap space.
11005
f7ff1b0f 110062011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
11007
11008 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
11009
639c109b
TZ
110102011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
11011
11012 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
11013 `gnutls_certificate_set_x509_key_file'.
11014
d2127135
JB
110152011-05-05 Juanma Barranquero <lekktu@gmail.com>
11016
11017 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
11018 Update dependencies.
11019
e968f4f3
JB
110202011-05-04 Juanma Barranquero <lekktu@gmail.com>
11021
11022 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
11023 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11024 Remove unused parameter `fildes'.
11025 * process.c (read_process_output, send_process): Don't pass it.
11026
84d358f0
JB
110272011-05-04 Juanma Barranquero <lekktu@gmail.com>
11028
11029 Fix previous change: the library cache is defined in w32.c.
11030 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
11031 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
11032
0898ca10
JB
110332011-05-04 Juanma Barranquero <lekktu@gmail.com>
11034
11035 Implement dynamic loading of GnuTLS on Windows.
11036
11037 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
11038 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
11039 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11040 Declare.
11041
11042 * gnutls.c (Qgnutls_dll): Define.
11043 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
11044 (gnutls_*): Declare function pointers.
11045 (init_gnutls_functions): New function to initialize function pointers.
11046 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
11047 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
11048 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11049 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
11050 (emacs_gnutls_write, emacs_gnutls_read)
11051 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
11052 (Fgnutls_available_p): New function.
11053 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
11054 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
11055 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
11056
11057 * image.c: Include w32.h.
11058 (Vimage_type_cache): Delete.
11059 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
11060 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
11061 (w32_delayed_load): Move to w32.c.
11062
11063 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
11064
11065 * w32.c (QCloaded_from, Vlibrary_cache): Define.
11066 (w32_delayed_load): Move from image.c. When loading a library, record
11067 its filename in the :loaded-from property of the library id.
11068 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
11069 Initialize and staticpro them.
11070 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
11071
11072 * process.c: Include lisp.h before w32.h, not after.
11073 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
11074 instead of gnutls_record_check_pending.
11075
11076 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
11077
ff4de4aa
TZ
110782011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
11079
11080 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
11081 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
11082 as passed in.
11083
abe95abb
JD
110842011-05-03 Jan Djärv <jan.h.d@swipnet.se>
11085
11086 * xterm.c (x_set_frame_alpha): Do not set property on anything
11087 else than FRAME_X_OUTER_WINDOW (Bug#8608).
11088
e16e55d4
JB
110892011-05-02 Juanma Barranquero <lekktu@gmail.com>
11090
11091 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
11092
bafcf6a5
JB
110932011-05-02 Juanma Barranquero <lekktu@gmail.com>
11094
11095 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
11096 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
11097 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
11098 (gnutls_global_initialized, Qgnutls_bootprop_priority)
11099 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
11100 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
11101 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
11102 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
11103 (Qgnutls_bootprop_callbacks_verify): Make static.
11104
e7a6747f
AS
111052011-05-01 Andreas Schwab <schwab@linux-m68k.org>
11106
19ed11ba
AS
11107 * callproc.c: Indentation fixup.
11108
e7a6747f 11109 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
11110 (wait_for_termination, interruptible_wait_for_termination):
11111 Move after wait_for_termination_1.
e7a6747f 11112
1ef14cb4
LMI
111132011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
11114
11115 * sysdep.c (interruptible_wait_for_termination): New function
11116 which is like wait_for_termination, but allows keyboard
11117 interruptions.
11118
11119 * callproc.c (Fcall_process): Add (:file "file") as an option for
11120 the STDOUT buffer.
11121 (Fcall_process_region): Ditto.
11122
330d880c
EZ
111232011-04-30 Eli Zaretskii <eliz@gnu.org>
11124
8db90b73
EZ
11125 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
11126 rather than `XVECTOR (FOO)->size'.
11127
330d880c
EZ
11128 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
11129 inttypes.h, as a gnulib replacement is used if it not available in
11130 system headers.
11131
15cbd324
EZ
111322011-04-21 Eli Zaretskii <eliz@gnu.org>
11133
11134 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
11135 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
11136 of MOST_POSITIVE_FIXNUM. (Bug#8528)
11137
11138 * coding.c (coding_alloc_by_realloc): Error out if destination
11139 will grow beyond MOST_POSITIVE_FIXNUM.
11140 (decode_coding_emacs_mule): Abort if there isn't enough place in
11141 charbuf for the composition carryover bytes. Reserve an extra
11142 space for up to 2 characters produced in a loop.
11143 (decode_coding_iso_2022): Abort if there isn't enough place in
11144 charbuf for the composition carryover bytes.
11145
111462011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 11147
ae940cca
EZ
11148 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
11149 aborting when %lld or %lll format is passed.
11150 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
11151 %llo or %llx format is passed. (Bug#8545)
11152
03ab8921
EZ
11153 * window.c (window_scroll_line_based): Use a marker instead of
11154 simple variables to record original value of point. (Bug#7952)
11155
afda1437
EZ
11156 * doprnt.c (doprnt): Fix the case where a multibyte sequence
11157 produced by %s or %c overflows available buffer space. (Bug#8545)
11158
f76dee0c
PE
111592011-04-28 Paul Eggert <eggert@cs.ucla.edu>
11160
11161 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 11162 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 11163
fdc5744d
JB
111642011-04-28 Juanma Barranquero <lekktu@gmail.com>
11165
11166 * w32.c (init_environment): Warn about defaulting HOME to C:\.
11167
638f053a
JB
111682011-04-28 Juanma Barranquero <lekktu@gmail.com>
11169
11170 * keyboard.c (Qdelayed_warnings_hook): Define.
11171 (command_loop_1): Run `delayed-warnings-hook'
11172 if Vdelayed_warnings_list is non-nil.
11173 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
11174 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
11175
d178f871
EZ
111762011-04-28 Eli Zaretskii <eliz@gnu.org>
11177
11178 * doprnt.c (doprnt): Don't return value smaller than the buffer
11179 size if the message was truncated. (Bug#8545).
11180
b124fd93
JB
111812011-04-28 Juanma Barranquero <lekktu@gmail.com>
11182
11183 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
11184 (Fx_window_property): #if-0 the whole functions, not just the bodies.
11185
e810457d
PE
111862011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11187
11188 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
11189
ea51cceb
JB
111902011-04-27 Juanma Barranquero <lekktu@gmail.com>
11191
11192 * makefile.w32-in: Update dependencies.
11193
94dcfacf
EZ
111942011-04-27 Eli Zaretskii <eliz@gnu.org>
11195
11196 Improve `doprnt' and its usage. (Bug#8545)
11197 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
11198 `format_end'. Remove support for %l as a conversion specifier.
11199 Don't use xrealloc. Improve diagnostics when the %l size modifier
11200 is used. Update the commentary.
11201
11202 * eval.c (verror): Simplify calculation of size_t.
11203
11204 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
11205 messages.
11206
f61f41d7
PE
112072011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
11208
11209 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
11210 change.
11211
96fb4434
PE
112122011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11213
11214 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
11215 This makes this file independent of the recent pseudovector change.
11216
671875da 112172011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 11218
69e9b5a3
PE
11219 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
11220
b5f869a7 11221 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 11222 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 11223 Remove unused local.
c8926152 11224 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 11225
841a1577 11226 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
11227 GCC 4.6.0 optimizes based on type-based alias analysis.
11228 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
11229 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
11230 != &v->size, and therefore "v->size = 1; b->size = 2; return
11231 v->size;" must therefore return 1. This assumption is incorrect
11232 for Emacs, since it type-puns struct Lisp_Vector * with many other
11233 types. To fix this problem, this patch adds a new type struct
f904488f 11234 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
11235 and pseudovectors, and helps optimizing compilers not get fooled
11236 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
11237 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
11238 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
11239 the size member.
eab3844f
PE
11240 (XSETPVECTYPE): Rewrite in terms of new macro.
11241 (XSETPVECTYPESIZE): New macro, specifying both type and size.
11242 This is a bit clearer, and further avoids the possibility of
11243 undesirable aliasing.
11244 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 11245 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
11246 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
11247 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
11248 (ASIZE): Now uses header.size rather than size.
11249 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
11250 to avoid the hassle of writing XVECTOR (foo)->header.size.
11251 (struct vectorlike_header): New type.
eab3844f
PE
11252 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
11253 object, to help avoid aliasing.
11254 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
11255 (SUBRP): Likewise, since Lisp_Subr is a special case.
11256 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11257 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11258 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 11259 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
11260 changed to be "header.size" and "header.next".
11261 * buffer.h (struct buffer): Likewise.
11262 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11263 * frame.h (struct frame): Likewise.
11264 * process.h (struct Lisp_Process): Likewise.
11265 * termhooks.h (struct terminal): Likewise.
11266 * window.c (struct save_window_data, struct saved_window): Likewise.
11267 * window.h (struct window): Likewise.
11268 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11269 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11270 * buffer.c (init_buffer_once): Likewise.
11271 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11272 special case.
11273 * process.c (Fformat_network_address): Use local var for size,
11274 for brevity.
11275
0df1eac5
PE
11276 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11277
847ab9d1 11278 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
11279 * data.c (atof): Remove decl; no longer used or needed.
11280 (digit_to_number): Move to lread.c.
11281 (Fstring_to_number): Use new string_to_number function, to be
11282 consistent with how the Lisp reader treats infinities and NaNs.
11283 Do not assume that floating-point numbers represent EMACS_INT
11284 without losing information; this is not true on most 64-bit hosts.
11285 Avoid double-rounding errors, by insisting on integers when
11286 parsing non-base-10 numbers, as the documentation specifies.
11287 * lisp.h (string_to_number): New decl, replacing ...
11288 (isfloat_string): Remove.
bc0a5c13 11289 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 11290 (read1): Do not accept +. and -. as integers; this
452f4150
PE
11291 appears to have been a coding error. Similarly, do not accept
11292 strings like +-1e0 as floating point numbers. Do not report
11293 overflow for integer overflows unless the base is not 10 which
11294 means we have no simple and reliable way to continue.
11295 Break out the floating-point parsing into a new
11296 function string_to_number, so that Fstring_to_number parses
11297 floating point numbers consistently with the Lisp reader.
04f2d78b 11298 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
11299 (E_CHAR, EXP_INT): Remove, replacing with ...
11300 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11301 (string_to_number): New function, replacing isfloat_string.
11302 This function checks for valid syntax and produces the resulting
11303 Lisp float number too. Rework it so that string-to-number
bc0a5c13 11304 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
11305 so that overflow for non-base-10 numbers is reported only when
11306 there's no portable and simple way to convert to floating point.
452f4150 11307
67769ffc
PE
11308 * textprop.c (set_text_properties_1): Rewrite for clarity,
11309 and to avoid GCC warning about integer overflow.
11310
c20db43f
PE
11311 * intervals.h (struct interval): Use EMACS_INT for members
11312 where EMACS_UINT might cause problems. See
11313 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11314 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11315 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11316 All uses changed.
37aa2f85
PE
11317 (offset_intervals): Tell GCC not to worry about length overflow
11318 when negating a negative length.
c20db43f 11319
2538aa2f
PE
11320 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11321 (overrun_check_free): Likewise.
11322
f2d3008d
PE
11323 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11324 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11325 word size.
11326
ec8df744
PE
11327 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11328 (gnutls_make_error): Rename local to avoid shadowing.
11329 (gnutls_emacs_global_deinit): ifdef out; not used.
11330 (Fgnutls_boot): Use const for pointer to readonly storage.
11331 Comment out unused local. Fix pointer signedness problems.
11332
640ee02d
PE
11333 * lread.c (openp): Don't stuff size_t into an 'int'.
11334 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11335 about possible signed overflow.
11336
6048fb2a
PE
11337 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11338 (GDK_KEY_g): Don't define if already defined.
11339 (xg_prepare_tooltip): Avoid pointer signedness problem.
11340 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
11341
fa3c87e1
PE
11342 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
11343 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
11344
2172544b
PE
11345 * xfns.c (Fx_window_property): Simplify a bit,
11346 to make a bit faster and to avoid GCC 4.6.0 warning.
11347 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11348
9b821a21
PE
11349 * fns.c (internal_equal): Don't assume size_t fits in int.
11350
3c616cfa
PE
11351 * alloc.c (compact_small_strings): Tighten assertion a little.
11352
c2982e87
PE
11353 Replace pEd with more-general pI, and fix some printf arg casts.
11354 * lisp.h (pI): New macro, generalizing old pEd macro to other
11355 conversion specifiers. For example, use "...%"pI"d..." rather
11356 than "...%"pEd"...".
11357 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11358 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11359 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11360 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11361 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11362 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11363 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11364 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11365 64-bit hosts.
11366 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11367 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11368 * print.c (safe_debug_print, print_object): Likewise.
11369 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11370 to int.
6f04d126
PE
11371 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11372 avoiding the 0 flag, which is not portable.
c2982e87
PE
11373 * process.c (Fmake_network_process): Use pI to avoid cast.
11374 * region-cache.c (pp_cache): Likewise.
11375 * xdisp.c (decode_mode_spec): Likewise.
11376 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11377 behavior on 64-bit hosts with printf arg.
6f04d126 11378 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11379 (x_stop_queuing_selection_requests): Likewise.
11380 (x_get_window_property): Don't truncate byte count to an 'int'
11381 when tracing.
0b432f21 11382
5e073ec7
PE
11383 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11384 here, since it parses constructs like leading '-' and spaces,
11385 which are not wanted; and it overflows with large numbers.
11386 Instead, simply match F[0-9]+, which is what is wanted anyway.
11387
36372bf9
PE
11388 * alloc.c: Remove unportable assumptions about struct layout.
11389 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11390 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11391 (allocate_vectorlike, make_pure_vector): Use the new macros,
11392 plus offsetof, to remove unportable assumptions about struct layout.
11393 These assumptions hold on all porting targets that I know of, but
11394 they are not guaranteed, they're easy to remove, and removing them
11395 makes further changes easier.
11396
0b432f21
PE
11397 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11398 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11399 (string_overrun_cookie): Now const. Use initializers that
11400 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11401 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11402 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11403 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11404 multiple of sizeof (EMACS_INT); it need not be, if
11405 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11406 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11407
895009e1
JB
114082011-04-26 Juanma Barranquero <lekktu@gmail.com>
11409
11410 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11411
6a7a1b0b
TZ
114122011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11413
11414 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11415 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11416 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11417
841a1577 114182011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11419
11420 * lisp.h (Qdebug): List symbol.
895009e1 11421 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11422 * keyboard.c (debug-on-event): New variable.
11423 (handle_user_signal): Break into debugger when debug-on-event
11424 matches the current signal symbol.
11425
f2d3ba6f
DN
114262011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11427
11428 * alloc.c (check_sblock, check_string_bytes)
11429 (check_string_free_list): Convert to standard C.
11430
42ce4c63
TZ
114312011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11432
11433 * w32.c (emacs_gnutls_push): Fix typo.
11434
825cd63c
EZ
114352011-04-25 Eli Zaretskii <eliz@gnu.org>
11436
fb11d64d
EZ
11437 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11438 "cast to pointer from integer of different size".
11439
825cd63c
EZ
11440 Improve doprnt and its use in verror. (Bug#8545)
11441 * doprnt.c (doprnt): Document the set of format control sequences
11442 supported by the function. Use SAFE_ALLOCA instead of always
11443 using `alloca'.
11444
11445 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11446 is one byte too soon. Don't use xrealloc; instead xfree and
11447 xmalloc anew.
11448
e061a11b
TZ
114492011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11450
11451 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11452 callbacks stage.
11453
11454 * gnutls.c: Renamed global_initialized to
11455 gnutls_global_initialized. Added internals for the
11456 :verify-hostname-error, :verify-error, and :verify-flags
11457 parameters of `gnutls-boot' and documented those parameters in the
11458 docstring. Start callback support.
9173deec
JB
11459 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11460 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11461 on error. Return error code.
e061a11b
TZ
11462 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11463 (emacs_gnutls_read): Likewise.
11464 (Fgnutls_boot): Return handshake error code.
11465 (emacs_gnutls_handle_error): New function.
11466 (wsaerror_to_errno): Likewise.
11467
11468 * w32.h (emacs_gnutls_pull): Add prototype.
11469 (emacs_gnutls_push): Likewise.
11470
11471 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11472 (emacs_gnutls_push): Likewise.
11473
114742011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11475
11476 * process.c (wait_reading_process_output): Check if GnuTLS
11477 buffered some data internally if no FDs are set for TLS
11478 connections.
11479
11480 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11481 (LIBS): Link to USER_LIBS.
11482 ($(BLD)/gnutls.$(0)): New target.
11483
fa6996bc
EZ
114842011-04-24 Eli Zaretskii <eliz@gnu.org>
11485
eb35682e
EZ
11486 * xdisp.c (handle_single_display_spec): Rename the
11487 display_replaced_before_p argument into display_replaced_p, to
11488 make it consistent with the commentary. Fix typos in the
11489 commentary.
11490
e2ad650c
EZ
11491 * textprop.c (syms_of_textprop): Remove dead code.
11492 (copy_text_properties): Delete obsolete commentary about an
11493 interface that was deleted long ago. Fix typos in the description
11494 of arguments.
11495
1b2de274
EZ
11496 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11497 to changes in oldXMenu/XMenu.h from 2011-04-16.
11498 <menu_help_message, prev_menu_help_message>: Constify.
11499 (IT_menu_make_room): menu->help_text is now `const char **';
11500 adjust.
11501
11502 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11503 to changes in oldXMenu/XMenu.h from 2011-04-16.
11504 (struct XMenu): Declare `help_text' `const char **'.
11505
11506 * xfaces.c <Qunspecified>: Make extern again.
11507
11508 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11509 required by POSIX.
1b2de274 11510
762b15be
EZ
11511 * doc.c (get_doc_string): Improve the format passed to `error'.
11512
11513 * doprnt.c (doprnt): Improve commentary.
11514
11515 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11516
11517 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11518 them with etags.
11519
f1052e5d
EZ
11520 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11521 changes in globals.h immediately force recompilation.
762b15be
EZ
11522 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11523 $(CURDIR)/s/ms-w32.h.
11524 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11525
fa6996bc
EZ
11526 * character.c (Fchar_direction): Function deleted.
11527 (syms_of_character): Don't defsubr it.
11528 <char-direction-table>: Deleted.
11529
e6c3da20
EZ
115302011-04-23 Eli Zaretskii <eliz@gnu.org>
11531
11532 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11533 * doprnt.c: Include limits.h.
11534 (SIZE_MAX): New macro.
04f2d78b
CB
11535 (doprnt): Return a size_t value. 2nd arg is now size_t.
11536 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11537 Improve overflow protection. Support `l' modifier for integer
11538 conversions. Support %l conversion. Don't assume an EMACS_INT
11539 argument for integer conversions and for %c.
11540
11541 * lisp.h (doprnt): Restore prototype.
11542
11543 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11544 $(SRC)/character.h.
11545
11546 * Makefile.in (base_obj): Add back doprnt.o.
11547
11548 * deps.mk (doprnt.o): Add back prerequisites.
11549 (callint.o): Depend on character.h.
11550
11551 * eval.c (internal_lisp_condition_case): Include the handler
11552 representation in the error message.
11553 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11554 when breaking from the loop.
11555
11556 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11557
11558 * callint.c (Fcall_interactively): When displaying error message
11559 about invalid control letter, pass the character's codepoint, not
11560 a pointer to its multibyte form. Improve display of the character
11561 in octal and display also its hex code.
11562
11563 * character.c (char_string): Use %x to display the (unsigned)
11564 codepoint of an invalid character, to avoid displaying a bogus
11565 negative value.
11566
11567 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11568 `error', not SYMBOL_NAME itself.
11569
11570 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11571 character arguments to `error'.
11572
11573 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11574 to `error' in error message about FINAL_CHAR argument. Make sure
11575 FINAL_CHAR is a character, and use %c when it is passed as
11576 argument to `error'.
11577
4ffd0d6b 115782011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11579
11580 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11581
11582 * w32.c: Include <time.h>.
11583 (sys_localtime): New function.
11584
4ffd0d6b 115852011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11586
11587 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11588
4ffd0d6b 11589 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11590
4ffd0d6b 115912011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11592
4ffd0d6b
GM
11593 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11594 zombies (Bug#8467).
aac0c6e3 11595
04c56954
EZ
115962011-04-19 Eli Zaretskii <eliz@gnu.org>
11597
11598 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11599 gl_state.e_property when gl_state.object is Qt.
11600
11601 * insdel.c (make_gap_larger): Remove limitation of buffer size
11602 to <= INT_MAX.
11603
16a43933
CY
116042011-04-18 Chong Yidong <cyd@stupidchicken.com>
11605
11606 * xdisp.c (lookup_glyphless_char_display)
11607 (produce_glyphless_glyph): Handle cons cell entry in
11608 glyphless-char-display.
11609 (Vglyphless_char_display): Document it.
11610
11611 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11612 glyphless-char-display.
11613
4581706e
CY
116142011-04-17 Chong Yidong <cyd@stupidchicken.com>
11615
11616 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11617
11618 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11619
11620 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11621 definition for no-X builds.
11622
4887c6e2 116232011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11624
fd35b6f9
PE
11625 Static checks with GCC 4.6.0 and non-default toolkits.
11626
5c1ccb01
PE
11627 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11628
006c5daa
PE
11629 * process.c (keyboard_bit_set): Define only if SIGIO.
11630 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11631 (send_process): Repair possible setjmp clobbering.
11632
efc736d3
PE
11633 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11634
4e2fe2e6
PE
11635 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11636
f97334a2
PE
11637 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11638
4e75f29d
PE
11639 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11640 Define only if needed.
11641
90efadd1
PE
11642 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11643 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11644 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11645
3c647824
PE
11646 * dispextern.h (struct redisplay_interface): Rename param
11647 to avoid shadowing.
e264f262 11648 * termhooks.h (struct terminal): Likewise.
761383f4 11649 * xterm.c (xembed_send_message): Likewise.
3c647824 11650
b58c5c4a
PE
11651 * insdel.c (make_gap_smaller): Define only if
11652 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11653
cad59032
PE
11654 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11655 it.
11656
c339dc2e
PE
11657 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11658 so that we aren't warned about unused symbols.
11659
91a3e27b
PE
11660 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11661
399c71d3 11662 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11663
8ffc96f5
PE
11664 * xfns.c (x_real_positions): Mark locals as initialized.
11665
eef9bc79
PE
11666 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11667
098db9dd
PE
11668 * xterm.c: Fix problems found by static analysis with other toolkits.
11669 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11670 (x_dispatch_event): Declare static if USE_GTK, and
11671 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11672 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11673 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11674 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11675 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11676
eb18f6cc
PE
11677 * xmenu.c (menu_help_callback): Pointer type fixes.
11678 Use const pointers when pointing at readonly data. Avoid pointer
11679 signedness clashes.
11680 (FALSE): Remove unused macro.
11681 (update_frame_menubar): Remove unused decl.
11682
1fe72bf8
PE
11683 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11684
60d9e1db
PE
11685 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11686 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11687 (single_menu_item): Rename local to avoid shadowing.
11688
39261c26
PE
11689 * keyboard.c (make_lispy_event): Remove unused local var.
11690
018c5e19
PE
11691 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11692 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11693
63d2b86e
PE
11694 * bitmaps: Change bitmaps from unsigned char back to the X11
11695 compatible char. Avoid the old compiler warnings about
11696 out-of-range initializers by using, for example, '\xab' rather
11697 than 0xab.
11698
aefd87e1
PE
11699 * xgselect.c (xgselect_initialize): Check vs interface
11700 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11701
bf501fb9
PE
11702 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11703
e9829fdf
PE
11704 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11705 to read-only memory.
11706
1086c095
PE
11707 * fns.c (vector): Remove; this old hack is no longer needed.
11708
2baccd04 11709 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11710 Remove unused var.
dde42981 11711 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11712
72391843 11713 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11714
436c16df 11715 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11716 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11717 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11718
92bb796d 11719 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11720 (x_term_init): Remove local to avoid shadowing.
92bb796d 11721
764430a3 11722 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11723
11724 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11725 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11726
d1dfb56c
EZ
117272011-04-16 Eli Zaretskii <eliz@gnu.org>
11728
c4354cb4
EZ
11729 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11730
d1dfb56c
EZ
11731 Fix regex.c, syntax.c and friends for buffers > 2GB.
11732 * syntax.h (struct gl_state_s): Declare character position members
11733 EMACS_INT.
11734
11735 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11736
04f2d78b
CB
11737 * textprop.c (verify_interval_modification, interval_of):
11738 Declare arguments EMACS_INT.
d1dfb56c
EZ
11739
11740 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11741 EMACS_INT.
11742
11743 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11744
11745 * indent.c (Fvertical_motion): Local variable it_start is now
11746 EMACS_INT.
11747
11748 * regex.c (re_match, re_match_2, re_match_2_internal)
11749 (bcmp_translate, regcomp, regexec, print_double_string)
11750 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11751 (re_compile_pattern, re_exec): Declare arguments and local
11752 variables `size_t' and `ssize_t' and return values `regoff_t', as
11753 appropriate.
11754 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11755 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11756 <compile_stack_type>: `size' and `avail' are now `size_t'.
11757
11758 * regex.h <regoff_t>: Use ssize_t, not int.
11759 (re_search, re_search_2, re_match, re_match_2): Arguments that
11760 specify buffer/string position and length are now ssize_t and
11761 size_t. Return type is regoff_t.
11762
613052cd
BK
117632011-04-16 Ben Key <bkey76@gmail.com>
11764
11765 * nsfont.m: Fixed bugs in ns_get_family and
11766 ns_descriptor_to_entity that were caused by using free to
11767 deallocate memory blocks that were allocated by xmalloc (via
11768 xstrdup). This caused Emacs to crash when compiled with
11769 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11770 --enable-checking=xmallocoverrun). xfree is now used to
11771 deallocate these memory blocks.
11772
4170f62f 117732011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11774
71b41406
PE
11775 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11776
9587a89d
PE
11777 emacs_write: Accept and return EMACS_INT for sizes.
11778 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11779 et seq.
11780 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11781 Accept and return EMACS_INT.
11782 (emacs_gnutls_write): Return the number of bytes written on
11783 partial writes.
11784 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11785 (emacs_read, emacs_write): Remove check for negative size, as the
11786 Emacs source code has been audited now.
9587a89d
PE
11787 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11788 (emacs_read, emacs_write): Use it.
273a5f82
PE
11789 * process.c (send_process): Adjust to the new signatures of
11790 emacs_write and emacs_gnutls_write. Do not attempt to store
11791 a byte offset into an 'int'; it might overflow.
9587a89d 11792 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11793
3e047f51
PE
11794 * sound.c: Don't assume sizes fit in 'int'.
11795 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11796 Return EMACS_INT, not int.
3e047f51 11797 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11798 Accept EMACS_INT, not int.
11799 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11800 record read return values.
11801
cc39a9db
BK
118022011-04-15 Ben Key <bkey76@gmail.com>
11803
c9d0ec6d
JB
11804 * keyboard.c (Qundefined): Don't declare static since it is used
11805 in nsfns.m.
11806 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11807 static since they are used in nsfont.m.
cc39a9db 11808
6c60eb9f
SM
118092011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11810
11811 * process.c (Qprocessp): Don't declare static.
11812 * lisp.h (Qprocessp): Declare again.
11813
7990b61a
JB
118142011-04-15 Juanma Barranquero <lekktu@gmail.com>
11815
11816 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11817
5d4cb038
PE
118182011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11819
8bd7b830 11820 Improve C-level modularity by making more things 'static'.
cd64ea1d 11821
e3b27b31
PE
11822 Don't publish debugger-only interfaces to other modules.
11823 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11824 (verify_bytepos, count_markers): Move decls to the only modules
11825 that need them.
11826 * region-cache.h (pp_cache): Likewise.
11827 * window.h (check_all_windows): Likewise.
11828 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11829
5d4cb038
PE
11830 * sysdep.c (croak): Now static, if
11831 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11832 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11833
11834 * alloc.c (refill_memory_reserve): Now static if
11835 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11836 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11837
e87b6180
PE
11838 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11839 Define only if USE_LUCID.
11840
ac64929e
PE
11841 * xrdb.c (x_customization_string, x_rm_string): Now static.
11842
6f37259d
PE
11843 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11844 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11845
1683e3ab
PE
11846 * xdisp.c (draw_row_with_mouse_face): Now static.
11847 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11848
de9c2632
PE
11849 * window.h (check_all_windows): Mark externally visible.
11850
2b96acb7
PE
11851 * window.c (window_deletion_count): Now static.
11852
11853 * undo.c: Make symbols static if they're not exported.
11854 (last_undo_buffer, last_boundary_position, pending_boundary):
11855 Now static.
11856
50436f33
PE
11857 * textprop.c (interval_insert_behind_hooks): Now static.
11858 (interval_insert_in_front_hooks): Likewise.
11859
64520e5c
PE
11860 * term.c: Make symbols static if they're not exported.
11861 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11862 (max_frame_lines, tty_set_terminal_modes):
11863 (tty_reset_terminal_modes, tty_turn_off_highlight):
11864 (get_tty_terminal): Now static.
11865 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11866 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11867 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11868 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11869 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11870
1fa53021
PE
11871 * sysdep.c: Make symbols static if they're not exported.
11872 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11873 Now static.
11874 (sigprocmask_set, full_mask): Remove; unused.
11875 (wait_debugging): Mark as visible.
11876 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11877 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11878
d4b43b22
PE
11879 * syntax.c (syntax_temp): Define only if !__GNUC__.
11880
b7c513d0
PE
11881 * sound.c (current_sound_device, current_sound): Now static.
11882
989b29ad
PE
11883 * search.c (searchbufs, searchbuf_head): Now static.
11884
13a55a78
PE
11885 * scroll.c (scroll_cost): Remove; unused.
11886 * dispextern.h (scroll_cost): Remove decl.
11887
de68a1fc
PE
11888 * region-cache.h (pp_cache): Mark as externally visible.
11889
40ccffa6
PE
11890 * process.c: Make symbols static if they're not exported.
11891 (process_tick, update_tick, create_process, chan_process):
11892 (Vprocess_alist, proc_buffered_char, datagram_access):
11893 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11894 (deactivate_process): Mark defn as static, as well as decl.
11895 * lisp.h (create_process): Remove decl.
11896 * process.h (chan_process, Vprocess_alist): Remove decls.
11897
ad64fc97
PE
11898 * print.c: Make symbols static if they're not exported.
11899 (print_depth, new_backquote_output, being_printed, print_buffer):
11900 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11901 (print_interval, print_number_index, initial_stderr_stream):
11902 Now static.
11903 * lisp.h (Fprinc): Remove decl.
11904 (debug_output_compilation_hack): Mark as externally visible.
11905
adddb265
PE
11906 * sysdep.c (croak): Move decl from here to syssignal.h.
11907 * syssignal.h (croak): Put it here, so the API can be checked when
11908 'croak' is called from dissociate_if_controlling_tty.
11909
1717ede2
PE
11910 * minibuf.c: Make symbols static if they're not exported.
11911 (minibuf_save_list, choose_minibuf_frame): Now static.
11912 * lisp.h (choose_minibuf_frame): Remove decl.
11913
fa5fb2bc
PE
11914 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11915
1e3890d1
PE
11916 * lread.c: Make symbols static if they're not exported.
11917 (read_objects, initial_obarray, oblookup_last_bucket_number):
11918 Now static.
11919 (make_symbol): Remove; unused.
11920 * lisp.h (initial_obarray, make_symbol): Remove decls.
11921
8a1414fa
PE
11922 * keyboard.c: Make symbols static if they're not exported.
11923 (single_kboard, recent_keys_index, total_keys, recent_keys):
11924 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11925 (this_single_command_key_start, echoing, last_auto_save):
11926 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11927 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11928 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11929 (Vlispy_mouse_stem, double_click_count):
11930 Now static.
11931 (force_auto_save_soon): Define only if SIGDANGER.
11932 (ignore_mouse_drag_p): Now static if
11933 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11934 (print_help): Remove; unused.
11935 (stop_character, last_timer_event): Mark as externally visible.
11936 * keyboard.h (ignore_mouse_drag_p): Declare only if
11937 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11938 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11939 * lisp.h (echoing): Remove decl.
11940 (force_auto_save_soon): Declare only if SIGDANGER.
11941 * xdisp.c (redisplay_window): Simplify code, to make it more
11942 obvious that ignore_mouse_drag_p is not accessed if !defined
11943 USE_GTK && !defined HAVE_NS.
11944
93ea6e8f
PE
11945 * intervals.c: Make symbols static if they're not exported.
11946 (merge_properties_sticky, merge_interval_right, delete_interval):
11947 Now static.
11948 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11949
77382fcc
PE
11950 * insdel.c: Make symbols static if they're not exported.
11951 However, leave prepare_to_modify_buffer alone. It's never
11952 called from outside this function, but that appears to be a bug.
11953 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11954 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11955 (adjust_after_replace_noundo): Remove; unused.
11956 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 11957 (signal_before_change): Remove decls.
77382fcc 11958
9306c32e
PE
11959 * indent.c (val_compute_motion, val_vmotion): Now static.
11960
cd44d2eb
PE
11961 * image.c: Make symbols static if they're not exported.
11962 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11963 if USE_GTK.
11964 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11965 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11966
ad9a7a06
PE
11967 * fringe.c (standard_bitmaps): Now static.
11968 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11969
81626931
PE
11970 * frame.c: Make symbols static if they're not exported.
11971 (x_report_frame_params, make_terminal_frame): Now static.
11972 (get_frame_param): Now static, unless HAVE_NS.
11973 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11974 (x_get_resource_string): Remove; not used.
11975 * frame.h (make_terminal_frame, x_report_frame_params):
11976 (x_get_resource_string); Remove decls.
11977 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11978 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11979
239f9db9
PE
11980 * font.c, fontset.c: Make symbols static if they're not exported.
11981 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11982 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11983 * font.c (font_close_object): Now static.
11984 * font.h (font_close_object): Remove.
11985 * fontset.c (FONTSET_OBJLIST): Remove.
11986 (free_realized_fontset) #if-0 the body, which does nothing.
11987 (face_suitable_for_char_p): #if-0, as it's never called.
11988 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
11989 * xfaces.c (face_at_string_position):
11990 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
11991 since 0 is always ASCII.
11992
dfcf3579
PE
11993 * fns.c (weak_hash_tables): Now static.
11994
5045092b
PE
11995 * fileio.c: Make symbols static if they're not exported.
11996 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11997 (Vwrite_region_annotation_buffers): Now static.
11998
57a96f5c
PE
11999 * eval.c: Make symbols static if they're not exported.
12000 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
12001 * lisp.h (backtrace_list): Remove decl.
12002
35f08c38
PE
12003 * emacs.c: Make symbols static if they're not exported.
12004 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
12005 (fatal_error_code, fatal_error_signal_hook, standard_args):
12006 Now static.
12007 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
12008 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
12009 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
12010 * lisp.h (fatal_error_signal_hook): Remove decl.
12011 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
12012
f44bd759
PE
12013 * editfns.c: Move a (normally-unused) function to its only use.
12014 * editfns.c, lisp.h (get_operating_system_release): Remove.
12015 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
12016 worth the hassle of breaking this out.
12017
b532497d
PE
12018 * xterm.c: Make symbols static if they're not exported.
12019 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
12020 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
12021 (x_destroy_window, x_delete_display):
12022 Now static.
12023 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
12024 (x_mouse_leave): Remove; unused.
12025 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
12026 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
12027 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
12028 Remove decls.
12029 (x_mouse_leave): Declare only if WINDOWSNT.
12030 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
12031 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
12032 USE_X_TOOLKIT.
12033
1675728f
PE
12034 * ftxfont.c: Make symbols static if they're not exported.
12035 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
12036 HAVE_FREETYPE.
12037 * font.h (ftxfont_driver): Likewise.
12038
e4cebfca
PE
12039 * xfns.c: Make symbols static if they're not exported.
12040 (x_last_font_name, x_display_info_for_name):
12041 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
12042 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
12043 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
12044 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
12045 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
12046 (last_show_tip_args): Now static.
12047 (xic_defaut_fontset, xic_create_fontsetname): Define only if
12048 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
12049 (x_screen_planes): Remove; unused.
12050 * dispextern.h (x_screen_planes): Remove decl.
12051
5bf46f05
PE
12052 * dispnew.c: Make symbols static if they're not exported.
12053 * dispextern.h (redraw_garbaged_frames, scrolling):
12054 (increment_row_positions): Remove.
12055 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
12056 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
12057 Now static.
12058 (redraw_garbaged_frames): Remove; unused.
12059
435f4c28
PE
12060 * xfaces.c: Make symbols static if they're not exported.
12061 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
12062 Remove decls.
12063 * xterm.h (defined_color): Remove decls.
12064 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
12065 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
12066 (menu_face_changed_default, defined_color, free_realized_face):
12067 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
12068 (ascii_face_of_lisp_face): Remove; unused.
12069
8524aef3
PE
12070 * xdisp.c: Make symbols static if they're not exported.
12071 * dispextern.h (scratch_glyph_row, window_box_edges):
12072 (glyph_to_pixel_coords, set_cursor_from_row):
12073 (get_next_display_element, set_iterator_to_next):
12074 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
12075 (show_mouse_face): Remove decls
12076 * frame.h (message_buf_print): Likewise.
12077 * lisp.h (pop_message, set_message, check_point_in_composition):
12078 Likewise.
12079 * xterm.h (set_vertical_scroll_bar): Likewise.
12080 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
12081 (message_buf_print, scratch_glyph_row, displayed_buffer):
12082 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
12083 (get_next_display_element, show_mouse_face, window_box_edges):
12084 (frame_to_window_pixel_xy, check_point_in_composition):
12085 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
12086 (glyph_to_pixel_coords): Remove; unused.
12087
16390cd2
PE
12088 * dired.c (file_name_completion): Now static.
12089
12090 * dbusbind.c (xd_in_read_queued_messages): Now static.
12091
a25f4dfa
PE
12092 * lisp.h (circular_list_error, FOREACH): Remove; unused.
12093 * data.c (circular_list_error): Remove.
12094
14a9c8df
PE
12095 * commands.h (last_point_position, last_point_position_buffer):
12096 (last_point_position_window): Remove decls.
12097 * keyboard.c: Make these variables static.
12098
04f2d78b
CB
12099 * coding.h (coding, code_convert_region, encode_coding_gap):
12100 Remove decls.
74ab6df5
PE
12101 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
12102 (iso_code_class, detect_coding, code_convert_region): Now static.
12103 (encode_coding_gap): Remove; unused.
12104
38dfbee1
PE
12105 * chartab.c (chartab_chars, chartab_bits): Now static.
12106
a2cb4e63
PE
12107 * charset.h (charset_iso_8859_1): Remove decl.
12108 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
12109 Now static.
12110
127198fd
PE
12111 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
12112 * ccl.c (Vccl_program_table): Now static.
12113 (check_ccl_update): Remove; unused.
12114
d85b608f
PE
12115 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
12116 * category.h: ... from here.
12117 * category.c (check_category_table, set_category_set): Now static.
12118
31cd66f3
PE
12119 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
12120 * lisp.h: Remove these decls.
12121
c358e587
PE
12122 * buffer.c (buffer_count): Remove unused var.
12123
e78aecca
PE
12124 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
12125 so that it's not optimized away.
12126 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
12127 * dispextern.h (bidi_dump_cached_states): Remove, since it's
12128 exported only to the debugger.
12129
e192d7d3 12130 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 12131 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 12132
92470028
PE
12133 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
12134 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
12135 was inaccessible from Lisp.
12136 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
12137 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
12138
244ed907
PE
12139 alloc.c: Import and export fewer symbols, and remove unused items.
12140 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
12141 is defined.
12142 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
12143 it's not optimized away by whole-program optimization.
12144 (message_enable_multibyte, free_misc): Remove.
12145 (catchlist, handlerlist, mark_backtrace):
12146 Declare only if BYTE_MARK_STACK.
12147 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12148 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
12149 (message_enable_multibyte): Remove decl.
12150 (free_misc, interval_free_list, float_block, float_block_index):
12151 (n_float_blocks, float_free_list, cons_block, cons_block_index):
12152 (cons_free_list, last_marked_index):
12153 Now static.
12154 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
12155 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
12156 (mark_backtrace): Define only if BYTE_MARK_STACK.
12157 * xdisp.c (message_enable_multibyte): Now static.
12158
61c2b50e 12159 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
12160 This makes it easier for human readers (and static analyzers)
12161 to see whether these variables are used from other modules.
12162 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
12163 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
12164 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
12165 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
12166 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
12167 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
12168 * xmenu.c, xselect.c:
12169 Declare Q* vars static if they are not used in other modules.
12170 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
12171 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
12172 Remove decls of unexported vars.
12173 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
12174
95c82688
PE
12175 * lisp.h (DEFINE_FUNC): Make sname 'static'.
12176
16a97296
PE
12177 Make Emacs functions such as Fatom 'static' by default.
12178 This makes it easier for human readers (and static analyzers)
12179 to see whether these functions can be called from other modules.
12180 DEFUN now defines a static function. To make the function external
12181 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
12182 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
12183 (Finit_image_library):
16a97296
PE
12184 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
12185 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
12186 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
12187 Remove decls, since these functions are now static.
12188 (Funintern, Fget_internal_run_time): New decls, since these functions
12189 were already external.
95c82688 12190
16a97296
PE
12191 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
12192 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
12193 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
12194 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
12195 * keyboard.c, keymap.c, lread.c:
12196 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
12197 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
12198 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
12199 Mark functions with DEFUE instead of DEFUN,
12200 if they are used in other modules.
12201 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
12202 decls for now-static functions.
12203 * buffer.h (Fdelete_overlay): Remove decl.
12204 * callproc.c (Fgetenv_internal): Mark as internal.
12205 * composite.c (Fremove_list_of_text_properties): Remove decl.
12206 (Fcomposition_get_gstring): New forward static decl.
12207 * composite.h (Fcomposite_get_gstring): Remove decl.
12208 * dired.c (Ffile_attributes): New forward static decl.
12209 * doc.c (Fdocumntation_property): New forward static decl.
12210 * eval.c (Ffetch_bytecode): New forward static decl.
12211 (Funintern): Remove extern decl; now in .h file where it belongs.
12212 * fileio.c (Fmake_symbolic_link): New forward static decl.
12213 * image.c (Finit_image_library): New forward static decl.
12214 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
12215 * intervals.h (Fprevious_property_change):
12216 (Fremove_list_of_text_properties): Remove decls.
12217 * keyboard.c (Fthis_command_keys): Remove decl.
12218 (Fcommand_execute): New forward static decl.
12219 * keymap.c (Flookup_key): New forward static decl.
12220 (Fcopy_keymap): Now static.
12221 * keymap.h (Flookup_key): Remove decl.
12222 * process.c (Fget_process): New forward static decl.
12223 (Fprocess_datagram_address): Mark as internal.
12224 * syntax.c (Fsyntax_table_p): New forward static decl.
12225 (skip_chars): Remove duplicate decl.
12226 * textprop.c (Fprevious_property_change): New forward static decl.
12227 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
12228 Now internal.
12229 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
12230 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
12231
785bbd42
PE
12232 * editfns.c (Fformat): Remove unreachable code.
12233
8b913b57
AS
122342011-04-14 Andreas Schwab <schwab@linux-m68k.org>
12235
12236 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
12237 change. (Bug#8496)
12238
a6744a35
EZ
122392011-04-13 Eli Zaretskii <eliz@gnu.org>
12240
12241 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
12242 when at ZV. (Bug#8487)
12243
e7974947
AS
122442011-04-12 Andreas Schwab <schwab@linux-m68k.org>
12245
baad03f0
AS
12246 * charset.c (Fclear_charset_maps): Use xfree instead of free.
12247 (Bug#8437)
12248 * keyboard.c (parse_tool_bar_item): Likewise.
12249 * sound.c (sound_cleanup, alsa_close): Likewise.
12250 * termcap.c (tgetent): Likewise.
12251 * xfns.c (x_default_font_parameter): Likewise.
12252 * xsettings.c (read_and_apply_settings): Likewise.
12253
e7974947
AS
12254 * alloc.c (overrun_check_malloc, overrun_check_realloc)
12255 (overrun_check_free): Protoize.
12256
28272684
PE
122572011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12258
12259 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12260 since callers should never pass a negative size.
12261 Change the signature to match that of plain 'read' and 'write'; see
12262 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12263 * lisp.h: Update prototypes of emacs_write and emacs_read.
12264
11997c76
EZ
122652011-04-11 Eli Zaretskii <eliz@gnu.org>
12266
12267 * xdisp.c (redisplay_window): Don't try to determine the character
12268 position of the scroll margin if the window start point w->startp
e896f03c 12269 is outside the buffer's accessible region. (Bug#8468)
11997c76 12270
8a2cbd72
EZ
122712011-04-10 Eli Zaretskii <eliz@gnu.org>
12272
12273 Fix write-region and its subroutines for buffers > 2GB.
12274 * fileio.c (a_write, e_write): Modify declaration of arguments and
12275 local variables to support buffers larger than 2GB.
12276 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12277
12278 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12279 argument, local variables, and return value.
12280
12281 * lisp.h: Update prototypes of emacs_write and emacs_read.
12282
12283 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12284
4073e537 122852011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 12286
1ebfdcb6
PE
12287 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12288
b2ded58d
PE
12289 Fix more problems found by GCC 4.6.0's static checks.
12290
7d66342c
PE
12291 * xdisp.c (vmessage): Use a better test for character truncation.
12292
bbf47d44
PE
12293 * charset.c (load_charset_map): <, not <=, for optimization,
12294 and to avoid potential problems with integer overflow.
9248994d 12295 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 12296 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 12297 * editfns.c (Fformat): Likewise.
1e69125e 12298 * syntax.c (skip_chars): Likewise.
3befa583 12299
e3019616
PE
12300 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12301 This also lets GCC 4.6.0 generate slightly better loop code.
12302
becfa255
PE
12303 * callint.c (Fcall_interactively): <, not <=, for optimization.
12304 (Fcall_interactively): Count the number of arguments produced,
12305 not the number of arguments given. This is simpler and lets GCC
12306 4.6.0 generate slightly better code.
12307
dae0cd48
PE
12308 * ftfont.c: Distingish more carefully between FcChar8 and char.
12309 The previous code passed unsigned char * to a functions like
12310 strlen and xstrcasecmp that expect char *, which does not
12311 conform to the C standard.
12312 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12313 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12314 char * when the C standard requires it.
12315
76032d70
PE
12316 * keyboard.c (read_char): Remove unused var.
12317
eb3f1cc8
PE
12318 * eval.c: Port to Windows vsnprintf (Bug#8435).
12319 Include <limits.h>.
12320 (SIZE_MAX): Define if the headers do not.
12321 (verror): Do not give up if vsnprintf returns a negative count.
12322 Instead, grow the buffer. This ports to Windows vsnprintf, which
12323 does not conform to C99. Problem reported by Eli Zaretskii.
12324 Also, simplify the allocation scheme, by avoiding the need for
12325 calling realloc, and removing the ALLOCATED variable.
12326
70476b54
PE
12327 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12328
12020a9e
PE
12329 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12330 But keep the doprint source code for now, as we might revamp it
12331 and use it again (Bug#8435).
ea6c7ae6
PE
12332 * lisp.h (doprnt): Remove.
12333 * Makefile.in (base_obj): Remove doprnt.o.
12334 * deps.mk (doprnt.o): Remove.
12335
5fdb398c
PE
12336 error: Print 32- and 64-bit integers portably (Bug#8435).
12337 Without this change, on typical 64-bit hosts error ("...%d...", N)
12338 was used to print both 32- and 64-bit integers N, which relied on
12339 undefined behavior.
61bdb816 12340 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
12341 * lisp.h (error, verror): Mark as printf-like functions.
12342 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
12343 Report overflow in size calculations when allocating printf buffer.
12344 Do not truncate output string at its first null byte.
12345 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12346 Truncate the output at a character boundary, since vsnprintf does not
12347 do that.
12348 * charset.c (check_iso_charset_parameter): Convert internal
12349 character to string before calling 'error', since %c now has the
12350 printf meaning.
12351 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12352 overflow when computing char to be passed to 'error'. Do not
12353 pass Lisp_Object to 'error'; pass the integer instead.
12354 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12355 formatted with plain %d.
12356
b189fa66
PE
12357 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12358
bff87ef0
PE
12359 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12360
7e2cac20
PE
12361 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12362
ce4d90b5
PE
12363 * xterm.c (x_catch_errors): Remove duplicate declaration.
12364
266c9547
PE
12365 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12366
79c49ad2
PE
12367 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12368
368f4090
JM
123692011-04-10 Jim Meyering <meyering@redhat.com>
12370
12371 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12372 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12373 return ssize_t not "int", and use size_t as the buffer length.
12374 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12375 * gnutls.h: Update declarations.
12376 * process.c (read_process_output): Use ssize_t, to match.
12377 (send_process): Likewise.
12378
a32d4040
CY
123792011-04-09 Chong Yidong <cyd@stupidchicken.com>
12380
12381 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12382
8546720e 123832011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12384
04f2d78b
CB
12385 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12386 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12387
8546720e
GM
12388 * xterm.c (handle_one_xevent):
12389 * xmenu.c (create_and_show_popup_menu):
12390 * xselect.c (x_decline_selection_request)
12391 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12392
0a2f5c1a 123932011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12394
12395 Fix some uses of `int' instead of EMACS_INT.
12396 * search.c (string_match_1, fast_string_match)
12397 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12398 (scan_buffer, find_next_newline_no_quit)
12399 (find_before_next_newline, search_command, Freplace_match)
12400 (Fmatch_data): Make some `int' variables be EMACS_INT.
12401
12402 * xdisp.c (display_count_lines): 3rd argument and return value now
12403 EMACS_INT. All callers changed.
12404 (pint2hrstr): Last argument is now EMACS_INT.
12405
12406 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12407 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12408 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12409 (decode_coding_utf_16, decode_coding_emacs_mule)
12410 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12411 (decode_coding_ccl, decode_coding_charset)
12412 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12413 (decode_coding_iso_2022, decode_coding_emacs_mule)
12414 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12415 <char_offset, last_offset>: Declare EMACS_INT.
12416 (encode_coding_utf_8, encode_coding_utf_16)
12417 (encode_coding_emacs_mule, encode_invocation_designation)
12418 (encode_designation_at_bol, encode_coding_iso_2022)
12419 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12420 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12421 Declare EMACS_INT.
12422 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12423 (encode_invocation_designation): Last argument P_NCHARS is now
12424 EMACS_INT.
12425 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12426 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12427
12428 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12429 All users changed.
12430
12431 * ccl.c (Fccl_execute_on_string): Declare some variables
12432 EMACS_INT.
12433
8546720e 124342011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12435
12436 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12437
4e19a977
CS
124382011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12439
12440 * process.c (Fformat_network_address): Doc fix.
12441
87302331
R
124422011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12443
ee7683eb 12444 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12445
cbb59342
CY
124462011-04-08 Chong Yidong <cyd@stupidchicken.com>
12447
12448 * keyboard.c (read_char): Call Lisp function help-form-show,
12449 instead of using internal_with_output_to_temp_buffer.
12450 (Qhelp_form_show): New var.
e0d38eeb 12451 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12452
12453 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12454
12455 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12456
e67a13ab
CY
124572011-04-06 Chong Yidong <cyd@stupidchicken.com>
12458
04f2d78b
CB
12459 * process.c (Flist_processes): Remove to Lisp.
12460 (list_processes_1): Delete.
e67a13ab 12461
973f782d
EZ
124622011-04-06 Eli Zaretskii <eliz@gnu.org>
12463
7c106b1e
EZ
12464 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12465
973f782d
EZ
12466 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12467
41cf7d1a 124682011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12469
ca23cc88
PE
12470 Fix more problems found by GCC 4.6.0's static checks.
12471
f390e2d5
PE
12472 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12473
42eea0d0
PE
12474 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12475
b69769da 12476 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12477
f9541e84
PE
12478 * xdisp.c (vmessage): Mark as a printf-like function.
12479
13841b55
PE
12480 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12481
c136c10f
PE
12482 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12483
5e2d4a30
PE
12484 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12485 printf-like functions.
12486 (tiff_load): Add casts to remove these marks before passing them
12487 to system-supplied API.
12488
583f48b9
PE
12489 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12490
b25d760e
PE
12491 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12492 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12493 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12494 directly, rather than having caller test rule sign. This avoids
12495 some unnecessary tests.
12496 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12497 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12498 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12499
bc7b6697 12500 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12501 (xfont_open): Avoid unnecessary tests.
bc7b6697 12502
27ccc379
PE
12503 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12504
dcd5c89a
PE
12505 * composite.h, composite.c (composition_gstring_put_cache):
12506 Use EMACS_INT, not int, for length.
12507
b13a45c6
PE
12508 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12509 breaking out part of COMPOSITION_DECODE_RULE.
12510 (COMPOSITION_DECODE_RULE): Use it.
12511 * composite.c (get_composition_id): Remove unused local vars,
12512 by using the new macro.
12513
1e792e4d
PE
12514 * textprop.c (set_text_properties_1): Change while to do-while,
12515 since the condition is always true at first.
12516
dc6c6455 12517 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12518 (interval_deletion_adjustment): Return unsigned value.
12519 All uses changed.
dc6c6455 12520
aba7731a
PE
12521 * process.c (list_processes_1, create_pty, read_process_output):
12522 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12523 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12524 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12525 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12526 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12527
fdfc4bf3
PE
12528 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12529
fca8fe46 12530 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12531 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12532
06a0259a 12533 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12534 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12535 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12536
e7b9e80f
PE
12537 * print.c (print_error_message): Avoid int overflow.
12538
56201685
PE
12539 * font.c (font_list_entities): Redo for clarity,
12540 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12541
78834453 12542 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12543 (font_score): Avoid potential overflow in diff calculation.
78834453 12544
0bc0b309 12545 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12546 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12547
e610eaca
PE
12548 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12549
b895abce
PE
12550 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12551 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12552 can always succeed if overflow has undefined behavior.
12553
1f1d9321 12554 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12555 (wordify): Omit three unnecessary tests.
1f1d9321 12556
c59478bc
PE
12557 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12558 All callers changed. This avoids the need for an unused var.
12559
79b73827
PE
12560 * casefiddle.c (casify_region): Remove var that is set but not used.
12561
a4db5dfe
PE
12562 * dired.c (file_name_completion): Remove var that is set but not used.
12563
43aae36e
PE
12564 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12565
2a47c44d 12566 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12567 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12568
a37c69bf
PE
12569 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12570 Check for integer overflow on size calculations.
12571
328ab8e7
PE
12572 * buffer.c (Fprevious_overlay_change): Remove var that is set
12573 but not used.
12574
e5a2a5cb
PE
12575 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12576 Remove vars that are set but not used.
8d84a6eb 12577 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12578 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12579
a60e5f68
PE
12580 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12581
f661cb61 12582 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12583 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12584
f0397f5a
PE
12585 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12586 that are set but not used.
12587
8664db06 12588 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12589 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12590
6abdaa4a
PE
12591 * xselect.c (x_get_local_selection, x_handle_property_notify):
12592 Remove vars that are set but not used.
12593
0ce7538d 12594 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12595 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12596
9ae848fc
PE
12597 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12598 Remove var that is set but not used.
0b918413
PE
12599 (scroll_bar_windows_size): Now size_t, not int.
12600 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12601 Check for overflow.
9ae848fc 12602
a5a62657
PE
12603 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12604 (map_tty_color) [!defined MSDOS]: Likewise.
12605
5c5cdd39
PE
12606 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12607
66ebf983
PE
12608 * coding.c: Remove vars that are set but not used.
12609 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12610 All callers changed.
12611 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12612 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12613 (decode_coding_charset): Remove vars that are set but not used.
12614
1be4d761
PE
12615 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12616 that is set but not used.
12617
47553fa8
PE
12618 * print.c (print_object): Remove var that is set but not used.
12619
1f7196bf 12620 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12621 The gnulib version avoids calling malloc in the usual case,
12622 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12623 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12624 * filelock.c (current_lock_owner): Likewise.
12625 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12626 * sysdep.c: Include allocator.h, careadlinkat.h.
12627 (emacs_no_realloc_allocator): New static constant.
12628 (emacs_readlink): New function.
fdb61804
PE
12629 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12630 ../lib/careadlinkat.h.
d1fdcab7 12631
f84c17c7
SM
126322011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12633
12634 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12635 first non-nil return value).
12636
ef3862ad
JD
126372011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12638
12639 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12640 if not defined (Bug#8403).
12641
376a7006
JB
126422011-04-02 Juanma Barranquero <lekktu@gmail.com>
12643
12644 * xdisp.c (display_count_lines): Remove parameter `start',
12645 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12646 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12647 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12648 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12649 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12650 and thereabouts. All callers changed.
12651 (get_per_char_metric): Remove parameter `f', unused since
12652 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12653
6ca3801d
JM
126542011-04-02 Jim Meyering <meyering@redhat.com>
12655
12656 do not dereference NULL upon failed strdup
12657 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12658 (ns_get_family): Likewise.
12659
d8e2b5ba
JB
126602011-04-02 Juanma Barranquero <lekktu@gmail.com>
12661
12662 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12663
8c74fcbd
JD
126642011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12665
12666 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12667 later (Bug#8403).
12668
7200d79c
SM
126692011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12670
03408648 12671 Add lexical binding.
7200d79c 12672
03408648
SM
12673 * window.c (Ftemp_output_buffer_show): New fun.
12674 (Fsave_window_excursion):
12675 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12676
12677 * lread.c (lisp_file_lexically_bound_p): New function.
12678 (Fload): Bind Qlexical_binding.
12679 (readevalloop): Remove `evalfun' arg.
12680 Bind Qinternal_interpreter_environment.
12681 (Feval_buffer): Bind Qlexical_binding.
12682 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12683 Mark as dynamic.
12684 (syms_of_lread): Declare `lexical-binding'.
12685
12686 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12687
12688 * keyboard.c (eval_dyn): New fun.
12689 (menu_item_eval_property): Use it.
ca105506
SM
12690
12691 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12692
03408648
SM
12693 * fns.c (concat, mapcar1): Accept byte-code-functions.
12694
12695 * eval.c (Fsetq): Handle lexical vars.
12696 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12697 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12698 (FletX, Flet): Obey lexical binding.
12699 (Fcommandp): Handle closures.
12700 (Feval): New `lexical' arg.
12701 (eval_sub): New function extracted from Feval. Use it almost
12702 everywhere where Feval was used. Look up vars in lexical env.
12703 Handle closures.
12704 (Ffunctionp): Move from subr.el.
12705 (Ffuncall): Handle closures.
12706 (apply_lambda): Remove `eval_flags'.
12707 (funcall_lambda): Handle closures and new byte-code-functions.
12708 (Fspecial_variable_p): New function.
12709 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12710 but without exporting it to Lisp.
23aba0ea 12711
23aba0ea 12712 * doc.c (Fdocumentation, store_function_docstring):
03408648 12713 * data.c (Finteractive_form): Handle closures.
23aba0ea 12714
03408648
SM
12715 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12716 interactive spec.
ba83908c 12717
04f2d78b
CB
12718 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12719 New byte-codes.
03408648
SM
12720 (exec_byte_code): New function extracted from Fbyte_code to handle new
12721 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12722
03408648 12723 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12724
03408648 12725 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12726
e2abce01
JB
127272011-03-31 Juanma Barranquero <lekktu@gmail.com>
12728
12729 * xdisp.c (redisplay_internal): Fix prototype.
12730
63696a73 127312011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12732
63696a73 12733 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12734 (try_scrolling): Use it when setting scroll_limit.
12735 Limit scrolling to 100 screen lines.
63696a73
EZ
12736 (redisplay_window): Even when falling back on "recentering",
12737 position point in the window according to scroll-conservatively,
12738 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12739
12740 (try_scrolling): When point is above the window, allow searching
12741 as far as scroll_max, or one screenful, to compute vertical
12742 distance from PT to the scroll margin position. This prevents
12743 try_scrolling from unnecessarily failing when
12744 scroll-conservatively is set to a value slightly larger than the
12745 window height. Clean up the case of PT below the margin at bottom
12746 of window: scroll_max can no longer be INT_MAX. When aggressive
12747 scrolling is in use, don't let point enter the opposite scroll
12748 margin as result of the scroll.
12749 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12750 threshold of 100 lines for never-recentering scrolling.
12751
e4cc2dfc
JB
127522011-03-31 Juanma Barranquero <lekktu@gmail.com>
12753
12754 * dispextern.h (move_it_by_lines):
12755 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12756 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12757 (message_log_check_duplicate): Remove parameters `prev_bol' and
12758 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12759 (redisplay_internal): Remove parameter `preserve_echo_area',
12760 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12761
12762 * indent.c (Fvertical_motion):
12763 * window.c (window_scroll_pixel_based, Frecenter):
12764 Don't pass `need_y_p' to `move_it_by_lines'.
12765
1c470562
SM
127662011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12767
44f230aa
SM
12768 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12769 steal a few bits to be more compact.
12770 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12771 Remove unneeded casts.
12772
1c470562
SM
12773 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12774
888adce9
ZK
127752011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12776
12777 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12778 binding" message (bug#7967).
12779
f838ed7b
PE
127802011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12781
77861b95
PE
12782 Fix more problems found by GCC 4.6.0's static checks.
12783
de6dbc14
PE
12784 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12785 Remove unused local var.
12786
f838ed7b
PE
12787 * editfns.c (Fmessage_box): Remove unused local var.
12788
792c7b2b
PE
12789 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12790 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12791 Omit unused local vars.
c499e557 12792 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12793 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12794 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12795 Omit unused local var.
12796
ba0165e1
PE
12797 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12798 Don't assume string length fits in int.
32ad8845 12799 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12800 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12801
3c59b4c9
PE
12802 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12803 instead of alloca (Bug#8344).
12804
a3eed478 12805 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12806 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12807
eb4d412d
PE
12808 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12809
1658b401
PE
12810 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12811 concerns.
12812
12813 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12814
12815 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12816
9a2c6e05
PE
12817 * keyboard.c (syms_of_keyboard): Use the same style as later
12818 in this function when indexing through an array. This also
12819 works around GCC bug 48267.
12820
03d0a109
PE
12821 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12822
44f730c8
PE
12823 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12824
fe75f926
PE
12825 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12826 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12827
ffa8c828
PE
12828 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12829 This avoids undefined behavior on integer overflow, and is a bit
12830 more convenient anyway since it is compared to a size_t variable.
12831
c5101a77
PE
12832 Variadic C functions now count arguments with size_t, not int.
12833 This avoids an unnecessary limitation on 64-bit machines, which
12834 caused (substring ...) to crash on large vectors (Bug#8344).
12835 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12836 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12837 All variadic functions and their callers changed accordingly.
c5101a77
PE
12838 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12839 * data.c (arith_driver, float_arith_driver): Likewise.
12840 * editfns.c (general_insert_function): Likewise.
12841 * eval.c (struct backtrace.nargs, interactive_p)
12842 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12843 (funcall_lambda, mark_backtrace): Likewise.
12844 * fns.c (concat): Likewise.
12845 * frame.c (x_set_frame_parameters): Likewise.
12846 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12847 0 if not found, not -1. All callers changed.
12848
dd3f25f7
PE
12849 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12850 (stack_copy_size): Now size_t, not int.
12851 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12852
461c2ab9
JB
128532011-03-28 Juanma Barranquero <lekktu@gmail.com>
12854
12855 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12856 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12857 All callers changed.
12858
12859 * lisp.h (multibyte_char_to_unibyte):
12860 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12861 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12862 * character.h (CHAR_TO_BYTE8):
12863 * cmds.c (internal_self_insert):
12864 * editfns.c (general_insert_function):
12865 * keymap.c (push_key_description):
12866 * search.c (Freplace_match):
12867 * xdisp.c (message_dolog, set_message_1): All callers changed.
12868
f6d62986
SM
128692011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12870
12871 * keyboard.c (safe_run_hook_funcall): New function.
12872 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12873 don't set the hook to nil, but remove the offending function instead.
12874 (Qcommand_hook_internal): Remove, unused.
12875 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12876 Vcommand_hook_internal.
12877
12878 * eval.c (enum run_hooks_condition): Remove.
12879 (funcall_nil, funcall_not): New functions.
12880 (run_hook_with_args): Call each function through a `funcall' argument.
12881 Remove `cond' argument, now redundant.
12882 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12883 (Frun_hook_with_args_until_failure): Adjust accordingly.
12884 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12885
1db5b1ad
JB
128862011-03-28 Juanma Barranquero <lekktu@gmail.com>
12887
12888 * dispextern.h (string_buffer_position): Remove declaration.
12889
12890 * print.c (strout): Remove parameter `multibyte', unused since
12891 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12892
12893 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12894 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12895 All callers changed.
12896
12897 * w32.c (_wsa_errlist): Use braces for struct initializers.
12898
12899 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12900 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12901 All callers changed.
12902 (string_buffer_position): Likewise. Also, make static (it's never
12903 used outside xdisp.c).
12904 (cursor_row_p): Remove parameter `w', unused since
12905 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12906 (decode_mode_spec): Remove parameter `precision', introduced during
12907 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12908 All callers changed.
12909
5ffb62aa
JD
129102011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12911
12912 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12913
461c2ab9 129142011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12915
12916 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12917 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12918 (ns_update_auto_hide_menu_bar): New functions.
12919 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12920 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12921 ns_constrain_all_frames.
12922 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12923 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12924
5c380ffb
JD
129252011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12926
12927 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12928
9af30bdf
GM
129292011-03-27 Glenn Morris <rgm@gnu.org>
12930
12931 * syssignal.h: Replace RETSIGTYPE with void.
12932 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12933 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12934 Replace SIGTYPE with void everywhere.
12935 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12936 * s/template.h (SIGTYPE): Remove commented out definition.
12937
e2abce01
JB
129382011-03-26 Eli Zaretskii <eliz@gnu.org>
12939
12940 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12941 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12942
f868cd8a
JB
129432011-03-26 Juanma Barranquero <lekktu@gmail.com>
12944
59eb0929
JB
12945 * w32.c (read_unc_volume): Use parameter `henum', instead of
12946 global variable `wget_enum_handle'.
12947
12948 * keymap.c (describe_vector): Remove parameters `indices' and
12949 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12950 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12951
f868cd8a
JB
12952 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12953
12954 * keyboard.c (timer_check): Remove parameter `do_it_now',
12955 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12956 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12957 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12958
12959 * keyboard.c (read_char):
12960 * w32menu.c (w32_menu_display_help):
12961 * xmenu.c (show_help_event, menu_help_callback):
12962 Adjust calls to `show_help_echo'.
12963
12964 * gtkutil.c (xg_maybe_add_timer):
12965 * keyboard.c (readable_events):
12966 * process.c (wait_reading_process_output):
12967 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12968
12969 * insdel.c (adjust_markers_gap_motion):
12970 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12971 (gap_left, gap_right): Don't call it.
12972
2ecf6fdb
CY
129732011-03-25 Chong Yidong <cyd@stupidchicken.com>
12974
12975 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12976 incurred during fontification.
12977
6b1f9ba4
JB
129782011-03-25 Juanma Barranquero <lekktu@gmail.com>
12979
12980 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12981 (DEFVAR_PER_BUFFER): Don't pass it.
12982
12983 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12984 (scrolling_window): Don't pass it.
12985
0f4a96b5
JB
129862011-03-25 Juanma Barranquero <lekktu@gmail.com>
12987
12988 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12989
12990 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12991 and `suffix'.
12992 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12993 of variables specific to SELinux and computation of `encoded_absname'.
12994
12995 * image.c (XPutPixel): Remove unused variable `height'.
12996
12997 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12998
12999 * unexw32.c (get_section_info): Remove unused variable `section'.
13000
13001 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
13002 (system_process_attributes): Remove unused variable `sess'.
13003 (sys_read): Remove unused variable `err'.
13004
13005 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
13006 (w32_wnd_proc): Remove unused variable `isdead'.
13007 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
13008 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
13009 (x_create_tip_frame): Remove unused variable `tem'.
13010
13011 * w32inevt.c (w32_console_read_socket):
13012 Remove unused variable `no_events'.
13013
13014 * w32term.c (x_draw_composite_glyph_string_foreground):
13015 Remove unused variable `width'.
13016
1149507c
JB
130172011-03-24 Juanma Barranquero <lekktu@gmail.com>
13018
13019 * w32term.c (x_set_glyph_string_clipping):
13020 Don't pass uninitialized region to CombineRgn.
13021
9c88f339
JB
130222011-03-23 Juanma Barranquero <lekktu@gmail.com>
13023
13024 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
13025 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
13026 (Fx_close_connection): Remove unused variable `i'.
13027
13028 * w32font.c (w32font_draw): Return number of glyphs.
13029 (w32font_open_internal): Remove unused variable `i'.
13030 (w32font_driver): Add missing initializer.
13031
13032 * w32menu.c (utf8to16): Remove unused variable `utf16'.
13033 (fill_in_menu): Remove unused variable `items_added'.
13034
13035 * w32term.c (last_mouse_press_frame): Remove static global variable.
13036 (w32_clip_to_row): Remove unused variable `f'.
13037 (x_delete_terminal): Remove unused variable `i'.
13038
13039 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
13040 (NOTHING): Remove unused static global variable.
13041 (uniscribe_check_otf): Remove unused variable `table'.
13042 (uniscribe_font_driver): Add missing initializers.
13043
dee091a3
JD
130442011-03-23 Julien Danjou <julien@danjou.info>
13045
13046 * term.c (Fsuspend_tty, Fresume_tty):
13047 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
13048 * window.c (temp_output_buffer_show):
13049 * insdel.c (signal_before_change):
13050 * frame.c (Fhandle_switch_frame):
13051 * fileio.c (Fdo_auto_save):
13052 * emacs.c (Fkill_emacs):
13053 * editfns.c (save_excursion_restore):
13054 * cmds.c (internal_self_insert):
13055 * callint.c (Fcall_interactively):
13056 * buffer.c (Fkill_all_local_variables):
13057 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
13058 Use Frun_hooks.
0f4a96b5 13059 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 13060 unconditionally since it does the check itself.
dee091a3 13061
2c520ab5 130622011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 13063
c9c49752
PE
13064 Fix more problems found by GCC 4.5.2's static checks.
13065
8abc3f12
PE
13066 * coding.c (encode_coding_raw_text): Avoid unnecessary test
13067 the first time through the loop, since we know p0 < p1 then.
13068 This also avoids a gcc -Wstrict-overflow warning.
13069
a2d26660
PE
13070 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
13071 leading to a memory leak, possible in functions like
13072 load_charset_map_from_file that can allocate an unbounded number
b12ef411 13073 of objects (Bug#8318).
a2d26660 13074
916c72e9
PE
13075 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
13076 that could (at least in theory) be that large.
13077
19ab8a18
PE
13078 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
13079 This is less likely to overflow, and avoids undefined behavior if
13080 overflow does occur. All callers changed. Use strtoul to scan
13081 for the unsigned long integer.
b7cbbd6f
PE
13082 (pint2hrstr): Simplify and tune code slightly.
13083 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 13084
f0641eff
PE
13085 * scroll.c (do_scrolling): Work around GCC bug 48228.
13086 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
13087
7f650bb9
PE
13088 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
13089 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
13090 (validate_x_resource_name): Simplify count usage.
13091 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 13092
37dd57d1
PE
13093 * fileio.c (Fcopy_file): Report error if fchown or fchmod
13094 fail (Bug#8306).
81e56e61 13095
699979fc 13096 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 13097
401bf9b4
PE
13098 * process.c (Fmake_network_process): Use socklen_t, not int,
13099 where POSIX says socklen_t is required in portable programs.
13100 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 13101 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
13102 (Fmake_network_process, server_accept_connection):
13103 (wait_reading_process_output, read_process_output):
13104 Likewise.
13105
b93aacde
PE
13106 * process.c: Rename or move locals to avoid shadowing.
13107 (list_processes_1, Fmake_network_process):
13108 (read_process_output_error_handler, exec_sentinel_error_handler):
13109 Rename or move locals.
4dc343ee 13110 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 13111 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 13112 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 13113 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 13114 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 13115
af8a867c 13116 Make tparam.h and terminfo.c consistent.
44f230aa
SM
13117 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
13118 Include tparam.h instead, since it declares them.
af8a867c
PE
13119 * cm.h (PC): Remove extern decl; tparam.h now does this.
13120 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
13121 * terminfo.c: Include tparam.h, to check interfaces.
13122 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
13123 (tparam): Adjust signature to match interface in tparam.h;
13124 this removes some undefined behavior. Check that outstring and len
13125 are zero, which they always are with Emacs.
13126 * tparam.h (PC, BC, UP): New extern decls.
13127
0248044d 13128 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 13129 (xftfont_open): Rename locals to avoid shadowing.
0248044d 13130
8ff096c1 13131 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
13132 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
13133 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 13134 (ftfont_list): Remove unused local.
49eaafba
PE
13135 (get_adstyle_property, ftfont_pattern_entity):
13136 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
13137 Rename locals to avoid shadowing.
8ff096c1 13138
e2be39f6
PE
13139 * xfont.c (xfont_list_family): Mark var as initialized.
13140
c9735e30
PE
13141 * xml.c (make_dom): Now static.
13142
8f5201ae
PE
13143 * composite.c (composition_compute_stop_pos): Rename local to
13144 avoid shadowing.
b246f932
PE
13145 (composition_reseat_it): Remove unused locals.
13146 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 13147 (composition_update_it): Mark var as initialized.
11b61122
PE
13148 (find_automatic_composition): Mark vars as initialized,
13149 with a FIXME (Bug#8290).
8f5201ae 13150
760fbc2c
PE
13151 character.h: Rename locals to avoid shadowing.
13152 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
13153 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
13154 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
13155 (BUF_DEC_POS): Be more systematic about renaming local temporaries
13156 to avoid shadowing.
13157
ff08eb85
PE
13158 * textprop.c (property_change_between_p): Remove; unused.
13159
fc7bf025
PE
13160 * intervals.c (interval_start_pos): Now static.
13161
235d7abc
PE
13162 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
13163
44f230aa
SM
13164 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
13165 Rename locals to avoid shadowing.
3e7d6594 13166
50060332
PE
13167 * sound.c (wav_play, au_play, Fplay_sound_internal):
13168 Fix pointer signedness.
d01f234b 13169 (alsa_choose_format): Remove unused local var.
c83b8872
PE
13170 (wav_play): Initialize a variable to 0, to prevent undefined
13171 behavior (Bug#8278).
50060332 13172
c4fc4e30
PE
13173 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
13174
918436ed
PE
13175 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
13176
c939f91b
PE
13177 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
13178 clobbering (Bug#8298).
b9c7f648
PE
13179 * sysdep.c (sys_subshell): Likewise.
13180 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 13181
6bd8c144
PE
13182 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
13183 This should get cleaned up, so that child_setup has the
13184 same signature on all platforms.
13185
7710357c 13186 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 13187 (relocate_fd): Rename locals to avoid shadowing.
7710357c 13188
c59da222
CY
131892011-03-22 Chong Yidong <cyd@stupidchicken.com>
13190
13191 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
13192 not to be necessary, and produces flickering.
13193
66b87493
GM
131942011-03-20 Glenn Morris <rgm@gnu.org>
13195
13196 * config.in: Remove file.
13197
45b6f6d5
JB
131982011-03-20 Juanma Barranquero <lekktu@gmail.com>
13199
13200 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
13201 are now in src/globals.h.
13202 (syms_of_minibuf): Remove spurious & from previous change.
13203
cd394be1 132042011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
13205
13206 * minibuf.c (completing-read-function): New variable.
13207 (completing-read-default): Rename from completing-read.
13208 (completing-read): Call completing-read-function.
13209
b14e3e21
CY
132102011-03-19 Juanma Barranquero <lekktu@gmail.com>
13211
13212 * xfaces.c (Fx_load_color_file):
13213 Read color file from absolute filename (bug#8250).
13214
f2b726e6
JB
132152011-03-19 Juanma Barranquero <lekktu@gmail.com>
13216
13217 * makefile.w32-in: Update dependencies.
13218
09f6ff02
EZ
132192011-03-17 Eli Zaretskii <eliz@gnu.org>
13220
13221 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
13222
29a6015a
PE
132232011-03-17 Paul Eggert <eggert@cs.ucla.edu>
13224
a3a6c54e
PE
13225 Fix more problems found by GCC 4.5.2's static checks.
13226
b766f867
PE
13227 * process.c (make_serial_process_unwind, send_process_trap):
13228 (sigchld_handler): Now static.
13229
be02381c
PE
13230 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
13231 That way, the code declares only the vars that it needs.
13232 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
13233 * s/cygwin.h (PTY_ITERATION): Likewise.
13234 * s/darwin.h (PTY_ITERATION): Likewise.
13235 * s/gnu-linux.h (PTY_ITERATION): Likewise.
13236
57048744
PE
13237 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
13238 * process.c (allocate_pty): Don't declare stb unless it's needed.
13239
7914961c 13240 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
13241 (CONSTANTLIM): Remove; unused.
13242 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
13243 Define only if needed.
7914961c 13244
b3967b18
PE
13245 * unexelf.c (unexec): Name an expression,
13246 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
13247 Use a different way to cause a compilation error if anyone uses
13248 n rather than nn, a way that does not involve shadowing.
73366a00 13249 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 13250
29a6015a
PE
13251 * deps.mk (unexalpha.o): Remove; unused.
13252
43cfc33e 13253 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 13254 * unexec.h: New file.
ce701a33
PE
13255 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13256 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13257 Depend on unexec.h.
13258 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13259 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13260 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 13261 Change as necessary to match prototype in unexec.h.
ce701a33 13262
01f44d5a
PE
13263 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13264 shadowing.
4f63c6bb 13265 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 13266
a6670b0b
PE
13267 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13268 Rename locals to avoid shadowing.
13269
cef2010d 13270 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 13271 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 13272
d4d7173a
PE
13273 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13274
f08b802a
PE
13275 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13276 warning when compiling print.c.
13277
3ddb0639
PE
13278 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13279 instead of using an uninitialized var.
5ad03b97 13280 (font_sort_entities): Mark var as initialized.
3ddb0639 13281
170a2692
PE
13282 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13283
e663c700
PE
13284 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13285 pointers to constants.
89bc529a 13286 (font_parse_fcname): Remove unused vars.
7b81e2d0 13287 (font_delete_unmatched): Now static.
ea838e10 13288 (font_get_spec): Remove; unused.
13a547c6
PE
13289 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13290 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13291 Rename or move locals to avoid shadowing.
e663c700 13292
2a80c887 13293 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 13294 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 13295
1384fa33 13296 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 13297 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 13298
8b2c52e9
PE
13299 * alloc.c (mark_backtrace): Move decl from here ...
13300 * lisp.h: ... to here, so that it can be checked.
13301
475545b5 13302 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 13303 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
13304 (lisp_indirect_variable): Name an expression,
13305 to avoid gcc -Wbad-function-cast warning.
1faed8ae 13306 (Fdefvar): Rename locals to avoid shadowing.
475545b5 13307
b1349114 13308 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 13309 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 13310 Use const pointer when appropriate.
b1349114 13311
a2928364
PE
13312 * lisp.h (get_system_name, get_operating_system_release):
13313 Move decls here, to check interfaces.
13314 * process.c (get_operating_system_release): Move decl to lisp.h.
13315 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
13316 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13317 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13318 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
13319 (Fformat_time_string, Fencode_time, Finsert_char):
13320 (Ftranslate_region_internal, Fformat):
13321 Rename or remove local vars to avoid shadowing.
9710023e 13322 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 13323
a415e694
PE
13324 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13325 avoid shadowing.
13326
8ef4622d
PE
13327 * lisp.h (eassert): Check that the argument compiles, even if
13328 ENABLE_CHECKING is not defined.
13329
946f9a5b
PE
13330 * data.c (Findirect_variable): Name an expression, to avoid
13331 gcc -Wbad-function-cast warning.
112396d6 13332 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 13333 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
13334 (Fmake_variable_buffer_local, Fmake_local_variable):
13335 Mark variables as initialized.
52746918 13336 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 13337
e5aab7e7 13338 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
13339 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
13340 Rename locals to avoid shadowing.
dff45157
PE
13341 (mark_stack): Move local variables into the #ifdef region where
13342 they're used.
7bc26fdb
PE
13343 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
13344 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13345 needed otherwise.
13346 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13347 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13348 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13349
e5aab7e7
PE
13350 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13351 avoids undefined behavior in theory.
13352
4da60324
PE
13353 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13354
88043301
PE
13355 Use functions, not macros, for up- and down-casing (Bug#8254).
13356 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13357 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13358 to use the following functions instead of these macros.
13359 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13360 EMACS_INT, since callers assume the returned value fits in int.
13361 (upcase1): Likewise, for UPCASE_TABLE.
13362 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13363 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13364 the race-condition problem in the old DOWNCASE.
88043301 13365
19ed5445
PE
13366 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13367 Rename locals to avoid shadowing.
13368 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13369 (regex_compile, re_search_2, re_match_2_internal):
13370 Remove unused local vars.
952db0d7
PE
13371 (FREE_VAR): Rewrite so as not to use empty "else",
13372 which gcc can warn about.
da053e48 13373 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13374 (RETALLOC_IF): Define only if needed.
13375 (WORDCHAR_P): Likewise. This one is never needed, but is used
13376 only in a comment talking about a compiler bug, so put inside
13377 the #if 0 of that comment.
13378 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13379 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13380 Remove; unused.
19ed5445 13381
1f3561e4 13382 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13383 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13384 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13385
ded6f8f7
PE
13386 * search.c (simple_search): Remove unused var.
13387
dbd37a95
PE
13388 * dired.c (compile_pattern): Move decl from here ...
13389 * lisp.h: ... to here, so that it can be checked.
13390 (struct re_registers): New forward decl.
13391
7e47afad
PE
13392 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13393
85f24f61
PE
13394 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13395 All uses changed.
13396 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13397 Rename locals to avoid shadowing.
5671df8f 13398 (Fvertical_motion): Mark locals as initialized.
85f24f61 13399
181aa2be 13400 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13401 (casify_region): Mark local as initialized.
181aa2be 13402
930d429c
PE
13403 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13404
7082eac6
PE
13405 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13406 New macros, so that the caller can use some names other than
13407 gcpro1, gcpro2, etc.
13408 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13409 of the new macros.
13410 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13411 argument, for consistency with GCPRO2_VAR, etc: it is now the
13412 prefix of the variable, not the variable itself. All uses
13413 changed.
38b2c076
PE
13414 * dired.c (directory_files_internal, file_name_completion):
13415 Rename locals to avoid shadowing.
13416
15206ed9
PE
13417 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13418 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13419 dired.c's scmp function, had undefined behavior.
13420 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13421 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13422 * buffer.h: ... to here, because these macros use current_buffer,
13423 and the new implementation with inline functions needs to have
13424 current_buffer in scope now, rather than later when the macros
13425 are used.
13426 (downcase, upcase1): New static inline functions.
13427 (DOWNCASE, UPCASE1): Reimplement using these functions.
13428 This avoids undefined behavior in expressions like
13429 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13430 from race conditions in accessing the global variables
13431 case_temp1 and case_temp2.
13432 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13433 * lisp.h (case_temp1, case_temp2): Remove their decls.
13434 * character.h (ASCII_CHAR_P): Move from here ...
13435 * lisp.h: ... to here, so that the inline functions mentioned
13436 above can use them.
13437
4a6bea26
PE
13438 * dired.c (directory_files_internal_unwind): Now static.
13439
f14b7e14
PE
13440 * fileio.c (file_name_as_directory, directory_file_name):
13441 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13442 Now static.
2893f146
PE
13443 (file_name_as_directory): Use const pointers when appropriate.
13444 (Fexpand_file_name): Likewise. In particular, newdir might
13445 point at constant storage, so make it a const pointer.
fd4ead52 13446 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13447 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13448 signedness issues.
f839df0c
PE
13449 (Fset_file_times, Finsert_file_contents, auto_save_error):
13450 Rename locals to avoid shadowing.
f14b7e14 13451
5716756e 13452 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13453 (Ftry_completion, Fall_completions): Rename or remove locals
13454 to avoid shadowing.
5716756e 13455
b4c3046a
PE
13456 * marker.c (bytepos_to_charpos): Remove; unused.
13457
b45db522
PE
13458 * lisp.h (verify_bytepos, count_markers): New decls,
13459 so that gcc does not warn that these functions aren't declared.
13460
85876d07
PE
13461 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13462 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13463 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13464 (copy_text): Remove unused local var.
85876d07 13465
03d78a21 13466 * filelock.c (within_one_second): Now static.
b3dd38ab 13467 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13468
5df8f01b
PE
13469 * buffer.c (fix_overlays_before): Mark locals as initialized.
13470 (fix_start_end_in_overlays): Likewise. This function should be
13471 simplified by using pointers-to-pointers, but that's a different
13472 matter.
b1d876f1 13473 (switch_to_buffer_1): Now static.
8f54f30a
PE
13474 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13475 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13476
a70072c9 13477 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13478 Fix pointer signedness issue.
edced198
PE
13479 (sys_subshell): Mark local as volatile if checking for lint,
13480 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13481 (MAXPATHLEN): Define only if needed.
a70072c9 13482
a0977c44
PE
13483 * process.c (serial_open, serial_configure): Move decls from here ...
13484 * systty.h: ... to here, so that they can be checked.
13485
a884fdcc
PE
13486 * fns.c (get_random, seed_random): Move extern decls from here ...
13487 * lisp.h: ... to here, so that they can be checked.
13488
604efe86 13489 * sysdep.c (reset_io): Now static.
b8950c94 13490 (wait_for_termination_signal): Remove; unused.
604efe86 13491
38fc62d9
PE
13492 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13493 (copy_keymap_item, append_key, push_text_char_description):
13494 Now static.
1004a21a 13495 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13496 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13497 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13498 (describe_map_tree):
13499 Rename locals to avoid shadowing.
38fc62d9 13500
2f2650da
PE
13501 * keyboard.c: Declare functions static if they are not used elsewhere.
13502 (echo_char, echo_dash, cmd_error, top_level_2):
13503 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13504 (read_char, kbd_buffer_get_event, make_lispy_position):
13505 (make_lispy_event, make_lispy_movement, apply_modifiers):
13506 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13507 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13508 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13509 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13510 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13511
a053e86c 13512 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13513 (mark_kboards): Move decl here ...
13514 * alloc.c (mark_kboards): ... from here.
a053e86c 13515
4752793e
PE
13516 * lisp.h (force_auto_save_soon): New decl.
13517
74f10ca7 13518 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13519 (DEFINE_DUMMY_FUNCTION): New macro.
13520 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13521 Use it.
c03cd23f
PE
13522 (main): Add casts to avoid warnings
13523 if GCC considers string literals to be constants.
74f10ca7 13524
022e70d4
PE
13525 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13526
59d6fe83
PE
13527 * dbusbind.c: Pointer signedness fixes.
13528 (xd_signature, xd_append_arg, xd_initialize):
13529 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13530 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13531 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13532 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13533
78320123
PE
13534 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13535 if GCC considers string literals to be constants.
49cebcca 13536 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13537
35ac2a97
SM
135382011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13539
fb103ca9
SM
13540 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13541 (print_preprocess, print_object): New macro to fix last change.
13542
35ac2a97
SM
13543 * print.c (print_preprocess): Don't forget font objects.
13544
62973b41
JB
135452011-03-16 Juanma Barranquero <lekktu@gmail.com>
13546
13547 * emacs.c (USAGE3): Doc fixes.
13548
0e48bb22
AS
135492011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13550
13551 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13552 structure.
13553
7684e57b
JB
135542011-03-14 Juanma Barranquero <lekktu@gmail.com>
13555
13556 * lisp.h (VWindow_system, Qfile_name_history):
13557 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13558 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13559 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13560
13561 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13562 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13563
13564 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13565 * w32console.c (detect_input_pending, read_input_pending)
13566 (encode_terminal_code):
13567 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13568 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13569 (w32_system_caret_y, Qfile_name_history):
13570 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13571 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13572 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13573 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13574 * w32proc.c (Qlocal, report_file_error):
13575 * w32term.c (Vwindow_system, updating_frame):
13576 * w32uniscribe.c (initialized, uniscribe_font_driver):
13577 Remove unneeded extern declarations.
13578
2aa46d6c
CY
135792011-03-14 Chong Yidong <cyd@stupidchicken.com>
13580
c96bbc66 13581 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13582
cffc6f3b
CY
135832011-03-13 Chong Yidong <cyd@stupidchicken.com>
13584
13585 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13586 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13587 These macros can no longer be used for assignment.
13588
44f230aa
SM
13589 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13590 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13591 (record_buffer_markers, fetch_buffer_markers): New functions for
13592 recording and fetching special buffer markers.
13593 (set_buffer_internal_1, set_buffer_temp): Use them.
13594
13595 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13596
13597 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13598
13599 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13600 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13601
13602 * xdisp.c (hscroll_window_tree):
13603 (reconsider_clip_changes): Use PT instead of BUF_PT.
13604
d251f04b
EZ
136052011-03-13 Eli Zaretskii <eliz@gnu.org>
13606
13607 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13608 $(EMACS_ROOT)/lib/intprops.h.
13609
f0c77cd1
PE
136102011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13611
3eca4629
PE
13612 Fix more problems found by GCC 4.5.2's static checks.
13613
7c86ee98
PE
13614 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13615 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13616 (xg_free_frame_widgets): Make it clear that a local variable is
13617 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13618 (gdk_window_get_screen): Make it clear that this macro is needed
13619 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13620 (int_gtk_range_get_value): New function, which avoids a diagnostic
13621 from gcc -Wbad-function-cast.
13622 (xg_set_toolkit_scroll_bar_thumb): Use it.
13623 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13624 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13625 (get_utf8_string, xg_get_file_with_chooser):
13626 Rename locals to avoid shadowing.
13627 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13628
41729b81
PE
13629 * xgselect.c (xg_select): Remove unused var.
13630
f0c77cd1
PE
13631 * image.c (four_corners_best): Mark locals as initialized.
13632 (gif_load): Initialize transparent_p to zero (Bug#8238).
13633 Mark another local as initialized.
ec6cf4c6 13634 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13635
ce0ad53d 13636 * image.c (clear_image_cache): Now static.
d5d5a617 13637 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13638 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13639 (x_edge_detection): Remove unnecessary cast that
13640 gcc -Wbad-function-cast diagnoses.
2037898d 13641 (gif_load): Fix pointer signedness.
6ae141d6
PE
13642 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13643 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13644
33383987 136452011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13646
d32df629
PE
13647 Improve quality of tests for time stamp overflow.
13648 For example, without this patch (encode-time 0 0 0 1 1
13649 1152921504606846976) returns the obviously-bogus value (-948597
13650 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13651 reports time overflow. See
13652 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13653 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13654 * editfns.c: Include limits.h and intprops.h.
13655 (TIME_T_MIN, TIME_T_MAX): New macros.
13656 (time_overflow): Move earlier, to before first use.
13657 (hi_time, lo_time): New functions, for an accurate test for
13658 out-of-range times.
13659 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13660 (Fget_internal_run_time): Don't assume time_t fits in int.
13661 (make_time): Use list2 instead of Fcons twice.
13662 (Fdecode_time): More accurate test for out-of-range times.
13663 (check_tm_member): New function.
13664 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13665 (lisp_time_argument): Don't rely on undefined left-shift and
13666 right-shift behavior when checking for time stamp overflow.
8be6f318 13667
fe31d94c
PE
13668 * editfns.c (time_overflow): New function, refactoring common code.
13669 (Fformat_time_string, Fdecode_time, Fencode_time):
13670 (Fcurrent_time_string): Use it.
13671
8be6f318
PE
13672 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13673 * dired.c (make_time): Move to ...
13674 * editfns.c (make_time): ... here.
13675 * systime.h: Note the move.
13676
09d9db2c 136772011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13678
126bc0dc
YM
13679 * fringe.c (update_window_fringes): Remove unused variables.
13680
c47cbdfd
YM
13681 * unexmacosx.c (copy_data_segment): Also copy __got section.
13682 (Bug#8223)
13683
7ac80be9
EZ
136842011-03-12 Eli Zaretskii <eliz@gnu.org>
13685
c96bbc66 13686 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13687 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13688 Constify `char *' arguments and their references according to
13689 prototypes in tparam.h.
13690
ecb0f94d 13691 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13692
7ac80be9
EZ
13693 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13694 Adapt all references accordingly.
13695
13696 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13697
ef1fd07e
TT
136982011-03-11 Tom Tromey <tromey@redhat.com>
13699
13700 * buffer.c (syms_of_buffer): Remove obsolete comment.
13701
7ef4b50c
EZ
137022011-03-11 Eli Zaretskii <eliz@gnu.org>
13703
13704 * termhooks.h (encode_terminal_code): Declare prototype.
13705
13706 * msdos.c (encode_terminal_code): Don't declare prototype.
13707
13708 * term.c (encode_terminal_code): Now external again, used by
13709 w32console.c and msdos.c.
13710
44f230aa
SM
13711 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13712 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13713
4b1ec863 137142011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13715
1714f52b 13716 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13717
4b1ec863
PE
13718 * fringe.c (update_window_fringes): Mark locals as initialized
13719 (Bug#8227).
13720 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13721
524c7aa6
PE
13722 * alloc.c (mark_fringe_data): Move decl from here ...
13723 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13724 to check its interface.
13725 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13726
a5c0af81 13727 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13728 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13729 (fontset_font): Mark local as initialized.
a9a06e0b 13730 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13731
b4716021
PE
13732 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13733
811e9bac 13734 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13735 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13736 (x_own_selection, Fx_disown_selection_internal): Rename locals
13737 to avoid shadowing.
13738 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13739
7e3ab302
PE
13740 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13741 so that the caller can use some name other than gcpro1.
13742 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13743 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13744 (Fx_backspace_delete_keys_p):
13745 Use them to avoid shadowing, and rename vars to avoid shadowing.
13746 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13747 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13748 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13749 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13750 Remove unused locals.
7e3ab302
PE
13751 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13752 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13753 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13754 macros.
f78faa98 13755
e2b13473
PE
13756 * xterm.h (x_mouse_leave): New decl.
13757
77f23912
PE
13758 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13759 Remove unused functions.
cdf4ba58
PE
13760 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13761 (x_calc_absolute_position): Now static.
7411c686 13762 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13763 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13764 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13765 unless they are used.
38d0b34a
PE
13766 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13767 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13768 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13769 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13770 (x_error_catcher, x_connection_closed, x_error_handler):
13771 (x_error_quitter, xembed_send_message, x_iconify_frame):
13772 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13773 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13774 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13775
44f230aa
SM
13776 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13777 Rename or move locals to avoid shadowing.
6b463e58 13778 (tty_defined_color, merge_face_heights): Now static.
5967d051 13779 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13780 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13781 does not deduce is never used uninitialized.
73719eba
PE
13782 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13783 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13784
426994c3 13785 * terminal.c (store_terminal_param): Now static.
5489860b 13786
032f1620 13787 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13788 (set_frame_menubar): Remove unused local.
d4323972 13789 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13790 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13791 since they might point to immutable storage.
281585b0
PE
13792 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13793 since it's unused otherwise.
032f1620 13794
367c19e5 13795 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13796 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13797 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13798 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13799 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13800 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13801 does not deduce are never used uninitialized.
70739cbe 13802
07b48fa9
PE
13803 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13804
8868a238 13805 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13806 * window.c (window_loop, size_window):
13807 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13808
7e5cf297 13809 * window.c (display_buffer): Now static.
d6550a9f
PE
13810 (size_window): Mark variables that gcc -Wuninitialized
13811 does not deduce are never used uninitialized.
a586633d
PE
13812 * window.h (check_all_windows): New decl, to forestall
13813 gcc -Wmissing-prototypes diagnostic.
5b555da1 13814 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13815
f6095868
PE
13816 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13817 shadowing.
13818 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13819 Include <limits.h>.
13820 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13821 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13822 (load_charset_map): Mark variables that gcc -Wuninitialized
13823 does not deduce are never used uninitialized.
53df7c11 13824 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13825
f38b440c
PE
13826 * coding.c (coding_set_source, coding_set_destination):
13827 Use "else { /* comment */ }" rather than "else /* comment */;"
13828 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13829 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13830 a block, when the outer 'i' will do.
13831 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13832 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13833 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13834 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13835 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13836 Rename locals to avoid shadowing.
13837 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13838 * coding.c (emacs_mule_char, encode_invocation_designation):
13839 Now static, since they're not used elsewhere.
413bb2db 13840 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13841 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13842 (decode_coding_emacs_mule): Mark variables that gcc
13843 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13844 (detect_coding_iso_2022): Initialize a local variable that might
13845 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13846 this initialization is needed. (Bug#8211)
5f58e762
PE
13847 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13848 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13849 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13850 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13851 Remove unused macros.
f38b440c 13852
232b38b9 13853 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13854 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13855 * character.c (string_count_byte8): Likewise.
232b38b9 13856
fb90da1b
PE
13857 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13858 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13859
fb93dbc2
PE
13860 * chartab.c (copy_sub_char_table): Now static, since it's not used
13861 elsewhere.
5c156ace
PE
13862 (sub_char_table_ref_and_range, char_table_ref_and_range):
13863 Rename locals to avoid shadowing.
bbcd0949 13864 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13865
7d3b3862 13866 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13867 (BIDI_BOB): Remove unused macro.
7d3b3862 13868
6be7d3da
PE
13869 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13870 deduce are never used uninitialized.
c2ed9c8b 13871 * term.c (encode_terminal_code): Likewise.
6be7d3da 13872
75f8807f 13873 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13874
50938595
PE
13875 * tparam.h: New file.
13876 * term.c, tparam.h: Include it.
13877 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13878 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13879 Move these decls to tparam.h, and make them agree with what
13880 is actually in tparam.c. The previous trick of using incompatible
13881 decls in different modules does not conform to the C standard.
13882 All callers of tparam changed to use tparam's actual API.
13883 * tparam.c (tparam1, tparam, tgoto):
13884 Use const pointers where appropriate.
13885
fbceeba2
PE
13886 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13887 * cm.h (struct cm): Likewise.
13888 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13889 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13890 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13891 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13892 (turn_on_face, init_tty): Likewise.
13893 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13894
7f3f1250
PE
13895 * term.c (term_mouse_position): Rename local to avoid shadowing.
13896
e6ca6543
PE
13897 * alloc.c (mark_ttys): Move decl from here ...
13898 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13899
c40f8d15
AS
139002011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13901
13902 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13903
cfe0661d
JB
139042011-03-09 Juanma Barranquero <lekktu@gmail.com>
13905
13906 * search.c (compile_pattern_1): Remove argument regp, unused since
13907 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13908 (compile_pattern): Don't pass it.
13909
0afb4571
J
139102011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13911
13912 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13913 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13914 for ! HAVE_GTK3.
13915 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13916
13917 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13918
13919 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13920 gdk_window_get_screen, gdk_window_get_geometry,
13921 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13922 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13923 (xg_get_pixbuf_from_pixmap): New function.
13924 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13925 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13926 Call xg_get_pixbuf_from_pixmap instead of
13927 gdk_pixbuf_get_from_drawable.
13928 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13929 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13930 (xg_check_special_colors): Use GtkStyleContext and its functions
13931 for HAVE_GTK3.
13932 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13933 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13934 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13935 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13936 Call gtk_widget_get_preferred_size.
0afb4571
J
13937 (xg_frame_resized): gdk_window_get_geometry only takes 5
13938 parameters.
44f230aa
SM
13939 (xg_win_to_widget, xg_event_is_for_menubar):
13940 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13941 (xg_set_widget_bg): New function.
13942 (delete_cb): New function.
895009e1 13943 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13944 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13945 (xg_set_background_color): Call xg_set_widget_bg.
13946 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13947 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13948 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13949 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13950 if ! HAVE_GTK3.
13951 (update_frame_tool_bar): Call gtk_widget_hide.
13952 (xg_initialize): Use GDK_KEY_g.
13953
13954 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13955 if ! HAVE_GTK3
13956 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13957
13958 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13959 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13960 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13961
1c2cc4ef
JB
139622011-03-08 Juanma Barranquero <lekktu@gmail.com>
13963
13964 * w32xfns.c (select_palette): Check success of RealizePalette against
13965 GDI_ERROR, not zero.
13966
33383987 13967See ChangeLog.11 for earlier changes.
aac0c6e3
MR
13968
13969;; Local Variables:
13970;; coding: utf-8
aac0c6e3
MR
13971;; End:
13972
2f097256 13973 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
13974
13975 This file is part of GNU Emacs.
13976
13977 GNU Emacs is free software: you can redistribute it and/or modify
13978 it under the terms of the GNU General Public License as published by
13979 the Free Software Foundation, either version 3 of the License, or
13980 (at your option) any later version.
13981
13982 GNU Emacs is distributed in the hope that it will be useful,
13983 but WITHOUT ANY WARRANTY; without even the implied warranty of
13984 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13985 GNU General Public License for more details.
13986
13987 You should have received a copy of the GNU General Public License
13988 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.