* vc/vc-git.el (vc-git-state): Don't call `vc-git-registered',
[bpt/emacs.git] / src / ChangeLog
CommitLineData
464d5a5e
SM
12012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lisp.h (last_undo_boundary): Declare new var.
4 * keyboard.c (command_loop_1): Set it.
5 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6 were auto-added by the command loop (bug#11774).
7
8dc2e44a
AS
82012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9
10 * w32font.c (Qsymbol): Remove local definition.
11 (syms_of_w32font): Don't DEFSYM it.
12
169925ec
DA
132012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
14
15 Fix sweep_vectors to handle large bool vectors correctly.
16 * alloc.c (sweep_vectors): Account total_vector_bytes for
17 bool vectors larger than VBLOCK_BYTES_MAX.
18
5fbfb018
CY
192012-07-18 Chong Yidong <cyd@gnu.org>
20
21 * frame.c (x_set_frame_parameters): Revert bogus change introduced
22 in 2012-05-25 commit by Paul Eggert (Bug#11738).
23
3ab6e069
DA
242012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
25
26 Return more descriptive data from Fgarbage_collect.
27 Suggested by Stefan Monnier in
28 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
29 * alloc.c (bounded_number): New function.
30 (total_buffers, total_vectors): New variable.
31 (total_string_size): Rename to total_string_bytes, adjust users.
32 (total_vector_size): Rename to total_vector_bytes, adjust users.
33 (sweep_vectors): Account total_vectors and total_vector_bytes.
34 (Fgarbage_collect): New return value. Adjust documentation.
35 (gc_sweep): Account total_buffers.
36 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
37 (VECTOR_SIZE): Remove.
38 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
39 (Qinterval, Qmisc): New symbols.
40 (syms_of_data): Initialize them.
41 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
42 (Qcons, Qbuffer): New declarations.
43
6d02fe5b
PE
442012-07-17 Paul Eggert <eggert@cs.ucla.edu>
45
46 * alloc.c (Fmemory_free): Account for memory-free's own storage.
47 Round up, not down. Improve doc.
48
b7ffe040
DA
492012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
50
51 Restore old code in allocate_string_data to avoid Faset breakage.
52 Reported by Julien Danjou <julien@danjou.info> in
53 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
54 * alloc.c (allocate_string_data): Restore old code with minor
55 adjustments, fix comment to explain this subtle issue.
56
4dc7c8d5
SM
572012-07-17 Eli Zaretskii <eliz@gnu.org>
58
59 Remove FILE_SYSTEM_CASE.
60 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
61
62 * fileio.c (FILE_SYSTEM_CASE): Don't define.
63 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
64 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
65 call-process-region passes it through expand-file-name.
66
67 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
68
692012-07-17 Andreas Schwab <schwab@linux-m68k.org>
70
71 Fix crash when creating indirect buffer (Bug#11917)
72 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
73 Don't handle unbound variables specially if non-zero.
74 (Fbuffer_local_variables): Pass zero.
75 (clone_per_buffer_values): Pass non-zero.
76
772012-07-17 Andreas Schwab <schwab@linux-m68k.org>
78
79 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
80 to make the loop interruptible.
81
822012-07-17 Andreas Schwab <schwab@linux-m68k.org>
83
84 * gnutls.c (emacs_gnutls_handshake): Only retry if
85 GNUTLS_E_INTERRUPTED.
86
872012-07-17 Eli Zaretskii <eliz@gnu.org>
cce7fefc
DA
882012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
89
90 Cleanup and convert miscellaneous checks to eassert.
91 * alloc.c (mark_interval): Fix comment, partially rephrase
92 old comment from intervals.h (see below).
93 * intervals.c (find_interval, adjust_intervals_for_insertion)
94 (delete_interval, adjust_intervals_for_deletion)
95 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
96 Convert to eassert.
97 (adjust_intervals_for_insertion, make_new_interval):
98 Remove obsolete and unused code.
99 * intervals.h (struct interval): Remove obsolete comment.
100 * textprotp.c (erase_properties): Remove unused code.
101 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
102 (Fremove_list_of_text_properties): Convert to eassert.
103
9ea10cc3
CY
1042012-07-17 Chong Yidong <cyd@gnu.org>
105
106 * editfns.c (Finsert_char): Doc fix.
107
3900d5de
DA
1082012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
109
110 Fix previous change to make Fmemory_free always accurate.
111 * alloc.c (make_interval): Update total_free_intervals.
112 (make_float): Likewise for total_free_floats.
113 (free_cons, Fcons): Likewise for total_free_conses.
114 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
115 Likewise for total_free_vector_bytes.
116 (Fmake_symbol): Likewise for total_free_symbols.
117 (bytes_free): Remove.
118
7098646f
DA
1192012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
120
121 Simple free memory accounting feature.
122 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
123 (sweep_vectors): Accumulate size of free vectors.
124 (Fgarbage_collect): Setup bytes_free.
125 (Fmemory_free): New function.
126 (syms_of_alloc): Register it.
127
22657b40
DA
1282012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
129
130 Cleanup overlays checking.
131 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
132 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
133 eassert and OVERLAYP.
134 (sort_overlays): Change to use OVERLAYP.
135
ddfc8813
RK
1362012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
137
138 * editfns.c (Finsert_char): Make it interactive, and make the
139 second arg optional. Copy interactive spec and docstring from
140 ucs-insert.
141
7c26cf3c
PE
1422012-07-17 Paul Eggert <eggert@cs.ucla.edu>
143
144 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
145 Unlike the other wrapped functions, fabs has an unspecified
146 effect on errno.
147
5d127af9
JD
1482012-07-16 Jan Djärv <jan.h.d@swipnet.se>
149
150 * nsterm.m (keyDown): Interpret flags without left/right bits
151 as the left key (Bug#11670).
152
6a0dd1d7
DA
1532012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
154
155 Remove empty and useless init functions.
156 * lisp.h (init_character_once, init_fns, init_image)
157 (init_filelock, init_sound): Remove prototype.
158 * character.c (init_character_once): Remove.
159 * filelock.c (init_filelock): Likewise.
160 * fns.c (init_fns): Likewise.
161 * image.c (init_image): Likewise.
162 * sound.c (init_sound): Likewise.
163 * emacs.c (main): Adjust accordingly.
164
7a6136fd
DA
1652012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
166
167 * gtkutil.h: Tiny cleanups.
168 (use_old_gtk_file_dialog): Remove useless declaration.
169 (xg_uses_old_file_dialog): Add suggested const attribute.
170
ce811ad9
EZ
1712012-07-15 Eli Zaretskii <eliz@gnu.org>
172
173 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
174 (bidi_paragraph_init): Use it to limit search forward for a strong
175 directional character in abnormally large paragraphs full of
176 neutral or weak characters. (Bug#11943)
177
c9adfeaa
SF
1782012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
179
180 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
181 the toolbar (Bug#9451).
182 (xg_make_tool_item): Give the widget event box a transparent
183 background.
184
fff62aa9
DA
1852012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
186
187 Cleanup basic allocation variables and functions.
188 * alloc.c (ignore_warnings, init_intervals, init_float)
189 (init_cons, init_symbol, init_marker): Remove.
190 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
191 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
192 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
193 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
194 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
195 (staticidx, init_alloc_once, init_strings, free_ablock):
196 Remove redundant initialization.
197 * fns.c (init_weak_hash_tables): Remove.
198 * lisp.h (init_weak_hash_tables): Remove prototype.
199
9730daca
DA
2002012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
201
202 Use zero_vector where appropriate.
203 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
204 accordingly.
205 * lisp.h (zero_vector): New declaration.
206 * font.c (null_vector): Remove.
207 (syms_of_font): Remove initialization and staticpro.
208 (font_list_entities, font_find_for_lface): Change to use zero_vector.
209 * keymap.c (Faccessible_keymaps): Likewise.
210
2e2d2a13
LL
2112012-07-15 Leo Liu <sdl.web@gmail.com>
212
213 * fringe.c: Fix typo in comments.
214
cd276f6e
LL
2152012-07-14 Leo Liu <sdl.web@gmail.com>
216
217 * fringe.c: Add a new bitmap exclamation-mark.
218
5a1131d9
EZ
2192012-07-14 Eli Zaretskii <eliz@gnu.org>
220
221 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
222
223 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
224 (HAVE_MENUS): Don't define, defined by editing config.in with
225 msdos/sed2v2.inp.
226 (GMALLOC_INHIBIT_VALLOC): Don't define.
227 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
228
22e983b7
JB
2292012-07-14 Juanma Barranquero <lekktu@gmail.com>
230
231 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
232
5b3f250f
GM
2332012-07-14 Glenn Morris <rgm@gnu.org>
234
235 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
236 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
237 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
238
33d63ff4
GM
2392012-07-13 Glenn Morris <rgm@gnu.org>
240
5b633342
GM
241 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
242
33d63ff4
GM
243 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
244 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
245
b55b9f85
JD
2462012-07-13 Jan Djärv <jan.h.d@swipnet.se>
247
0dc8cf50
JD
248 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
249 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
250 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
251 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
252 where appropriate.
253 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
254 as boolean expression.
255 (x_set_window_size): Remove unused variable toolbar.
256 (ns_get_color_default, ns_mod_to_lisp): Remove.
257 (ns_mouse_position): Remove unused variables xchar and ychar.
258 (ns_compute_glyph_string_overhangs): Remove unused variable face.
259 (ns_set_vertical_scroll_bar): Remove unused variable count.
260 (ns_delete_terminal): Remove unused variable i.
261 (ns_term_init): Remove unused variables r, g and b.
262 (mouseDown): Remove unused variable window.
263 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
264 (initFrameFromEmacs): Remove unused variable vbextra.
265 (mouseEntered): Remove unused variables p and dpyinfo.
266 (mouseExited): Remove unused variables p and r.
267 (ns_define_frame_cursor, ns_clear_frame_area)
268 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
269 (menuDown): Assign [sender tag] to variable and cast the variable.
270
271 * nsterm.h (menuDown): Add id as type to argument sender.
272 (ns_display_info_for_name): Add Lisp_Object argument.
273 (ns_term_init): Add Lisp_Object argument.
274 (ns_map_event_to_object): Add void argument.
275 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
276 prototype with arguments and only declare if __OBJC__.
277 (nxatoms_of_nsselect): Add void argument.
278 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
279 (ns_alloc_autorelease_pool): Add void argument.
280 (ns_release_autorelease_pool): Add void* argument.
281 (ns_get_defaults_value): Add const char* argument.
282
283 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
284 (initFromContents): Use SSDATA where appropriate.
285 (ns_update_menubar): Add braces to ambigous if-else.
286 (initWithTitle): Put () around assignment in if statement.
287 (ns_menu_show): Remove unused variables window and keymap.
288 (update_frame_tool_bar): Remove unused variable selected_p.
289 (initWithContentRect): Remove unused variable this_cmd_name.
290
291 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
292 appropriate.
293 (setXBMColor): Remove unused variable len.
294 (setPixmapData): Put () around assignment in loop statement.
295
296 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
297 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
298 where appropriate.
299 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
300 around assignment in loop statement.
301 (nsfont_open): Remove unused variable i.
302 (nsfont_open): Remove unused variable len.
303 (nsfont_draw): Remove unused variable cs.
304
305 * nsfns.m (x_set_icon_name, ns_set_name_internal)
306 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
307 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
308 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
309 (Fns_font_name, Fns_perform_service)
310 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
311 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
312 (ns_set_name): Remove unused variable view.
313 (x_set_menu_bar_lines): Remove unused variable olines.
314 (x_set_tool_bar_lines): Remove unused variable root_window.
315 (Fns_list_colors): Put () around assignment in while statement.
316 (Fns_perform_service): Remove unused variable len.
317 (Fns_display_usable_bounds): Remove unused variable top.
318 (syms_of_nsfns): Remove unused variable i.
319
b55b9f85
JD
320 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
321 memcpy (Bug#11907).
322
ed9265fc 3232012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
324
325 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
326 and free it with DestroyExceptionInfo (Bug#11558).
327
ef099b57
JB
3282012-07-13 Juanma Barranquero <lekktu@gmail.com>
329
330 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
331 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
332 Set here, not in nt/config.nt.
333
ea814a5d
EZ
3342012-07-13 Eli Zaretskii <eliz@gnu.org>
335
336 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
337 cursor overflow into the last glyph on display line when the right
338 fringe is off. (Bug#11832)
339
1a952767
PE
3402012-07-13 Paul Eggert <eggert@cs.ucla.edu>
341
342 * xdisp.c (produce_special_glyphs): Now static.
343 * dispextern.h (produce_special_glyphs): Remove decl.
344
983188fd
GM
3452012-07-13 Glenn Morris <rgm@gnu.org>
346
32fb4bb6
GM
347 * s/bsd-common, s/cygwin.h: Remove empty files.
348 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
349
983188fd
GM
350 * s/usg5-4-common.h (USG, USG5):
351 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
352 * s/sol2-6.h (SOLARIS2):
353 * s/irix6-5.h (IRIX6_5):
354 * s/hpux10-20.h (USG, USG5, HPUX):
355 * s/gnu-linux.h (USG, GNU_LINUX):
356 * s/freebsd.h (BSD_SYSTEM):
357 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
358 * s/cygwin.h (CYGWIN):
359 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
360 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
361
d1e68667 3622012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
363
364 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 365
6de0e799
GM
3662012-07-13 Glenn Morris <rgm@gnu.org>
367
739ae010
GM
368 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
369
dbee5793
GM
370 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
371
6de0e799
GM
372 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
373 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
374
b82da769
GM
3752012-07-12 Glenn Morris <rgm@gnu.org>
376
4fae5a7a 377 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
378
379 * process.c (init_process_emacs): Rename from init_process.
380 The old name is also the name of a Mach system call.
381 * lisp.h, emacs.c: Update for this name change.
382 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
383 longer needed.
384
5a979817
EZ
3852012-07-12 Eli Zaretskii <eliz@gnu.org>
386
387 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
388 memmove call that removes glyphs covered by the left truncation
389 glyph. Improve commentary.
390 (display_line): Fix display of continuation glyphs on GUI frames
391 when the right fringe is turned off and variable-size fonts are
392 used in the window. Move the code that appends a stretch glyph to
393 produce_special_glyphs, so that it could be used for truncation
394 and continuation glyphs alike.
395 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
396 glyph of a suitably computed width, to align the special glyphs at
397 the window margin. Code moved from display_line. (Bug#11832)
398
3e91a053
GM
3992012-07-12 Glenn Morris <rgm@gnu.org>
400
ba9e4b84
GM
401 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
402
403 * s/gnu-linux.h, s/hpux10-20.h:
404 Do not unconditionally define HAVE_XRMSETDATABASE.
405
3e91a053
GM
406 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
407
b300b1f4
PE
4082012-07-12 Paul Eggert <eggert@cs.ucla.edu>
409
410 Fix typos that broke OS X build.
411 Reported by Randal L. Schwartz in
412 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
413 * nsterm.m (ns_timeout): Add missing local decl.
414 (ns_get_color): snprintf -> sprintf, to fix typo.
415
6e777848
GM
4162012-07-12 Glenn Morris <rgm@gnu.org>
417
3f922c37
GM
418 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
419 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
420 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
421 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
422
0ab7b23a
GM
423 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
424 Move PTY_OPEN to configure.
425
6e777848
GM
426 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
427 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
428 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
429
4a7edc24
DA
4302012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
431
432 Use empty_unibyte_string where applicable.
433 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
434 * lread.c (read1): Likewise.
435 * xsettings.c (syms_of_xsettings): Likewise.
436
308aab79
GM
4372012-07-12 Glenn Morris <rgm@gnu.org>
438
42bd1719
GM
439 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
440 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
441 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
442 * s/hpux10-20.h (RUN_TIME_REMAP):
443 * s/bsd-common.h (TABDLY): Move to configure.
444
445 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
446
447 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
448
ea0bbd17 449 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 450 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
451
452 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 453
308aab79
GM
454 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
455 * s/template.h: Move NARROWPROTO to configure.
456
ee1cf5cf
GM
4572012-07-11 Glenn Morris <rgm@gnu.org>
458
30fe9bf4
GM
459 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
460 unused since 2011-01-17 change to systty.h.
461
ee1cf5cf
GM
462 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
463 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
464 Move HAVE_PTYS and HAVE_SOCKETS to configure.
465
63e47e07
PE
4662012-07-11 Paul Eggert <eggert@cs.ucla.edu>
467
468 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
469
c43fb4c3
GM
4702012-07-11 Glenn Morris <rgm@gnu.org>
471
472 * s/darwin.h, s/gnu-linux.h, s/template.h:
473 Move INTERRUPT_INPUT to configure.
474
e8df9267
DA
4752012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
476
477 Minor adjustments to interning code.
478 * lisp.h (intern, intern_c_string): Redefine as static inline
479 wrappers for intern_1 and intern_c_string_1, respectively.
480 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
481 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
482 Vobarray checking.
e8df9267
DA
483 * font.c (font_intern_prop): Likewise. Adjust comment.
484 * w32font.c (intern_font_name): Likewise.
485
34348bd4
AS
4862012-07-11 Andreas Schwab <schwab@linux-m68k.org>
487
d96a1e0c
AS
488 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
489
34348bd4
AS
490 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
491 of Fcar/Fcdr if possible.
492 * font.c (check_otf_features): Likewise.
493 * fontset.c (Fnew_fontset): Likewise.
494 * gnutls.c (Fgnutls_boot): Likewise.
495 * minibuf.c (read_minibuf): Likewise.
496 * msdos.c (IT_set_frame_parameters): Likewise.
497 * xmenu.c (Fx_popup_dialog): Likewise.
498 * w32menu.c (Fx_popup_dialog): Likewise.
499
c8add24e
GM
5002012-07-11 Glenn Morris <rgm@gnu.org>
501
4b575b3c
GM
502 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
503 since nothing has defined it on these platforms.
504
09f4e3b0
GM
505 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
506 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
507
172bedef
GM
508 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
509 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
510 Move CLASH_DETECTION to configure.
511
249685df
GM
512 * s/gnu.h: Remove file, which is now empty.
513
c8add24e
GM
514 * s/gnu.h, s/gnu-linux.h:
515 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
516
b41253a3
JW
5172012-07-11 John Wiegley <johnw@newartisans.com>
518
519 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
520 function attribute, so we only use it if it exists in the
521 compiler.
522
d923b542
DA
5232012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
524
525 Avoid call to strlen in fast_c_string_match_ignore_case.
526 * search.c (fast_c_string_match_ignore_case): Change to use
527 length argument. Adjust users accordingly.
528 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
529
5ebbef1d
PE
5302012-07-11 Paul Eggert <eggert@cs.ucla.edu>
531
bb352260
PE
532 Assume mkdir, rmdir.
533 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
534 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
535
57054ddd
PE
536 Assume rename.
537 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
538
b747d3f7
PE
539 Assume perror.
540 * s/hpux10-20.h (HAVE_PERROR): Remove.
541 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
542 Remove dummy definition, as this problem was obsolete long ago.
543
5ebbef1d
PE
544 Assume strerror.
545 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
546
984e7f30
DA
5472012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
548
549 Avoid calls to strlen in font processing functions.
550 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 551 (font_open_by_name): Change to use length argument. Adjust
984e7f30 552 users accordingly.
d923b542
DA
553 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
554 Adjust prototypes.
555 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
556 Change to return ptrdiff_t.
984e7f30
DA
557 (xfont_list_pattern, xfont_match): Use length returned by
558 xfont_decode_coding_xlfd.
559 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
560
20e94fdd
GM
5612012-07-11 Glenn Morris <rgm@gnu.org>
562
9d596af3
GM
563 * s/darwin.h, s/freebsd.h, s/netbsd.h:
564 Move DONT_REOPEN_PTY to configure.
565
20e94fdd
GM
566 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
567 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
568
e99a530f
PE
5692012-07-10 Paul Eggert <eggert@cs.ucla.edu>
570
22ffb973
PE
571 Remove "#define unix" that is no longer needed (Bug#11905).
572 * s/aix4-2.h (unix): Remove; no longer needed.
573
e9a9ae03
PE
574 EMACS_TIME simplification (Bug#11875).
575 This replaces macros (which typically do not work in GDB)
576 with functions, typedefs and enums, making the code easier to debug.
577 The functional style also makes code easier to read and maintain.
578 * systime.h: Include <sys/time.h> on all hosts, not just if
579 WINDOWSNT, since 'struct timeval' is needed in general.
580 (EMACS_TIME): Now a typedef, not a macro.
581 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
582 not macros.
583 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
584 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
585 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
586 (EMACS_TIME_LE): Now functions, not macros.
587 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
588 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
589 which are not functions. All uses rewritten to use:
590 (make_emacs_time): New function.
591 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
592 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
593 not functions. All uses rewritten to use the following, respectively:
594 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
595 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 596 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
597 * fileio.c (Fcopy_file):
598 * xterm.c (XTflash): Get the current time closer to when it's used.
599 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
600
ffacb126
PE
601 * bytecode.c (targets): Suppress -Woverride-init warnings.
602
e99a530f
PE
603 Simplify by avoiding confusing use of strncpy etc.
604 * doc.c (Fsnarf_documentation):
605 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
606 * frame.c (Fmake_terminal_frame):
607 * gtkutil.c (get_utf8_string):
608 * lread.c (openp):
609 * nsmenu.m (ns_update_menubar):
610 * regex.c (regerror):
611 Prefer memcpy to strncpy and strncat when either will do.
612 * fileio.c (Fsubstitute_in_file_name):
613 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
614 (menu_separator_name_p):
615 * nsmenu.m (ns_update_menubar):
616 Prefer memcmp to strncmp when either will do.
617 * nsterm.m: Include <ftoastr.h>.
618 (ns_get_color):
619 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
620 Prefer snprintf to strncpy.
621 * nsterm.m (ns_term_init):
622 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
623 * nsterm.m (ns_term_init):
624 Avoid the need for strncpy, by using build_string or
625 make_unibyte_string directly. Use dtoastr, not snprintf.
626 * process.c (Fmake_network_process): Diagnose service names that
627 are too long, rather than silently truncating them or creating
628 non-null-terminated names.
629 (Fnetwork_interface_info): Likewise, for interface names.
630 * sysdep.c (system_process_attributes) [GNU_LINUX]:
631 Prefer sprintf to strncat.
632 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
633 Prefer vsnprintf to vsprintf + strncpy.
634
c59592b3
GM
6352012-07-10 Glenn Morris <rgm@gnu.org>
636
637 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
638 Clarify fallback case.
639
7d7bbefd
DA
6402012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
641
642 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
643 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
644 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 645 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
646 where argument type is known to be a Lisp_Cons.
647
3a4c8000
TT
6482012-07-10 Tom Tromey <tromey@redhat.com>
649
650 * bytecode.c (BYTE_CODE_THREADED): New macro.
651 (BYTE_CODES): New macro. Replaces all old byte-code defines.
652 (enum byte_code_op): New type.
653 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
654 (exec_byte_code): Use them. Use token threading when applicable.
655
2a0213a6
DA
6562012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
657
658 Optimize pure C strings initialization.
659 * lisp.h (make_pure_string): Fix prototype.
660 (build_pure_c_string): New function, defined as static inline. This
661 provides a better opportunity to optimize away calls to strlen when
662 the function is called with compile-time constant argument.
663 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
664 argument, adjust users accordingly. Use build_pure_c_string where
665 appropriate.
666 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
667 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
668 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
669
cb1caeaf
DA
6702012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
671
672 Avoid calls to strlen in miscellaneous functions.
673 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
674 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
675 * lread.c (openp): Likewise.
676
c293e30c
DA
6772012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
678
679 Avoid calls to strlen in path processing functions.
680 * fileio.c (file_name_as_directory): Add comment. Change to add
681 srclen argument and return the length of result. Adjust users
682 accordingly.
683 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 684 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
685 users accordingly.
686 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
687
9e059e3f
GM
6882012-07-10 Glenn Morris <rgm@gnu.org>
689
d02eb359
GM
690 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
691 Move PENDING_OUTPUT_COUNT definition to configure.
692
882cf227
GM
693 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
694 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
695 * s/gnu.h (DATA_START): Move definitions to configure.
696
af6e839f
GM
697 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
698 We include usg5-4-common.h, which defines them both.
699
40289a12
GM
700 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
701 O_RDONLY already includes it).
702
9e059e3f
GM
703 Stop ns builds setting the EMACSLOADPATH environment variable.
704 * nsterm.m (ns_load_path): Rename from ns_init_paths.
705 Now it does not set EMACSLOADPATH, just returns the load-path string.
706 * nsterm.h: Update accordingly.
707 * lread.c [HAVE_NS]: Include nsterm.h.
708 (init_lread) [HAVE_NS]: Use ns_load_path.
709 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
710
7c4e8ec0
GM
7112012-07-09 Glenn Morris <rgm@gnu.org>
712
d4f600ff
GM
713 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
714 since the included bsd-common.h does so.
715
cbb31951
GM
716 Stop ns builds setting the EMACSPATH environment variable.
717 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
718 (ns_init_paths): Do not set EMACSPATH.
719 * nsterm.h (ns_exec_path): Add it.
720 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
721 Use ns_exec_path.
722
7c4e8ec0
GM
723 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
724
26bccfae
PE
7252012-07-09 Paul Eggert <eggert@cs.ucla.edu>
726
a0bee46f
PE
727 * process.c (wait_reading_process_output): 'waitchannels' was unset
728 when read_kbd || !NILP (wait_for_cell); fix this.
729
5994c183
PE
730 Add GCC-style 'const' attribute to functions that can use it.
731 * character.h (char_resolve_modifier_mask):
732 * keyboard.h (make_ctrl_char):
733 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
734 (init_character_once, next_almost_prime, init_fns, init_image)
735 (flush_pending_output, init_sound):
736 * mem-limits.h (start_of_data):
737 * menu.h (finish_menu_items):
738 Add ATTRIBUTE_CONST.
739 * emacs.c (DEFINE_DUMMY_FUNCTION):
740 Declare the dummy function with ATTRIBUTE_CONST.
741 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
742 Add decls with ATTRIBUTE_CONST.
743
26bccfae
PE
744 Minor improvements to make_formatted_string.
745 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
746 where int is good enough, as vsprintf returns an int.
747 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
748
a8290ec3
DA
7492012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
750
751 Use make_formatted_string to avoid double length calculation.
752 * lisp.h (make_formatted_string): New prototype.
753 * alloc.c (make_formatted_string): New function.
754 * buffer.c (Fgenerate_new_buffer_name): Use it.
755 * dbus.c (syms_of_dbusbind): Likewise.
756 * editfns.c (Fcurrent_time_zone): Likewise.
757 * filelock.c (get_boot_time): Likewise.
758 * frame.c (make_terminal_frame, set_term_frame_name)
759 (x_report_frame_params): Likewise.
760 * image.c (gs_load): Likewise.
761 * minibuf.c (get_minibuffer): Likewise.
762 * msdos.c (dos_set_window_size): Likewise.
763 * process.c (make_process): Likewise.
764 * xdisp.c (ensure_echo_area_buffers): Likewise.
765 * xsettings.c (apply_xft_settings): Likewise.
766
d01ba2f1
GM
7672012-07-09 Glenn Morris <rgm@gnu.org>
768
769 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
770 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
771 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
772 * nsterm.h (ns_etc_directory): Add it.
773 * callproc.c [HAVE_NS]: Include nsterm.h.
774 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
775
f1f924b6
DA
7762012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
777
778 Move marker debugging code under MARKER_DEBUG.
779 * marker.c (MARKER_DEBUG): Move marker debugging code under
780 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
781 for bootstrap with --enable-checking (~3x slowdown reported
782 by Juanma Barranquero <lekktu@gmail.com>).
783 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
784
ab531b66
PE
7852012-07-08 Paul Eggert <eggert@cs.ucla.edu>
786
787 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
788 See <http://bugs.gnu.org/11825#29>.
789
c4b3bc8a
EZ
7902012-07-08 Eli Zaretskii <eliz@gnu.org>
791
792 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
793 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
794 (display_line): Add commentary about displaying truncation glyphs
795 on GUI frames.
796 (produce_special_glyphs): Move here from term.c.
797
798 * term.c (produce_special_glyphs): Move to xdisp.c.
799
800 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
801 section.
c4b3bc8a 802
b676b881
AS
8032012-07-07 Andreas Schwab <schwab@linux-m68k.org>
804
f17c5273
AS
805 * xdisp.c (display_line): Avoid warning about implicit declaration
806 of FRAME_FONT.
807
298819b9
AS
808 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
809
b676b881
AS
810 * lisp.h: Remove empty conditional.
811
6045c4fd
PE
8122012-07-07 Paul Eggert <eggert@cs.ucla.edu>
813
b3350bf9
PE
814 * lread.c (load_path_check): Now static.
815
6045c4fd
PE
816 Fix some minor --with-ns problems found by static checking.
817 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
818 (x_set_font) [!HAVE_X_WINDOWS]:
819 * image.c (xpm_load_image) [HAVE_NS]:
820 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
821 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
822 Remove unused local.
823 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
824 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
825 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
826 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
827 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
828 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
829 Fix pointer signedness problem.
830 * xfaces.c (FRAME_X_FONT_TABLE):
831 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
832
929e7845
GM
8332012-07-07 Glenn Morris <rgm@gnu.org>
834
835 * lread.c (load_path_check): New function, split from init_lread.
836 (init_lread): Reorganize. Motivation:
837 If EMACSLOADPATH is set, check/warn about that rather than the
838 defaults, which we are not going to use. Hence we can remove
839 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
840 Don't warn if site-lisp directories are missing.
841 If not installed, start from a blank load-path, since
842 PATH_LOADSEARCH refers to the eventual installation directories.
843
58dd0aa4
EZ
8442012-07-07 Eli Zaretskii <eliz@gnu.org>
845
846 Support truncation and continuation glyphs on GUI frames, when
847 fringes are disabled. (Bug#11832)
848 * xdisp.c (init_iterator): Get dimensions of truncation and
849 continuation glyphs even if on GUI frames. Adjust
850 it->last_visible_x on GUI frames when the left or right fringes,
851 or both, are absent.
852 (start_display, move_it_in_display_line_to): Handle the case of a
853 GUI frame without a fringe to display continuation or truncation
854 glyphs.
855 (insert_left_trunc_glyphs): Support GUI frames: make sure
856 truncation glyphs overwrite enough glyphs from the current line to
857 have sufficient space in pixels.
858 (display_line): Support truncation and continuation glyphs on GUI
859 frames. If some spare pixels are left on the line after inserting
860 the truncation glyphs, fill that space with a stretch glyph of a
861 suitably computed width.
862
863 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
864 produce_glyphs, to support GUI sessions.
865
31571fd7
PE
8662012-07-07 Paul Eggert <eggert@cs.ucla.edu>
867
5a16b9bc
PE
868 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
869
f3047c75
PE
870 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
871
31571fd7
PE
872 Do not require float-time's arg to fit in time_t (Bug#11825).
873 This works better on hosts where time_t is unsigned, and where
874 float-time is applied to the (negative) difference between two times.
875 * editfns.c (decode_time_components): Last arg is now double *,
876 not int *, and means to store all the result as a double, without
877 worrying about whether the seconds part fits in time_t.
878 All callers changed.
879 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
880 All callers changed.
881 (Ffloat_time): Do not fail merely because the specified time falls
882 outside of time_t range.
883
4516fbef
GM
8842012-07-07 Glenn Morris <rgm@gnu.org>
885
886 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
887 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
888 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
889
07adc2c6
JB
8902012-07-07 Juanma Barranquero <lekktu@gmail.com>
891
892 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
893 Update dependencies.
894
895 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
896
fd573f31
PE
8972012-07-06 Paul Eggert <eggert@cs.ucla.edu>
898
fee5959d
PE
899 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
900 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
901 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
902 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
903 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
904 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
905
fd573f31
PE
906 * xfont.c (compare_font_names): Redo to omit the need for casts.
907
ddadbc0e
AS
9082012-07-06 Andreas Schwab <schwab@linux-m68k.org>
909
fca8d6b6
AS
910 * xfns.c (Fx_change_window_property): Doc fix.
911 * w32fns.c (Fx_change_window_property): Doc fix.
912
ddadbc0e
AS
913 * w32fns.c (Fx_window_property): Accept the same arguments as the
914 X Windows version. Doc fix.
915 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
916
ed9265fc 9172012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
918 Eli Zaretskii <eliz@gnu.org>
919
920 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
921 Windows-specific code from nt/config.nt moved here.
922 Obsolete settings removed.
923
216ee680
PE
9242012-07-06 Paul Eggert <eggert@cs.ucla.edu>
925
926 * process.c: Avoid unnecessary calls to gettime.
927 (wait_reading_process_output): Don't get the time of day
928 when gobbling data immediately and not waiting, as there's no need
929 for it in that case. This removes a FIXME.
930
bdd091e4
JD
9312012-07-06 Jan Djärv <jan.h.d@swipnet.se>
932
933 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
934 is defined (Bug#11768).
935
9d44f8ce
DA
9362012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
937
938 Fix marker debugging code.
939 * marker.c (byte_char_debug_check): Do not perform the check
940 if buffer is not multibyte.
090bd7cb
JB
941 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
942 Call byte_char_debug_check with correct arguments.
9d44f8ce 943
90fc4786
DA
9442012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
945
946 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
947 * marker.c (byte_char_debug_check, count_markers):
948 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
949 (byte_debug_flag): Remove.
950 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
951 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
952
7b7ae965
DA
9532012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
954
4e57b342
DA
955 Avoid code repetition in marker-related functions.
956 * marker.c (attach_marker): New function.
957 (Fset_marker, set_marker_restricted, set_marker_both)
958 (set_marker_restricted_both): Use it.
959 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
960 Consistently rename charno to charpos.
961 (marker_position): Add eassert.
962 (marker_byte_position): Convert to eassert.
963
9642012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
965
966 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 967 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 968 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 969
657924ff
DA
9702012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
971
972 Introduce fast path for the widely used marker operation.
973 * alloc.c (build_marker): New function.
974 * lisp.h (build_marker): New prototype.
975 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
976 * composite.c (autocmp_chars): Likewise.
977 * editfns.c (buildmark): Remove.
978 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
979 (save_restriction_save): Use build_marker.
980 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
981 * window.c (save_window_save): Likewise.
982
041a49a6
DA
9832012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
984
985 Do not use Fdelete_overlay in delete_all_overlays
986 to avoid redundant calls to unchain_overlay.
987 * buffer.c (drop_overlay): New function.
988 (delete_all_overlays, Fdelete_overlay): Use it.
989 * minibuf.c (get_minibuffer): Fix comment.
990
7dca65a4
PE
9912012-07-06 Paul Eggert <eggert@cs.ucla.edu>
992
993 Port to OpenBSD 5.1 amd64.
994 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
995 This is needed for OpenBSD, and should be harmless on all BSD systems.
996 Also, include <sys/sysctl.h>, as it should be available on all
997 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
998 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
999 use p_pid member, not kp_proc.pid.
1000
8eb876e2
GM
10012012-07-06 Glenn Morris <rgm@gnu.org>
1002
1003 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
1004
38182d90
PE
10052012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1006
1007 More xmalloc and related cleanup.
1008 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
1009 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
1010 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
1011 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
1012 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
1013 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
1014 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
1015 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
1016 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
1017 * xterm.c:
1018 Omit needless casts involving void * pointers and allocation.
1019 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
1020 as the former is more robust if P's type is changed.
1021 Prefer xzalloc to xmalloc + memset 0.
1022 Simplify malloc-or-realloc to realloc.
1023 Don't worry about xmalloc returning a null pointer.
1024 Prefer xstrdup to xmalloc + strcpy.
1025 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
1026 growing it.
1027 * keyboard.c (apply_modifiers_uncached): Prefer local array to
1028 alloca of a constant.
1029
6dd5a677
EZ
10302012-07-05 Eli Zaretskii <eliz@gnu.org>
1031
1032 * xdisp.c (display_line): Fix horizontal pixel coordinates when
1033 hscroll is larger than the line width. Fixes long and futile
1034 looping inside extend_face_to_end_of_line (on a TTY) producing
1035 glyphs that are not needed and thrown away.
1036
6b312f0f
DA
10372012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1038
1039 * marker.c (set_marker_restricted_both): Simplify by using
1040 clip_to_bounds.
1041
f520ef9b
PE
10422012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1043
1044 * editfns.c (region_limit): Simplify by using clip_to_bounds.
1045
383b7c95
JD
10462012-07-05 Jan Djärv <jan.h.d@swipnet.se>
1047
1048 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
1049 not defined (Bug#11768).
1050 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
1051 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
1052 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
1053 followed by gtk_box_set_homogeneous (Bug#11768).
1054 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
1055 (update_theme_scrollbar_width, xg_create_scroll_bar):
1056 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
1057 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
1058 (is_box_type): New function (Bug#11768).
1059 (xg_tool_item_stale_p): Call is_box_type.
5293d758 1060 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
1061 with default display (Bug#11768).
1062
d6e7bf45
EZ
10632012-07-05 Eli Zaretskii <eliz@gnu.org>
1064
1065 * xdisp.c (window_hscroll_limited): New function.
1066 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
1067 coordinates when window's hscroll is set to insanely large
1068 values. (Bug#11857)
1069
431391ec
JB
10702012-07-05 Juanma Barranquero <lekktu@gmail.com>
1071
1072 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
1073 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
1074
23f86fce
DA
10752012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1076
1077 Cleanup xmalloc.
1078 * lisp.h (xzalloc): New prototype. Omit needless casts.
1079 * alloc.c (xzalloc): New function. Omit needless casts.
1080 * charset.c: Omit needless casts. Convert all calls to
1081 xmalloc with following memset to xzalloc.
1082 * dispnew.c: Likewise.
1083 * fringe.c: Likewise.
1084 * image.c: Likewise.
1085 * sound.c: Likewise.
1086 * term.c: Likewise.
1087 * w32fns.c: Likewise.
1088 * w32font.c: Likewise.
1089 * w32term.c: Likewise.
1090 * xfaces.c: Likewise.
1091 * xfns.c: Likewise.
1092 * xterm.c: Likewise.
1093 * atimer.c: Omit needless casts.
1094 * buffer.c: Likewise.
1095 * callproc.c: Likewise.
1096 * ccl.c: Likewise.
1097 * coding.c: Likewise.
1098 * composite.c: Likewise.
1099 * doc.c: Likewise.
1100 * doprnt.c: Likewise.
1101 * editfns.c: Likewise.
1102 * emacs.c: Likewise.
1103 * eval.c: Likewise.
1104 * filelock.c: Likewise.
1105 * fns.c: Likewise.
1106 * gtkutil.c: Likewise.
1107 * keyboard.c: Likewise.
1108 * lisp.h: Likewise.
1109 * lread.c: Likewise.
1110 * minibuf.c: Likewise.
1111 * msdos.c: Likewise.
1112 * print.c: Likewise.
1113 * process.c: Likewise.
1114 * region-cache.c: Likewise.
1115 * search.c: Likewise.
1116 * sysdep.c: Likewise.
1117 * termcap.c: Likewise.
1118 * terminal.c: Likewise.
1119 * tparam.c: Likewise.
1120 * w16select.c: Likewise.
1121 * w32.c: Likewise.
1122 * w32reg.c: Likewise.
1123 * w32select.c: Likewise.
1124 * w32uniscribe.c: Likewise.
1125 * widget.c: Likewise.
1126 * xdisp.c: Likewise.
1127 * xmenu.c: Likewise.
1128 * xrdb.c: Likewise.
1129 * xselect.c: Likewise.
1130
0497dc44
PE
11312012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1132
1133 * fileio.c (time_error_value): Check the right error number.
1134 Problem reported by Troels Nielsen in
1135 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
1136
356e7178
PE
11372012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1138
4e71fd89
PE
1139 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
1140 This should be fixed in a better way; see Eli Zaretskii in
1141 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
1142 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
1143
f0941253
PE
1144 * fileio.c (time_error_value): Rename from special_mtime.
1145 The old name's problems were noted by Eli Zaretskii in
1146 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
1147
065c9eb4
PE
1148 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
1149 This variable's comment says Emacs needs at least one GDB-visible
1150 symbol of type enum pvec_type, to work around GDB problems.
1151 The symbol's value doesn't matter.
1152
356e7178
PE
1153 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
1154 that causes compilation to fail on pre-C99 compilers.
1155
ed9265fc 11562012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
1157
1158 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
1159 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
1160
3884d954
DA
11612012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1162
d209e2fb 1163 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
1164 headers for buffer_defaults and buffer_local_symbols.
1165 Reported by Juanma Barranquero <lekktu@gmail.com>.
1166
ee28be33
SM
11672012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1168
1169 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
1170 * lisp.h (enum pvec_type): Use fewer bits.
1171 (PSEUDOVECTOR_SIZE_BITS): New constant.
1172 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
1173 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
1174 change in pvec_type.
1175 (PSEUDOVECTOR_TYPEP): New macro.
1176 (TYPED_PSEUDOVECTORP): Use it.
1177 * fns.c (internal_equal): Adapt code to extract pvectype.
1178 * emacs.c (gdb_pvec_type): Update type.
1179 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
1180 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
1181 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
1182 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
1183 (sweep_vectors): Use it. Use local var `total_bytes' instead of
1184 abusing vector->header.next.nbytes.
1185 (live_vector_p): Use PVEC_TYPE.
1186 (mark_object): Adapt code to extract pvectype. Use switch.
1187
c7f2cd7f
PE
11882012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1189
1190 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
1191 Tighten new eassert a bit.
1192
8ce70ed2
DA
11932012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1194
1195 Fix compilation with --enable-gcc-warnings and -O1
1196 optimization level.
1197 * doprnt.c (doprnt): Change type of tem to int, initialize
1198 to avoid compiler warning. Add eassert.
1199 * search.c (simple_search): Initialize match_byte to avoid
1200 compiler warning. Add eassert.
1201
dea7f1e5
PE
12022012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1203
24a212eb
PE
1204 Avoid weird behavior with large horizontal scrolls.
1205 Without this change, for example, large hscroll values would
1206 mess up Emacs's display on Fedora 15 x86, presumably due to
1207 overflows in int calculations in the display code.
1208 Also, if buffers had long lines, Emacs would freeze.
1209 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
1210 (set_window_hscroll): New function, containing the old guts of
1211 Fset_window_hscroll. Return the clipped value.
1212 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
1213 This avoids the need to check against PTRDIFF_MAX.
1214
dea7f1e5
PE
1215 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
1216
76046526
DA
12172012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1218
1219 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
1220
39adff0d
PE
12212012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1222
63807d47
PE
1223 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
1224 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
1225 since GCC 4.4.6 issues a bogus warning for them.
1226
39adff0d
PE
1227 Fix bugs in file timestamp newness comparisons.
1228 * fileio.c (Ffile_newer_than_file_p):
1229 * lread.c (Fload): Use full timestamp resolution of files,
1230 not just the 1-second resolution, so that files that are only
1231 slightly newer still count as newer.
1232 * fileio.c (Ffile_newer_than_file_p): Don't assume file
1233 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
1234
dbeed9a6
PE
12352012-07-03 Paul Eggert <eggert@cs.ucla.edu>
1236
1237 * fileio.c: Improve handling of file time marker. (Bug#11852)
1238 (special_mtime): New function.
1239 (Finsert_file_contents, Fverify_visited_file_modtime):
1240 Use it to set special mtime values consistently.
1241
636334d6
AS
12422012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1243
1244 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1245 marker for non-existing file. (Bug#11852)
1246
e2017fe2
GM
12472012-07-03 Glenn Morris <rgm@gnu.org>
1248
1249 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1250 and did not make it into globals.h).
1251
404dbd37
TT
12522012-07-03 Tom Tromey <tromey@redhat.com>
1253
1254 * window.c (Fset_window_margins, Fset_window_fringes)
1255 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1256 * textprop.c (Fprevious_property_change): No longer static.
1257 * syntax.c (Fsyntax_table_p): No longer static.
1258 * process.c (Fget_process, Fprocess_datagram_address): No longer
1259 static.
1260 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1261 * keyboard.c (Fcommand_execute): No longer static.
1262 Remove EXFUN.
1263 * insdel.c (Fcombine_after_change_execute): No longer static.
1264 * image.c (Finit_image_library): No longer static.
1265 * fileio.c (Fmake_symbolic_link): No longer static.
1266 * eval.c (Ffetch_bytecode): No longer static.
1267 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
1268 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1269 No longer static.
404dbd37
TT
1270 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1271 static.
1272 * dired.c (Ffile_attributes): No longer static.
1273 * composite.c (Fcomposition_get_gstring): No longer static.
1274 * callproc.c (Fgetenv_internal): No longer static.
1275
1276 * ccl.h: Remove EXFUNs.
1277 * buffer.h: Remove EXFUNs.
1278 * dispextern.h: Remove EXFUNs.
1279 * intervals.h: Remove EXFUNs.
1280 * fontset.h: Remove EXFUN.
1281 * font.h: Remove EXFUNs.
1282 * dosfns.c (system_process_attributes): Remove EXFUN.
1283 * keymap.h: Remove EXFUNs.
1284 * lisp.h: Remove EXFUNs.
1285 * w32term.h: Remove EXFUNs.
1286 * window.h: Remove EXFUNs.
1287 * xsettings.h: Remove EXFUN.
1288 * xterm.h: Remove EXFUN.
1289
8e4fd1e1
GM
12902012-07-03 Glenn Morris <rgm@gnu.org>
1291
1292 * lisp.h (Frandom): Make it visible to C.
1293 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1294 buffer for invisible buffers. (Bug#1229)
1295
ca95b3eb
DA
12962012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1297
1298 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1299 values which aren't power of 2.
1300 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1301 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1302 accordingly.
1303
7555c33f
SM
13042012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1305
1306 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1307
1308 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1309
d12e8f5a
DA
13102012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1311
1312 * alloc.c (allocate_vector_block): Remove redundant
1313 calls to mallopt if DOUG_LEA_MALLOC is defined.
1314 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1315 avoid calls to mallopt if zero_vector is returned.
1316
296094c3
DA
13172012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1318
1319 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
1320 is enabled, avoid dereferencing NULL current_sblock if
1321 running undumped.
1322
36429c89
DA
13232012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1324
1325 Cleanup basic buffer management.
1326 * buffer.h (struct buffer): Change layout to use generic vector
1327 marking code. Fix some comments. Change type of 'clip_changed'
1328 to bitfield. Remove unused #ifndef old.
1329 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1330 (GET_OVERLAYS_AT): Fix indentation.
1331 (for_each_per_buffer_object_at): New macro.
1332 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1333 (Fbuffer_local_variables): Use it.
1334 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1335 * alloc.c (allocate_buffer): Adjust to match new layout of
1336 struct buffer. Fix comment.
1337 (mark_overlay): New function.
1338 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1339 Lisp area of struct buffer.
1340 (mark_object): Use it. Adjust marking of misc objects
1341 and related comments.
1342
3b3e4cac
PE
13432012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1344
1345 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1346 wrapper that is not needed because the wrapped code is a no-op (zero
1347 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1348 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1349
cf5c0175
DA
13502012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1351
1352 * alloc.c (mark_buffer): Simplify. Remove prototype.
1353 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1354 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1355 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1356 redundant calls to mark_vectorlike for bool vectors.
1357
ca26824c
GM
13582012-06-30 Glenn Morris <rgm@gnu.org>
1359
2e4c5312
GM
1360 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1361
ca26824c
GM
1362 * epaths.in (PATH_SITELOADSEARCH): New.
1363 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1364 This is rather than relying on --enable-locallisppath elements
1365 having "site-lisp" in their names. (Bug#10208#25, 11658)
1366
0d23c240
EZ
13672012-06-30 Eli Zaretskii <eliz@gnu.org>
1368
c9240d7a
EZ
1369 * w32proc.c (sys_select): Accept and ignore one more argument.
1370
1371 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1372
0d23c240 1373 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1374 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1375
1376 * sysdep.c: Don't include dos.h and dosfns.h.
1377
1378 * process.c (sys_select):
1379 * msdos.c (sys_select): Accept one more argument and ignore it.
1380
1381 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1382 adapt data types and code to that.
1383
1384 * dosfns.c:
1385 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1386 which clashes with the gnulib function of the same name.
1387
af5a5a98
AS
13882012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1389
c5e4379c
AS
1390 * font.c (font_style_to_value, font_style_symbolic)
1391 (font_prop_validate_style): Add type checks for values in
1392 font_style_table.
1393
af5a5a98
AS
1394 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1395 argument.
1396 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1397 uses.
1398
8d38f461
EZ
13992012-06-29 Eli Zaretskii <eliz@gnu.org>
1400
2e5a6631
EZ
1401 * xdisp.c (try_window_id): Undo last change.
1402
8d38f461
EZ
1403 * w32.c (getwd): Adjust commentary about startup_dir.
1404 (init_environment): Always call sys_access, even in non-MSVC
1405 builds. Don't chdir to the directory of the Emacs executable.
1406 This undoes code from 1997 which was justified by the need to
1407 "avoid conflicts when removing and renaming directories". But its
1408 downside was that every relative file name was being interpreted
1409 relative to the directory of the Emacs executable, which can never
1410 be TRT. In particular, it broke sys_access when called with
1411 relative file names.
1412 (sys_access): Map GetLastError to errno.
1413
2af3565e
DA
14142012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1415
1416 * window.h (struct window): Change type of 'fringes_outside_margins'
1417 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1418 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1419 Adjust comment.
1420 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1421 to ptrdiff_t.
1422
c8d3a25c 14232012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1424
c8d3a25c
GM
1425 * gnutls.c (emacs_gnutls_handshake):
1426 Add QUIT to make the loop interruptible.
57570cd3 1427
c8d3a25c 14282012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1429
c8d3a25c
GM
1430 * charset.c (init_charset): Make lack of etc/charsets fatal.
1431
3e984ee8
DA
14322012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1433
1434 * editfns.c (region_limit): Fix type mismatch.
1435
ef884f23
DA
14362012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1437
1438 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1439 undefined. Convert from xassert to eassert.
1440 * nsmenu.m: Convert from xassert to eassert.
1441 * nsterm.m: Likewise.
1442
7d7e0027
SM
14432012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1444
1445 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1446
aa754e6a
PE
14472012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1448
1449 Avoid integer overflow on scroll-left and scroll-right.
1450 * window.c (HSCROLL_MAX): New macro.
1451 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1452 overflow when requested scroll falls outside ptrdiff_t range.
1453
80b00b08
DA
14542012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1455
1456 * window.h (struct window): Change type of 'hscroll',
1457 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1458 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1459 Adjust users accordingly.
1460 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1461 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1462 from EMACS_INT to ptrdiff_t.
1463 (make_window): Omit redundant initialization.
1464
62b2bcf6
JB
14652012-06-28 Juanma Barranquero <lekktu@gmail.com>
1466
1467 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1468
45942c7d
DA
14692012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1470
1471 * window.h (struct window): Change type of 'use_time' and
1472 'sequence_number' from Lisp_Object to int.
1473 * frame.c (make_frame): Adjust users accordingly.
1474 * print.c (print_object): Likewise.
1475 * window.c (select_window, Fwindow_use_time, make_parent_window)
1476 (make_window): Likewise.
1477
e509cfa6
DA
14782012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1479
1480 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1481 enabled with --enable-checking=[all,glyphs] configure option.
1482 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1483 adjust comments accordingly.
1484 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1485 undefined, adjust comments accordingly.
1486 * image.c: Likewise.
1487 * scroll.c: Likewise.
1488 * w32fns.c: Likewise.
1489 * w32term.c: Likewise.
1490 * xdisp.c: Likewise.
1491 * xfaces.c: Likewise.
1492 * xfns.c: Likewise.
1493 * xterm.c: Likewise.
1494
a54e2c05
DA
14952012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1496
1497 Generalize run-time debugging checks.
1498 * dispextern.h (XASSERTS): Remove.
1499 * fontset.c (xassert): Remove.
1500 Convert from xassert to eassert.
1501 * alloc.c: Convert from xassert to eassert.
1502 * bidi.c: Likewise.
1503 * dispnew.c: Likewise.
1504 * fns.c: Likewise.
1505 * fringe.c: Likewise.
1506 * ftfont.c: Likewise.
1507 * gtkutil.c: Likewise.
1508 * image.c: Likewise.
1509 * keyboard.c: Likewise.
1510 * menu.c: Likewise.
1511 * process.c: Likewise.
1512 * scroll.c: Likewise.
1513 * sound.c: Likewise.
1514 * term.c: Likewise.
1515 * w32console.c: Likewise.
1516 * w32fns.c: Likewise.
1517 * w32term.c: Likewise.
1518 * window.c: Likewise.
1519 * xdisp.c: Likewise.
1520 * xfaces.c: Likewise.
1521 * xfns.c: Likewise.
1522 * xselect.c: Likewise.
1523 * xterm.c: Likewise.
1524
1ec4b7b2
SM
15252012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1526
1527 * fns.c (maybe_resize_hash_table): Output message when growing the
1528 purify-hashtable.
1529
2014308a
DA
15302012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1531
1532 * alloc.c (allocate_string_data): Remove dead code.
1533 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1534 avoid GCC warning about unused macro.
1535
246155eb
DA
15362012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1537
1538 * alloc.c (allocate_string): Omit intervals initialization.
1539 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1540 as in make_pure_string and make_pure_c_string.
1541
43184b7b
DA
15422012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1543
d209e2fb 1544 * alloc.c (allocate_string): Fix last change.
43184b7b 1545
3fe6dd74
DA
15462012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1547
d209e2fb 1548 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1549 to memset, add explicit initialization where appropriate.
1550
1ba6038a
GM
15512012-06-27 Glenn Morris <rgm@gnu.org>
1552
1553 * lisp.mk (lisp): Remove paths.elc.
1554
c89926a5
CY
15552012-06-27 Chong Yidong <cyd@gnu.org>
1556
1557 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1558
ed6b3510
JW
15592012-06-26 John Wiegley <johnw@newartisans.com>
1560
1ec4b7b2 1561 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1562 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1563
ed6b3510
JW
1564 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1565 when building with Clang.
1566
8edd4a2b
SM
15672012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1568
1569 * eval.c (Fapply): Allow calling it with a single argument.
1570
f6f62d1b
EZ
15712012-06-26 Eli Zaretskii <eliz@gnu.org>
1572
1573 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1574 _stricmp and _strnicmp.
1575 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1576
62efea5e
DA
15772012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1578
1579 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1580 allocated window.
1581 (allocate_process): Likewise for new process.
8edd4a2b 1582 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1583 (allocate_frame): Likewise.
1584 * frame.c (make_frame): Omit redundant initialization.
1585 * window.c (make_parent_window): Use memset.
1586 (make_window): Omit redundant initialization.
1587 * process.c (make_process): Omit redundant initialization.
1588 * terminal.c (create_terminal): Likewise.
1589
42997f4d
DA
15902012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1591
1592 * term.c (delete_tty): Remove redundant call to memset.
1593
1130ecfc
DA
15942012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1595
1596 * alloc.c: Remove build_string.
1597 * lisp.h: Define build_string as static inline. This provides
1598 a better opportunity to optimize away calls to strlen when the
1599 function is called with compile-time constant argument.
1600 * image.c (imagemagick_error): Convert to build_string.
1601 * w32proc.c (sys_spawnve): Likewise.
1602 * xterm.c (x_term_init): Likewise.
1603
cf38a720
PE
16042012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1605
99027bdd
PE
1606 Use sprintf return value instead of invoking strlen on result.
1607 In the old days this wasn't portable, since some sprintf
1608 implementations returned char *. But they died out years ago and
1609 Emacs already assumes sprintf returns int.
1610 Similarly for float_to_string.
1611 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1612 * ccl.c (ccl_driver):
1613 * character.c (string_escape_byte8):
1614 * data.c (Fnumber_to_string):
1615 * doprnt.c (doprnt):
1616 * print.c (print_object):
1617 * xdisp.c (message_dolog):
1618 * xfns.c (syms_of_xfns):
1619 Use sprintf or float_to_string result to avoid need to call strlen.
1620 * data.c (Fnumber_to_string):
1621 Use make_unibyte_string, since the string must be ASCII.
1622 * lisp.h, print.c (float_to_string): Now returns int length.
1623 * term.c (produce_glyphless_glyph):
1624 Use sprintf result rather than recomputing it.
1625
cf38a720
PE
1626 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1627 * Makefile.in (ALL_CFLAGS):
1628 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1629 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1630
3511c784
DA
16312012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1632
0a08eb21 1633 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1634 strcasecmp if available.
1635 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1636
fb7da12e
AS
16372012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1638
1639 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1640 Avoid comma operator.
1641 * menu.c (push_submenu_start, push_submenu_end)
1642 (push_left_right_boundary, push_menu_pane): Likewise.
1643 * msdos.c (dos_rawgetc): Likewise.
1644
afa2ffd8
DA
16452012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1646
1647 * xfns.c (xic_create_fontsetname): Remove redundant calls
1648 to memset.
1649
b3b4476b
PE
16502012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1651
4495ff38
PE
1652 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1653 sprintf already null-terminates its output.
1654
b3b4476b
PE
1655 * xfns.c (x_window): Remove redundant cast.
1656
b00876c9
DA
16572012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1658
1659 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1660 `const char *' to `char *' to avoid compiler warning.
1661
d188e26b
PE
16622012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1663
885d1d74
PE
1664 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1665 instead of truncating it to 63 (admittedly a generous limit).
1666
d188e26b
PE
1667 * process.c: Fix spelling and caps in comments.
1668
e2f560b1
DN
16692012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1670
e86db54b 1671 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1672 * sysdep.c (setpgrp): Remove definition, not used in this file.
1673
7583a3a1
JB
16742012-06-24 Juanma Barranquero <lekktu@gmail.com>
1675
1676 * makefile.w32-in: Update dependencies.
1677
696056c2
EZ
16782012-06-24 Eli Zaretskii <eliz@gnu.org>
1679
1680 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1681 (SYSTIME_H): Add nt/inc/sys/time.h.
1682
1683 * systime.h [WINDOWSNT]: Include sys/time.h.
1684
1685 * s/ms-w32.h (struct timespec): Definition moved from
1686 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1687
845ca893
PE
16882012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1689
1690 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1691 * buffer.h (buffer_slot_type_mismatch):
1692 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1693 * eval.c (unwind_to_catch):
1694 * image.c (my_png_error, my_error_exit):
1695 * keyboard.c (quit_throw_to_read_char, user_error)
1696 (Fexit_recursive_edit, Fabort_recursive_edit):
1697 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1698 (wrong_type_argument, buffer_overflow, __executable_start)
1699 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1700 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1701 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1702 (fatal):
1703 (child_setup) [!DOS_NT]:
1704 * lread.c (end_of_file_error, invalid_syntax):
1705 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1706 * puresize.h (pure_write_error):
1707 * search.c (matcher_overflow):
1708 * sound.c (sound_perror, alsa_sound_perror):
1709 * sysdep.c, syssignal.h (croak):
1710 * term.c (maybe_fatal, vfatal):
1711 * textprop.c (text_read_only):
1712 * undo.c (user_error):
1713 * unexmacosx.c (unexec_error):
1714 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1715 Use _Noreturn rather than NO_RETURN.
1716 No need for separate decl merely because of _Noreturn.
1717 * sound.c (sound_warning, parse_sound):
1718 Remove unnecessary forward decls.
1719
f1dd8073
PE
17202012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1721
1722 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1723 * lisp.h (WAIT_READING_MAX): New macro.
1724 * dispnew.c (Fsleep_for, sit_for):
1725 * keyboard.c (kbd_buffer_get_event):
1726 * process.c (Faccept_process_output):
1727 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1728 This improves on the previous patch, which introduced a bug
1729 when time_t is unsigned and as wide as intmax_t.
1730 See <http://bugs.gnu.org/9000#51>.
1731
b82c1755
EZ
17322012-06-23 Eli Zaretskii <eliz@gnu.org>
1733
1734 * dispnew.c (sit_for, Fsleep_for):
1735 * keyboard.c (kbd_buffer_get_event):
1736 * process.c (Faccept_process_output): Avoid compiler warnings when
1737 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1738
ca300656
JB
17392012-06-23 Juanma Barranquero <lekktu@gmail.com>
1740
049ec95b
JB
1741 * makefile.w32-in: Update dependencies.
1742
ca300656
JB
1743 * w32.c (ltime): Add return type and declare static.
1744 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1745
db7b8d06
PE
17462012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1747
1748 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1749 Privately reported by Herbert J. Skuhra.
1750 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1751 All uses changed.
1752 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1753 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1754
0bd8297f
EZ
17552012-06-23 Eli Zaretskii <eliz@gnu.org>
1756
96512555
EZ
1757 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1758 last argument of make_unibyte_string.
1759
0bd8297f
EZ
1760 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1761 language ID in the event parameters.
1762
1763 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1764 event.code, not the obscure "character set ID".
1765
63def6b6
CY
17662012-06-23 Chong Yidong <cyd@gnu.org>
1767
1768 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1769
e8a02204
EZ
17702012-06-23 Eli Zaretskii <eliz@gnu.org>
1771
388cdec0
EZ
1772 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1773 * w32.c (fdutimens): New function.
1774
1775 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1776
1777 * s/ms-w32.h (pselect): Redirect to sys_select.
1778
1779 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1780
e8a02204
EZ
1781 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1782 in the logic of incrementing and decrementing the value of
1783 use_relocatable_buffers.
1784
d054f3fb
PE
17852012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1786
1787 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1788 Privately reported by Herbert J. Skuhra.
1789 [__FreeBSD__]: Remove "*/" typo after "#include".
1790 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1791 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1792 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1793 Don't assume EMACS_TIME and struct timeval are the same type.
1794
d35af63c
PE
17952012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1796
1797 Support higher-resolution time stamps (Bug#9000).
1798 The time stamps are only nanosecond-resolution at the C level,
1799 since that's the best that any real-world system supports now.
1800 But they are picosecond-resolution at the Lisp level, as that's
1801 easy, and leaves room for future OS improvements.
1802
1803 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1804 (LIBES): Use it.
1805
1806 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1807 Don't get current time unless it's needed.
1808
1809 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1810 now provides it if it's absent.
1811 (start_atimer): Port to higher-res time stamps.
1812 Check for time stamp overflow. Don't get current time more
1813 often than is needed.
1814
1815 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1816 Include systime.h, not time.h.
1817 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1818
1819 * dired.c: Include stat-time.h.
1820 (Ffile-attributes): File times now have higher resolution.
1821
1822 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1823 (struct image): Timestamp now has higher resolution.
1824
1825 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1826 has at least microseconds now. All uses removed.
1827 (update_frame, update_single_window, update_window, update_frame_1)
1828 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1829
1830 * editfns.c (time_overflow): Now extern.
1831 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1832 (float-time, Fformat_time_string, Fcurrent_time_string)
1833 (Fcurrent_time_zone): Accept and generate higher-resolution
1834 time stamps.
1835 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1836 (decode_time_components, lisp_seconds_argument): New functions.
1837 (make_time): Now static.
1838 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1839 Report an error if the time is invalid, rather than having the caller
1840 do that.
1841
1842 * fileio.c: Include <stat-time.h>
1843 (Fcopy_file): Copy higher-resolution time stamps.
1844 Prefer to set the time stamp via a file descriptor if that works.
1845 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1846 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1847 (Fvisited_file_modtime, Fset_visited_file_modtime):
1848 Support higher-resolution time stamps.
1849
1850 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1851
1852 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1853
1854 * image.c (prepare_image_for_display, clear_image_cache)
1855 (lookup_image): Port to higer-resolution time stamps.
1856
1857 * keyboard.c (start_polling, bind_polling_period):
1858 Check for time stamp overflow.
1859 (read_char, kbd_buffer_get_event, timer_start_idle)
1860 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1861 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1862 Port to higher-resolution time stamps. Do not assume time_t is signed.
1863 (decode_timer): New function. Timers are now vectors of length 9,
1864 not 8, to accommodate the picosecond component.
1865 (timer_check_2): Use it.
1866
1867 * nsterm.m (select_timeout, timeval_subtract): Remove.
1868 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1869 as they're a bit more accurate and handle overflow better.
1870 (ns_select): Change prototype to be compatible with pselect.
1871 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1872 * nsterm.h (ns_select): Adjust prototype.
1873
1874 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1875 us-resolution time stamps.
1876 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1877
1878 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1879
1880 * lisp.h (time_overflow): New decl.
1881 (wait_reading_process_output): First arg is now intmax_t, not int,
1882 to accommodate larger waits.
1883
1884 * process.h (struct Lisp_Process.read_output_delay):
1885 Now counts nanoseconds, not microseconds.
1886 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1887 EMACS_HAS_USECS.
1888 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1889 (wait_reading_process_output):
1890 Port to ns-resolution time stamps.
1891 (Faccept_process_output, wait_reading_process_output):
1892 Check for time stamp overflow. Do not assume time_t is signed.
1893 (select_wrapper): Remove; we now use pselect.
1894 (Fprocess_attributes): Now generates ns-resolution time stamps.
1895
1896 * sysdep.c: Include utimens.h. Don't include utime.h
1897 or worry about struct utimbuf; gnulib does that for us now.
1898 (gettimeofday): Remove; gnulib provides a substitute.
1899 (make_timeval): New function.
1900 (set_file_times): Now sets ns-resolution time stamps.
1901 New arg FD; all uses changed.
1902 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1903 (system_process_attributes):
1904 Now returns ns-resolution time stamp. All uses changed.
1905 Check for time stamp overflow.
1906
1907 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1908 provides a substitute now.
1909
1910 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1911 since it guarantees struct timespec.
1912 (EMACS_TIME): Now struct timespec, so that we can support
1913 ns-resolution time stamps.
1914 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1915 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1916 (EMACS_USECS): Remove.
1917 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1918 so multiply the arg by 1000 before storing it.
1919 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1920 New macros.
1921 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1922 Port to ns-resolution time stamps.
1923 (EMACS_TIME_NEG_P): Remove; replaced by....
1924 (EMACS_TIME_SIGN): New macro.
1925 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1926 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1927 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1928 (make_timeval, make_lisp_time, decode_time_components): New decls.
1929 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1930 that it mishandled time_t overflow. You can't compare by subtracting!
1931 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1932 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1933
1934 * term.c: Include <sys/time.h>.
1935 (timeval_to_Time): New function, for proper overflow wraparound.
1936 (term_mouse_position, term_mouse_click): Use it.
1937
1938 * undo.c (record_first_change): Support higher-resolution time stamps
1939 in the undo buffer.
1940 (Fprimitive_undo): Use them when restoring time stamps.
1941
1942 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1943 (w32_get_internal_run_time):
1944 Port to higher-resolution Emacs time stamps.
1945 (ltime): Now accepts single 64-bit integer, as that's more convenient
1946 for callers.
1947
1948 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1949
1950 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1951 for compatibility with pselect. Support ns-resolution time stamps.
1952
1953 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1954
1955 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1956 Check for time stamp overflow, and support ns-resolution time stamps.
1957
1958 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1959 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1960 (timeval_subtract): Remove; no longer needed.
1961 (XTflash, XTring_bell, x_wait_for_event):
1962 Port to ns-resolution time stamps. Don't assume time_t is signed.
1963
b6a92dfe
CY
19642012-06-22 Chong Yidong <cyd@gnu.org>
1965
1966 * xdisp.c (x_consider_frame_title): Revert last change.
1967
d251c37c
EZ
19682012-06-22 Eli Zaretskii <eliz@gnu.org>
1969
1970 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1971 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1972 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1973 staticidx goes up to 1597 out of 1600 = 0x640.)
1974
f10deafb
PE
19752012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1976
1977 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1978 Otherwise, the umask might be mistakenly 0 while handling input signals.
1979
ec6de1e2
SM
19802012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1981
1982 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1983
28be1ada
DA
19842012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
1985
1986 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1987 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1988 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1989 access to `contents' member of Lisp_Vector objects with AREF and ASET
1990 where appropriate.
1991
c6bf3022
CY
19922012-06-19 Chong Yidong <cyd@gnu.org>
1993
1994 * frame.c (delete_frame): When selecting a frame on a different
1995 text terminal, do not alter the terminal's top-frame.
1996
1997 * xdisp.c (format_mode_line_unwind_data): Record the target
1998 frame's selected window and its terminal's top-frame.
1999 (unwind_format_mode_line): Restore them.
2000 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
2001 Callers changed.
2002 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
2003 since tty frames can be explicitly named.
2004 (prepare_menu_bars): Likewise.
2005
2006 * term.c (Ftty_top_frame): New function.
2007
defd4196
PE
20082012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2009
2010 Port byte-code-meter to modern targets.
2011 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
2012 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 2013 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
2014 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
2015 (METER_1, METER_2): Simplify.
2016
1053a871
SM
20172012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2018
2019 * data.c (Fdefalias): Return `symbol' (bug#11686).
2020
b7e8d081
MR
20212012-06-18 Martin Rudalics <rudalics@gmx.at>
2022
2023 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
2024 gets killed during executing of this function (Bug#11665).
2025 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
2026 (Vkill_buffer_query_functions): In doc-string say that functions
2027 run by this hook should not change the current buffer.
2028
7ea2b339
PE
20292012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2030
2031 Fix recently-introduced process.c problems found by static checking.
2032 * process.c (write_queue_push, write_queue_pop, send_process):
2033 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
2034 (write_queue_pop): Fix pointer signedness problem.
2035 (send_process): Remove unused local.
2036
96a313a1
CY
20372012-06-17 Chong Yidong <cyd@gnu.org>
2038
2039 * xdisp.c (redisplay_internal): No need to redisplay terminal
2040 frames that are not on top.
2041
20ca2e94
TN
20422012-06-17 Troels Nielsen <bn.troels@gmail.com>
2043
2044 * process.c (make_process): Initialize write_queue.
2045 (write_queue_push, write_queue_pop): New functions.
2046 (send_process): Use them to maintain correct ordering of process
2047 writes (Bug#10815).
2048
9a900ca9
PE
20492012-06-17 Paul Eggert <eggert@cs.ucla.edu>
2050
310fbfa8
PE
2051 * lisp.h (eassert): Assume C89 or later.
2052 This removes the need for CHECK.
2053 (CHECK): Remove. Its comments about always evaluating its
2054 argument were confusing, as 'eassert' typically does not evaluate
2055 its argument.
2056
27bb1ca4
PE
2057 * coding.c (produce_chars): Use ptrdiff_t, not int.
2058
9a900ca9
PE
2059 * xterm.c (x_draw_underwave): Check for integer overflow.
2060 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
2061
41b7f8bc 20622012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
2063
2064 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
2065 referenced (Bug#11583).
2066
9b0e3eba
AA
20672012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
2068
2069 Implement wave-style variant of underlining.
2070 * dispextern.h (face_underline_type): New enum.
2071 (face): Add field for underline type.
2072 * nsterm.m (ns_draw_underwave): New function.
2073 (ns_draw_text_decoration): Use it.
2074 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
2075 New functions.
2076 (x_draw_glyph_string): Use them.
2077 * xfaces.c (Qline, Qwave): New Lisp objects.
2078 (check_lface_attrs, merge_face_ref)
1053a871
SM
2079 (Finternal_set_lisp_face_attribute, realize_x_face):
2080 Handle wave-style underline face attributes.
9b0e3eba
AA
2081 * xterm.c (x_draw_underwave): New function.
2082 (x_draw_glyph_string): Use it.
2083
0fb52f11
JB
20842012-06-16 Juanma Barranquero <lekktu@gmail.com>
2085
2086 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
2087 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
2088 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
2089 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
2090 ($(BLD)/w32select.$(O)): Update dependencies.
2091
e5560ff7
AS
20922012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2093
2094 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
2095 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
2096 * character.c (_fetch_multibyte_char_p): Remove.
2097 * alloc.c: Include "character.h" before "buffer.h".
2098 * bidi.c: Likewise.
2099 * buffer.c: Likewise.
2100 * bytecode.c: Likewise.
2101 * callint.c: Likewise.
2102 * callproc.c: Likewise.
2103 * casefiddle.c: Likewise.
2104 * casetab.c: Likewise.
2105 * category.c: Likewise.
2106 * cmds.c: Likewise.
2107 * coding.c: Likewise.
2108 * composite.c: Likewise.
2109 * dired.c: Likewise.
2110 * dispnew.c: Likewise.
2111 * doc.c: Likewise.
2112 * dosfns.c: Likewise.
2113 * editfns.c: Likewise.
2114 * emacs.c: Likewise.
2115 * fileio.c: Likewise.
2116 * filelock.c: Likewise.
2117 * font.c: Likewise.
2118 * fontset.c: Likewise.
2119 * fringe.c: Likewise.
2120 * indent.c: Likewise.
2121 * insdel.c: Likewise.
2122 * intervals.c: Likewise.
2123 * keyboard.c: Likewise.
2124 * keymap.c: Likewise.
2125 * lread.c: Likewise.
2126 * macros.c: Likewise.
2127 * marker.c: Likewise.
2128 * minibuf.c: Likewise.
2129 * nsfns.m: Likewise.
2130 * nsmenu.m: Likewise.
2131 * print.c: Likewise.
2132 * process.c: Likewise.
2133 * regex.c: Likewise.
2134 * region-cache.c: Likewise.
2135 * search.c: Likewise.
2136 * syntax.c: Likewise.
2137 * term.c: Likewise.
2138 * textprop.c: Likewise.
2139 * undo.c: Likewise.
2140 * unexsol.c: Likewise.
2141 * w16select.c: Likewise.
2142 * w32fns.c: Likewise.
2143 * w32menu.c: Likewise.
2144 * window.c: Likewise.
2145 * xdisp.c: Likewise.
2146 * xfns.c: Likewise.
2147 * xmenu.c: Likewise.
2148 * xml.c: Likewise.
2149 * xselect.c: Likewise.
2150
2f07e6af
EZ
21512012-06-16 Eli Zaretskii <eliz@gnu.org>
2152
1053a871
SM
2153 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
2154 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 2155 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
2156 row.
2157 (handle_face_prop): Use chunk-relative overlay string index when
2158 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
2159 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
2160 the rightmost. (Bug#11720)
2f07e6af 2161
29b83cec
AS
21622012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2163
2164 * category.h (CHAR_HAS_CATEGORY): Define as inline.
2165 (CATEGORY_MEMBER): Enforce 1/0 value.
2166 * category.c (_temp_category_set): Remove.
2167
4c5501e9
EZ
21682012-06-16 Eli Zaretskii <eliz@gnu.org>
2169
2170 * window.c (Fdelete_other_windows_internal)
2171 (Fdelete_window_internal): Don't access frame's mouse highlight
2172 info of the initial frame. (Bug#11677)
2173
2b570124
PE
21742012-06-14 Paul Eggert <eggert@cs.ucla.edu>
2175
e93864f9
PE
2176 * .gdbinit (xgetint): Fix recently-introduced paren typo.
2177 Assume USE_2_TAGS_FOR_INTS.
2178 (xreload): Adjust $tagmask width to match recent lisp.h change.
2179
2b570124
PE
2180 Simplify lisp.h in minor ways that should not affect code.
2181 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
2182 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
2183 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
2184 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
2185 (INTTYPEBITS): New macro, for clarity.
2186 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
2187 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
2188 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
2189 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
2190 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
2191
81755f69
JB
21922012-06-13 Juanma Barranquero <lekktu@gmail.com>
2193
2194 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
2195
16192a57
GM
21962012-06-13 Glenn Morris <rgm@gnu.org>
2197
2198 * s/bsd-common.h (BSD4_3):
2199 * s/usg5-4-common.h (USG5_4): No longer define; unused.
2200
646b5f55
AS
22012012-06-13 Andreas Schwab <schwab@linux-m68k.org>
2202
2203 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
2204 instead of union.
2205 (XLI, XIL): Define.
1053a871
SM
2206 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
2207 Use them.
2208 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 2209 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 2210 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
2211 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
2212 * frame.c (delete_frame): Remove outdated comment.
2213 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
2214 USE_LISP_UNION_TYPE.
2215 (Fw32_unregister_hot_key): Likewise.
2216 (Fw32_toggle_lock_key): Likewise.
2217 * w32menu.c (add_menu_item): Likewise.
2218 (w32_menu_display_help): Use XIL instead of checking
2219 USE_LISP_UNION_TYPE.
2220 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
2221 (init_heap): Likewise.
2222 * w32term.c (w32_read_socket): Update comment.
2223
1d3823c9
GM
22242012-06-13 Glenn Morris <rgm@gnu.org>
2225
c62ff706
GM
2226 * s/usg5-4-common.h, src/s/unixware.h:
2227 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
2228
1d3823c9
GM
2229 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
2230
bfe3e0a2
PE
22312012-06-13 Paul Eggert <eggert@cs.ucla.edu>
2232
2233 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
2234 * alloc.c (make_number) [!defined make_number]:
2235 Remove, as lisp.h always defines this now.
2236 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
2237 (roundup_size): Verify that it is a power of 2.
2238 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2239 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2240 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2241 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2242 USE_LSB_TAG now is always defined to be either 0 or 1.
2243 All uses changed.
2244 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2245 code works fine either way, and efficiency is not a concern here,
2246 as the union type is for debugging, not for production.
2247 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2248 Use an inline function on all platforms when using the union type,
2249 since this is simpler and 'static inline' can be used portably
2250 within Emacs now.
2251 (LISP_INITIALLY_ZERO): New macro.
2252 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2253 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2254
45fa9c0f
GM
22552012-06-12 Glenn Morris <rgm@gnu.org>
2256
b4492cba
GM
2257 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2258
2259 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 2260
45fa9c0f
GM
2261 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2262 Move BROKEN_SIGIO to configure.
2263
2264 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2265 Move NO_TERMIO to configure.
2266
0e25d334
CY
22672012-06-12 Chong Yidong <cyd@gnu.org>
2268
2269 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2270 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2271 MagickExportImagePixels is undefined.
2272
43682bb6
PE
22732012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2274
2275 * image.c (imagemagick_load_image): Remove unused label.
2276
a9be7d2b
GM
22772012-06-11 Glenn Morris <rgm@gnu.org>
2278
2279 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2280 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2281 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2282 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2283
3017f87f
SM
22842012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2285
2286 * alloc.c (make_byte_code): New function.
2287 (Fmake_byte_code): Use it. Don't purify here.
2288 * lread.c (read1): Use it as well to avoid extra allocation.
2289
1b9b4cf4
CY
22902012-06-11 Chong Yidong <cyd@gnu.org>
2291
2292 * image.c (imagemagick_load_image): Implement transparency.
2293
95988fcf
AS
22942012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2295
2296 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2297 account for preceding backslashes. (Bug#11663)
2298
cd4eb164
CY
22992012-06-09 Chong Yidong <cyd@gnu.org>
2300
2301 * term.c: Support italics in capable terminals (Bug#9652).
2302 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2303 (turn_on_face): Output using TS_enter_italic_mode if available.
2304 Don't handle unused blinking and alt-charset cases.
2305 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2306 and tty_alt_charset_p cases.
2307 (tty_capable_p, init_tty): Support italics.
2308
2309 * termchar.h (struct tty_display_info): Add field for italics.
2310 Remove unused blink field.
2311
2312 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2313 Handle slant.
2314
2315 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2316 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2317 tty_alt_charset_p. Add tty_italic_p.
2318
ff88beb8
MA
23192012-06-09 Michael Albinus <michael.albinus@gmx.de>
2320
2321 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
2322 dbus_type_is_basic if available.
2323 (xd_extract_signed, xd_extract_unsigned): Rename from
2324 extract_signed and extract_unsigned, respectively. Adapt callers.
2325
44286096
CY
23262012-06-09 Chong Yidong <cyd@gnu.org>
2327
1682701f
CY
2328 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2329
44286096
CY
2330 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2331 case (Bug#9752).
2332
d86feb17
PE
23332012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2334
2335 * xdisp.c (vmessage): Treat frame message as multibyte.
2336 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2337 would generate the diagnostic "Making \302\247 buffer-local while
2338 let-bound!".
2339
d5c20fe8
EZ
23402012-06-08 Eli Zaretskii <eliz@gnu.org>
2341
2342 * dispnew.c (showing_window_margins_p): Undo last change, which
2343 was done due to an inadvertent commit.
2344 (adjust_frame_glyphs_for_frame_redisplay): Do call
2345 showing_window_margins_p.
2346
513749ee
SM
23472012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2348
2349 * eval.c (Fmake_var_non_special): New primitive.
2350 (syms_of_eval): Defsubr it.
2351 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2352
d4a8f5c1
JB
23532012-06-08 Juanma Barranquero <lekktu@gmail.com>
2354
2355 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2356 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2357
8bbbc977
EZ
23582012-06-08 Eli Zaretskii <eliz@gnu.org>
2359
2360 * alloc.c (allocate_vectorlike): Fix last change.
2361
f3372c87
DA
23622012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2363
2364 Block-based vector allocation of small vectors.
2365 * lisp.h (struct vectorlike_header): New field `nbytes',
2366 adjust comment accordingly.
2367 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2368 to denote vector blocks. Adjust users (live_vector_p,
2369 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2370 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2371 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2372 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2373 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2374 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2375 (roundup_size): New constant.
2376 (struct vector_block): New data type.
2377 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2378 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2379 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2380 (sweep_vectors): New functions.
2381 (allocate_vectorlike): Return `zero_vector' as the only vector of
2382 0 items. Allocate new vector from block if vector size is less than
2383 or equal to VBLOCK_BYTES_MAX.
2384 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2385 (init_alloc_once): Add call to init_vectors.
2386
4f18a4ed
SM
23872012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2388
2389 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2390
86f158bc
PE
23912012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2392
2393 * doprnt.c (doprnt): Truncate multibyte char correctly.
2394 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2395 would mishandle a string argument "Xc" if X was a multibyte
2396 character of length 2: it would truncate after X's first byte
2397 rather than including all of X.
2398
c5cfcbe0
CY
23992012-06-06 Chong Yidong <cyd@gnu.org>
2400
2401 * buffer.c (word_wrap): Doc fix.
2402
c05cf390
PE
24032012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2404
2405 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2406
0c3461de
GM
24072012-06-03 Glenn Morris <rgm@gnu.org>
2408
2409 * xdisp.c (tool-bar-style): Doc fix.
2410
c71232db
UM
24112012-06-03 Ulrich Müller <ulm@gentoo.org>
2412
2413 * Makefile.in (PAXCTL): Define.
2414 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2415 binary via PaX flags if the paxctl utility is available.
2416 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2417 Restore PaX flags to their default. (Bug#11398)
2418
383f7350
CY
24192012-06-03 Chong Yidong <cyd@gnu.org>
2420
2421 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2422 buffer (Bug#11226).
2423
5f2c76c6
CY
24242012-06-03 Chong Yidong <cyd@gnu.org>
2425
2426 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2427 (note_mode_line_or_margin_highlight): If there is no help echo,
2428 use mode-line-default-help-echo. Handle the case where the mouse
2429 position is past the end of the mode line string.
2430
2431 * buffer.c (buffer_local_value_1): New function, split from
2432 Fbuffer_local_value; can return Qunbound.
2433 (Fbuffer_local_value): Use it.
2434 (Vmode_line_format): Docstring tweaks.
2435
773d47f6
PE
24362012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2437
2438 * sysdep.c (system_process_attributes): Improve comment.
2439
f2d6a3df
SM
24402012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2441
2442 * keyboard.c: Export real-this-command to Elisp.
2443 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2444 and DEFVAR it. Update all users.
2445
63810350
PE
24462012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2447
7bd5c1f4
PE
2448 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2449
63810350
PE
2450 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2451 Convert pctcpu and pctmem to Lisp float properly.
2452 Let the compiler fold better, as 100.0/0x8000 is exact.
2453
a2821611
AS
24542012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2455
2456 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2457 cons_block.
2458
5fceba1d
PE
24592012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2462
c98ff5dd
DA
24632012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2464
2465 For a 'struct window', replace some Lisp_Object fields to
2466 bitfields where appropriate, remove unused fields.
2467 * window.h (struct window): Remove unused 'last_mark_x' and
2468 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2469 change it's type from Lisp_Object to bitfield.
2470 Change type of 'force_start', 'optional_new_start',
2471 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2472 fields from Lisp_Object to bitfield. Adjust users accordingly.
2473
ca34e0be
PE
24742012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2475
2476 Pacify gcc -Wdouble-precision when using Xaw.
2477 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2478 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2479 Use 'float' consistently, rather than 'float' in most places
2480 and 'double' in a couple of places.
2481
efc00ab1 24822012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2483
2484 * xdisp.c (handle_stop): Detect whether we have overlay strings
2485 loaded by testing it->current.overlay_string_index to be
2486 non-negative, instead of checking whether n_overlay_strings is
2487 positive. (Bug#11587)
2488
efc00ab1 24892012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2490
2491 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2492
2493 * doc.c (Fsubstitute_command_keys): Doc fix.
2494
efc00ab1 24952012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2496
2497 * search.c (search_buffer): Remove calls to
2498 r_alloc_inhibit_buffer_relocation, as it is now called by
2499 maybe_unify_char, which was the cause of relocation of buffer text
2500 in bug#11519.
2501
efc00ab1 25022012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2503
2504 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2505 for the duration of call to load_charset, to avoid problems with
2506 callers of maybe_unify_char that access buffer text through C
2507 pointers.
2508
2509 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2510 decrement the inhibition flag, instead of just setting or
2511 resetting it.
2512
ba93a187
PE
25132012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2514
2515 Remove obsolete '#define static' cruft.
2516 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2517 This #undef was "temporary" in 2000; it is no longer needed
2518 now that '#define static' has gone away.
2519 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2520 (gray_bitmap_bits): Remove; no longer needed.
2521 All uses replaced with definiens.
2522 * xterm.c: Include "bitmaps/gray.xbm".
2523
9e4bf381
PE
25242012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Clean up __executable_start, monstartup when --enable-profiling.
2527 The following changes affect the code only when profiling.
2528 * dispnew.c (__executable_start): Rename from safe_bcopy.
2529 Define only on platforms that need it.
2530 * emacs.c: Include <sys/gmon.h> when profiling.
2531 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2532 (__executable_start): Remove decl, since lisp.h does it now.
2533 (safe_bcopy): Remove decl; no longer has that name.
2534 (main): Coalesce #if into single bit of code, for simplicity.
2535 Cast pointers to uintptr_t, since standard libraries want integers
2536 and not pointers.
2537 * lisp.h (__executable_start): New decl.
2538
32d72c2f
GM
25392012-05-31 Glenn Morris <rgm@gnu.org>
2540
2541 * image.c (Fimagemagick_types): Doc fix.
2542
baac5bc7
JM
25432012-05-30 Jim Meyering <meyering@redhat.com>
2544
2545 * callproc.c (Fcall_process_region): Include directory component
2546 in mkstemp error message (Bug#11586).
2547
72cb32cf
PE
25482012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2549
2550 * alloc.c, lisp.h (make_pure_vector): Now static.
2551
61b108cc
SM
25522012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2553
2554 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2555 Move to byte-run.el.
2556 (Fautoload): Do the hash-doc more carefully.
2557 * data.c (Fdefalias): Purify definition, except for keymaps.
2558 (Qdefun): Move from eval.c.
2559 * lisp.h (Qdefun): Remove.
2560 * lread.c (read1): Tiny simplification.
2561
471fe23d
TN
25622012-05-29 Troels Nielsen <bn.troels@gmail.com>
2563
934f3f58 2564 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2565 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2566 Bug#9642, but explicitly check that the buffer the overlay would
2567 be moved to is live and rearrange lines to make sure that errors
2568 will not put the overlay in an inconsistent state.
2569 (Fdelete_overlay): Cosmetics.
2570
85d0efd1
EZ
25712012-05-28 Eli Zaretskii <eliz@gnu.org>
2572
2573 * w32term.c (my_bring_window_to_top): New function.
2574 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2575 could be different from the original one.
2576 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2577 (Bug#11513)
2578
2579 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2580 by calling BringWindowToTop.
2581
2582 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2583 (WM_EMACS_END): Increase by one.
2584
da92a98c
PE
25852012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2586
2587 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2588 This avoids undefined behavior that might cause the eassert
2589 to not catch an out-of-range value.
2590
74d1f848
JB
25912012-05-28 Juanma Barranquero <lekktu@gmail.com>
2592
2593 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2594 Update dependencies.
2595
9e1a06fc
EZ
25962012-05-27 Eli Zaretskii <eliz@gnu.org>
2597
2598 * bidi.c (bidi_mirror_char): Fix last change.
2599
f3dd7312
AS
26002012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2601
2602 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2603 when referring to sectname field in printf format.
2604
81899c91
PE
26052012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2606
57b81a9f
PE
2607 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2608 Only r_alloc_inhibit_buffer_relocation needed to be added;
2609 the others were already declared.
2610
81899c91
PE
2611 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2612 before checking whether it's out of range. Put the check inside
2613 eassert. See
2614 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2615
33017faf 26162012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2617
2618 * callproc.c (Fcall_process): Restore a line that was accidentally
2619 commented out in the 2011-02-13 change (bug#11547).
2620
33017faf 26212012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2622
2623 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2624 defined on ralloc.c.
2625
2626 * buffer.c [REL_ALLOC]: Remove prototypes of
2627 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2628 they are now on lisp.h.
2629
2630 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2631
2632 * search.c (search_buffer): Use it to inhibit relocation of buffer
2633 text while re_search_2 is doing its job, because re_search_2 is
2634 passed C pointers to buffer text. (Bug#11519)
2635
23415acf
EZ
2636 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2637 Update value to 24.
2638
44e27368
EZ
2639 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2640 state after an additional call to move_it_in_display_line_to, keep
2641 the values of it->max_ascent and it->max_descent found for the
2642 entire line.
2643 (pos_visible_p): Revert the comparison against bottom_y to what it
2644 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2645 (Bug#11464)
2646
c1892f11
PE
26472012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2648
2649 Fix coding-related core dumps with gcc -ftrapv.
2650 The code was computing A - B, where A and B are pointers, and B is
2651 random garbage. This can lead to core dumps on platforms that
2652 have special pointer registers, and it also leads to core dumps on
2653 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2654 A - B only when B is initialized properly.
2655 * coding.c (coding_set_source, coding_set_destination): Return void.
2656 (coding_change_source, coding_change_destinations): New functions,
2657 with the old behaviors of coding_set_source and coding_set_destination.
2658 All callers that need an offset changed to use these new functions.
2659
eb7afdad
GM
26602012-05-26 Glenn Morris <rgm@gnu.org>
2661
2662 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2663
f12fdf02
EZ
26642012-05-26 Eli Zaretskii <eliz@gnu.org>
2665
53a63be6 2666 Extend mouse support on W32 text-mode console.
61b108cc
SM
2667 * xdisp.c (draw_row_with_mouse_face):
2668 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2669
eb3f6f01 2670 * w32console.c: Include window.h.
61b108cc
SM
2671 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2672 New functions.
eb3f6f01
EZ
2673 (initialize_w32_display): Initialize mouse-highlight data.
2674
53a63be6
EZ
2675 * w32inevt.c: Include termchar.h and window.h.
2676 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2677 moves, call note_mouse_highlight. If help_echo changed, call
2678 gen_help_event to produce help-echo message in the echo area.
2679 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2680 highlight info.
2681
4cfd81f6
PE
26822012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2683
2684 * lread.c (read1): Simplify slightly to avoid an overflow warning
2685 with GCC 4.7.0 on x86-64.
2686
4446092a
EZ
26872012-05-26 Eli Zaretskii <eliz@gnu.org>
2688
2689 * bidi.c (bidi_mirror_char): Revert last change: an int is
2690 definitely wide enough here.
2691
42b2a986 26922012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2693
42b2a986 2694 Fix integer width and related bugs (Bug#9874).
eb106a49 2695 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2696 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2697 (string_bytes, check_sblock, allocate_string_data):
2698 (compact_small_strings, Fmake_bool_vector, make_string)
2699 (make_unibyte_string, make_multibyte_string)
2700 (make_string_from_bytes, make_specified_string)
2701 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2702 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2703 (mark_vectorlike):
2704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2705 (allocate_pseudovector):
2706 Use int, not EMACS_INT, where int is wide enough.
2707 (inhibit_garbage_collection, Fgarbage_collect):
2708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2709 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2710 int might not be wide enough.
2711 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2712 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2713 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2714 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2715 (bidi_level_of_next_char, bidi_move_to_visually_next):
2716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2717 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2718 (Fkill_buffer, Fset_buffer_major_mode)
2719 (advance_to_char_boundary, Fbuffer_swap_text)
2720 (Fset_buffer_multibyte, overlays_at, overlays_in)
2721 (overlay_touches_p, struct sortvec, record_overlay_string)
2722 (overlay_strings, recenter_overlay_lists)
2723 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2724 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2725 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2726 (Foverlay_recenter, last_overlay_modification_hooks_used)
2727 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2729 (validate_region): Omit unnecessary test for b <= e,
2730 since that's guaranteed by the previous test.
d311d28c
PE
2731 (adjust_overlays_for_delete): Avoid pos + length overflow.
2732 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2733 (report_overlay_modification):
2734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2735 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2736 Omit pointer cast, which isn't needed anyway, and doesn't work
2737 after the EMACS_INT -> ptrdiff_t change.
02481186 2738 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2739 * buffer.h: Adjust decls to match defn changes elsewhere.
2740 (struct buffer_text, struct buffer):
2741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2742 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2743 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2744 not int, to avoid needless 32-bit limit on 64-bit hosts.
2745 (exec_byte_code): Use tighter memory-full test, one that checks
2746 for alloca overflow. Don't compute the address of the object just
2747 before an array, as that's not portable. Use EMACS_INT, not
2748 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2749 * callint.c (Fcall_interactively):
2750 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2751 * callproc.c (call_process_kill, Fcall_process):
2752 Don't assume pid_t fits into an Emacs fixnum.
2753 (call_process_cleanup, Fcall_process, child_setup):
2754 Don't assume pid_t fits into int.
2755 (call_process_cleanup, Fcall_process, delete_temp_file)
2756 (Fcall_process_region):
2757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2758 (Fcall_process): Simplify handling of volatile integers.
2759 Use int, not EMACS_INT, where int will do.
2760 * casefiddle.c (casify_object, casify_region, operate_on_word)
2761 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2763 (casify_object): Avoid integer overflow when overallocating buffer.
2764 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2765 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2766 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2767 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2768 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2769 integers are now checked earlier. All uses replaced with XINT.
2770 (ccl_driver):
2771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2772 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2773 (ccl_driver, Fregister_code_conversion_map):
2774 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2775 (resolve_symbol_ccl_program): Check that vector header is in range.
2776 Always copy the vector, so that we can check its contents reliably
2777 now rather than having to recheck each instruction as it's being
2778 executed. Check that vector words fit in 'int'.
2779 (ccl_get_compiled_code, Fregister_ccl_program)
2780 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2781 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2782 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2783 contents are in range.
2784 (Fccl_execute_on_string): Check that status is in range.
2785 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2786 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2787 Accept and return EMACS_INT, not int, because callers can pass values
2788 out of 'int' range.
2789 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2790 (multibyte_chars_in_text, parse_str_as_multibyte)
2791 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2792 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2793 (string_escape_byte8, Fget_byte):
2794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2795 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2796 avoid mishandling large integers.
2797 * character.h: Adjust decls to match defn changes elsewhere.
2798 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2799 (Ffind_charset_region):
2800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2801 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2802 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2803 Don't assume fixnum fits in int.
d311d28c
PE
2804 (load_charset_map_from_vector, Fmap_charset_chars):
2805 Remove now-unnecessary CHECK_NATNUMs.
2806 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2807 Don't rely on undefined behavior with signed left shift overflow.
2808 Don't assume unsigned int fits into fixnum, or that fixnum fits
2809 into unsigned int. Don't require max_code to be a valid fixnum;
2810 that's not true for gb10830 4-byte on a 32-bit host. Allow
2811 invalid_code to be a cons, for the same reason. Require code_offset
2812 to be a character. Avoid int overflow if max_char is close
2813 to INT_MAX.
2814 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2815 this is intended anyway and avoids some undefined behavior.
2816 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2817 INDEX_TO_CODE_POINT, as that's what it expects.
2818 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2819 * charset.h (DECODE_CHAR): Return int, not unsigned;
2820 this is what was intended anyway, and it avoids undefined behavior.
2821 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2822 integer-overflow issues.
2823 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2824 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2825 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2826 * chartab.c (Fmake_char_table, Fset_char_table_range)
2827 (uniprop_get_decoder, uniprop_get_encoder):
2828 Don't assume fixnum fits in int.
2829 * cmds.c (move_point): New function, that does the gist of
2830 Fforward_char and Fbackward_char, but does so while checking
2831 for integer overflow more accurately.
c96e5d6a 2832 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2833 (Fforward_line, Fend_of_line, internal_self_insert)
2834 (internal_self_insert):
2835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2836 Fix a FIXME, by checking for integer overflow when calculating
2837 target_clm and actual_clm.
2838 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2839 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2840 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2841 (coding_alloc_by_making_gap, alloc_destination)
2842 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2843 (encode_coding_utf_16, detect_coding_emacs_mule)
2844 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2845 (detect_coding_iso_2022, decode_coding_iso_2022)
2846 (encode_invocation_designation, encode_designation_at_bol)
2847 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2848 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2849 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2850 (encode_coding_ccl, encode_coding_raw_text)
2851 (detect_coding_charset, decode_coding_charset)
2852 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2853 (produce_composition, produce_charset, produce_annotation)
2854 (decode_coding, handle_composition_annotation)
2855 (handle_charset_annotation, consume_chars, decode_coding_gap)
2856 (decode_coding_object, encode_coding_object, detect_coding_system)
2857 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2858 (code_convert_region, code_convert_string)
8f50130c
PE
2859 (Fdefine_coding_system_internal)
2860 (coding_set_source, coding_set_destination):
d311d28c
PE
2861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2862 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2863 (Fdefine_coding_system_internal):
2864 Don't assume fixnums fit in int.
2865 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2866 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2867 (Funencodable_char_position, Fcheck_coding_systems_region)
2868 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2870 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2871 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2872 Don't access memory outside of the args array.
d311d28c 2873 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2874 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2875 result of ENCODE_CHAR.
d311d28c
PE
2876 * coding.h: Adjust decls to match defn changes elsewhere.
2877 (struct coding_system):
2878 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2879 * composite.c (get_composition_id, find_composition)
2880 (run_composition_function, update_compositions)
2881 (compose_text, composition_gstring_put_cache)
2882 (composition_gstring_p, composition_gstring_width)
2883 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2884 (composition_compute_stop_pos, composition_reseat_it)
2885 (composition_update_it, struct position_record)
2886 (find_automatic_composition, composition_adjust_point)
2887 (Fcomposition_get_gstring, Ffind_composition_internal):
2888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2889 (update_compositions):
2890 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2891 * composite.h: Adjust decls to match defn changes elsewhere.
2892 (struct composition):
2893 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2894 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2895 Do not attempt to compute the address of the object just before a
2896 buffer; this is not portable.
2897 (Faref, Faset):
2898 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2899 (Faset): Use int, not EMACS_INT, where int is wide enough.
2900 (Fstring_to_number): Don't assume fixnums fit in int.
2901 (Frem): Don't assume arg is nonnegative.
2902 * dbusbind.c (xd_append_arg): Check for integers out of range.
2903 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2904 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2905 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2906 (xd_get_connection_references): Return ptrdiff_t, not int.
2907 All uses changed.
2908 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2909 (xd_read_message_1):
2910 Use int, not unsigned, where the dbus API uses int.
2911 (Fdbus_message_internal): Don't overflow mtype.
2912 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2913 * dired.c (directory_files_internal, file_name_completion, scmp)
2914 (file_name_completion_stat):
2915 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2916 (file_name_completion): Don't overflow matchcount.
2917 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2918 * dispextern.h: Adjust decls to match defn changes elsewhere.
2919 (struct text_pos, struct glyph, struct bidi_saved_info)
2920 (struct bidi_string_data, struct bidi_it, struct composition_it)
2921 (struct it):
2922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2923 (struct display_pos, struct composition_it, struct it):
2924 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2925 * dispnew.c (increment_matrix_positions)
2926 (increment_row_positions, mode_line_string)
2927 (marginal_area_string):
2928 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2929 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2931 (duration_to_sec_usec): New function, to check for overflow better.
2932 (Fsleep_for, sit_for): Use it.
2933 * doc.c (get_doc_string, store_function_docstring):
2934 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2935 (get_doc_string, Fsnarf_documentation):
2936 Use int, not EMACS_INT, where int is wide enough.
2937 (get_doc_string):
2938 Use SAFE_ALLOCA, not alloca.
2939 Check for overflow when converting EMACS_INT to off_t.
2940 * doprnt.c (doprnt):
2941 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2942 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2943 Don't assume uid_t fits into fixnum.
2944 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2945 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2946 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2947 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2948 (general_insert_function)
2949 (Finsert_char, make_buffer_string, make_buffer_string_both)
2950 (update_buffer_properties, Fbuffer_substring)
2951 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2952 (Fsubst_char_in_region, check_translation)
2953 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2954 (transpose_markers, Ftranspose_regions):
2955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2956 (clip_to_bounds): Move to lisp.h as an inline function).
2957 (Fconstrain_to_field): Don't assume integers are nonnegative.
2958 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2959 (Fsubst_char_in_region, Fsave_restriction):
2960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2961 (Femacs_pid): Don't assume pid_t fits into fixnum.
2962 (lo_time): Use int, not EMACS_INT, when int suffices.
2963 (lisp_time_argument): Check for usec out of range.
2964 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
2965 (Fuser_login_name, Fuser_full_name): Signal an error
2966 if a uid argument is out of range, rather than relying on
2967 undefined behavior.
c8d5c857
PE
2968 (Fformat_time_string): Remove now-unnecessary check.
2969 lisp_time_argument checks for out-of-range usec now.
243e0530 2970 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
2971 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2972 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2973 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2974 (init_cmdargs, Fdump_emacs):
2975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2976 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2977 the bottom (typically) 32 bits of the fixnum.
2978 * eval.c (specpdl_size, call_debugger):
2979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2980 (when_entered_debugger, Fbacktrace_debug):
2981 Don't assume fixnum can fit in int.
2982 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2983 the object just before a buffer; this is not portable.
2984 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2985 (grow_specpdl, unbind_to):
2986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2987 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2988 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 2989 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
2990 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2991 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2993 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2994 (a_write, e_write):
2995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2996 (Fcopy_file, non_regular_nbytes, read_non_regular)
2997 (Finsert_file_contents):
2998 Use int, not EMACS_INT, where int is wide enough.
2999 (READ_BUF_SIZE): Verify that it fits in int.
3000 (Finsert_file_contents): Check that counts are in proper range,
3001 rather than assuming fixnums fit into ptrdiff_t etc.
3002 Don't assume fixnums fit into int.
125b3835 3003 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
3004 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
3005 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
3006 (string_char_to_byte, string_byte_to_char)
3007 (string_make_multibyte, string_to_multibyte)
3008 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
3009 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
3010 (substring_both, Fdelete, internal_equal, Ffillarray)
3011 (Fclear_string, mapcar1)
3012 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
3013 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
3014 (larger_vector, make_hash_table, maybe_resize_hash_table)
3015 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
3016 (Fmaphash, secure_hash):
3017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3018 (concat): Check for string index and length overflow.
3019 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
3020 (Frequire):
3021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3022 (larger_vector): New API (vec, incr_min, size_max) replaces old
3023 one (vec, new_size, init). This catches size overflow.
3024 INIT was removed because it was always Qnil.
3025 All callers changed.
3026 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
3027 the upper bound on a hash table index size.
3028 (make_hash_table, maybe_resize_hash_table): Use it.
3029 (secure_hash): Computer start_byte and end_byte only after
3030 they're known to be in ptrdiff_t range.
3031 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
3032 (Ffont_get_glyphs, Ffont_at):
3033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3034 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
3035 (Flist_fonts, Fopen_font):
3036 Don't assume fixnum can fit in int.
3037 (check_gstring): Don't assume index can fit in int.
3038 (font_match_p): Check that fixnum is a character, not a nonnegative
3039 fixnum, since the later code needs to stuff it into an int.
3040 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
3041 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
3042 conversion overflow issues.
3043 (Fopen_font): Check for integer out of range.
3044 (Ffont_get_glyphs): Don't assume index can fit in int.
3045 * font.h: Adjust decls to match defn changes elsewhere.
3046 * fontset.c (reorder_font_vector): Redo score calculation to avoid
3047 integer overflow.
3048 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
3049 printmax_t, where ptrdiff_t is wide enough.
3050 (Finternal_char_font):
3051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3052 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
3053 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
3054 (Fset_frame_position, x_set_frame_parameters)
3055 (x_set_line_spacing, x_set_border_width)
3056 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
3057 Check that fixnums are in proper range for system types.
3058 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
3059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3060 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
3061 Use SAFE_ALLOCA_LISP, not alloca.
3062 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
3063 intptr_t is wide enough.
3064 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
3065 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
3066 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
3067 Check for fixnum out of range.
3068 * ftfont.c (ftfont_list): Don't assume index fits in int.
3069 Check that fixnums are in proper range for system types.
3070 (ftfont_shape_by_flt):
3071 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
3072 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3074 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
3075 Check that fixnums are in proper range for system types.
3076 * gnutls.h: Adjust decls to match defn changes elsewhere.
3077 * gtkutil.c (xg_dialog_run):
3078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3079 (update_frame_tool_bar):
3080 Check that fixnums are in proper range for system types.
3081 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 3082 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
3083 * indent.c (last_known_column, last_known_column_point):
3084 (current_column_bol_cache):
3085 (skip_invisible, current_column, check_display_width):
3086 (check_display_width, scan_for_column, current_column_1)
3087 (Findent_to, Fcurrent_indentation, position_indentation)
3088 (indented_beyond_p, Fmove_to_column, compute_motion):
3089 (Fcompute_motion, Fvertical_motion):
3090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3091 (last_known_column_modified): Use EMACS_INT, not int.
3092 (check_display_width):
3093 (Fcompute_motion):
3094 Check that fixnums and floats are in proper range for system types.
3095 (compute_motion): Don't assume index or fixnum fits in int.
3096 (compute_motion, Fcompute_motion):
3097 Use int, not EMACS_INT, when it is wide enough.
3098 (vmotion): Omit local var start_hpos that is always 0; that way
3099 we don't need to worry about overflow in expressions involving it.
3100 * indent.h: Adjust decls to match defn changes elsewhere.
3101 (struct position):
3102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3103 Use int, not EMACS_INT, where int is wide enough.
3104 Remove unused members ovstring_chars_done and tab_offset;
3105 all uses removed.
3106 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
3107 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
3108 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
3109 (make_gap, copy_text, insert, insert_and_inherit)
3110 (insert_before_markers, insert_before_markers_and_inherit)
3111 (insert_1, count_combining_before, count_combining_after)
3112 (insert_1_both, insert_from_string)
3113 (insert_from_string_before_markers, insert_from_string_1)
3114 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
3115 (adjust_after_replace, adjust_after_insert, replace_range)
3116 (replace_range_2, del_range, del_range_1, del_range_byte)
3117 (del_range_both, del_range_2, modify_region)
3118 (prepare_to_modify_buffer, signal_before_change)
3119 (signal_after_change, Fcombine_after_change_execute):
3120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3121 * intervals.c (traverse_intervals, rotate_right, rotate_left)
3122 (balance_an_interval, split_interval_right, split_interval_left)
3123 (find_interval, next_interval, update_interval)
3124 (adjust_intervals_for_insertion, delete_node, delete_interval)
3125 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3126 (static_offset_intervals, offset_intervals)
3127 (merge_interval_right, merge_interval_left, make_new_interval)
3128 (graft_intervals_into_buffer, temp_set_point_both)
3129 (temp_set_point, set_point, adjust_for_invis_intang)
3130 (set_point_both, move_if_not_intangible, get_property_and_range)
3131 (get_local_map, copy_intervals, copy_intervals_to_string)
3132 (compare_string_intervals, set_intervals_multibyte_1):
3133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3134 * intervals.h: Adjust decls to match defn changes elsewhere.
3135 (struct interval):
3136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3137 * keyboard.c (this_command_key_count, this_single_command_key_start)
3138 (before_command_key_count, before_command_echo_length, echo_now)
3139 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
3140 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
3141 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
3142 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
3143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3144 (last_non_minibuf_size, last_point_position, echo_truncate)
3145 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
3146 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
3147 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
3148 (stuff_buffered_input):
3149 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3150 (last_auto_save, command_loop_1, read_char):
3151 Use EMACS_INT, not int, to avoid integer overflow.
3152 (record_char): Avoid overflow in total_keys computation.
3153 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
3154 * keyboard.h: Adjust decls to match defn changes elsewhere.
3155 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
3156 (Fkey_description, Fdescribe_vector, Flookup_key):
3157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3158 (click_position): New function, to check that positions are in range.
3159 (Fcurrent_active_maps):
3160 (describe_command):
3161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3162 (Faccessible_keymaps, Fkey_description):
3163 (preferred_sequence_p):
3164 Don't assume fixnum can fit into int.
3165 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
3166 Check for integer overflow in size calculations.
3167 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
3168 avoid mishandling large integers.
3169 * lisp.h: Adjust decls to match defn changes elsewhere.
3170 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
3171 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
3172 (struct Lisp_Marker):
3173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3174 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
3175 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
3176 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
3177 All callers changed.
3178 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
3179 Assume the arg has valid form, since it always does.
3180 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
3181 unsigned integer system type.
3182 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
3183 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
3184 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3185 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
3186 (duration_to_sec_usec): New decl.
3187 * lread.c (read_from_string_index, read_from_string_index_byte)
3188 (read_from_string_limit, readchar, unreadchar, openp)
3189 (read_internal_start, read1, oblookup):
3190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3191 (Fload, readevalloop, Feval_buffer, Feval_region):
3192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3193 (openp): Check for out-of-range argument to 'access'.
3194 (read1): Use int, not EMACS_INT, where int is wide enough.
3195 Don't assume fixnum fits into int.
6efdadfd 3196 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
3197 (read_filtered_event): Use duration_to_sec_usec
3198 to do proper overflow checking on durations.
d311d28c
PE
3199 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
3200 in size calculation.
3201 (Fexecute_kbd_macro):
3202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3203 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
3204 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
3205 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
3206 (set_marker_both, set_marker_restricted_both, marker_position)
3207 (marker_byte_position, Fbuffer_has_markers_at):
3208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3209 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 3210 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
3211 It now merely ensures that the menu is large enough, without
3212 necessarily growing it, as this avoids some integer overflow issues.
3213 All callers changed.
3214 (keymap_panes, parse_single_submenu, Fx_popup_menu):
3215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3216 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
3217 Use SAFE_ALLOCA_LISP, not alloca.
3218 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
3219 to EMACS_INT. Check that fixnums are in proper range for system types.
3220 * minibuf.c (minibuf_prompt_width, string_to_object)
3221 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
3222 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
3223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3224 (get_minibuffer, read_minibuf_unwind):
3225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3226 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
3227 this simplifies overflow checking. All callers changed.
3228 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
3229 (Ftest_completion):
3230 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3231 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
3232 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
3233 Check that fixnums are in proper range for system types.
3234 (Fx_create_frame, Fx_show_tip):
3235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3236 * nsfont.m (ns_findfonts, nsfont_list_family):
3237 Don't assume fixnum fits in long.
3238 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3240 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3241 wide enough.
17fdb222 3242 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
3243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3244 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3245 (PRINTDECLARE, PRINTPREPARE):
3246 (strout, print_string):
3247 (print, print_preprocess, print_check_string_charset_prop)
3248 (print_object):
3249 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3250 (PRINTDECLARE):
3251 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3252 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3253 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 3254 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 3255 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
3256 (print_error_message): Use SAFE_ALLOCA, not alloca.
3257 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
3258 (print_depth, new_backquote_output, print_number_index):
3259 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
3260 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3261 (Fset_process_window_size, Fformat_network_address)
3262 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 3263 (sigchld_handler):
d311d28c 3264 Check that fixnums are in proper range for system types.
d44287d4 3265 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
3266 Check for process-ids out of pid_t range rather than relying on
3267 undefined behavior.
e4d81efc 3268 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
3269 (Fformat_network_address, read_process_output, send_process)
3270 (Fprocess_send_region, status_notify):
3271 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3272 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3273 (wait_reading_process_output, read_process_output, exec_sentinel):
3274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3275 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3276 (Faccept_process_output): Use duration_to_sec_usec to do proper
3277 overflow checking on durations.
dde14581
PE
3278 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3279 Don't assume pid_t fits in int.
02481186
PE
3280 * process.h (struct Lisp_Process): Members tick and update_tick
3281 are now of type EMACS_INT, not int.
b62b53e8
PE
3282 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3283 configured --with-wide-int.
d311d28c
PE
3284 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3285 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3286 * search.c (looking_at_1, string_match_1):
3287 (fast_string_match, fast_c_string_match_ignore_case)
3288 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3289 (scan_newline, find_before_next_newline, search_command)
3290 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3291 (set_search_regs, wordify):
3292 (Freplace_match):
3293 (Fmatch_data):
3294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3295 (string_match_1, search_buffer, set_search_regs):
3296 (Fmatch_data):
3297 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3298 (wordify): Check for overflow in size calculation.
3299 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3300 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3301 Check that fixnums are in proper range for system types.
3302 * sound.c (struct sound_device)
3303 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3305 (Fplay_sound_internal):
3306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 3307 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
3308 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3309 (Fparse_partial_sexp):
3310 Don't assume fixnums can fit in int.
3311 (struct lisp_parse_state, find_start_pos, find_start_value)
3312 (find_start_value_byte, find_start_begv)
3313 (update_syntax_table, char_quoted, dec_bytepos)
3314 (find_defun_start, prev_char_comend_first, back_comment):
3315 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3316 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3318 (Finternal_describe_syntax_value): Check that match_lisp is a
3319 character, not an integer, since the code stuffs it into int.
3320 (scan_words, scan_sexps_forward):
3321 Check that fixnums are in proper range for system types.
3322 (Fforward_word):
3323 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3324 (scan_sexps_forward):
3325 Use CHARACTERP, not INTEGERP, since the value must fit into int.
3326 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3327 * syntax.h: Adjust decls to match defn changes elsewhere.
3328 (struct gl_state_s):
3329 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3330 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3331 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3332 * sysdep.c (wait_for_termination_1, wait_for_termination)
3333 (interruptible_wait_for_termination, mkdir):
3334 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3335 (emacs_read, emacs_write):
3336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3337 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3338 and double all fit in int.
d311d28c
PE
3339 * term.c (set_tty_color_mode):
3340 Check that fixnums are in proper range for system types.
3341 * termhooks.h (struct input_event):
3342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3343 * textprop.c (validate_interval_range, interval_of)
3344 (Fadd_text_properties, set_text_properties_1)
3345 (Fremove_text_properties, Fremove_list_of_text_properties)
3346 (Ftext_property_any, Ftext_property_not_all)
3347 (copy_text_properties, text_property_list, extend_property_ranges)
3348 (verify_interval_modification):
3349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3350 (Fnext_single_char_property_change)
3351 (Fprevious_single_char_property_change):
3352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3353 (copy_text_properties):
3354 Check for integer overflow in index calculation.
d311d28c
PE
3355 * undo.c (last_boundary_position, record_point, record_insert)
3356 (record_delete, record_marker_adjustment, record_change)
3357 (record_property_change):
3358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3359 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3360 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3361 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3362 (Fx_hide_tip, Fx_file_dialog):
3363 * w32menu.c (set_frame_menubar):
3364 Use ptrdiff_t, not int, for consistency with rest of code.
3365 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3366 (select_window, Fdelete_other_windows_internal)
3367 (window_scroll_pixel_based, window_scroll_line_based)
3368 (Frecenter, Fset_window_configuration):
3369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3370 (Fset_window_hscroll, run_window_configuration_change_hook)
3371 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3372 (Fscroll_other_window, Frecenter):
d311d28c
PE
3373 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3374 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3375 Don't assume fixnum fits in int.
3376 (Fset_window_scroll_bars):
3377 Check that fixnums are in proper range for system types.
3378 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3379 (string_pos, c_string_pos, number_of_chars, init_iterator)
3380 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3381 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3382 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3383 (face_before_or_after_it_pos, handle_invisible_prop)
3384 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3385 (display_prop_intangible_p, string_buffer_position_lim)
3386 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3387 (get_overlay_strings_1, get_overlay_strings)
3388 (iterate_out_of_display_property, forward_to_next_line_start)
3389 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3390 (get_next_display_element, set_iterator_to_next)
3391 (get_visually_first_element, compute_stop_pos_backwards)
3392 (handle_stop_backwards, next_element_from_buffer)
3393 (move_it_in_display_line_to, move_it_in_display_line)
3394 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3395 (add_to_log, message_dolog, message_log_check_duplicate)
3396 (message2, message2_nolog, message3, message3_nolog
3397 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3398 (current_message_1, truncate_echo_area, truncate_message_1)
3399 (set_message, set_message_1, store_mode_line_noprop)
3400 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3401 (text_outside_line_unchanged_p, check_point_in_composition)
3402 (reconsider_clip_changes)
3403 (redisplay_internal, set_cursor_from_row, try_scrolling)
3404 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3405 (redisplay_window, find_last_unchanged_at_beg_row)
3406 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3407 (trailing_whitespace_p, find_row_edges, display_line)
3408 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3409 (display_mode_element, store_mode_line_string)
3410 (pint2str, pint2hrstr, decode_mode_spec)
3411 (display_count_lines, display_string, draw_glyphs)
3412 (x_produce_glyphs, x_insert_glyphs)
3413 (rows_from_pos_range, mouse_face_from_buffer_pos)
3414 (fast_find_string_pos, mouse_face_from_string_pos)
3415 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3416 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3417 (safe_call, init_from_display_pos, handle_fontified_prop)
3418 (handle_single_display_spec, load_overlay_strings)
3419 (with_echo_area_buffer, setup_echo_area_for_printing)
3420 (display_echo_area, echo_area_display)
3421 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3422 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3423 (redisplay_window, dump_glyph_row, display_mode_line)
3424 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3425 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3426 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3427 (handle_single_display_spec, build_desired_tool_bar_string)
3428 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3429 (get_specified_cursor_type):
3430 Check that fixnums are in proper range for system types.
3431 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3432 (Flookup_image_map):
3433 Don't assume fixnums fit in int.
3434 (compare_overlay_entries):
3435 Avoid mishandling comparisons due to subtraction overflow.
3436 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3437 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3438 (handle_tool_bar_click):
3439 Use int, not unsigned, since we prefer signed and the signedness
3440 doesn't matter here.
3441 (get_next_display_element, next_element_from_display_vector):
3442 Use int, not EMACS_INT, when int is wide enough.
3443 (start_hourglass): Use duration_to_sec_usec to do proper
3444 overflow checking on durations.
3445 * xfaces.c (Fbitmap_spec_p):
3446 Check that fixnums are in proper range for system types.
3447 (compare_fonts_by_sort_order):
3448 Avoid mishandling comparisons due to subtraction overflow.
3449 (Fx_family_fonts, realize_basic_faces):
3450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3451 (Fx_family_fonts):
3452 Don't assume fixnum fits in int.
3453 Use SAFE_ALLOCA_LISP, not alloca.
3454 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3455 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3456 (face_at_buffer_position, face_for_overlay_string)
3457 (face_at_string_position):
3458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3459 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3460 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3461 (Fx_show_tip):
3462 Check that fixnums are in proper range for system types.
3463 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3464 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3465 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3466 (Fx_change_window_property): Don't assume fixnums fit in int.
3467 * xfont.c (xfont_chars_supported):
3468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3469 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3470 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3471 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3472 * xml.c (parse_region):
3473 * xrdb.c (magic_file_p):
3474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3475 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3476 (x_get_local_selection, x_reply_selection_request)
3477 (x_handle_selection_request, wait_for_property_change):
3478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3479 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3480 short is wide enough.
3481 (x_send_client_event): Don't assume fixnum fits in int.
3482 * xterm.c (x_x_to_emacs_modifiers):
3483 Don't assume EMACS_INT overflows nicely into int.
3484 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3485 may come from Lisp.
3486 (handle_one_xevent): NATNUMP can eval its arg twice.
3487 (x_connection_closed):
3488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3489 * xterm.h: Adjust decls to match defn changes elsewhere.
3490 (struct scroll_bar): Use struct vectorlike_header
3491 rather than rolling our own approximation.
3492 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3493
c6574eb5
GM
34942012-05-25 Glenn Morris <rgm@gnu.org>
3495
3496 * lisp.mk (lisp): Update for more files being compiled now.
3497
e8d32c7e
SM
34982012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3499
48def666
SM
3500 * lread.c: Remove `read_pure' which makes no difference.
3501 (read_pure): Remove var.
3502 (unreadpure): Remove function.
3503 (readevalloop): Don't call read_list with -1 flag.
3504 (read1, read_vector): Don't test read_pure any more.
3505 (read_list): Simplify.
3506
e8d32c7e
SM
3507 * fileio.c, character.h: Minor style tweaks.
3508
4b2addb7
DA
35092012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3510
3511 * window.h (clip_changed): Remove useless declaration.
3512
584461b2
JB
35132012-05-22 Juanma Barranquero <lekktu@gmail.com>
3514
3515 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3516 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3517
34374650
PE
35182012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3519
3520 Remove src/m/*.
3521 This directory predates autoconf and is no longer needed nowadays.
3522 Move its few remaining bits of functionality to where they're needed.
3523 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3524 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3525 * m/template.h: Remove.
3526 * Makefile.in (M_FILE): Remove. All uses removed.
3527 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3528 * lisp.h (USE_LSB_TAG):
3529 * mem-limits.h (EXCEEDS_LISP_PTR):
3530 Use VAL_MAX, not VALBITS, in #if.
3531 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3532 (EMACS_UINT): Define unconditionally now.
3533 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3534 (BITS_PER_EMACS_INT): New constants, replacing
3535 what used to be in config.h, but not useful in #if.
3536 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3537 define them any more.
3538 (VAL_MAX): New macro.
3539 (VALMASK): Use it.
3540 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3541 BITS_PER_EMACS_INT, in #if.
3542 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3543 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3544 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3545 * s/ms-w32.h (DATA_START):
3546 Move here from removed file m/intel386.h.
3547 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3548 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3549
261cb4bb
PE
35502012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3551
3552 Assume C89 or later.
3553 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3554 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3555 (xrealloc):
3556 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3557 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3558 * textprop.c, tparam.c (NULL): Remove.
3559 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3560 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3561 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3562 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3563 * xterm.c (input_signal_count): Assume volatile works.
3564
ff23cd9f
KB
35652012-05-21 Ken Brown <kbrown@cornell.edu>
3566
3567 * xgselect.c (xg_select): Fix first argument in call to 'select'
3568 (bug#11508).
3569
1b170bc6
KB
35702012-05-20 Ken Brown <kbrown@cornell.edu>
3571
3572 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3573 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3574
b2f4d39f
KB
35752012-05-19 Ken Brown <kbrown@cornell.edu>
3576
3577 * xfns.c (x_in_use): Remove `static' qualifier.
3578 * xterm.h (x_in_use): Declare.
3579 * xgselect.c: Include xterm.h.
3580 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3581 and `display_arg' (bug#9754).
3582
003fdae2
PE
35832012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3584
9232a6d9
PE
3585 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3586
003fdae2
PE
3587 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3588 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3589
784b56e2
EZ
35902012-05-18 Eli Zaretskii <eliz@gnu.org>
3591
3592 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3593
3594 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3595 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3596
3597 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3598 reference to image_cache->refcount.
3599 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3600
a0a79cde
JL
36012012-05-17 Juri Linkov <juri@jurta.org>
3602
3603 * search.c (Fword_search_regexp, Fword_search_backward)
3604 (Fword_search_forward, Fword_search_backward_lax)
3605 (Fword_search_forward_lax): Move functions to isearch.el
3606 (bug#10145, bug#11381).
3607
b0572523
PE
36082012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3609
3610 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3611
9660f5fc
SM
36122012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3613
3614 * lread.c (init_obarray): Declare Qt and Qnil as special.
3615
4374de83
GM
36162012-05-14 Glenn Morris <rgm@gnu.org>
3617
3618 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3619 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3620
dc44c39a
PE
36212012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3622
078c97cb
PE
3623 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3624
dc44c39a
PE
3625 * unexaix.c: Port to more-recent AIX compilers.
3626 (report_error, report_error_1, make_hdr, copy_sym)
3627 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3628 Make arguments const char *, not char *, to avoid violations of C
3629 standard and to fix some AIX warnings reported by Gilles Pion.
3630
e18afed7 36312012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3632
3633 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3634 already have overlays loaded.
3635 (handle_single_display_spec): Before returning without displaying
3636 fringe bitmap, synchronize the bidi iterator with the main display
3637 iterator, by calling iterate_out_of_display_property.
3638 (iterate_out_of_display_property): Detect buffer iteration by
3639 testing that it->string is a Lisp string.
3640 (get_next_display_element): When the current object is exhausted,
3641 and there's something on it->stack, call set_iterator_to_next to
3642 proceed with what's on the stack, instead of returning zero.
3643 (set_iterator_to_next): If called at the end of a Lisp string,
3644 proceed to consider_string_end without incrementing string
3645 position. Don't increment display vector index past the end of
3646 the display vector. (Bug#11417)
c8fb9dc6
EZ
3647 (pos_visible_p): Don't report a position visible when move_it_to
3648 stopped at the last line of window, which happens to be scanned
3649 backwards by the bidi iteration. (Bug#11464)
ac268e67 3650
e18afed7 36512012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3652
3653 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3654 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3655 are on a TTY, and thus unable to display on the fringes.
3656 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3657 so we need to signal to the caller that this is a "replacing"
3658 display spec. This fixes display when the spec is invalid or we
3659 are on a TTY.
3660
e18afed7 36612012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3662
3663 * unexaix.c (make_hdr): Fix typo in prototype.
3664 This bug broke the build on AIX. Problem reported by Gilles Pion.
3665
9d0a235a
MA
36662012-05-14 Michael Albinus <michael.albinus@gmx.de>
3667
3668 * keyboard.c (kbd_buffer_get_event): Read special events also in
3669 batch mode. (Bug#11415)
3670
9e6b06ed
GM
36712012-05-12 Glenn Morris <rgm@gnu.org>
3672
3673 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3674
c1a1d7a3
EZ
36752012-05-12 Eli Zaretskii <eliz@gnu.org>
3676
3677 * lisp.mk (lisp): Add newcomment.elc.
3678
3fe7cdc8
GM
36792012-05-12 Glenn Morris <rgm@gnu.org>
3680
3681 * Makefile.in (MKDIR_P): New, set by configure.
3682 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3683
53f7d2c0
PE
36842012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3685
3686 Remove unused function hourglass_started.
3687 * dispextern.h (hourglass_started):
3688 * w32fns.c (hourglass_started):
3689 * xdisp.c (hourglass_started): Remove.
3690
75aafb17
JB
36912012-05-10 Juanma Barranquero <lekktu@gmail.com>
3692
3693 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3694 Update dependencies.
3695
12959e8e
PE
36962012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3697
97107e2e
PE
3698 * xgselect.c (xg_select): Put maxfds+1 into a var.
3699 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3700
12959e8e
PE
3701 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3702
836d29b3
DA
37032012-05-10 Dave Abrahams <dave@boostpro.com>
3704
3705 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3706 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3707
5cb67954
MA
37082012-05-09 Michael Albinus <michael.albinus@gmx.de>
3709
3710 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3711 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3712 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3713 Initialize xd_registered_buses.
3714
3478ec45
PE
37152012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3716
b263a6b0
PE
3717 Untag more efficiently if USE_LSB_TAG.
3718 This is based on a proposal by YAMAMOTO Mitsuharu in
3719 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3720 For an admittedly artificial (nth 8000 longlist) benchmark on
3721 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3722 Emacs's overall text size by 1%.
3723 * lisp.h (XUNTAG): New macro.
3724 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3725 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3726 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3727 * eval.c (Fautoload):
3728 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3729 * frame.h (XFRAME): Use XUNTAG.
3730
3478ec45
PE
3731 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3732 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3733 Remove unportable assumptions about print widths of types like
3734 dbus_uint32_t.
3735 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3736 intptr_t when converting between pointer and integer, to avoid GCC
3737 warnings about wrong width.
3738
666b903b 37392012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3740
3741 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3742 stack for each reader_thread, instead of defaulting to 8MB
3743 determined by the linker. This avoids failures in creating
3744 subprocesses on Windows 7, see the discussion in this thread:
3745 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3746
b120cc17
JC
37472012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3748
3749 Fix up display of the *Minibuf-0* buffer in the mini window.
3750 * keyboard.c (read_char): Don't clear the echo area if there's no
3751 message to clear.
3752 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3753 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3754
9a4b36f8
MA
37552012-05-07 Michael Albinus <michael.albinus@gmx.de>
3756
3757 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3758 batch mode.
3759
e5f9458f
CY
37602012-05-06 Chong Yidong <cyd@gnu.org>
3761
3762 * lisp.mk (lisp): Update.
3763
eceeb5fc 37642012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3765
3766 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3767
71873e2b
SM
37682012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3769
3770 * data.c (PUT_ERROR): New macro.
3771 (syms_of_data): Use it. Add new error type `user-error'.
3772 * undo.c (user_error): New function.
3773 (Fprimitive_undo): Use it.
3774 * print.c (print_error_message): Adjust print style for `user-error'.
3775 * keyboard.c (user_error): New function.
3776 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3777
ab0fa4e4
PE
37782012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3779
3780 Do not limit current-time-string to years 1000..9999.
3781 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3782 (Fcurrent_time_string): Support any year that is supported by the
3783 underlying localtime representation. Don't use asctime, as it
3784 has undefined behavior for years outside the range -999..9999.
3785
7ed806a7
PE
37862012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3787
3788 Fix race conditions involving setenv, gmtime, localtime, asctime.
3789 Without this fix, interrupts could mess up code that uses these
3790 nonreentrant functions, since setting TZ invalidates existing
3791 tm_zone or tzname values, and since most of these functions return
3792 pointers to static storage.
3793 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3794 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3795 Grow the critical sections to include not just invoking
3796 localtime/gmtime, but also accessing these functions' results
3797 including their tm_zone values if any, and any related TZ setting.
3798 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3799 so that the struct tm is saved in the critical section.
3800 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3801 motivated by the fact that memory allocation needs to be outside
3802 the critical section.
3803
0c16dfed
DA
38042012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3805
3806 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3807 with RESET_INTERVAL.
3808
3809 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3810 Remove duplicated buffer name initialization.
3811
3f83ace8
JM
38122012-05-02 Jim Meyering <jim@meyering.net>
3813
3814 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3815
c7b8541e
JM
3816 * xfns.c (x_window): Use xstrdup (Bug#11375).
3817
90207a15 38182012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3819
3820 * xdisp.c (pos_visible_p): If already at a newline from the
3821 display string before the 'while' loop, don't walk back the glyphs
3822 from it3.glyph_row. Solves assertion violation when the display
3823 string begins with a newline (egg.el). (Bug#11367)
3824
b593d6a9
AH
38252012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3826
3827 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3828 Move to simple.el.
3829
4737362e
GM
38302012-05-01 Glenn Morris <rgm@gnu.org>
3831
99cf43f9
GM
3832 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3833 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3834 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3835 All were removed before 23.1.
3836
9311dcff
GM
3837 * dispnew.c: Remove HAVE_LIBNCURSES test;
3838 it is always true on relevant platforms.
3839
4d5c6349
GM
3840 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3841 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3842
4737362e
GM
3843 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3844
74dd3a6b
AS
38452012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3846
3847 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3848 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3849 Remove.
3850
13c379ee
PE
38512012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3852
3853 Do not avoid creating empty evaporating overlays (Bug#9642).
3854 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3855 That is, do not delete an evaporating overlay if it becomes
3856 empty after its bounds are adjusted to fit within its buffer.
3857 This fix caused other problems, and I'm reverting it until we get
3858 to the bottom of them.
3859
a8e7d6d7 38602012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3861
3862 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3863
a8e7d6d7 38642012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3865
3866 * xdisp.c (pos_visible_p): If the window start position is beyond
3867 ZV, start the display from buffer beginning. Prevents assertion
3868 violation in init_iterator when the minibuffer window is scrolled
3869 via the scroll bar.
3870
3871 * window.c (window_scroll_pixel_based): Likewise.
3872
a8e7d6d7 38732012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3874
3875 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3876
a8e7d6d7 38772012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3878
3879 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3880 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3881
a8e7d6d7 38822012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3883
b593d6a9
AH
3884 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3885 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3886
1c6900d9
EZ
38872012-04-26 Eli Zaretskii <eliz@gnu.org>
3888
4c3fa1d9
EZ
3889 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3890 display element, check also the underlying string or buffer
3891 character. (Bug#11341)
3892
1c6900d9
EZ
3893 * w32menu.c: Include w32heap.h.
3894 (add_menu_item): If the call to AppendMenuW (via
3895 unicode_append_menu) fails, disable Unicode menus only if we are
3896 running on Windows 9X/Me.
3897
42bf8205
AS
38982012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3899
3900 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3901 (xgetint): Add missing shift for LSB tags.
3902
b1bac16e
MR
39032012-04-24 Martin Rudalics <rudalics@gmx.at>
3904
3905 * keyboard.c (read_char): Don't wipe echo area for select window
3906 events: These might get delayed via `mouse-autoselect-window'
3907 (Bug#11304).
3908
d69621cc
JB
39092012-04-24 Juanma Barranquero <lekktu@gmail.com>
3910
3911 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3912 manipulation of :loaded-from data.
3913
02fd101b
JB
39142012-04-23 Juanma Barranquero <lekktu@gmail.com>
3915
3916 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3917 now a cons (bug#11311).
3918
888bec30
PE
39192012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3920
89a438bd
PE
3921 Do not create empty overlays with the evaporate property (Bug#9642).
3922 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3923 if it becomes empty after its bounds are adjusted to fit within
3924 its buffer. Without this fix, in a nonempty buffer (let ((o
3925 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3926 yields an empty overlay that has the evaporate property, which is
3927 not supposed to happen.
3928
1068fe4d
PE
3929 Fix minor GTK3 problems found by static checking.
3930 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3931 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3932 (struct _EmacsFixedClass, emacs_fixed_get_type):
3933 Move decls here from emacsgtkfixed.h, since they needn't be public.
3934 (emacs_fixed_get_type): Now static.
3935 (emacs_fixed_class_init): Omit unused local.
3936 (emacs_fixed_child_type): Remove; unused.
3937 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3938 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3939 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3940 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3941 (EMACS_FIXED_GET_CLASS): Remove; unused.
3942 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3943
888bec30
PE
3944 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3945 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3946
de85e130
PE
39472012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3948
d0baac98 3949 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 3950 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
3951 (__malloc_size_t, __malloc_ptrdiff_t):
3952 Remove. All uses removed, replaced by the definiens if needed,
3953 since we can assume C89 or better now.
3954 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3955 (protect_malloc_state, align, get_contiguous_space)
3956 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3957 (malloc_atfork_handler_child, malloc_enable_thread)
3958 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3959 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3960 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3961 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3962 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3963 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3964 Define using prototypes, not old style.
3965 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3966 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3967 (align): Don't assume that signed integer overflow wraps around.
3968 Omit unused local var.
3969 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3970 (_free_internal_nolock, memalign, mallochook, reallochook):
3971 Omit no-longer-needed casts.
3972 (valloc): Use getpagesize, not __getpagesize.
3973 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3974 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3975
de85e130
PE
3976 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3977
dcbf5805
MA
39782012-04-22 Michael Albinus <michael.albinus@gmx.de>
3979
3980 Move functions from C to Lisp. Make non-blocking method calls
3981 the default. Implement further D-Bus standard interfaces.
3982
3983 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3984 (QCdbus_request_name_allow_replacement)
3985 (QCdbus_request_name_replace_existing)
3986 (QCdbus_request_name_do_not_queue)
3987 (QCdbus_request_name_reply_primary_owner)
3988 (QCdbus_request_name_reply_in_queue)
3989 (QCdbus_request_name_reply_exists)
3990 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3991 (QCdbus_registered_serial, QCdbus_registered_method)
3992 (QCdbus_registered_signal): New Lisp objects.
3993 (XD_DEBUG_MESSAGE): Use sizeof.
3994 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3995 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3996 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3997 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3998 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3999 (xd_signature, xd_append_arg): Allow float for integer types.
4000 (xd_get_connection_references): New function.
b593d6a9
AH
4001 (xd_get_connection_address): Rename from xd_initialize.
4002 Return cached address.
dcbf5805
MA
4003 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
4004 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
4005 level.
4006 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 4007 Return number of refcounts.
dcbf5805
MA
4008 (Fdbus_get_unique_name): Make stronger parameter check.
4009 (Fdbus_message_internal): New defun.
4010 (Fdbus_call_method, Fdbus_call_method_asynchronously)
4011 (Fdbus_method_return_internal, Fdbus_method_error_internal)
4012 (Fdbus_send_signal, Fdbus_register_service)
4013 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
4014 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
4015 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
4016 (Vdbus_compiled_version, Vdbus_runtime_version)
4017 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
4018 (Vdbus_message_type_method_return, Vdbus_message_type_error)
4019 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
4020 (Vdbus_registered_buses, Vdbus_registered_objects_table):
4021 Adapt docstring.
dcbf5805 4022
52828e02
PE
40232012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4024
da05bc4c
PE
4025 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
4026 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
4027 Do not assume ptrdiff_t is the same width as 'int'.
4028
52828e02
PE
4029 * alloc.c: Handle unusual debugging option combinations.
4030 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
4031 since the two debugging options are incompatible.
4032 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
4033 is defined.
4034 (mem_init, mem_insert, mem_insert_fixup):
4035 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
4036 (NEED_MEM_INSERT): Remove; no longer needed.
4037
f01769f9
LL
40382012-04-22 Leo Liu <sdl.web@gmail.com>
4039
4040 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
4041
5790543d
PE
40422012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4043
4044 * sysdep.c [__FreeBSD__]: Minor cleanups.
4045 (list_system_processes, system_process_attributes) [__FreeBSD__]:
4046 Use Emacs indenting style more consistently. Avoid some casts.
4047 Use 'double' consistently rather than mixing 'float' and 'double'.
4048
b91b7e4d
EW
40492012-04-21 Eduard Wiebe <usenet@pusto.de>
4050
b593d6a9
AH
4051 * sysdep.c (list_system_processes, system_process_attributes):
4052 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 4053
6114eb15
AS
40542012-04-21 Andreas Schwab <schwab@linux-m68k.org>
4055
4056 * lisp.mk (lisp): Update.
4057
2f38dff7
PE
40582012-04-20 Paul Eggert <eggert@cs.ucla.edu>
4059
4060 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
4061 It is never used otherwise.
4062
4ae29f89
SM
40632012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
4064
4065 * print.c (print_preprocess): Only check print_depth if print-circle
4066 is nil.
4067 (print_object): Check for cycles even when print-circle is nil and
4068 print-gensym is t, but only check print_depth if print-circle is nil.
4069
f30d612a
CY
40702012-04-20 Chong Yidong <cyd@gnu.org>
4071
4072 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4073 set the status to "failed" and ensure that sentinel is run.
4074
c07a4c0b 40752012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
4076
4077 * process.c (Fset_process_inherit_coding_system_flag)
4078 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 4079 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 4080
c07a4c0b 40812012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
4082
4083 * xdisp.c (string_buffer_position_lim): Limit starting position to
4084 BEGV.
4085 (set_cursor_from_row): If called for a mode-line or header-line
4086 row, return zero immediately.
4087 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
4088 farther than the first row after the header line, if any.
4089 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
4090 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
4091
c07a4c0b 40922012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4093
4ae29f89
SM
4094 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
4095 (bug#11238).
ad3a2b41 4096
c07a4c0b 40972012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 40982012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
4099
4100 configure: new option --enable-gcc-warnings (Bug#11207)
4101 * Makefile.in (C_WARNINGS_SWITCH): Remove.
4102 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
4103 (ALL_CFLAGS): Use new macros rather than old.
4104 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
4105 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
4106 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
4107 -Wunused-result, -Wunused-variable. This should go away once
4108 the Emacs and Gnulib regex code is merged.
4109 (xmalloc, xrealloc): Now static.
4110
aba027e8
PE
41112012-04-17 Paul Eggert <eggert@cs.ucla.edu>
4112
4113 * dired.c (Fsystem_groups): Remove unused local.
4114
e5a36063
GM
41152012-04-17 Glenn Morris <rgm@gnu.org>
4116
4117 * dired.c (Fsystem_users): Doc fix.
4118
316411f0
DA
41192012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
4120
4121 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
4122 (syms_of_dired): Add them.
4123
9426aba4
PE
41242012-04-16 Paul Eggert <eggert@cs.ucla.edu>
4125
b62a57be
PE
4126 Fix minor alloc.c problems found by static checking.
4127 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
4128 New extern decls, to avoid calling undeclared functions.
4129 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
4130 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
4131 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
4132 (NEED_MEM_INSERT): New macro.
4133 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 4134 Remove one incorrect comment and fix another.
b62a57be 4135
3539f31f
PE
4136 Fix minor ralloc.c problems found by static checking.
4137 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4138 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
4139 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
4140 (r_alloc_sbrk): Now static.
4141
a041960a
PE
4142 Improve ralloc.c interface checking.
4143 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4144 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
4145 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
4146 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
4147 [REL_ALLOC]: ... to here, to check interface.
4148 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
4149 Remove decls. This fixes an "It stinks!".
4150
9426aba4
PE
4151 * alloc.c (which_symbols): Fix alignment issue / type clash.
4152
d55c12ed
AS
41532012-04-15 Andreas Schwab <schwab@linux-m68k.org>
4154
4155 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
4156 (struct Lisp_Misc_Any): Likewise.
4157 (struct Lisp_Free): Likewise.
4158 * alloc.c (union aligned_Lisp_Symbol): Define.
4159 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
4160 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
4161 (union aligned_Lisp_Misc): Define.
4162 (MARKER_BLOCK_SIZE, struct marker_block): Use union
4163 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 4164 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 4165
b948ce8b
PE
41662012-04-14 Paul Eggert <eggert@cs.ucla.edu>
4167
4168 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
4169 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
4170 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
4171 * s/netbsd.h, s/sol2-6.h:
4172 Remove definition of GC_MARK_STACK, since the default now works.
4173 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
4174 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
4175 no longer the default.
4176 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
4177
35dc09a1 41782012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4179
35dc09a1
GM
4180 * lread.c (lisp_file_lexically_bound_p):
4181 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 4182
35dc09a1
GM
41832012-04-14 Eli Zaretskii <eliz@gnu.org>
4184
4185 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
4186 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
4187
41882012-04-14 Jan Djärv <jan.h.d@swipnet.se>
4189
4190 * nsterm.m (constrainFrameRect): Always constrain when there is only
4191 one screen (Bug#10962).
4192
bcd86815
KB
41932012-04-13 Ken Brown <kbrown@cornell.edu>
4194
4195 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
4196
c25df26e
RT
41972012-04-13 Reuben Thomas <rrt@sc3d.org>
4198
4199 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
4200
0fc59f1e
DC
42012012-04-11 Daniel Colascione <dancol@dancol.org>
4202
4203 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
4204 against is gone. It's better to use vfork now so that when Cygwin
4205 gains a new, working vfork, we use it automatically (bug#10398).
4206
de8c03dc
SM
42072012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4208
4209 * window.c (save_window_save): Obey window-point-insertion-type.
4210
2f097256
GM
42112012-04-11 Glenn Morris <rgm@gnu.org>
4212
4213 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
4214
453b951e
SM
42152012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4216
4217 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
4218
75f1671a 42192012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
4220
4221 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
4222 (force_quit_count): New var.
4223 (handle_interrupt): Use it.
4224
2a8ce227
JB
42252012-04-10 Juanma Barranquero <lekktu@gmail.com>
4226
4227 * w32.c (w32_delayed_load): Record the full path of the library
4228 being loaded (bug#10424).
4229
935396c0
GM
42302012-04-09 Glenn Morris <rgm@gnu.org>
4231
05920a43
GM
4232 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
4233 not just in the obarray, before snarfing them. (Bug#11036)
4234
935396c0
GM
4235 * Makefile.in ($(leimdir)/leim-list.el):
4236 Pass EMACS rather than BUILT_EMACS.
4237
a18ecafa
TZ
42382012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4239
4240 * process.c (make_process):
4241 * process.h: Add integer `gnutls_handshakes_tried' member to
4242 process struct.
4243
6bbef4e5
JC
4244 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4245 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
4246
4247 * gnutls.c (gnutls_log_function2i): Convenience log function.
4248 (emacs_gnutls_read): Use new log functions,
4249 `gnutls_handshakes_tried' process member, and
4250 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4251 attempts per process (connection).
4252
b4d3bc10
CY
42532012-04-09 Chong Yidong <cyd@gnu.org>
4254
4255 * eval.c (Fuser_variable_p, user_variable_p_eh)
4256 (lisp_indirect_variable): Functions deleted.
4257 (Fdefvar): Caller changed.
4258
4259 * callint.c (Finteractive, Fcall_interactively):
4260 * minibuf.c (Fread_variable): Callers changed.
4261
70f4d973
EZ
42622012-04-09 Eli Zaretskii <eliz@gnu.org>
4263
4264 * xdisp.c (set_cursor_from_row): If the display string appears in
4265 the buffer at position that is closer to point than the position
4266 after the display string, display the cursor on the first glyph of
4267 the display string. Fixes cursor display when a 'display' text
4268 property immediately follows invisible text. (Bug#11094)
4269
cb3c2e3e
PE
42702012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4271
4272 composite.c: use 'double' consistently
4273 * composite.c (get_composition_id): Use 'double' consistently
4274 instead of converting 'float' to 'double' and vice versa; this is
4275 easier to understand and avoids a GCC warning.
4276
fd06db5d
GM
42772012-04-09 Glenn Morris <rgm@gnu.org>
4278
50fe702a
GM
4279 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4280 preparation for dumping it with emacs. (Bug#4789)
4281 (leimdir): New variable.
4282 ($(leimdir)/leim-list.el): New rule.
4283 (emacs$(EXEEXT)): Depend on leim-list.el.
4284
fd06db5d
GM
4285 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4286 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4287 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4288
55c131ee
AS
42892012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4290
4291 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4292 proper alignment.
4293
9209588f
JB
42942012-04-07 Juanma Barranquero <lekktu@gmail.com>
4295
4296 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4297 Remove unused local variable.
4298
e3fb2efb
PE
42992012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4300
4301 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4302 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4303 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4304 objects, as mark_maybe_pointer will catch them otherwise.
4305 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4306 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4307
b5385551
PE
43082012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4309
4310 Fix typo that broke non-Windows builds.
4311 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4312
9078ead6
EZ
43132012-04-07 Eli Zaretskii <eliz@gnu.org>
4314
4315 Support building on MS-Windows with libxml2.
4316
4317 * makefile.w32-in (OBJ2): Add xml.$(O).
4318 (GLOBAL_SOURCES): Add xml.c.
4319 ($(BLD)/xml.$(O)): New dependency list.
4320
4321 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
4322 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
4323 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
4324 [!WINDOWSNT]: New macros.
4325 (init_libxml2_functions, libxml2_loaded_p): New functions.
4326 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4327 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4328 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4329 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4330 linked in).
6bbef4e5
JC
4331 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4332 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4333 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4334
4335 * emacs.c: Don't include libxml/parser.h.
4336 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4337 xmlCleanupParser directly.
4338
4339 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4340
3811fdf3
EZ
43412012-04-07 Eli Zaretskii <eliz@gnu.org>
4342
4343 * indent.c (Fvertical_motion): If there is a display string at
4344 point, use it.vpos to compute how many lines to backtrack after
4345 move_it_to point. (Bug#11133)
4346
2f8e16b2
EZ
43472012-04-06 Eli Zaretskii <eliz@gnu.org>
4348
4349 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4350 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4351 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4352 macros related to unification of CJK characters. For the details,
4353 see the discussion following the message here:
4354 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4355
3d439cd1
CY
43562012-04-04 Chong Yidong <cyd@gnu.org>
4357
4358 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4359
8bc53d00
EZ
43602012-04-01 Eli Zaretskii <eliz@gnu.org>
4361
4362 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4363 instead of alloca. (Bug#11138)
4364
3b0512a3
AS
43652012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4366
4367 * w32menu.c (is_simple_dialog): Properly check lisp types.
4368 (Bug#11141)
4369
8427ddd2
EZ
43702012-03-31 Eli Zaretskii <eliz@gnu.org>
4371
979022ef
EZ
4372 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4373 position we get to after a call to move_it_to fails the
4374 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4375 only if we wind up in a string from display property. (Bug#11063)
4376
a6b1c7cc
EZ
4377 * window.c (Fdelete_other_windows_internal): Invalidate the row
4378 and column information about mouse highlight, so that redisplay
4379 restores it after reallocating the glyph matrices. (Bug#7464)
4380
8427ddd2
EZ
4381 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4382 string comes from a `display' text property, use the buffer
4383 position of that property as if we actually saw that position in
4384 the row's glyphs.
697ba24b
EZ
4385 (move_it_by_lines): Remove the assertion that
4386 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4387 violated when there's a before-string at the beginning of a line.
4388 (Bug#11063)
8427ddd2 4389
65a0a738
EZ
43902012-03-30 Eli Zaretskii <eliz@gnu.org>
4391
4392 * xdisp.c (append_space_for_newline): If the default face was
4393 remapped, use the remapped face for the appended newline.
4394 (extend_face_to_end_of_line): Use the remapped default face for
4395 extending the face to the end of the line.
4396 (display_line): Call extend_face_to_end_of_line when the default
4397 face was remapped. (Bug#11068)
4398
581355cc
EZ
43992012-03-29 Eli Zaretskii <eliz@gnu.org>
4400
4401 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4402
e8fc049f
SM
44032012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4404
4405 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4406
4fb9a543
GM
44072012-03-27 Glenn Morris <rgm@gnu.org>
4408
4409 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4410 Doc fixes.
4411
679910f1
KH
44122012-03-26 Kenichi Handa <handa@m17n.org>
4413
4414 * dispextern.h (struct glyph): Fix previous change. Change the
4415 bit length of glyphless.ch to 25 (Bug#11082).
4416
90d49b7f
CY
44172012-03-26 Chong Yidong <cyd@gnu.org>
4418
4419 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4420 (command_loop_1): Use it; inhibit selection update for
4421 handle-select-window too (Bug#8996).
4422
f514f6f0
FP
44232012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4424
e8fc049f 4425 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4426
bf43fa51
KH
44272012-03-25 Kenichi Handa <handa@m17n.org>
4428
4429 * dispextern.h (struct glyph): Change the bit length of
4430 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4431
8a0c01dd
EZ
44322012-03-24 Eli Zaretskii <eliz@gnu.org>
4433
4434 * s/ms-w32.h (tzname): Include time.h before redirecting to
4435 _tzname. Fixes the MSVC build. (Bug#9960)
4436
7d1c3a76
AS
44372012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4438
8ed79523
AS
4439 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4440 characters.
4441
7d1c3a76
AS
4442 * xterm.c (XTread_socket): Only modify handling_signal if
4443 !SYNC_INPUT. (Bug#11080)
4444
e99a9b8b
EZ
44452012-03-23 Eli Zaretskii <eliz@gnu.org>
4446
4447 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4448 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4449 when fetching a multibyte character consumes more bytes than
4450 CHAR_BYTES returns, due to unification of CJK characters in
4451 string_char. (Bug#11073)
4452
5063c0e1
TN
44532012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4454
4455 * process.c (wait_reading_process_output): Handle pty disconnect
4456 by refraining from sending oneself a SIGCHLD (bug#10933).
4457
9f851fbd
CY
44582012-03-22 Chong Yidong <cyd@gnu.org>
4459
4460 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4461
5063c0e1 4462 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4463 Mark string as coming from a prefix property.
4464 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4465 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4466
fb5b8aca
CY
44672012-03-21 Chong Yidong <cyd@gnu.org>
4468
4469 * xfaces.c (Vface_remapping_alist): Doc fix.
4470
62356a1b
EZ
44712012-03-20 Eli Zaretskii <eliz@gnu.org>
4472
4473 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4474 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4475 Doc fixes.
62356a1b 4476
025de85b
CY
44772012-03-20 Chong Yidong <cyd@gnu.org>
4478
4479 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4480 to reflect default non-nil value of redisplay-dont-pause.
4481
4827f94e
KH
44822012-03-19 Kenichi Handa <handa@m17n.org>
4483
4484 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4485 it fit in a valid range (Bug#11003).
4486
e50a24a2
EZ
44872012-03-18 Eli Zaretskii <eliz@gnu.org>
4488
4489 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4490 that is not from display property, accept the row as a "cursor
4491 row" if one of the string's character has a non-nil `cursor'
4492 property. Fixes cursor positioning when there are newlines in
4493 overlay strings, e.g. in icomplete.el. (Bug#11035)
4494
9af5ed87
PE
44952012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4496
4497 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4498
d1f55f16
CY
44992012-03-12 Chong Yidong <cyd@gnu.org>
4500
4501 * eval.c (inhibit_lisp_code): Rename from
4502 inhibit_window_configuration_change_hook; move from window.c.
4503
4504 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4505 * window.c (run_window_configuration_change_hook)
4506 (syms_of_window): Callers changed.
4507
66c5eebd
CY
45082012-03-11 Chong Yidong <cyd@gnu.org>
4509
413df973
CY
4510 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4511
66c5eebd
CY
4512 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4513
1de11f56
CY
45142012-03-10 Chong Yidong <cyd@gnu.org>
4515
4516 * frame.c (other_visible_frames): Don't assume the selected frame
4517 is visible (Bug#10955).
4518
cae07000
SM
45192012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4520
4521 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4522
89c94350
JD
45232012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4524
4525 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4526 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4527 zero (Bug#10954).
4528
999dd333
GM
45292012-03-03 Glenn Morris <rgm@gnu.org>
4530
01a6dcc8 4531 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4532
de0100f2
EZ
45332012-03-02 Eli Zaretskii <eliz@gnu.org>
4534
4535 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4536 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4537 (redisplay_window, next_element_from_string): Fix typos in
4538 comments.
3e441275
EZ
4539 (redisplay_window): Pass to move_it_vertically the margin in
4540 pixels, not in screen lines.
de0100f2 4541
96a72ee9
GM
45422012-03-02 Glenn Morris <rgm@gnu.org>
4543
4544 * buffer.c (buffer-list-update-hook): Doc fix.
4545
312508d7
EZ
45462012-02-29 Eli Zaretskii <eliz@gnu.org>
4547
4548 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4549 push_it before setting up the iterator for the first overlay
4550 string, even if we have an empty string loaded.
4551 (next_overlay_string): If there's an empty string on the iterator
4552 stack, pop the stack. (Bug#10903)
4553
27f3c637
PE
45542012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4555
4556 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4557 Suggested by Stefan Monnier in
4558 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4559 * alloc.c (widen_to_Lisp_Object): New static function.
4560 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4561 and widening them to Lisp_Objects. This would work even if
4562 USE_LSB_TAG is defined and wide integers are used, which might
4563 happen in a future version of Emacs.
4564
3c9dfce6
CY
45652012-02-25 Chong Yidong <cyd@gnu.org>
4566
fa74b241
CY
4567 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4568 Doc fix.
4569
3c9dfce6
CY
4570 * xselect.c (Fx_selection_exists_p): Doc fix.
4571 (x_clipboard_manager_save_all): Print an informative message
4572 before saving to clipboard manager.
4573
9486df08
CY
45742012-02-24 Chong Yidong <cyd@gnu.org>
4575
4576 * keyboard.c (process_special_events): Handle all X selection
4577 requests in kbd_buffer, not just the next one (Bug#8869).
4578
f01d3321
CY
45792012-02-23 Chong Yidong <cyd@gnu.org>
4580
4581 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4582 call when setting menu-bar-lines and tool-bar-lines parameters.
4583 (unwind_create_frame_1): New helper function.
4584
4585 * window.c (inhibit_window_configuration_change_hook): New var.
4586 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4587 (syms_of_window): Initialize it.
f01d3321 4588
86b847b6
CY
45892012-02-22 Chong Yidong <cyd@gnu.org>
4590
4591 * xterm.c (x_draw_image_relief): Add missing type check for
4592 Vtool_bar_button_margin (Bug#10743).
4593
a59225b1
CY
45942012-02-21 Chong Yidong <cyd@gnu.org>
4595
4596 * fileio.c (Vfile_name_handler_alist): Doc fix.
4597
4598 * buffer.c (Fget_file_buffer): Protect against invalid file
4599 handler return value.
4600
310f5bd4
PE
46012012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4602
cb3a28cc
PE
4603 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4604 when computing $valmask.
4605
310f5bd4
PE
4606 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4607 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4608 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4609 It's useless in that case, and it can cause problems on hosts
4610 that allocate halves of EMACS_INT values separately.
4611 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4612 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4613 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4614 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4615 it avoids undefined behavior on hosts where shifting right by more
4616 than the word width has undefined behavior.
4617
2375c96a
CY
46182012-02-19 Chong Yidong <cyd@gnu.org>
4619
4620 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4621 (Funhandled_file_name_directory, Ffile_name_as_directory)
4622 (Fdirectory_file_name, Fexpand_file_name)
4623 (Fsubstitute_in_file_name): Protect against invalid file handler
4624 return values (Bug#10845).
4625
3eb49e71
EZ
46262012-02-18 Eli Zaretskii <eliz@gnu.org>
4627
4628 * .gdbinit (pitx): Fix incorrect references to fields of the
4629 iterator stack.
4630
7b926f3f
CY
46312012-02-17 Chong Yidong <cyd@gnu.org>
4632
4633 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4634
11273115
PE
46352012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4636
4637 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4638 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4639
c3a70e2b
CY
46402012-02-15 Chong Yidong <cyd@gnu.org>
4641
4642 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4643 marked as special. Also, starting docstrings with * is obsolete.
4644
0ca43699
AS
46452012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4646
4647 * gnutls.c (emacs_gnutls_write): Fix last change.
4648
2e8f3c56
LI
46492012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4650
4651 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4652 send_process.
4653
af70074f
SM
46542012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4655
4656 * keymap.c (Fsingle_key_description): Handle char ranges.
4657
95986d52
CY
46582012-02-12 Chong Yidong <cyd@gnu.org>
4659
afd83bd1
CY
4660 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4661 as that creates a dangerous corner case.
4662
95986d52
CY
4663 * window.c (Fdelete_window_internal): Invalidate the mouse
4664 highlight (Bug#9904).
4665
bd7da63e
GM
46662012-02-12 Glenn Morris <rgm@gnu.org>
4667
4668 * xselect.c (Fx_own_selection_internal)
4669 (Fx_get_selection_internal, Fx_disown_selection_internal)
4670 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4671 * nsselect.m (Fx_own_selection_internal)
4672 (Fx_disown_selection_internal, Fx_selection_exists_p)
4673 (Fx_selection_owner_p, Fx_get_selection_internal):
4674 Sync docs and argument specs with the xselect.c versions.
4675
77abcbc2
LI
46762012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4677
4678 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4679
90b671e2
EZ
46802012-02-11 Eli Zaretskii <eliz@gnu.org>
4681
1c0ca0b7
EZ
4682 * w32select.c (Fx_selection_exists_p): Sync doc string and
4683 argument list with xselect.c. (Bug#10783)
4684
4685 * w16select.c (Fx_selection_exists_p): Sync doc string and
4686 argument list with xselect.c. (Bug#10783)
90b671e2 4687
49241268
GM
46882012-02-10 Glenn Morris <rgm@gnu.org>
4689
4690 * fns.c (Fsecure_hash): Doc fix.
4691
f998bbe7 46922012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4693
4694 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4695
0992bd9c
CY
46962012-02-07 Chong Yidong <cyd@gnu.org>
4697
4698 * buffer.c (Fbuffer_local_variables)
4699 (buffer_lisp_local_variables): Handle unbound vars correctly;
4700 don't let Qunbound leak into Lisp.
4701
af008560
GM
47022012-02-07 Glenn Morris <rgm@gnu.org>
4703
dd605cc4
GM
4704 * image.c (Fimagemagick_types): Doc fix.
4705
af008560
GM
4706 * image.c (imagemagick-render-type): Change it from a lisp object
4707 to an integer. Move the doc here from the lisp manual.
4708 Treat all values not equal to 0 the same.
4709
1449fa1d
CY
47102012-02-06 Chong Yidong <cyd@gnu.org>
4711
4712 * doc.c (store_function_docstring): Avoid applying docstring of
4713 alias to base function (Bug#2603).
4714
3723ec07
AS
47152012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4716
4717 * .gdbinit (pp1, pv1): Remove redundant defines.
4718 (pr): Use pp.
4719
79c1cc1e
CY
47202012-02-04 Chong Yidong <cyd@gnu.org>
4721
4722 * nsterm.m: Declare a global (Bug#10694).
4723
d7f29f8e
EZ
47242012-02-04 Eli Zaretskii <eliz@gnu.org>
4725
cae07000
SM
4726 * w32.c (get_emacs_configuration_options):
4727 Include --enable-checking, if specified, in the return value.
d7f29f8e 4728
3b95a6f9
MR
47292012-02-04 Martin Rudalics <rudalics@gmx.at>
4730
4731 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4732 after rounding frame sizes. (Bug#9723)
4733
d6fa96a6
EZ
47342012-02-04 Eli Zaretskii <eliz@gnu.org>
4735
4736 * keyboard.c (adjust_point_for_property): Don't position point
4737 before BEGV. (Bug#10696)
4738
df0b2940
PE
47392012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4740
4741 Handle overflow when computing char display width (Bug#9496).
4742 * character.c (char_width): Return EMACS_INT, not int.
4743 (char_width, c_string_width): Check for overflow when
4744 computing the width; this is possible now that individual
4745 characters can have unbounded width. Problem introduced
4746 by merge from Emacs 23 on 2012-01-19.
4747
6bee44d6
MA
47482012-02-02 Michael Albinus <michael.albinus@gmx.de>
4749
4750 * dbusbind.c (Fdbus_register_method): Mention the return value
4751 :ignore in the docstring.
4752
44f92739
GM
47532012-02-02 Glenn Morris <rgm@gnu.org>
4754
1b9f60cc
GM
4755 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4756
44f92739
GM
4757 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4758 Unconditionally set to t. (Bug#10673)
4759 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4760 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4761 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4762
c5d3843c
KH
47632012-02-02 Kenichi Handa <handa@m17n.org>
4764
4765 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4766 0, do not call append_composite_glyph.
4767
159462d4 47682012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4769
4770 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4771 NULL (Bug#6988).
4772 (x_produce_glyphs): If the component of a composition is a null
4773 string, set it->pixel_width to 1 to avoid zero-width glyph.
4774
78cef877
EZ
47752012-02-01 Eli Zaretskii <eliz@gnu.org>
4776
4777 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4778 first 2 arguments are identical. This makes inserting large
4779 output from a subprocess an order of magnitude faster on
4780 MS-Windows, where all sbrk'ed memory is always contiguous.
4781
97897668
GM
47822012-01-31 Glenn Morris <rgm@gnu.org>
4783
4784 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4785 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4786 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4787
31fd3586
GM
47882012-01-29 Glenn Morris <rgm@gnu.org>
4789
4790 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4791
0e24a8b2
CY
47922012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4793
4794 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4795
cc0adcb0
CY
47962012-01-28 Chong Yidong <cyd@gnu.org>
4797
4798 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4799
acc28cb9
CY
48002012-01-26 Chong Yidong <cyd@gnu.org>
4801
9c69cfb7
CY
4802 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4803
acc28cb9
CY
4804 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4805 repeat counts (Bug#10507).
4806
48da7392
GM
48072012-01-26 Glenn Morris <rgm@gnu.org>
4808
4809 * lread.c (syms_of_lread): Doc fix.
4810
14af5f7f
CY
48112012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4812
4813 * coding.c (encode_designation_at_bol): Change return value to
4814 EMACS_INT.
4815
0b21c100
CY
48162012-01-25 Chong Yidong <cyd@gnu.org>
4817
4818 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4819
3c2907f7
CY
48202012-01-21 Chong Yidong <cyd@gnu.org>
4821
4822 * floatfns.c (Fcopysign): Make the second argument non-optional,
4823 since nil is not allowed anyway.
4824
959ad23f
AS
48252012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4826
4827 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4828 (send_process): Likewise.
4829
34a02f46
MR
48302012-01-19 Martin Rudalics <rudalics@gmx.at>
4831
4832 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4833 (Vwindow_persistent_parameters): Do not use Qstate.
4834 Rewrite doc-strings.
34a02f46 4835
1259009a 48362012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4837
4838 * character.c (char_width): New function.
70d4fdf6
GM
4839 (Fchar_width, c_string_width, lisp_string_width):
4840 Use char_width (Bug#9496).
25ed9e61 4841
6a6ee00d
MR
48422012-01-16 Martin Rudalics <rudalics@gmx.at>
4843
4844 * window.c (Vwindow_persistent_parameters): New variable.
4845 (Fset_window_configuration, save_window_save): Handle persistent
4846 window parameters.
4847
c85efaf7
EZ
48482012-01-14 Eli Zaretskii <eliz@gnu.org>
4849
4850 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4851 thrashing the stack of the thread. (Bug#9087)
4852
5944709e
PE
48532012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4854
4855 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4856
e71f5d99
EZ
48572012-01-11 Eli Zaretskii <eliz@gnu.org>
4858
4859 * xdisp.c (rows_from_pos_range): Handle the case where the
4860 highlight ends on a newline. (Bug#10464)
4861 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4862 he end column for display of highlight that ends on a newline
4863 before a R2L line.
4864
ce316182
GM
48652012-01-11 Glenn Morris <rgm@gnu.org>
4866
4867 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4868 from load-path also when installation-directory is nil. (Bug#10208)
4869
5b43da69
GM
48702012-01-10 Glenn Morris <rgm@gnu.org>
4871
74cc8ff9
GM
4872 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4873
7d8d6e4e
GM
4874 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4875 Update template values to be closer to their typical values these days.
5b43da69 4876
a0db8d43
EZ
48772012-01-09 Eli Zaretskii <eliz@gnu.org>
4878
4879 * xdisp.c (rows_from_pos_range): Accept additional argument
4880 DISP_STRING, and accept any glyph in a row whose object is that
4881 string as eligible for mouse highlight. Fixes mouse highlight of
4882 display strings from overlays. (Bug#10464)
4883
9a0115ab 48842012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4885
b9110d6a 4886 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4887 * fileio.c (auto_saving_dir_umask): New static var.
4888 (Fmake_directory_internal): Use it.
4889 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4890 creating the directory. The old code temporarily assigns
4891 too-generous permissions to the directory.
4892 (do_auto_save_eh): Clear it.
b9110d6a 4893 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4894 that the var is always cleared.
4895
6c1bd3f3
EZ
48962012-01-07 Eli Zaretskii <eliz@gnu.org>
4897
4898 * search.c (scan_buffer): Pass character positions to
4899 know_region_cache, not byte positions. (Bug#6540)
4900
069d2b50
L
49012012-01-07 LynX <_LynX@bk.ru> (tiny change)
4902
4903 * w32.c (sys_rename): Report EXDEV when rename of a directory
4904 fails because the target is on another logical disk. (Bug#10284)
4905
75bf0d33
DB
49062012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4907
4908 * xterm.c (x_embed_request_focus): New function.
4909
4910 * xterm.h: Add prototype.
4911
4912 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4913
1c6e5a32
GM
49142012-01-05 Glenn Morris <rgm@gnu.org>
4915
4916 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4917
651e947e
EZ
49182012-01-01 Eli Zaretskii <eliz@gnu.org>
4919
4920 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4921 Load gnutls_transport_set_lowat only if GnuTLS version is below
4922 2.11.1.
4923 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4924 GnuTLS versions below 2.11.1.
4925
3778cdd8
AL
49262011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4927
4928 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4929 to the doc string advising against its use for altering the way
4930 windows are scrolled.
4931
0e5317f7
KH
49322011-12-28 Kenichi Handa <handa@m17n.org>
4933
4934 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4935 coding-system ASCII compatible only when it does not produce BOM
4936 on encoding (Bug#10383).
4937
93d5ca1f
JD
49382011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4939
4940 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4941 can scroll.
4942 (create_and_show_popup_menu): Always use menu_position_func for
4943 Gtk3 (Bug#10361).
4944
ca22b785
AS
49452011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4946
4947 * callint.c (Fcall_interactively): Don't truncate prompt string.
4948
d048e1e6
EZ
49492011-12-23 Eli Zaretskii <eliz@gnu.org>
4950
4951 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4952 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 4953 resumed from there (after widening). (Bug#10360)
d048e1e6 4954
5ccaba1f
JD
49552011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4956
4957 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4958
204ee57f
JD
49592011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4960
b81d40f0
JB
4961 * nsterm.m (x_free_frame_resources):
4962 Release f->output_data.ns->miniimage.
204ee57f
JD
4963 (ns_index_color): Fix indentation. Do not retain
4964 color_table->colors[i].
4965
4966 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4967 before returning.
4968
4969 * nsfns.m (x_set_background_color): Assign return value from
4970 ns_index_color to face-background instead of NSColor*.
4971 (ns_implicitly_set_icon_type): Fix indentation.
4972 Change assignment in for loop to comparison.
4973
4974 * emacs.c (ns_pool): New variable.
4975 (main): Assign ns_pool.
4976 (Fkill_emacs): Call ns_release_autorelease_pool.
4977
4978 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4979 autorelease fdesc, release fdAttrs and tdict.
4980 (ns_get_covering_families): Release charset.
4981 (ns_findfonts): Release NSFontDescriptor created with new.
4982 (ns_uni_to_glyphs): Fix indentation.
4983 (setString): Release attrStr before assigning new value.
4984
c803b2b7
JD
49852011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4986
678f4426
JD
4987 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4988 and NS_IMPL_COCOA.
4989 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4990 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4991
cd394be1 49922011-12-18 David Reitter <reitter@cmu.edu>
678f4426 4993
5fecd5fc
JD
4994 * nsterm.m (ns_term_init): Subscribe for notifications
4995 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4996 to method trackingNotification in EmacsMenu.
4997
4998 * nsmenu.m (trackingMenu): New variable.
3771cb17 4999 (trackingNotification): New method (from Aquamacs).
5fecd5fc 5000 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 5001 from Aquamacs (Bug#7030).
678f4426
JD
5002
50032011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 5004
c803b2b7
JD
5005 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
5006 (symbol_to_nsstring): Fix indentation.
5007 (ns_symbol_to_pb): New function.
cae07000
SM
5008 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
5009 (Fns_rotate_cut_buffers_internal): Remove.
5010 (Fns_store_selection_internal): Rename from
c803b2b7
JD
5011 Fns_store_cut_buffer_internal.
5012 (ns_get_foreign_selection, Fx_own_selection_internal)
5013 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
5014 (Fns_get_selection_internal, Fns_store_selection_internal):
5015 Use ns_symbol_to_pb and check if return value is nil.
5016 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
5017 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
5018 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
5019 renamed to Sns_store_selection_internal.
5020 (ns_handle_selection_request): Move code to Fx_own_selection_internal
5021 and remove this function.
5022 (ns_handle_selection_clear): Remove, never used.
5023 (Fx_own_selection_internal): Move code from ns_handle_selection_request
5024 here.
5025
e1b01a3a
KB
50262011-12-17 Ken Brown <kbrown@cornell.edu>
5027
5028 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
5029 GID is unknown (Bug#10257).
5030
2adb6e85
PE
50312011-12-17 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
5034 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
5035 which caused a build failure on GNU/Linux IA-64. This problem was
5036 introduced by my 2011-10-07 patch.
5037
d1d7b339
JL
50382011-12-15 Juri Linkov <juri@jurta.org>
5039
5040 * image.c (imagemagick_error): New function. (Bug#10112)
5041 (imagemagick_load_image): Comment out `MagickSetResolution' call.
5042 Use `imagemagick_error' where ImageMagick functions return
5043 `MagickFalse'.
5044 (Fimagemagick_types): Add `Fnreverse' to return the list in the
5045 proper order.
5046
100d5755
KH
50472011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5048
5049 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
5050 fill background (Bug#8992).
5051
454592a6
MR
50522011-12-13 Martin Rudalics <rudalics@gmx.at>
5053
5054 * window.c (Vwindow_combination_resize)
5055 (Vwindow_combination_limit): Use t instead of non-nil in
5056 doc-strings.
61d4b438
MR
5057 (Vrecenter_redisplay): Add first sentence of doc-string on
5058 separate line.
53524d93 5059 (Frecenter): Fix doc-string typo.
454592a6 5060
3633e3aa
KH
50612011-12-11 Kenichi Handa <handa@m17n.org>
5062
5063 * coding.c (Funencodable_char_position): Pay attention to the
5064 buffer text relocation (Bug#9389).
5065
7b9d523a 50662011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 5067
7b9d523a
JD
5068 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
5069 gtk_init (Bug#10100).
5070
b73189c6
EZ
50712011-12-10 Eli Zaretskii <eliz@gnu.org>
5072
5073 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
5074 IT->string is nil. (Bug#10263)
5075
f7dfe5d6
JD
50762011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5077
83faebb4
JD
5078 * nsterm.h (x_free_frame_resources): Declare.
5079
f7dfe5d6
JD
5080 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
5081 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
5082
5083 * nsterm.h (ns_get_defaults_value): Declare.
5084
5085 * nsterm.m (ns_default): Call ns_get_defaults_value.
5086
7cd4e72c
EZ
50872011-12-09 Eli Zaretskii <eliz@gnu.org>
5088
5089 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
5090 (Bug#10170)
5091
b34d7317
YM
50922011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5093
5094 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
5095 that where the value of an _OBJC_* symbol points to is in the .bss
5096 section (Bug#10240).
5097
76470ad1
KH
50982011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5099
5100 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 5101 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 5102
745fff94
KH
51032011-12-08 Kenichi Handa <handa@m17n.org>
5104
5105 * ftfont.c (get_adstyle_property): Fix previous change
5106 (Bug#10233).
5107
6e44397c
JB
51082011-12-07 Juanma Barranquero <lekktu@gmail.com>
5109
5110 * w32.c (init_environment): If no_site_lisp, remove site-lisp
5111 dirs from the default value of EMACSLOADPATH (bug#10208).
5112
7efa6272
GM
51132011-12-07 Glenn Morris <rgm@gnu.org>
5114
5115 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
5116 installation and source directories as well. (Bug#10208)
5117
f6fc4d87
CY
51182011-12-06 Chong Yidong <cyd@gnu.org>
5119
5120 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
5121
2bf26180
GM
51222011-12-06 Glenn Morris <rgm@gnu.org>
5123
5124 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
5125 as an error, not just -1. (Bug#10217)
5126
3a6ad4f0
CY
51272011-12-05 Chong Yidong <cyd@gnu.org>
5128
5129 * keyboard.c (process_special_events): New function.
5130 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5131
75a3b399
PE
51322011-12-05 Paul Eggert <eggert@cs.ucla.edu>
5133
5134 * coding.c (encode_designation_at_bol): Don't use uninitialized
5135 local variable (Bug#9318).
5136
c3c9e25e
KH
51372011-12-05 Kenichi Handa <handa@m17n.org>
5138
5139 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
5140 return Qnil (Bug#8046, Bug#10193).
5141
5eb05ea3
KH
51422011-12-05 Kenichi Handa <handa@m17n.org>
5143
5144 * coding.c (encode_designation_at_bol): New args charbuf_end and
5145 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
5146 (coding_set_source): Return how many bytes coding->source was
5147 relocated.
5148 (coding_set_destination): Return how many bytes
5149 coding->destination was relocated.
5150 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 5151 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
5152
51532011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5154
5155 * coding.c (CODING_CHAR_CHARSET_P): New macro.
5156 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
5157 macro (Bug#9318).
5158
51592011-12-05 Andreas Schwab <schwab@linux-m68k.org>
5160
5161 The following changes are to fix Bug#9318.
5162
a79703f5 5163 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
5164 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
5165 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 5166 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 5167
7dbda6df
JB
51682011-12-05 Juanma Barranquero <lekktu@gmail.com>
5169
5170 * lisp.h (process_quit_flag): Fix external declaration.
5171
6d5eb5b0
SM
51722011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
5173
5174 Don't macro-inline non-performance-critical code.
5175 * eval.c (process_quit_flag): New function.
5176 * lisp.h (QUIT): Use it.
5177
a0c3fad0
JD
51782011-12-04 Jan Djärv <jan.h.d@swipnet.se>
5179
5180 * nsfns.m (get_geometry_from_preferences): New function.
5181 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
5182
6c07aac2
AS
51832011-12-04 Andreas Schwab <schwab@linux-m68k.org>
5184
5185 * emacs.c (Qkill_emacs): Define.
5186 (syms_of_emacs): Initialize it.
5187 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
5188 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
5189 (quit_throw_to_read_char): Add parameter `from_signal'.
5190 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
5191 * lisp.h (QUIT): Call Fkill_emacs if requested.
5192
c052ead4
JD
51932011-12-03 Jan Djärv <jan.h.d@swipnet.se>
5194
5195 * widget.c (update_wm_hints): Return if wmshell is null.
5196 (widget_update_wm_size_hints): New function.
5197
5198 * widget.h (widget_update_wm_size_hints): Declare.
5199
5200 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
5201 widget_update_wm_size_hints (Bug#10104).
5202
9e49252b
EZ
52032011-12-03 Eli Zaretskii <eliz@gnu.org>
5204
5205 * xdisp.c (handle_invisible_prop): If the invisible text ends just
5206 before a newline, prepare the bidi iterator for consuming the
5207 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 5208 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 5209
02b16839
JL
52102011-12-02 Juri Linkov <juri@jurta.org>
5211
5212 * search.c (Fword_search_regexp): New Lisp function created from
5213 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
5214 (Fword_search_backward, Fword_search_forward)
5215 (Fword_search_backward_lax, Fword_search_forward_lax):
5216 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
5217 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
5218
0068070e
SM
52192011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
5220
5221 * fileio.c (Finsert_file_contents): Move after-change-function call
5222 to before the "handled:" label, since all "goto handled" appear in
5223 cases where the *-change-functions have already been properly called
5224 (bug#10117).
5225
3360a3fc
AS
52262011-12-01 Andreas Schwab <schwab@linux-m68k.org>
5227
5228 * keyboard.c (interrupt_signal): Don't call kill-emacs when
5229 waiting for input. (Bug#10169)
5230
73d6c093
EZ
52312011-11-30 Eli Zaretskii <eliz@gnu.org>
5232
5233 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
5234 verifies glyph row's hash code--we have just reallocated the
5235 glyphs, so their contents can be complete garbage. (Bug#10164)
5236
febe6bea
JB
52372011-11-30 Juanma Barranquero <lekktu@gmail.com>
5238
5239 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5240
801a4313
EZ
52412011-11-30 Eli Zaretskii <eliz@gnu.org>
5242
5243 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5244 attributes are tested _before_ calling verify_row_hash, to protect
5245 against GCC re-ordering of the tests. (Bug#10164)
5246
2b56b87e
JD
52472011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5248
5249 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5250
5251 * xterm.c (handle_one_xevent): Only set async_visible and friends
5252 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 5253 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
5254 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5255
dbf31225
PE
52562011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5257
5258 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5259 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5260 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5261 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5262 All uses changed to use GCPRO1 etc.
5263 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5264 Revert to old implementation (i.e., before 2011-03-11).
5265
1305621b
YM
52662011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5267
5268 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5269 of scroll runs so as to avoid assigning disabled bogus rows and
5270 unnecessary graphics copy operations.
5271
8c9afb46
EZ
52722011-11-27 Eli Zaretskii <eliz@gnu.org>
5273
5274 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5275 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5276 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5277 (malloc, free, realloc, calloc): Redirect to e_* only when
5278 compiling Emacs.
5279
5280 * lisp.h (GCTYPEBITS): Move before first use.
5281 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5282 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5283 this macro definition.
5284
5285 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5286 _MSC_VER.
5287
54e9e3bf
JD
52882011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5289
6d5eb5b0
SM
5290 * gtkutil.c (xg_create_frame_widgets):
5291 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
5292 present with Gtk+ 2.0.
5293
83aca1cb
PE
52942011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5295
5296 * fileio.c (Finsert_file_contents): Undo previous change; see
5297 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5298
5b76caa4
PE
52992011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5300
5301 Rename locals to avoid shadowing.
5302 * fileio.c (Finsert_file_contents):
5303 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5304 * process.c (wait_reading_process_output):
5305 Rename inner 'proc' to 'p' to avoid shadowing.
5306 Indent for consistency with usual Emacs style.
5307
8c535114
EZ
53082011-11-25 Eli Zaretskii <eliz@gnu.org>
5309
5310 * xdisp.c (redisplay_window): If cursor row is not fully visible
5311 after recentering, and scroll-conservatively is set to a large
5312 number, scroll window by a few more lines to make the cursor fully
5313 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
5314 (start_display): Don't move to the next line if the display should
5315 start at a newline that is part of a display vector or an overlay
5316 string. (Bug#10119)
8c535114 5317
fa4fdb5c
JL
53182011-11-24 Juri Linkov <juri@jurta.org>
5319
5320 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
5321 after the `MagickPingImage' call. (Bug#10112)
5322
90ec88df
CY
53232011-11-23 Chong Yidong <cyd@gnu.org>
5324
5325 * window.c (Fcoordinates_in_window_p): Accept only live windows.
5326
56e2e794
MR
53272011-11-23 Martin Rudalics <rudalics@gmx.at>
5328
5329 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5330 making another buffer current. (Bug#10114)
5331
b6e64c41
GM
53322011-11-23 Glenn Morris <rgm@gnu.org>
5333
5334 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5335
6b21de18
CY
53362011-11-23 Chong Yidong <cyd@gnu.org>
5337
5338 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5339 using it (Bug#5984).
5340
b12cd789
EZ
53412011-11-22 Eli Zaretskii <eliz@gnu.org>
5342
5343 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5344 and header-lines, as they don't have one computed for them.
5345 (Bug#10098)
5346
5347 * .gdbinit (prow): Make displayed values more self-explaining.
5348 Add row's hash code.
5349
261b6fd4
LMI
53502011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5351
5352 * process.c (wait_reading_process_output): Fix asynchrounous
5353 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5354 (wait_reading_process_output): Add comment and URL.
261b6fd4 5355
e7cfd277
JD
53562011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5357
5358 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5359
a9b9b7f5
CY
53602011-11-21 Chong Yidong <cyd@gnu.org>
5361
5362 * window.c (Fnext_window, Fprevious_window): Doc fix.
5363
b0d15b4f
SM
53642011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5365
5366 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5367
fe7a3057
JB
53682011-11-20 Juanma Barranquero <lekktu@gmail.com>
5369
5370 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5371
d2999b1a
MR
53722011-11-20 Martin Rudalics <rudalics@gmx.at>
5373
5374 * window.c (Fset_window_combination_limit): Rename argument
5375 STATUS to LIMIT.
5376 (Vwindow_combination_limit): Remove "status" from doc-string.
5377
d5ff9cd0
AS
53782011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5379
5380 * m/ibms390.h: Remove.
5381 * m/ibms390x.h: Don't include "ibms390.h".
5382
a5bb9bd3
SM
53832011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5384
5385 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5386 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5387
cd1181db
JB
53882011-11-20 Juanma Barranquero <lekktu@gmail.com>
5389
5390 * casetab.c (Fset_case_table):
5391 * charset.c (Fcharset_after): Fix typos.
5392
615a3b8d 53932011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5394
17e845af
PE
5395 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5396 Otherwise, valgrind does not work on some platforms.
5397 Problem reported by Andreas Schwab in
6a0bf43d
PE
5398 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5399 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5400 is set, removing the need for VIRT_ADDRESS_VARIES.
5401 (PURE_P): Use a more-efficient implementation that needs just one
5402 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5403 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5404 to 4 (xorl, subq, cmpq, setbe).
5405 * alloc.c (pure): Always extern now, since that's the
5406 VIRT_ADDR_VARIES behavior.
5407 (PURE_POINTER_P): Use a single comparison, not two, for
5408 consistency with the new puresize.h.
5409 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5410 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5411 Remove VIRT_ADDR_VARIES no longer needed.
5412
f8fe6f96
EZ
54132011-11-19 Eli Zaretskii <eliz@gnu.org>
5414
5415 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5416 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5417 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5418 behave as if the cursor position were at the window margin.
5419
5420 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5421 and the cursor position is out of bounds, behave as if the cursor
5422 position were at the window margin. (Bug#10075)
5423
df05a53c
CY
54242011-11-18 Chong Yidong <cyd@gnu.org>
5425
5426 * window.c (Fwindow_combination_limit): Make first argument
5427 non-optional, since it is meaningless for live windows like the
5428 selected window.
61ccba97 5429
2071918e
DA
54302011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5431
5432 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5433
b50a28de
SM
54342011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5435
5436 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5437 (graft_intervals_into_buffer): Simplify.
5438
015137db
EZ
54392011-11-18 Eli Zaretskii <eliz@gnu.org>
5440
5441 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5442 hash values of the two rows.
5443 (copy_row_except_pointers): Preserve the used[] arrays and the
5444 hash values of the two rows. (Bug#10035)
68c95424 5445 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5446
5447 * xdisp.c (row_hash): New function, body extracted from
5448 compute_line_metrics.
5449 (compute_line_metrics): Call row_hash, instead of computing the
5450 hash code inline.
5451
5452 * dispnew.c (verify_row_hash): Call row_hash for computing the
5453 hash code of a row, instead of duplicating code from xdisp.c.
5454
5455 * dispextern.h (row_hash): Add prototype.
5456
a2addb04
TH
54572011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5458
5459 * frame.c (delete_frame): Don't delete the terminal when the last
5460 X frame is closed if emacs is built with GTK toolkit.
5461
df85d315
JB
54622011-11-17 Juanma Barranquero <lekktu@gmail.com>
5463
5464 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5465
a0c2d0ae
MR
54662011-11-17 Martin Rudalics <rudalics@gmx.at>
5467
5468 * window.c (Vwindow_splits): Rename to
5469 Vwindow_combination_resize. Suggested by Juri Linkov.
5470 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5471 of Vwindow_splits.
5472
58179cce
JB
54732011-11-16 Juanma Barranquero <lekktu@gmail.com>
5474
7877f373
JB
5475 * nsfns.m (Fns_font_name):
5476 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5477
b6f67890
MR
54782011-11-16 Martin Rudalics <rudalics@gmx.at>
5479
5480 * window.h (window): Rename slot "nest" to "combination_limit".
5481 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5482 (Fset_window_nest): Rename to Fset_window_combination_limit.
5483 (Vwindow_nest): Rename to Vwindow_combination_limit.
5484 (recombine_windows, make_parent_window, make_window)
5485 (Fsplit_window_internal, saved_window)
5486 (Fset_window_configuration, save_window_save): Rename all
5487 occurrences of window_nest to window_combination_limit.
5488
c7015153
JB
54892011-11-15 Juanma Barranquero <lekktu@gmail.com>
5490
5491 * image.c (imagemagick_load_image): Fix typo.
5492
322ad6ec
EZ
54932011-11-14 Eli Zaretskii <eliz@gnu.org>
5494
5495 * xdisp.c (display_line): Move the call to
5496 highlight_trailing_whitespace before the call to
5497 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5498 faces of all the glyphs to compute ROW's hash value.
5499 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5500
f067b8ec
JB
55012011-11-14 Juanma Barranquero <lekktu@gmail.com>
5502
5503 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5504 just return (bug#10044).
5505
1e5b2111
EZ
55062011-11-12 Eli Zaretskii <eliz@gnu.org>
5507
7ef3cbd5
EZ
5508 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5509 with user-defined heap size. Bump the default size of the temacs
5510 heap to 27MB, to avoid memory warning when running temacs.
5511 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5512
1e5b2111
EZ
5513 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5514 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5515 (verify_row_hash) [XASSERTS]: New function.
5516 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5517 that the hash value of glyph rows is correct.
1e5b2111 5518
89d61221
MR
55192011-11-12 Martin Rudalics <rudalics@gmx.at>
5520
5521 * window.h (window): Remove splits slot.
5522 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5523 (Fdelete_other_windows_internal, make_parent_window)
5524 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5525 (Fset_window_configuration, save_window_save): Don't deal with
5526 split status of windows.
5527 (saved_window): Remove splits slot.
5528 (Vwindow_splits): Rewrite doc-string.
5529
97f18cc8
JD
55302011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5531
5532 * xfns.c (unwind_create_frame):
5533 * nsfns.m (unwind_create_frame):
5534 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5535 Vframe_list (Bug#9999).
5536
22a648b4
DA
55372011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5538
0b381c7e 5539 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5540
659afede
KH
55412011-11-11 Kenichi Handa <handa@m17n.org>
5542
5543 * callproc.c (Fcall_process): Set the member dst_multibyte of
5544 process_coding.
5545
9ac0394b
KH
55462011-11-11 Johan Bockgård <bojohan@gnu.org>
5547
5548 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5549 avoid a crash (bug#9496).
5550
2fbdc249
CY
55512011-11-09 Chong Yidong <cyd@gnu.org>
5552
5553 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5554 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5555
ac6b1f81
PE
55562011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5557
5558 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5559
09db192c
PE
55602011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5561
5562 Avoid some portability problems by eschewing 'extern inline' functions.
5563 The trivial performance wins aren't worth the portability hassles; see
5564 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5565 et seq.
5566 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5567 (window_box_width, window_box_left, window_box_left_offset)
5568 (window_box_right, window_box_right_offset): Undo previous change,
5569 by removing the "extern"s.
5570 * intervals.c (adjust_intervals_for_insertion)
5571 (adjust_intervals_for_deletion): Undo previous change,
5572 making these static again.
5573 (offset_intervals, temp_set_point_both, temp_set_point)
5574 (copy_intervals_to_string): No longer inline.
5575 * xdisp.c (window_text_bottom_y, window_box_width)
5576 (window_box_height, window_box_left_offset)
5577 (window_box_right_offset, window_box_left, window_box_right)
5578 (window_box): No longer inline.
5579
105216ed
CY
55802011-11-08 Chong Yidong <cyd@gnu.org>
5581
5582 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5583 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5584 Signal an error if not a live window.
105216ed
CY
5585 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5586 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5587
ae9e237f
JB
55882011-11-07 Juanma Barranquero <lekktu@gmail.com>
5589
5590 * lisp.h (syms_of_abbrev): Remove declaration.
5591 Reported by CHENG Gao <chenggao@royau.me>.
5592
c7aa8333
EZ
55932011-11-07 Eli Zaretskii <eliz@gnu.org>
5594
5595 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5596 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5597 of temacs in GUI mode.
5598
be7f5545
MR
55992011-11-07 Martin Rudalics <rudalics@gmx.at>
5600
5601 * window.h: Declare delete_all_child_windows instead of
5602 delete_all_subwindows.
5603 * window.c (Fwindow_nest, Fset_window_nest)
5604 (Fset_window_new_total, Fset_window_new_normal)
5605 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5606 (delete_all_subwindows): Rename to delete_all_child_windows.
5607 (Fdelete_other_windows_internal, Fset_window_configuration):
5608 Call delete_all_child_windows instead of delete_all_subwindows.
5609 * frame.c (delete_frame): Call delete_all_child_windows instead
5610 of delete_all_subwindows.
5611
ca78dc43
PE
56122011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5613
5614 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5615 This is also needed for porting to any host where GC_MARK_STACK is
5616 not GC_MAKE_GCPROS_NOOPS.
5617 (which_symbols): Use it.
5618
a0241d01
KH
56192011-11-07 Kenichi Handa <handa@m17n.org>
5620
5621 * coding.c (coding_set_destination): Check coding->src_pos only
5622 when coding->src_object is a buffer (bug#9910).
5623
5624 * process.c (send_process): Set the member src_multibyte of coding
5625 to 0 (bug#9911) when sending a unibyte text.
5626
5627 * callproc.c (Fcall_process): Set the member src_multibyte of
5628 process_coding to 0 (bug#9912).
5629
a64bfdfa 56302011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5631
5632 * xmenu.c (cleanup_widget_value_tree): New function.
5633 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5634 calling free_menubar_widget_value_tree directly (Bug#9830).
5635
cb41b32a
PE
56362011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5637
5638 Fix some portability problems with 'inline'.
5639 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5640 (window_box_width, window_box_left, window_box_left_offset)
5641 (window_box_right, window_box_right_offset): Declare extern.
5642 Otherwise, these inline functions do not conform to C99 and
5643 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5644 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5645 * intervals.c (adjust_intervals_for_insertion)
5646 (adjust_intervals_for_deletion): Now extern, because otherwise the
5647 extern inline functions 'offset_intervals' couldn't refer to it.
5648 (static_offset_intervals): Remove.
5649 (offset_intervals): Rewrite using the old contents of
5650 static_offset_intervals. The old version didn't conform to C99
5651 because an extern inline function contained a reference to an
5652 identifier with static linkage.
5653
b7041366
AS
56542011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5655
5656 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5657 GC.
5658
88a37c4d
EZ
56592011-11-06 Eli Zaretskii <eliz@gnu.org>
5660
5661 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5662 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5663 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5664 return Qleft_to_right.
5665
49745b39
CY
56662011-11-06 Chong Yidong <cyd@gnu.org>
5667
5668 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5669 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5670 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5671 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5672 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5673 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5674 (Fwindow_vscroll): Doc fix.
5675 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5676 argument, since it makes no sense to pass a live window and for
5677 consistency with window-child.
5678
1f05cd82
CS
56792011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5680
5681 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5682 support MSVC.
5683
22610910
JR
56842011-11-05 Jason Rumney <jasonr@gnu.org>
5685
5686 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5687 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5688 fonts (Bug#6029).
5689 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5690 bitwise arithmetic preventing use of unicode-sip and non-truetype
5691 opentype fonts.
5692
a06776b2
EZ
56932011-11-05 Eli Zaretskii <eliz@gnu.org>
5694
3ad924ba
EZ
5695 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5696 "emacs"-only part.
5697
a06776b2
EZ
5698 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5699 initialization code to keep similarity to xfns.c after changes
5700 from 2011-11-05.
5701
c9e7db78
JD
57022011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5703
a97f8f3f
JD
5704 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5705 (unwind_create_frame): New function (Bug#9943).
5706 (Fx_create_frame): Restructure code to be more similar to the one in
5707 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5708 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5709 Move terminal->reference_count++ just before making the frame official
5710 (Bug#9943).
5711
5712 * nsterm.m (x_free_frame_resources): New function.
5713 (x_destroy_window): Move code to x_free_frame_resources.
5714
c9e7db78 5715 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5716 (Fx_create_frame, x_create_tip_frame):
5717 Move terminal->reference_count++ just before making the frame
75f1671a 5718 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5719 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5720
a6fc3b5c
EZ
57212011-11-05 Eli Zaretskii <eliz@gnu.org>
5722
5723 Support MSVC build with newer versions of Visual Studio.
5724 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5725 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5726 nt/gmake.defs.
5727
5728 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5729 which are not supported by MSVC.
5730 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5731 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5732 bitfields.
5733 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5734 types in bitfields.
5735 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5736
5737 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5738
58179cce 57392011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5740
5741 Support MSVC build with newer versions of Visual Studio.
5742 * w32.c: Don't include w32api.h for MSVC.
5743 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5744
5745 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5746 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5747 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5748 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5749 e_* cousins.
5750 (alloca) [_MSC_VER]: Define to _alloca.
5751
5752 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5753
5754 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5755
a58c13ed
EZ
57562011-11-04 Eli Zaretskii <eliz@gnu.org>
5757
5758 * xdisp.c (note_mouse_highlight): If either of
5759 previous/next-single-property-change returns nil, treat that as
5760 the beginning or the end of the buffer. (Bug#9955)
5761
fe0b6370
JD
57622011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5763
a58c13ed 5764 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5765 label is not null (Bug#9951).
5766 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5767 may be NULL.
5768
89bd5ee1
EZ
57692011-11-04 Eli Zaretskii <eliz@gnu.org>
5770
5771 * window.c (Fwindow_body_size): Mention in the doc string that the
5772 return value is in frame's canonical units. (Bug#9949)
5773
84c3edb9
EZ
57742011-11-03 Eli Zaretskii <eliz@gnu.org>
5775
4e2fb5c7
EZ
5776 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5777
84c3edb9 5778 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5779 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5780 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5781
bc17a887
EZ
57822011-11-01 Eli Zaretskii <eliz@gnu.org>
5783
5784 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5785 Don't stop backward scan on the continuation glyph, even though
5786 its CHARPOS is positive.
6d5eb5b0
SM
5787 (mouse_face_from_buffer_pos, note_mouse_highlight):
5788 Rename cover_string to disp_string.
bc17a887 5789
4ee88440
MR
57902011-11-01 Martin Rudalics <rudalics@gmx.at>
5791
5792 * window.c (temp_output_buffer_show): Don't use
5793 Vtemp_buffer_show_specifiers.
5794 (Vtemp_buffer_show_specifiers): Remove unused variable.
5795
c2ff3c02
EZ
57962011-10-30 Eli Zaretskii <eliz@gnu.org>
5797
5798 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5799 past the beginning of the current glyph matrix.
5800
58179cce 58012011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5802
5803 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5804 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5805 HAVE_GTK3 (Bug#9869).
b77a6a7f 5806
3b574623
JD
5807 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5808 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5809
b77a6a7f
JD
5810 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5811
5812 * xterm.c: Declare x_handle_net_wm_state to return int.
5813 (handle_one_xevent): Check if we are iconified but don't have
5814 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5815 (get_current_wm_state): Return non-zero if not hidden,
5816 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5817 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5818 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5819 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5820
196e41e4
PE
58212011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5824 so that this new function doesn't get optimized away by a
5825 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5826
021f2e1a
AS
58272011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5828
5829 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5830
8b058d44
EZ
58312011-10-29 Eli Zaretskii <eliz@gnu.org>
5832
5833 Fix the `xbytecode' command.
5834 * .gdbinit (xprintbytestr): New command.
b50a28de 5835 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5836 (xbytecode): Print the byte-code string as well.
5837
4452fb80
EZ
58382011-10-29 Kim Storm <storm@cua.dk>
5839
8b058d44
EZ
5840 * alloc.c (which_symbols): New function.
5841
21b72067
AS
58422011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5843
5844 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5845 line. (Bug#9903)
5846
83ed7b5c
GM
58472011-10-29 Glenn Morris <rgm@gnu.org>
5848
5849 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5850 Not clear what it was for, and it causes various bugs. (Bug#9839)
5851
5a7a728b
EZ
58522011-10-28 Eli Zaretskii <eliz@gnu.org>
5853
5854 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5855 possible random value that matches one of those tested as
5856 condition to clear the mouse face.
5857
d3d0842f
CY
58582011-10-28 Chong Yidong <cyd@gnu.org>
5859
5860 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5861
31b39d13
DN
58622011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5863
5864 * window.c (make_window): Initialize phys_cursor_on_p.
5865
9aba6043
SM
58662011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5867
5868 * lisp.h (struct Lisp_Symbol): Update comments.
5869
c20992f4
JB
58702011-10-28 Juanma Barranquero <lekktu@gmail.com>
5871
5872 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5873
db4f02f2
EZ
58742011-10-28 Eli Zaretskii <eliz@gnu.org>
5875
5876 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5877 <oslsachem@gmail.com> for helping to debug this.
5878
5879 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5880 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5881 (g_b_init_get_glyph_outline_w): New static variables.
5882 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5883 (GetGlyphOutlineW_Proc): New typedefs.
5884 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5885 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5886 New functions.
5887 (w32font_open_internal, compute_metrics):
5888 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5889 instead of calling the "wide" APIs directly.
5890
5891 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5892
5893 * w32.h (syms_of_w32font): Add prototype.
5894
87e68db4
JB
58952011-10-27 Juanma Barranquero <lekktu@gmail.com>
5896
5897 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5898 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5899 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5900 (Fmove_to_window_line): Doc fix.
5901
435c1d67
CY
59022011-10-27 Chong Yidong <cyd@gnu.org>
5903
5904 * process.c (make_process): Set gnutls_state to NULL.
5905
5906 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5907 non-NULL, regardless of GNUTLS_INITSTAGE.
5908 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5909 an error. Set process slots as soon as we allocate them.
5910
5911 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5912
9c6c6f49
CY
59132011-10-27 Chong Yidong <cyd@gnu.org>
5914
9aba6043
SM
5915 * gnutls.c (emacs_gnutls_deinit): New function.
5916 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5917 (Fgnutls_deinit, Fgnutls_boot): Use it.
5918
5919 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5920 (deactivate_process): Call emacs_gnutls_deinit.
5921
657d08d3
JB
59222011-10-27 Juanma Barranquero <lekktu@gmail.com>
5923
5924 * image.c (x_create_x_image_and_pixmap):
5925 * w32.c (sys_rename, w32_delayed_load):
5926 * w32font.c (fill_in_logfont):
5927 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5928
5430d399
JB
59292011-10-26 Juanma Barranquero <lekktu@gmail.com>
5930
5931 * w32fns.c (w32_default_color_map): New function,
5932 extracted from Fw32_default_color_map.
a7ef684b 5933 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5934
fe0055fa
PE
59352011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5936
5937 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5938
e6346438
SM
59392011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5940
5941 * keyboard.c (test_undefined): New function (bug#9751).
5942 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5943
e112cc37
ET
59442011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5945
5946 * sysdep.c (init_sys_modes): Fix the check for the controlling
5947 terminal (Bug#6649).
5948
7b5d6677
EZ
59492011-10-20 Eli Zaretskii <eliz@gnu.org>
5950
5951 * dispextern.h (struct bidi_it): New member next_en_type.
5952
5953 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5954 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5955 current character, check also for next_en_type being WEAK_EN.
5956 (bidi_resolve_weak): Don't enter the expensive loop if the current
5957 position is before next_en_pos. Record the bidi type of the first
5958 non-ET, non-BN character we find, in addition to its position.
5959 (bidi_level_of_next_char): Invalidate next_en_type when
5960 next_en_pos is over-stepped.
5961
7da0b018
PE
59622011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5963
5964 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5965 * editfns.c: Rewrite current-time-zone so that it invokes
5966 the equivalent of (format-time-string "%Z") to get the time zone name.
5967 This fixes a bug when the time zone name contains characters that
5968 need converting from the system time locale to Emacs internal format.
5969 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5970 that patch fixed format-time-string to do the conversion, but
5971 I forgot to fix current-time-zone.
5972 (format_time_string): New function, containing most of
5973 what Fformat_time_string used to contain.
5974 (Fformat_time_string): Rewrite in terms of format_time_string.
5975 This doesn't change this function's behavior.
5976 (current-time-zone): Rewrite to use format_time_string.
5977 This fixes the bug reported by Michael Schierl in
5978 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5979 Jason Rumney's 2007-06-07 change worked around this bug, but
5980 didn't fix it.
5981 * systime.h (tzname, timezone): Remove no-longer-used declarations.
5982
8547b010
EZ
59832011-10-19 Eli Zaretskii <eliz@gnu.org>
5984
5985 * xdisp.c (start_display): If the character at POS is displayed
5986 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
5987 (try_window_reusing_current_matrix): If a line ends in a display
5988 vector or the next line starts in a display vector, continue
5989 redrawing the window even though the character position of
5990 start_row was reached.
8547b010
EZ
5991 (Bug#9771, part 2)
5992
4e948d15
CY
59932011-10-18 Chong Yidong <cyd@gnu.org>
5994
5995 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5996 with nobreak-char-display too.
5997
4787455f
EZ
59982011-10-18 Eli Zaretskii <eliz@gnu.org>
5999
6000 Fix part 3 of bug#9771.
6001 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
6002 (bidi_resolve_neutral): Don't enter the expensive loop looking for
6003 non-neutral characters if the current character is a paragraph
6004 separator (a.k.a. Newline). This avoids running the same
6005 expensive loop twice, once when we consume the preceding newline
6006 and the other time when the line actually needs to be displayed.
6007 Avoid the loop when we see neutrals on the base embedding level
6008 following a character whose directionality is the same as the
6009 paragraph's. This avoids running the expensive loop when a line
6010 ends in a long sequence of neutrals, like control characters.
6011 Add assertion against STRONG_AL type. Slightly rearrange code
6012 that determines the type of a neutral given the first non-neutral
6013 that follows it.
6014 (bidi_level_of_next_char): Set next_en_pos to zero when
6015 invalidating its info.
6016
2c91f553
EZ
60172011-10-17 Eli Zaretskii <eliz@gnu.org>
6018
6019 * xdisp.c (push_display_prop): Determine whether to record string
6020 or buffer position by IT->string, not by IT->method. Allow
6021 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
6022 (move_it_vertically_backward): Don't look for character position
6023 immediately after the newline when in a continuation line.
6024 (Bug#9771, part 1)
2c91f553 6025
c7b08b0d
MR
60262011-10-15 Martin Rudalics <rudalics@gmx.at>
6027
6028 * window.c (coordinates_in_window): Rewrite and delabelize
6029 vertical border check. (Bug#5357) (Bug#9618)
6030
6b02f655
SM
60312011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
6032
6033 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
6034 errors in XSetWindowBorder (bug#9310).
6035
81d40c92
DA
60362011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
6037
6038 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
6039 avoid crash when xmalloc overrun checking is enabled.
6040
d4172c3b
EZ
60412011-10-13 Eli Zaretskii <eliz@gnu.org>
6042
6043 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
6044 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
6045 cursor motion with <left> and <right> arrow keys.
6046
6047 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
6048 some callers set that themselves.
6049
b00eea75
EZ
60502011-10-12 Eli Zaretskii <eliz@gnu.org>
6051
6052 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
6053 display string and the previous row comes from the same string and
6054 is empty. (Bug#9739) (Bug#9738)
6055
8fe012c4
SM
60562011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
6057
6058 * doc.c (get_doc_string): Encode file name (bug#9735).
6059
0074aef2
EZ
60602011-10-12 Eli Zaretskii <eliz@gnu.org>
6061
79beb178
EZ
6062 * bidi.c (bidi_level_of_next_char):
6063 * xdisp.c (get_visually_first_element): Remove old incorrect
6064 comments regarding the Unicode Line Separator character.
6065
0074aef2
EZ
6066 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
6067
6e4b3fbe
DA
60682011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
6069
6070 * alloc.c (Fgc_status): Do not access beyond zombies array
6071 boundary if nzombies > MAX_ZOMBIES.
6072 * alloc.c (dump_zombies): Add missing format specifier.
6073
0324f3af
PE
60742011-10-12 Paul Eggert <eggert@cs.ucla.edu>
6075
b5525cac
PE
6076 * xdisp.c (set_cursor_from_row): Simplify conditionals,
6077 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
6078
0324f3af
PE
6079 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
6080 Some packages use them to denote characters with modifiers.
6081
e9b5f888
AS
60822011-10-11 Andreas Schwab <schwab@linux-m68k.org>
6083
6084 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
6085 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
6086 matching a pp-number. Rename parameter var to var1.
6087
127827c0
SM
60882011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
6089
6090 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
6091
c8fd3bd0
GM
60922011-10-08 Glenn Morris <rgm@gnu.org>
6093
6094 * callint.c (Fcall_interactively): Give a more explicit error for the
6095 'c' case with a non-character input. (Bug#8479)
6096
352ec8ff
EZ
60972011-10-08 Eli Zaretskii <eliz@gnu.org>
6098
03669ccb
EZ
6099 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
6100 lines.
7061c986
EZ
6101 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
6102 lines that are hscrolled on the left.
03669ccb 6103
352ec8ff
EZ
6104 * dispnew.c (buffer_posn_from_coords): Account for a possible
6105 presence of header-line. (Bug#4426)
6106
a66cfb1c
SM
61072011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
6108
6b02f655
SM
6109 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
6110 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 6111
7c5ee88e
PE
61122011-10-07 Paul Eggert <eggert@cs.ucla.edu>
6113
6114 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
6115 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
6116 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
6117 this makes Emacs dump core during garbage collection on rare
6118 occasions. sizeof is obviously inferior to offsetof here, so
6119 stick with offsetof.
6120 (GC_POINTER_ALIGNMENT): New macro.
6121 (mark_memory): Omit 3rd (offset) arg; caller changed.
6122 Don't assume EMACS_INT alignment is the same as pointer alignment.
6123
df1bbe5b
SM
61242011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
6125
6126 * keyboard.c (read_key_sequence_remapped): New var.
6127 (read_key_sequence): Compute remapping in the right buffer.
6128 (command_loop_1): Use read_key_sequence's remapping directly.
6129
51553db6
SM
61302011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6131
32c1fffd
SM
6132 * dired.c (file_name_completion): Don't expand file name.
6133 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
6134 before checking file name handler.
6135
51553db6
SM
6136 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
6137 they've been requested explicitly (bug#9591).
6138
b6bd1599 61392011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
6140
6141 * keymap.c (Fsingle_key_description): Use make_specified_string
6142 instead of build_string to build string from push_key_description.
6143 (Bug#5193)
6144
f701dc2a
PE
61452011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6146
4222c55d
PE
6147 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
6148 This fixes a Y2038 bug on 64-bit hosts.
6149 * buffer.c (reset_buffer):
6150 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
6151 (Fclear_buffer_auto_save_failure):
6152 Use 0, not -1, to represent an unset failure time, since time_t
6153 might not be signed.
6154
f701dc2a
PE
6155 Remove dependency on glibc malloc internals.
6156 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6157 Move back here from lisp.h, but with their new implementations.
6158 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6159 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
6160 * charset.c (charset_table_init): New static var.
6161 (syms_of_charset): Use it instead of xmalloc. This removes a
6162 dependency on glibc malloc internals. See Eli Zaretskii's comment in
6163 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
6164 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6165 Move back to alloc.c.
6166 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6167 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
6168
9ceebf39
JD
61692011-09-30 Jan Djärv <jan.h.d@swipnet.se>
6170
6171 * nsterm.m (windowDidResize): Call x_set_window_size only when
6172 ns_in_resize is true. Otherwise set pixelwidth/height and
6173 call change_frame_size (Bug#9628).
6174
cb993c58
PE
61752011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6176
3930c88b
PE
6177 Port --enable-checking=all to Fedora 14 x86-64.
6178 * charset.c (syms_of_charset): Also account for glibc malloc's
6179 internal overhead when calculating the initial malloc maximum.
6180
cb993c58
PE
6181 Port --enable-checking=all to Fedora 14 x86.
6182 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6183 Move to lisp.h.
6184 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
6185 (overrun_check_realloc, overrun_check_free):
6186 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
6187 That way, xmalloc returns a properly-aligned pointer even if
6188 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
6189 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
6190 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
6191 into account when calculating the initial malloc maximum.
6192 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6193 Move here from alloc.c, so that charset.c can use it too.
6194 Properly align; the old code wasn't right for common 32-bit hosts
6195 when configured with --enable-checking=all.
6196 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6197 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
6198
31bed486
EZ
61992011-09-29 Eli Zaretskii <eliz@gnu.org>
6200
04c70788 6201 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
6202 use EDOM.
6203
fbcaa2f3
EZ
62042011-09-28 Eli Zaretskii <eliz@gnu.org>
6205
6206 * xdisp.c (compute_display_string_end): If there's no display
6207 string at CHARPOS, return -1.
6208
6209 * bidi.c (bidi_fetch_char): When compute_display_string_end
6210 returns a negative value, treat the character as a normal
6211 character not covered by a display string. (Bug#9624)
6212
a239d4e9
JB
62132011-09-28 Juanma Barranquero <lekktu@gmail.com>
6214
6215 * lread.c (Fread_from_string): Fix typo in docstring.
6216
88652fd5
EZ
62172011-09-27 Eli Zaretskii <eliz@gnu.org>
6218
6219 * xdisp.c (handle_invisible_prop): If invisible text ends on a
6220 newline, reseat the iterator instead of bidi-iterating there one
6221 character at a time. (Bug#9610)
32c1fffd
SM
6222 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
6223 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 6224
ed497dd4
AS
62252011-09-27 Andreas Schwab <schwab@linux-m68k.org>
6226
6227 * lread.c (readevalloop): Use correct code for NBSP.
6228 (read1): Likewise. (Bug#9608)
6229
b2bf61aa
MA
62302011-09-25 Michael Albinus <michael.albinus@gmx.de>
6231
6232 * dbusbind.c (Fdbus_register_signal): When service is not
6233 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
6234
32bbb17c
GM
62352011-09-25 Glenn Morris <rgm@gnu.org>
6236
6237 * buffer.c (truncate-lines): Doc fix.
6238
94e0933e
CY
62392011-09-24 Chong Yidong <cyd@stupidchicken.com>
6240
6241 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6242 (Fset_window_next_buffers): Doc fix.
6243
cddde921
GM
62442011-09-24 Glenn Morris <rgm@gnu.org>
6245
6246 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6247
1260aef1
PE
62482011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6249
25b4bfa0
PE
6250 Fix minor problems found by static checking.
6251 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
6252 * indent.c (Fvertical_motion): Fix == vs = typo.
6253
e3cbd34b
EZ
62542011-09-24 Eli Zaretskii <eliz@gnu.org>
6255
a66cfb1c
SM
6256 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6257 Default value is now t. Doc fix.
6bf7006f 6258
e3cbd34b 6259 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 6260 logic when moving up, not only when moving down. Fix the
e3cbd34b 6261 confusing name and values of the it_overshoot_expected variable;
32c1fffd 6262 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
6263
6264 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6265 CHARPOS is covered by a display string which includes newlines.
6266 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6267 is covered by a display string with embedded newlines.
6268
a3de0cbd
MA
62692011-09-24 Michael Albinus <michael.albinus@gmx.de>
6270
6271 * dbusbind.c (Fdbus_register_signal): Add match rule to
6272 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
6273 (Fdbus_register_method, Vdbus_registered_objects_table):
6274 Fix docstring.
a3de0cbd 6275
b260039d
JM
62762011-09-24 Jim Meyering <meyering@redhat.com>
6277
32c1fffd 6278 do not ignore write error for any output size
b260039d
JM
6279 The previous change was incomplete.
6280 While it makes emacs --batch detect the vast majority of stdout
6281 write failures, errors were still ignored whenever the output size is
6282 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6283 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6284 && echo FAIL: ignored write error
6285 FAIL: ignored write error
6286 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6287 && echo FAIL: ignored write error
6288 FAIL: ignored write error
6289 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6290
8eca8a7c
AS
62912011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6292
6293 * emacs.c (Fkill_emacs): In noninteractive mode exit
6294 non-successfully if a write error occurred on stdout. (Bug#9574)
6295
3341db62
EZ
62962011-09-21 Eli Zaretskii <eliz@gnu.org>
6297
6298 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6299 the xassert test.
6300
6301 * dispextern.h (struct it): Update the comment documenting what
6302 can it->OBJECT be.
6303
8c203dbf
EZ
63042011-09-20 Eli Zaretskii <eliz@gnu.org>
6305
6306 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6307 a display string, extend search for cursor position to end of row.
6308 (find_row_edges): If the row ends in a newline from a display
6309 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6310 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
6311 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6312 non-empty line. Fixes confusing cursor motion with arrow keys at
6313 the beginning of a line that starts with whitespace.
8c203dbf 6314
a4824228
LMI
63152011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6316
6317 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
6318 (bug#9493).
6319
33ed493b
CY
63202011-09-18 Chong Yidong <cyd@stupidchicken.com>
6321
6322 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
6323 boolean (Bug#9154).
6324
56cd55c8
EZ
63252011-09-18 Eli Zaretskii <eliz@gnu.org>
6326
6327 * xdisp.c (display_line): Record maximum and minimum buffer
6328 positions even if no glyphs were produced (e.g., by a zero-width
6329 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6330 buffer positions that will be removed from the glyph row because
6331 they don't fit.
c02dcedf
EZ
6332 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6333 column is beyond frame width: don't subtract 1 "pixel" when
6334 computing width of the stretch.
3e62b7e0
EZ
6335 (reseat_at_next_visible_line_start): Undo the change made on
6336 2011-09-17 that saved paragraph information and restored it after
6337 the call to `reseat'. (Bug#9545)
56cd55c8 6338
5ed99d36 63392011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6340
6341 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6342 and turn window cursor on if cleared (Bug#9415).
6343
5ed99d36 63442011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6345
6346 * search.c (boyer_moore): Take unibyte characters from pattern
6347 literally. (Bug#9458)
6348
9bade7b2
EZ
63492011-09-18 Eli Zaretskii <eliz@gnu.org>
6350
6351 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6352
e5e9d610
PE
63532011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6354
87e4427a
PE
6355 Fix minor problem found by static checking.
6356 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6357 initialized, to pacify gcc -Wuninitialized.
6358
e5e9d610
PE
6359 * fileio.c: Report proper errno when syscall falls.
6360 (Finsert_file_contents): Save and restore errno,
6361 so that report_file_error outputs the correct diagnostic.
6362 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6363
a1674f0b
EZ
63642011-09-18 Eli Zaretskii <eliz@gnu.org>
6365
6366 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6367
fbfb6dd4
EZ
63682011-09-17 Eli Zaretskii <eliz@gnu.org>
6369
6370 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6371 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6372
bb187662
EZ
63732011-09-17 Eli Zaretskii <eliz@gnu.org>
6374
1137e8b8 6375 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6376 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6377
6378 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6379 (bidi_find_paragraph_start): Search back for paragraph beginning
6380 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6381 (bidi_move_to_visually_next): Only trigger paragraph-related
6382 computations when the last character is a newline or at EOB, not
6383 just any NEUTRAL_B. (Bug#9470)
6384
bb187662
EZ
6385 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6386 truncated lines if point is covered by a display string. (Bug#9524)
6387
2e621251
PE
63882011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6389
6390 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6391 (cons_to_x_long): New function.
6392 (lisp_data_to_selection_data): Use it. Correct the test for
6393 short-versus-long data; it was negated. Break out of vector
6394 loop, for efficiency, when a long datum is discovered.
6395
91a15bc6
SM
63962011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6397
6398 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6399
b41c3a35
EZ
64002011-09-16 Eli Zaretskii <eliz@gnu.org>
6401
6402 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6403 GCC PR/17406) by declaring this function with external scope.
6404
7812ba2d
PE
64052011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6406
6407 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6408 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6409
cf7edc2a
AS
64102011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6411
6412 * editfns.c (Fformat): Correctly handle text properties on "%%".
6413
bd01620e
EZ
64142011-09-15 Eli Zaretskii <eliz@gnu.org>
6415
6416 * xterm.c (x_draw_composite_glyph_string_foreground):
6417 * w32term.c (x_draw_composite_glyph_string_foreground):
6418 * term.c (encode_terminal_code):
6419 * composite.c (composition_update_it, get_composition_id):
6420 * xdisp.c (get_next_display_element)
6421 (fill_composite_glyph_string): Add comments about special meaning
6422 of TAB characters in a composition.
6423
a02719a3
PE
64242011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6425
6426 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6427 This occurs when processing a multibyte format.
6428 Problem reported by Wolfgang Jenker.
a02719a3 6429
72589a3c
JB
64302011-09-15 Johan Bockgård <bojohan@gnu.org>
6431
6432 * xdisp.c (try_cursor_movement): Only check for exact match if
6433 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6434
1c14176c
PE
64352011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6436
6437 Remove unused external symbols.
6438 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6439 * xdisp.c (calc_pixel_width_or_height): Now static.
6440 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6441 * indent.c (check_display_width):
6442 * w32term.c: Fix comment to match code.
6443 * xterm.c, xterm.h (x_catching_errors): Remove.
6444
d2eea5b5
PE
64452011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6446
6447 * xselect.c: Use signed conversions more consistently (Bug#9498).
6448 (selection_data_to_lisp_data): Assume incoming selection data are
6449 signed integers, not unsigned. This is to be consistent with
6450 outgoing selection data, which was modified to use signed integers
6451 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6452 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6453 expects long, not unsigned long.
6454
46888499
EZ
64552011-09-14 Eli Zaretskii <eliz@gnu.org>
6456
6457 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6458 computation of loop end. Reported by Johan Bockgård
6459 <bojohan@gnu.org>.
6460
ef8ef9fb
CY
64612011-09-13 Chong Yidong <cyd@stupidchicken.com>
6462
6463 * frame.c (Fother_visible_frames_p): Function deleted.
6464
fa819fed
EZ
64652011-09-12 Eli Zaretskii <eliz@gnu.org>
6466
6467 * indent.c (compute_motion): Process display vector front to back
6468 rather than the other way around. (Bug#2496)
6469
2ba8e008
SM
64702011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6471
6472 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6473
20f53c69
CY
64742011-09-11 Chong Yidong <cyd@stupidchicken.com>
6475
6476 * minibuf.c (Fread_from_minibuffer): Doc fix.
6477
d562d7a4
EZ
64782011-09-11 Eli Zaretskii <eliz@gnu.org>
6479
6480 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6481 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6482
1c4d7f3d
LMI
64832011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6484
6485 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6486 value for non-existent files.
6487
b885bf36
EZ
64882011-09-11 Eli Zaretskii <eliz@gnu.org>
6489
6490 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6491 set its "size" to -1. This will set the modtime_size field of
6492 the corresponding buffer to -1, which is what
6493 verify-visited-file-modtime expects for files that do not exist.
6494 (Bug#9139)
6495
6612f0bf
PE
64962011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6497
6498 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6499 here ...
6500 * lisp.h: ... from here. push_key_description is no longer
6501 defined in keyboard.c, so its declaration should not be in
6502 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6503 logically belongs with push_key_description.
6504
dfb3f755
PE
65052011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6506
6507 * buffer.h: Include <sys/types.h> instead of <time.h>.
6508 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6509 Problem reported by Herbert J. Skuhra.
6510
3134906c
LMI
65112011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6512
6513 * xml.c (parse_region): Make the parsing work for
6514 non-comment-starting XML files again (bug#9144).
6515
8d903f4e
AS
65162011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6517
6518 * image.c (gif_load): Fix calculation of bottom and right corner.
6519 (Bug#9468)
6520
80ad64f4
EZ
65212011-09-10 Eli Zaretskii <eliz@gnu.org>
6522
6523 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6524 redisplay in small windows.
6525
208a048d
EZ
65262011-09-09 Eli Zaretskii <eliz@gnu.org>
6527
6528 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6529
9b1c252e
MR
65302011-09-08 Martin Rudalics <rudalics@gmx.at>
6531
6532 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6533 Operate on live windows only.
6534
2949f33b
JB
65352011-09-08 Juanma Barranquero <lekktu@gmail.com>
6536
6537 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6538
e08dcafd
EZ
65392011-09-07 Eli Zaretskii <eliz@gnu.org>
6540
6541 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6542 only under bidi iteration.
6543
115b96bd
JD
65442011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6545
6546 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6547
c8199d0f
PE
65482011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6551 Without this fix, the command to link temacs failed due to an
6552 undefined symbol __builtin_isnan. This is because
6553 /usr/include/iso/math_c99.h #defines isnan(x) to
6554 __builtin_isnan(x), but the bundled gcc, which identifies itself
6555 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6556 a __builtin_isnan.
6557 * floatfns.c (isnan): #undef, and then #define to a clone of
6558 what's in data.c.
6559 (Fisnan): Always define, since it's always available now.
6560 (syms_of_floatfns): Always define isnan at the Lisp level.
6561
e39b275c 65622011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6563
6564 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6565
b2db44d9 65662011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6567
f4af5137 6568 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6569 The previous code assumed that file offsets (off_t values) fit in
6570 EMACS_INT variables, which is not true on typical 32-bit hosts.
6571 The code messed up by falsely reporting buffer overflow in cases
6572 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6573 when "big" contains more than 2**29 bytes, even though this
6574 inserts just one byte and does not overflow the buffer.
6575 (Finsert_file_contents): Store file offsets as off_t
6576 values, not as EMACS_INT values. Check for overflow when
6577 converting between EMACS_INT and off_t. When checking for
6578 buffer overflow or for overlap, take the offsets into account.
6579 Don't use EMACS_INT for small values where int suffices.
6580 When checking for overlap, fix a typo: ZV was used where
6581 ZV_BYTE was intended.
6582 (Fwrite_region): Don't assume off_t fits into 'long'.
6583 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6584
ecfc0a49
MA
65852011-09-05 Michael Albinus <michael.albinus@gmx.de>
6586
6587 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6588
6511acf2 65892011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6590
0999621a 6591 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6592
6593 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6594 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6595 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6596 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6597 (modify_event_symbol): Do not assume that the length of
6598 name_alist_or_stem is safe to alloca and fits in int.
6599 (Fexecute_extended_command): Likewise for function name and binding.
6600 (Frecursion_depth): Wrap around reliably on integer overflow.
6601 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6602 since some callers pass EMACS_INT values.
6603 (Fsingle_key_description): Don't crash if symbol name contains more
6604 than MAX_ALLOCA bytes.
6605 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6606 (get_minibuffer): Arg is now EMACS_INT, not int.
6607 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6608 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6609 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6610
2be7d702
PE
6611 * dbusbind.c (signature_cat): New function.
6612 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6613 Do not overrun buffer; instead, report string overflow.
6614
9d1df220
PE
6615 * dispnew.c (add_window_display_history): Don't overrun buffer.
6616 Truncate instead; this is OK since it's just a log.
6617
33ef5c64
PE
6618 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6619 even if the time zone offset is outlandishly large.
6620 Don't mishandle offset == INT_MIN.
6621
66c6fdd5
PE
6622 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6623 when creating daemon; the previous buffer-overflow check was incorrect.
6624
d749b01b
PE
6625 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6626 which has the guts of the old verror function.
6627
b5cd1905
PE
6628 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6629 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6630
6e1a67fb
PE
6631 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6632 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6633 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6634 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6635 length of string rather than counting it via multiple sprintfs;
6636 that's simpler and more reliable.
c21721cc
PE
6637 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6638 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6639 sprintf, in case result does not fit in int.
6640
c57b67fc
PE
6641 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6642 (fontset_from_font): Print it.
6643
8a401434
PE
6644 * frame.c (tty_frame_count): Now printmax_t, not int.
6645 (make_terminal_frame, set_term_frame_name): Print it.
6646 (x_report_frame_params): In X, window IDs are unsigned long,
6647 not signed long, so print them as unsigned.
6648 (validate_x_resource_name): Check for implausibly long names,
6649 and don't assume name length fits in 'int'.
6650 (x_get_resource_string): Don't blindly alloca invocation name;
6651 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6652 not fit in int.
6653
6e1a67fb
PE
6654 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6655 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6656 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6657
0df02bf3
PE
6658 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6659 Use esprintf, not sprintf, in case result does not fit in int.
6660
48e30793
PE
6661 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6662 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6663 it as a large positive number.
6664 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6665 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6666
a66ff6d8
PE
6667 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6668 in case result does not fit in int.
6669
aca216ff
PE
6670 * print.c (float_to_string): Detect width overflow more reliably.
6671 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6672 buffer overrun. Don't assume list length fits in 'int'. Treat
6673 print length of 0 as 0, not as infinity; to be consistent with other
6674 uses of print length in this function. Don't overflow print length
6675 index. Don't assume hash table size fits in 'long', or that
6676 vectorlike size fits in 'unsigned long'.
6677
31c286f7
PE
6678 * process.c (make_process): Use printmax_t, not int, to format
6679 process-name gensyms.
6680
55e5faa1
PE
6681 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6682
80f2e268
PE
6683 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6684 to avoid potential buffer overrun.
6685
670741ab
PE
6686 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6687 if X resource line is longer than 512 bytes.
6688
b7163a50
PE
6689 * xfns.c (x_window): Make sprintf buffer a bit bigger
6690 to avoid potential buffer overrun.
6691
ae58ff1f
PE
6692 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6693
c43c8a6a
PE
6694 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6695
3f8236f4
PE
66962011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6697
53e9fe90 6698 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6699 Without these, Emacs silently mishandles large integers sometimes.
6700 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6701 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6702
6511acf2
PE
6703 * xdisp.c (try_window_id): Check Emacs fixnum range before
6704 converting to 'int'.
806add1d 6705
6511acf2 6706 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6707 Check that an Emacs fixnum is in range before assigning it to 'int'.
6708 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6709 values converted from Emacs fixnums.
6710 (Frecenter): Don't wrap around a line count if it is out of 'int'
6711 range; instead, treat it as an extreme value.
6712 (Fset_window_configuration, compare_window_configurations):
6713 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6714
6511acf2
PE
6715 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6716 that can exceed INT_MAX. Check that EMACS_INT value is in range
6717 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6718 (match_limit): Don't assume that a fixnum can fit in 'int'.
6719
6511acf2 6720 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6721 exceed INT_MAX.
6722
6511acf2 6723 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6724 (Fvertical_motion): Don't wrap around LINES values that don't fit
6725 in 'int'. Instead, treat them as extreme values. This is good
6726 enough for windows, which can't have more than INT_MAX lines anyway.
6727
fcb901a7
LMI
67282011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6729
0f2f6b6d
LMI
6730 * Require libxml/parser.h to avoid compilation warning.
6731
fcb901a7
LMI
6732 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6733
6734 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6735 since this reportedly can destroy thread storage.
6736
6e20a0d4
CY
67372011-08-30 Chong Yidong <cyd@stupidchicken.com>
6738
6739 * syntax.c (find_defun_start): Update all cache variables if
6740 exiting early (Bug#9401).
6741
148ae00e
EZ
67422011-08-30 Eli Zaretskii <eliz@gnu.org>
6743
f6cfbd8f
EZ
6744 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6745
148ae00e
EZ
6746 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6747 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6748 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6749
6750 * term.c (tty_append_glyph): New function.
6751 (produce_stretch_glyph): Static function and its prototype deleted.
6752
a66cfb1c
SM
6753 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6754 Add prototypes.
148ae00e 6755
c4a07a4c
PE
67562011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6757
6758 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6759 when checking :margin (Bug#9390).
6760 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6761 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6762 so that the name doesn't mislead. All uses changed.
6763
6bc8cd65
JB
67642011-08-28 Johan Bockgård <bojohan@gnu.org>
6765
6766 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6767 set_tty_hooks.
6768
dca4927e
EZ
67692011-08-27 Eli Zaretskii <eliz@gnu.org>
6770
6771 * xdisp.c (move_it_to): Don't bail out early when reaching
6772 position beyond to_charpos, if we are scanning backwards.
6773 (move_it_vertically_backward): When DY == 0, make sure we get to
6774 the first character in the line after the newline.
6775
f2cad773
PE
67762011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6777
6778 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6779 (ccl_driver): Do not generate an out-of-range pointer.
6780 (Fccl_execute_on_string): Remove unnecessary check for
6781 integer overflow, noted by Stefan Monnier in
6782 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6783 Remove a FIXME that didn't need fixing.
6784 Simplify the newly-introduced buffer reallocation code.
6785
0cae2cdb
JB
67862011-08-27 Juanma Barranquero <lekktu@gmail.com>
6787
6788 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6789
5fc295a4 67902011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6791
70c60eb2 6792 Integer and memory overflow issues (Bug#9196).
726e0ab1 6793
d31850da
PE
6794 * doc.c (get_doc_string): Rework so that
6795 get_doc_string_buffer_size is the actual buffer size, rather than
6796 being 1 less than the actual buffer size; this makes xpalloc more
6797 convenient.
6798
a69fbedb
PE
6799 * image.c (x_allocate_bitmap_record, cache_image):
6800 * xselect.c (Fx_register_dnd_atom):
6801 Simplify previous changes by using xpalloc.
6802
fe5c5d37
PE
6803 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6804 since either will do and ptrdiff_t is convenient with xpalloc.
6805
0065d054
PE
6806 * charset.c (charset_table_size)
6807 (struct charset_sort_data.priority): Now ptrdiff_t.
6808 (charset_compare): Don't overflow if priorities differ greatly.
6809 (Fsort_charsets): Don't assume list length fits in int.
6810 Check for size-calculation overflow when allocating sort data.
6811 (syms_of_charset): Allocate an initial charset table that is
6812 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6813
6814 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6815
6816 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6817 The actual value is always <= INT_MAX, and leaving it unsigned made
6818 overflow checking harder.
6819
6820 * dispextern.h (struct glyph_matrix.rows_allocated)
6821 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6822 with xpalloc. The values are still always <= INT_MAX.
6823
6824 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6825
6826 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6827 (SAFE_NALLOCA): New macro.
6828
6829 * region-cache.c (struct boundary.pos, find_cache_boundary)
6830 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6831 (set_cache_region, invalidate_region_cache)
6832 (revalidate_region_cache, know_region_cache, region_cache_forward)
6833 (region_cache_backward, pp_cache):
6834 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6835 so that ptrdiff_t * can be passed to xpalloc.
6836 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6837 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6838 (pp_cache): Don't assume cache_len fits in int.
6839 * region-cache.h: Adjust extern decls to match.
6840
6841 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6842 EMACS_INT, since either will do, for xpalloc.
6843
6844 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6845 (xnmalloc, xnrealloc, xpalloc): New functions.
6846
726e0ab1
PE
6847 * bidi.c (bidi_shelve_header_size): New constant.
6848 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6849 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6850
51f30bc5 6851 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6852 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6853 (overlay_strings):
6854 Don't update size of array until after memory allocation succeeds,
6855 because xmalloc/xrealloc may not return.
0065d054
PE
6856 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6857 now that we have proper integer overflow checking.
6858 (record_overlay_string, overlay_strings): Catch overflows when
6859 calculating size of overlay_str_buf.
726e0ab1 6860
0065d054
PE
6861 * callproc.c (Fcall_process): Check for size overflow when
6862 calculating size of args2.
6863 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6864 Normally we prefer signed values, but sticking with ptrdiff_t would
6865 require adding more-complicated checks.
726e0ab1
PE
6866
6867 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6868 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6869 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6870 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6871
6872 * character.c (Fstring): Check for size-calculation overflow.
6873
6874 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6875 unnecessary integer overflow. Check for size overflow.
6876 (encode_coding_object): Don't update size until xmalloc succeeds.
6877
6878 * composite.c (get_composition_id): Check for overflow in glyph
6879 length calculations.
6880
6881 Integer and memory overflow fixes for display code.
6882 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6883 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6884 (scrolling_window): Check for overflow in size calculations.
6885 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6886 Don't assume glyph table len fits in int.
6887 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6888 (row_table_size): Now ptrdiff_t, not int.
6889 (scrolling_window): Avoid overflow in size calculations.
6890 Don't update size until allocation succeeds.
6891 * fns.c (concat): Check for overflow in size calculations.
6892 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6893 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6894 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6895
6896 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6897 (get_doc_string): Check for size calculation overflow.
6898 Don't update size until allocation succeeds.
6899 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6900 EMACS_INT, where ptrdiff_t will do.
6901 (Fsubstitute_command_keys): Check for string overflow.
6902
6903 * editfns.c (set_time_zone_rule): Don't assume environment length
6904 fits in int.
6905 (message_length): Now ptrdiff_t, not int.
6906 (Fmessage_box): Don't update size until allocation succeeds.
6907 Don't assume message length fits in int.
6908 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6909
0065d054
PE
6910 * emacs.c (main): Do not reallocate argv, since there is a null at
6911 the end that can be overwritten, and this way there's no need to
6912 worry about size-calculation overflow.
6913 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6914
6915 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6916 alloc succeeds.
6917 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6918
6919 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6920 (x_set_scroll_bar_width, x_figure_window_size):
6921 Check for integer overflow.
6922 (x_set_alpha): Do not assume XINT fits in int.
6923
6924 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6925 This is for the members text_lines, text_cols, total_lines, total_cols,
6926 where the system imposes an 'int' limit.
6927
6928 * fringe.c (Fdefine_fringe_bitmap):
6929 Don't update size until alloc works.
6930
6931 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6932 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6933
6934 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6935 Check for size-calculation overflow.
6936 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6937 do, as we prefer signed integers.
6938 (id_to_widget.max_size, id_to_widget.used)
6939 (xg_store_widget_in_map, xg_remove_widget_from_map)
6940 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6941 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6942 Use and return ptrdiff_t, not int.
6943 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6944 * gtkutil.h: Change prototypes to match the above.
6945
6946 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6947 are duplicate now that they've been promoted to lisp.h.
6948 (x_allocate_bitmap_record, x_alloc_image_color)
6949 (make_image_cache, cache_image, xpm_load):
6950 Don't update size until alloc is done.
6951 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6952 (x_detect_edges):
3256efce 6953 Check for size calculation overflow.
726e0ab1
PE
6954 (ct_colors_allocated_max): New constant.
6955 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6956 overflow.
3256efce 6957
726e0ab1
PE
6958 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6959 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6960 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6961 Use ptrdiff_t, not int, to count maps.
6962 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
6963 calculations. Don't update size until allocation succeeds.
6964 Redo calculations to avoid overflow.
726e0ab1
PE
6965 * keyboard.h: Change prototypes to match the above.
6966
6967 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6968 to count maps.
6969 (current_minor_maps): Check for size calculation overflow.
6970 * keymap.h: Change prototypes to match the above.
6971
6972 * lread.c (read1, init_obarray): Don't update size until alloc done.
6973
6974 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6975 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6976
726e0ab1
PE
6977 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6978 Now ptrdiff_t, not int.
6979 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6980 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6981
6982 * process.c (Fnetwork_interface_list): Check for overflow
6983 in size calculation.
6984
6985 * region-cache.c (move_cache_gap): Check for size calculation overflow.
6986
6987 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6988 overflow. Don't bother calling xmalloc when xrealloc will do.
6989
6990 * search.c (Freplace_match): Check for size calculation overflow.
6991 (Fset_match_data): Don't assume list lengths fit in 'int'.
6992
6993 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6994 for command line length. Do not attempt to address one before the
6995 beginning of an array, as that's not portable.
6996
6997 * term.c (max_frame_lines): Remove; unused.
6998 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6999 not int.
7000 (encode_terminal_code, calculate_costs): Check for size
7001 calculation overflow.
7002 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
7003 table lengths and related sizes. Don't update size until alloc
7004 done. Redo calculations to avoid overflow.
7005 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
7006
7007 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
7008 subtracting pointers.
7009 (gobble_line): Check for overflow more carefully. Don't update size
7010 until alloc done.
7011
7012 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
7013 Don't update size until alloc done.
7014 Redo size calculations to avoid overflow.
7015 Check for size calculation overflow.
0065d054 7016 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
7017
7018 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
7019 Use ptrdiff_t, not int, for sizes.
7020 (store_mode_line_noprop_char): Don't update size until alloc done.
7021
0065d054
PE
7022 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
7023 Use ptrdiff_t, not int, for sizes.
7024 (Finternal_make_lisp_face, cache_face):
7025 Check for size calculation overflow.
7026 (cache_face): Treat size calculation overflows as if they were
7027 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
7028
7029 * xfns.c (x_encode_text, x_set_name_internal)
7030 (Fx_change_window_property): Use ptrdiff_t, not int, to count
7031 sizes, since they can exceed INT_MAX in size. Check for size
7032 calculation overflow.
7033
0065d054
PE
7034 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
7035 (xg_select): Check for size calculation overflow.
726e0ab1
PE
7036 Don't update size until alloc done.
7037
0065d054 7038 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 7039 as sprintf is limited to int lengths.
1d526e2f 7040
252c5ee1
PE
7041 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
7042 (X_LONG_MIN): New macros.
864d7ce7
PE
7043 Use them to make the following changes clearer.
7044 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
7045 This change doesn't affect the value now, but it may help remind
7046 future maintainers not to raise the value too much later.
7047 (SELECTION_QUANTUM): Remove, replacing with ...
7048 (selection_quantum): ... new function, which avoids overflow.
7049 All uses changed.
7050 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
7051 assumption that selection length fits in 'int'.
7052 (x_reply_selection_request, x_handle_selection_request)
7053 (x_get_window_property, receive_incremental_selection)
7054 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
7055 (lisp_data_to_selection_data, clean_local_selection_data):
7056 Use ptrdiff_t, not int, to record length of selection.
7057 (x_reply_selection_request, x_get_window_property)
7058 (receive_incremental_selection, x_property_data_to_lisp):
7059 Redo calculations to avoid overflow.
7060 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 7061 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
7062 something.
7063 (x_get_window_property, receive_incremental_selection)
7064 (lisp_data_to_selection_data, x_property_data_to_lisp):
7065 Check for size-calculation overflow.
7066 (x_get_window_property, receive_incremental_selection)
7067 (lisp_data_to_selection_data, Fx_register_dnd_atom):
7068 Don't store size until memory allocation succeeds.
7069 (x_get_window_property): Plug memory leak on memory exhaustion.
7070 Don't double-block input; malloc is safe here. Don't assume 2**34
7071 - 4 fits in unsigned long. Add an xassert to check
7072 XGetWindowProperty overflow. Be more careful about overflow
7073 calculations, and distinguish size from memory overflow better.
7074 (receive_incremental_selection): When tracing, don't assume
7075 unsigned int is less than INT_MAX.
7076 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
7077 harmful) conversions of unsigned short to int.
7078 (lisp_data_to_selection_data): Don't assume that integers
7079 in the range -65535 through -1 fit in an X unsigned short.
7080 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
7081 result parameters unless successful. Rely on cons_to_unsigned
7082 to report problems with elements; the old code wasn't right anyway.
7083 (x_check_property_data): Check for int overflow; we cannot use
7084 a wider type due to X limits.
7085 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
7086
726e0ab1 7087 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 7088
0065d054
PE
7089 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
7090 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
7091 (x_color_cells): Don't store size until memory allocation succeeds.
7092 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 7093 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
7094 (x_term_init): Don't assume length fits in int (sprintf is limited
7095 to int size).
bc18e09d 7096
ebfa62c0
PE
7097 Use ptrdiff_t for composition IDs.
7098 * character.c (lisp_string_width):
7099 * composite.c (composition_table_size, n_compositions)
7100 (get_composition_id, composition_gstring_from_id):
7101 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
7102 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
7103 * window.c (Frecenter):
7104 Use ptrdiff_t, not int, for composition IDs.
7105 * composite.c (get_composition_id): Check for integer overflow.
7106 * composite.h: Adjust prototypes to match the above changes.
7107
d3411f89
PE
7108 Use ptrdiff_t for hash table indexes.
7109 * category.c (hash_get_category_set):
7110 * ccl.c (ccl_driver):
7111 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
7112 * coding.c (coding_system_charset_list, detect_coding_system):
7113 * coding.h (struct coding_system.id):
7114 * composite.c (get_composition_id, gstring_lookup_cache):
7115 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
7116 * image.c (xpm_get_color_table_h):
7117 * lisp.h (hash_lookup, hash_put):
7118 * minibuf.c (Ftest_completion):
7119 Use ptrdiff_t for hash table indexes, not int (which is too
7120 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
7121 32-bit --with-wide-int hosts).
7122
e097a6fa
PE
7123 * charset.c (Fdefine_charset_internal): Check for integer overflow.
7124 Add a FIXME comment about memory leaks.
7125 (syms_of_charset): Don't assume xmalloc returns.
7126
5637687f
PE
7127 Don't assume that stated character widths fit in int.
7128 * character.c (Fchar_width, c_string_width, lisp_string_width):
7129 * character.h (CHAR_WIDTH):
7130 * indent.c (MULTIBYTE_BYTES_WIDTH):
7131 Use sanitize_char_width to avoid undefined and/or bad behavior
7132 with outlandish widths.
a66cfb1c 7133 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
7134 now that we have two such functions. All uses changed.
7135 (sanitize_char_width): New inline function.
7136
a2271ba2
PE
7137 Don't assume that tab-width fits in int.
7138 * character.h (sanitize_width): New inline function.
7139 (SANE_TAB_WIDTH): New macro.
7140 (ASCII_CHAR_WIDTH): Use it.
7141 * indent.c (sane_tab_width): Remove. All uses replaced by
7142 SANE_TAB_WIDTH (current_buffer).
7143 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
7144
18c52557
PE
7145 * fileio.c: Integer overflow issues with file modes.
7146 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
7147
caeeedc1
PE
7148 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
7149 Remove unreachable code.
7150 (read_hex, load_charset_map_from_file): Check for integer overflow.
7151
6df6ae42 7152 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
7153 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
7154 (x_send_scroll_bar_event): Likewise. Check that the size does not
7155 exceed limits imposed by XClientMessageEvent, as well as the usual
7156 ptrdiff_t and size_t limits.
7157
b13995db
PE
7158 * keyboard.c: Overflow, signedness and related fixes.
7159 (make_lispy_movement): Use same integer type in forward decl
7160 that is used in the definition.
7161 (read_key_sequence, keyremap_step):
7162 Change bufsize argument back to int, undoing my 2011-03-30 change.
7163 We prefer signed types, and int is wide enough here.
7164 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
7165 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
7166 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
7167 length, not size_t. Use ptrdiff_t for index, not int.
7168 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
7169 possibility of integer overflow.
7170
13464394
PE
7171 Overflow, signedness and related fixes for images.
7172
7173 * dispextern.h (struct it.stack[0].u.image.image_id)
7174 (struct_it.image_id, struct image.id, struct image_cache.size)
7175 (struct image_cache.used, struct image_cache.ref_count):
7176 * gtkutil.c (update_frame_tool_bar):
7177 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
7178 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
7179 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
7180 * nsmenu.m (update_frame_tool_bar):
7181 * xdisp.c (calc_pixel_width_or_height):
7182 * xfns.c (image_cache_refcount):
7183 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
7184 on typical 64-bit hosts.
7185
7186 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7187 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
7188 Omit unnecessary casts to int.
7189 (parse_image_spec): Check that integers fall into 'int' range
7190 when the callers expect that.
7191 (image_ascent): Redo ascent calculation to avoid int overflow.
7192 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
7193 (lookup_image): Remove unnecessary tests.
7194 (xbm_image_p): Locals are now of int, not EMACS_INT,
7195 since parse_image_check makes sure they fit into int.
7196 (png_load, gif_load, svg_load_image):
7197 Prefer int to unsigned where either will do.
7198 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
7199 old tiff_error_handler and tiff_warning_handler.
7200 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
7201 stack buffer overflows. It uses only the features of vsnprintf
7202 that are common to both POSIX and native Microsoft.
7203 (tiff_error_handler, tiff_warning_handler): Use it.
7204 (tiff_load, gif_load, imagemagick_load_image):
7205 Don't assume :index value fits in 'int'.
7206 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
7207 (imagemagick_load_image): Check that crop parameters fit into
7208 the integer types that MagickCropImage accepts. Don't assume
7209 Vimagemagick_render_type has a nonnegative value. Don't assume
7210 size_t fits in 'long'.
7211 (gs_load): Use printmax_t to print the widest integers possible.
7212 Check for integer overflow when computing image height and width.
7213
c11821d4
EZ
72142011-08-26 Eli Zaretskii <eliz@gnu.org>
7215
7216 * xdisp.c (redisplay_window): Don't force window start if point
7217 will be invisible in the resulting window. (Bug#9324)
7218
0c95fcf7
EZ
72192011-08-25 Eli Zaretskii <eliz@gnu.org>
7220
7221 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
7222 the display spec is of the form `(space ...)'.
7223 (handle_display_spec): Return the value returned by
7224 handle_single_display_spec, not just 1 or zero.
7225 (handle_single_display_spec): If the display spec is of the form
7226 `(space ...)', and specifies display in the text area, return 2
7227 rather than 1.
fee65a97 7228 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
7229 accurately, and prefer exact match for point under bidi.
7230 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
7231
7232 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
7233 into disp_prop; all users changed.
7234
7235 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
7236 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
7237 for the text covered by the display property.
7238
e4ed06f1
CY
72392011-08-25 Chong Yidong <cyd@stupidchicken.com>
7240
7241 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7242 Change return value to nil.
7243 (Frecord_buffer): Delete unused function.
7244
f67cdd7f
EZ
72452011-08-24 Eli Zaretskii <eliz@gnu.org>
7246
5980d4c6
EZ
7247 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7248 buffers, return left-to-right.
8610fe8b
EZ
7249 (set_cursor_from_row): Consider candidate row a win if its glyph
7250 represents a newline and point is on that newline. Fixes cursor
7251 positioning on the newline at EOL of R2L text within L2R
7252 paragraph, and vice versa.
7253 (try_cursor_movement): Check continued rows, in addition to
7254 continuation rows. Fixes unwarranted scroll when point enters a
7255 continued line of R2L text within an L2R paragraph, or vice versa.
7256 (cursor_row_p): Consider the case of point being equal to
7257 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7258 from the end of a short line to the beginning of a continued line
7259 of R2L text within L2R paragraph.
7260 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7261 composed characters.
5980d4c6 7262
f67cdd7f
EZ
7263 * bidi.c (bidi_check_type): Use xassert.
7264 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7265 members.
7266
bca633fb
EZ
72672011-08-23 Eli Zaretskii <eliz@gnu.org>
7268
7269 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7270 a character.
7271
4a5885a7
CY
72722011-08-23 Chong Yidong <cyd@stupidchicken.com>
7273
7274 * nsfont.m (ns_otf_to_script): Fix typo.
7275
0902a04e
KH
72762011-08-22 Kenichi Handa <handa@m17n.org>
7277
7278 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7279 extra slot even if the purpose is char-code-property-table.
7280
1a2e6670
EZ
72812011-08-23 Eli Zaretskii <eliz@gnu.org>
7282
8ddde651
EZ
7283 * xdisp.c (redisplay_window): When computing centering_position,
7284 account for the height of the header line. (Bug#8874)
7285
425cc014
EZ
7286 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7287 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7288 candidate is selected by the mouse, and that candidate has a
7289 composed character under the mouse.
7290
1a2e6670
EZ
7291 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7292 coordinates reported by pos-visible-in-window-p for a composed
7293 character in column zero.
7294
8b76d6f8
SM
72952011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7296
7297 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7298
dac347dd
EZ
72992011-08-22 Eli Zaretskii <eliz@gnu.org>
7300
7301 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7302 consider it a hit if to_charpos is anywhere in the range of the
7303 composed buffer positions.
7304
e013fb34
CY
73052011-08-22 Chong Yidong <cyd@stupidchicken.com>
7306
7307 * image.c (gif_load): Don't assume that each subimage has the same
7308 dimensions as the base image. Handle disposal method that is
7309 "undefined" by the gif spec (Bug#9335).
7310
bd1ba3e8
CY
73112011-08-20 Chong Yidong <cyd@stupidchicken.com>
7312
7313 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 7314 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 7315
54a1215b
EZ
73162011-08-19 Eli Zaretskii <eliz@gnu.org>
7317
823564e5
EZ
7318 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
7319 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
7320 from an Org mode buffer to a Speedbar frame.
7321
54a1215b
EZ
7322 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
7323 a composition, take its buffer position from IT->cmp_it.charpos.
7324 Fixes cursor positioning at the beginning of a line that begins
7325 with a composed character.
7326
9778ebcc
EZ
73272011-08-18 Eli Zaretskii <eliz@gnu.org>
7328
0be6ee06
EZ
7329 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7330 character bidirectional type, use STRONG_L instead. Fixes crashes
7331 in a buffer produced by `describe-categories'.
7332
9778ebcc
EZ
7333 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7334 members before the level stack, so they would be saved and
7335 restored when copying iterator state. Fixes incorrect reordering
7336 around TABs covered by display properties.
7337
156bffbe
AS
73382011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7339
6b02f655 7340 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7341
72ad093b
CY
73422011-08-17 Chong Yidong <cyd@stupidchicken.com>
7343
7344 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7345 (internal_condition_case_2, internal_condition_case_n):
7346 Remove unnecessary aborts (Bug#9081).
72ad093b 7347
35774242
EZ
73482011-08-17 Eli Zaretskii <eliz@gnu.org>
7349
7350 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7351 has no `load' handler, try opening the file locally. (Bug#9311)
7352
db76dd85
KB
73532011-08-16 Ken Brown <kbrown@cornell.edu>
7354
7355 * gmalloc.c: Expand comment.
7356
b215eee5
EZ
73572011-08-16 Eli Zaretskii <eliz@gnu.org>
7358
7359 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7360 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7361
a4579d33
KB
73622011-08-16 Ken Brown <kbrown@cornell.edu>
7363
7364 Fix memory allocation problems in Cygwin build (Bug#9273).
7365
7366 * unexcw.c ( __malloc_initialized): Declare external variable.
7367 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7368
8b76d6f8
SM
7369 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7370 New variables.
a4579d33
KB
7371 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7372 dumped emacs.
7373 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7374 in the static heap.
7375 [CYGWIN] (special_realloc): New function.
7376 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7377 requests to realloc storage in the static heap.
7378
3ebec551
PE
73792011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 * bidi.c (bidi_initialize): Remove unused local.
7382
9fd8be00
EZ
73832011-08-15 Eli Zaretskii <eliz@gnu.org>
7384
6b02f655
SM
7385 * bidimirror.h:
7386 * biditype.h: Remove file.
7387 * makefile.w32-in ($(BLD)/bidi.$(O)):
7388 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7389
7390 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7391
7392 * chartab.c: Improve commentary for the uniprop_table API.
7393
32413314
EZ
7394 * bidi.c (bidi_paragraph_init): Support zero value of
7395 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7396 (bidi_initialize): Use uniprop_table instead of including
7397 biditype.h and bidimirror.h.
32413314 7398
9fd8be00
EZ
7399 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7400 coordinates of the iterator when restoring from ppos_it.
7401 (Bug#9296)
7402
5cf2b69b
KH
74032011-08-14 Kenichi Handa <handa@m17n.org>
7404
7405 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7406 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7407
daf17d00
EZ
74082011-08-14 Eli Zaretskii <eliz@gnu.org>
7409
7410 * xdisp.c (move_it_in_display_line_to): Don't invoke
7411 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7412 ppos_it. Fixes vertical cursor motion when line beginning is
7413 covered by an image. (Bug#9296)
7414
08e3161a
JD
74152011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7416
7417 * nsterm.h (ns_run_ascript): Declare.
7418 (NSAPP_DATA2_RUNASSCRIPT): Define.
7419
7420 * nsfns.m (as_script, as_result, as_status): New static variables.
7421 (ns_run_ascript): New function.
5e617bc2 7422 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7423 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7424 the event loop. Get status from as_status (Bug#7276).
7425
7426 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7427 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7428 the event loop (Bug#7276).
7429
a3720aa2
AS
74302011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7431
7432 * gnutls.c (QCgnutls_bootprop_priority)
7433 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7434 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7435 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7436 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7437 (QCgnutls_bootprop_verify_hostname_error)
7438 (QCgnutls_bootprop_callbacks_verify): Rename from
7439 Qgnutls_bootprop_..., all uses changed.
7440
7441 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7442 uses changed.
7443
0a0d27fb
PE
74442011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7445
19d5c50c
PE
7446 * xfaces.c (Qframe_set_background_mode): Now static.
7447 * dispextern.h (Qframe_set_background_mode): Remove decl.
7448
0a0d27fb
PE
7449 * process.c (Fnetwork_interface_info): Declare local only if needed.
7450
377538cb
JD
74512011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7452
7453 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7454 (Fnetwork_interface_list): Allocate in increments of bytes instead
7455 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7456 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7457 sockaddr.
7458 (struct ifflag_def): notrailers is smart on OSX.
7459 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7460 Get hardware address with getifaddrs if available.
7461
08fff70c
EZ
74622011-08-12 Eli Zaretskii <eliz@gnu.org>
7463
7464 * xdisp.c (iterate_out_of_display_property): xassert that
7465 IT->position is set to within IT->object's boundaries. Break from
7466 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7467 when IT->position is set up wrongly due to some bug.
7468 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7469 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7470 entry. Force push_it to save on the stack the current
7471 buffer/string position, to be restored by pop_it. Fix flags in
7472 the iterator structure wrt the object coming from a display
7473 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7474 properties. (Bug#9284)
7475
7be1c708 74762011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7477
7be1c708
CY
7478 * fontset.c (fontset_get_font_group): Add proper type checks.
7479 (Bug#9172)
aac0c6e3 7480
7be1c708 74812011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7482
7be1c708
CY
7483 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7484 and LC_VERSION_MIN_MACOSX.
7485 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7486 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7487
97bb72a6
EZ
74882011-08-08 Eli Zaretskii <eliz@gnu.org>
7489
7490 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7491 no-display-properties-and-no-overlays under bidi display.
7492 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7493 properties and overlays.
97bb72a6 7494
d5617611
CY
74952011-08-08 Chong Yidong <cyd@stupidchicken.com>
7496
37e11a63
CY
7497 * editfns.c (Fset_time_zone_rule): Document relationship with the
7498 setenv function.
7499
d5617611
CY
7500 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7501 the font entity extracted from the cache (Bug#8109).
7502
58872834
CY
75032011-08-07 Chong Yidong <cyd@stupidchicken.com>
7504
7505 * composite.c (autocmp_chars): Don't reset point. That is done by
7506 restore_point_unwind (Bug#5984).
7507
75bfc667
JL
75082011-08-07 Juri Linkov <juri@jurta.org>
7509
7510 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7511 to show the arg `TIME' instead of `TIMEVAL'.
7512
d1410150
EZ
75132011-08-06 Eli Zaretskii <eliz@gnu.org>
7514
7515 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7516 display property strides EOL and includes a newline, as in
7517 longlines-mode. (Bug#9254)
75b771e4
EZ
7518 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7519 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7520
7521 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7522 is non-zero, even if the data buffer is NULL. Fixes a crash in
7523 vertical-motion with longlines-mode. (Bug#9254)
7524
35928349
EZ
75252011-08-05 Eli Zaretskii <eliz@gnu.org>
7526
ec7cc85b
EZ
7527 * bidi.c <bidi_cache_total_alloc>: Now static.
7528 (bidi_initialize): Initialize bidi_cache_total_alloc.
7529
8b76d6f8 7530 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7531 cache. (Bug#9221)
7532
7533 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7534 amount allocated this far in `bidi_cache_total_alloc'.
7535 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7536 non-zero, only free the data buffer without restoring the cache
7537 contents. All callers changed.
7538
7539 * dispextern.h (bidi_unshelve_cache): Update prototype.
7540
7541 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7542 (move_it_in_display_line, move_it_to)
7543 (move_it_vertically_backward, move_it_by_lines): Replace the call
7544 to xfree to an equivalent call to bidi_unshelve_cache.
7545 (move_it_in_display_line_to): Fix logic of returning
412b6358 7546 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7547
e2e2423b
EZ
75482011-08-05 Eli Zaretskii <eliz@gnu.org>
7549
7550 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7551 came from a string character with a `cursor' property. (Bug#9229)
7552
ae9e757a
JD
75532011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7554
7555 * Makefile.in (LIB_PTHREAD): New variable.
7556 (LIBES): Add LIB_PTHREAD (Bug#9216).
7557
7558 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7559 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7560
213bd7f2
AS
75612011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7562
6b02f655 7563 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7564
99aaf75f
JD
75652011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7566
7567 * xterm.c (x_find_topmost_parent): New function.
7568 (x_set_frame_alpha): Find topmost parent window with
7569 x_find_topmost_parent and set the property there also (bug#9181).
7570 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7571
c74e9d86
PE
75722011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7573
7574 * callproc.c (Fcall_process): Avoid vfork clobbering
7575 the local vars buffer, coding_systems, current_dir.
7576
640c8776
SM
75772011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7578
7579 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7580
f26d0e4c
PE
75812011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7582
8a10d76c
PE
7583 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7584 so that it is not optimized away.
7585
f26d0e4c
PE
7586 * xdisp.c (compute_display_string_pos): Remove unused local.
7587
55439c61
EZ
75882011-08-02 Eli Zaretskii <eliz@gnu.org>
7589
7590 Fix slow cursor motion and scrolling in large buffers with
7591 selective display, like Org Mode buffers. (Bug#9218)
7592
7593 * dispextern.h (struct bidi_it): New member disp_prop_p.
7594
7595 * xdisp.c: Remove one-slot cache of display string positions.
7596 (compute_display_string_pos): Accept an additional argument
5e617bc2 7597 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7598 for a display string or property. If found, set DISP_PROP_P
7599 non-zero.
7600
7601 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7602 DISP_PROP_P, and pass it to compute_display_string_pos.
7603 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7604 non-zero. All callers of bidi_fetch_char changed.
7605
fb33fa43
SM
76062011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7607
7608 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7609
b099e063
DM
76102010-12-03 Don March <don@ohspite.net>
7611
7612 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7613 last character M-[char] is translated to ESC [char] (bug#7541).
7614
5cc7f7af
KH
76152011-08-02 Kenichi Handa <handa@m17n.org>
7616
d0fffa3f 7617 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7618
7619 * chartab.c (uniprop_table): Make it non-static.
7620
525d5e6e
EZ
76212011-08-01 Eli Zaretskii <eliz@gnu.org>
7622
7623 * xdisp.c (forward_to_next_line_start): Accept additional argument
7624 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7625 on the newline.
7626 (reseat_at_next_visible_line_start): Use the bidi iterator state
7627 returned by forward_to_next_line_start to restore the state of
7628 it->bidi_it after backing up to previous newline. (Bug#9212)
7629
31011111
AS
76302011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7631
7632 * regex.c (re_comp): Protoize.
7633 (re_exec): Fix return type.
7634 (regexec): Fix type of `ret'. (Bug#9203)
7635
476371c4
PE
76362011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7637
e5d76069
PE
7638 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7639 This is needed if max-image-size is a floating-point number.
7640
9a79b20c
AS
76412011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7642
7643 * print.c (print_object): Print empty symbol as ##.
7644
7645 * lread.c (read1): Read ## as empty symbol.
7646
d8c2fa78
AA
76472011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7648
7649 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7650 setting frame foreground color (Bug#9175).
7651 (x_set_background_color): Likewise.
7652
ffe57a7a
AA
7653 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7654 contents (Bug#9176).
7655 (EmacsTooltip -init): Remove bezels and add shadows to
7656 tooltip windows.
7657
bf3492a5
AA
7658 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7659 or scroll bar (Bug#8470).
7660
d55e9c53
AA
7661 * nsfont.m (nsfont_open): Remove assignment to voffset and
7662 unnecessary vars hshink, expand, hd, full_height, min_height.
7663 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7664
7665 * nsterm.h (nsfont_info): Remove voffset field.
7666
d8c2fa78 76672011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7668
7669 Implement strike-through and overline on NextStep (Bug#8863).
7670
7671 * nsfont.m (nsfont_open): Use underline position provided by font,
7672 instead of hard-coded value of 2.
7673 (nsfont_draw): Call ns_draw_text_decoration instead.
7674
7675 * nsterm.h: Add declaration for ns_draw_text_decoration.
7676
7677 * nsterm.m (ns_draw_text_decoration): New function for drawing
7678 underline, overline, and strike-through.
7679 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7680 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7681 accommodate underlining, etc.
4843aac3 7682
4cc60b9b
EZ
76832011-07-28 Eli Zaretskii <eliz@gnu.org>
7684
bc7ece87
EZ
7685 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7686 default.
4cc60b9b 7687
476371c4
PE
76882011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7689
66606eea
PE
7690 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7691 Without this fix, if a signal arrives just after memory fills up,
7692 'malloc' might be invoked reentrantly.
7693
476371c4
PE
7694 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7695 In other words, assume that every image size is allowed, on non-X
7696 hosts. This assumption is probably wrong, but it lets Emacs compile.
7697
f3fcc40d
AS
76982011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7699
7700 * regex.c (re_iswctype): Convert return values to boolean.
7701
350c992f
EZ
77022011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7703
7704 * xdisp.c (compute_display_string_pos): Don't use cached display
7705 string position if the buffer had its restriction changed.
7706 (Bug#9184)
7707
5266b4bb
PE
77082011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7709
7710 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7711
2573a837 77122011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7713
41f55ccd 7714 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7715
39e378da
PE
7716 * bidi.c: Integer size and overflow fixes.
7717 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7718 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7719 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7720 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7721 (bidi_find_other_level_edge):
7722 Use ptrdiff_t instead of EMACS_INT where either will do.
7723 This works better on 32-bit hosts configured --with-wide-int.
7724 (bidi_cache_ensure_space): Check for size-calculation overflow.
7725 Use % rather than repeated addition, for better worst-case speed.
7726 Don't set bidi_cache_size until after xrealloc returns, because it
7727 might not return.
7728 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7729 (bidi_cache_ensure_space): Also check that the bidi cache size
7730 does not exceed that of the largest Lisp string or buffer. See Eli
7731 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7732
5e927815
PE
7733 * alloc.c (__malloc_size_t): Remove.
7734 All uses replaced by size_t. See Andreas Schwab's note
7735 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7736
ca4aa935
PE
7737 * image.c: Improve checking for integer overflow.
7738 (check_image_size): Assume that f is nonnull, since
7739 it is always nonnull in practice. This is one less thing to
7740 worry about when checking for integer overflow later.
7741 (x_check_image_size): New function, which checks for integer
7742 overflow issues inside X.
7743 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7744 This removes the need for a memory_full check.
7745 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7746 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7747 (xbm_read_bitmap_data): Change locals back to 'int', since
7748 their values must fit in 'int'.
7749 (xpm_load_image, png_load, tiff_load):
7750 Invoke x_create_x_image_and_pixmap earlier,
7751 to avoid much needless work if the image is too large.
7752 (tiff_load): Treat overly large images as if
7753 x_create_x_image_and_pixmap failed, not as malloc failures.
7754 (gs_load): Use x_check_image_size.
7755
5f8f9cc2
PE
7756 * gtkutil.c: Omit integer casts.
7757 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7758 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7759
5adf60bc
PE
7760 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7761
c8907a93
PE
7762 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7763 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7764 would wrongly return t on a 64-bit host.
7765
e3c25c68
PE
7766 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7767 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7768 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7769 and therefore cause GCC to emit a bogus diagnostic in some cases.
7770
3f791afe
PE
7771 * image.c: Integer signedness and overflow and related fixes.
7772 This is not an exhaustive set of fixes, but it's time to
7773 record what I've got.
7774 (lookup_pixel_color, check_image_size): Remove redundant decls.
7775 (check_image_size): Don't assume that arbitrary EMACS_INT values
7776 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7777 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7778 (tiff_load, imagemagick_load_image):
7779 Check for overflow in size calculations.
7780 (x_create_x_image_and_pixmap): Remove unnecessary test for
7781 xmalloc returning NULL; that can't happen.
7782 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7783 (xpm_color_bucket): Use better integer hashing function.
7784 (xpm_cache_color): Don't possibly over-allocate memory.
7785 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7786 (gif_memory_source):
7787 Use ptrdiff_t, not int or size_t, to record sizes.
7788 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7789 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7790 either works, as we prefer signed integers.
7791 (tiff_read_from_memory, tiff_write_from_memory):
7792 Return tsize_t, not size_t, since that's what the TIFF API wants.
7793 (tiff_read_from_memory): Don't fail simply because the read would
7794 go past EOF; instead, return a short read.
7795 (tiff_load): Omit no-longer-needed casts.
7796 (Fimagemagick_types): Don't assume size fits into 'int'.
7797
3cc5a532
PE
7798 Improve hashing quality when configured --with-wide-int.
7799 * fns.c (hash_string): New function, taken from sxhash_string.
7800 Do not discard information about ASCII character case; this
7801 discarding is no longer needed.
7802 (sxhash-string): Use it. Change sig to match it. Caller changed.
7803 * lisp.h: Declare it.
7804 * lread.c (hash_string): Remove, since we now use fns.c's version.
7805 The fns.c version returns a wider integer if --with-wide-int is
7806 specified, so this should help the quality of the hashing a bit.
7807
b312a492
PE
7808 * emacs.c: Integer overflow minor fix.
7809 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7810 Define only if GNU_LINUX.
7811 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7812
dfd153ae
PE
7813 * dispnew.c: Integer signedness and overflow fixes.
7814 Remove unnecessary forward decls, that were a maintenance hassle.
7815 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7816 All uses changed.
7817 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7818 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7819 (prepare_desired_row, line_draw_cost):
7820 Use int, not unsigned, where either works.
7821 (save_current_matrix, restore_current_matrix):
7822 Use ptrdiff_t, not size_t, where either works.
7823 (init_display): Check for overflow more accurately, and without
7824 relying on undefined behavior.
7825
a81d11a3
PE
7826 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7827 Remove, replacing with the new symbols in lisp.h. All uses changed.
7828 * fileio.c (make_temp_name):
7829 * filelock.c (lock_file_1, lock_file):
7830 * xdisp.c (message_dolog):
7831 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7832 Use pMd etc. instead.
7833 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7834 replacing the pWIDE etc. symbols removed from editfns.c.
7835
3300e6fd
PE
7836 * keyboard.h (num_input_events): Now uintmax_t.
7837 This is (very slightly) less likely to mess up due to wraparound.
7838 All uses changed.
7839
fd05c7e9
PE
7840 * buffer.c: Integer signedness fixes.
7841 (alloc_buffer_text, enlarge_buffer_text):
7842 Use ptrdiff_t rather than size_t when either will do, as we prefer
7843 signed integers.
7844
903fe15d
PE
7845 * alloc.c: Integer signedness and overflow fixes.
7846 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7847 (__malloc_size_t): Default to size_t, not to int.
7848 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7849 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7850 Prefer ptrdiff_t to size_t when either would do, as we prefer
7851 signed integers.
7852 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7853 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7854 Now const. Initialize with values that are in range even if char
7855 is signed.
7856 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7857 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7858 These functions do the right thing with sizes > 2**32.
7859 (check_depth): Now ptrdiff_t, not int.
7860 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7861 Adjust to new way of storing sizes. Check for size overflow bugs
7862 in rest of code.
7863 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7864 slightly wrong anyway, as it missed one instance of
7865 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7866 (refill_memory_reserve): Omit needless cast to size_t.
7867 (mark_object_loop_halt): Mark as externally visible.
7868
ac82cc6a
PE
7869 * xselect.c: Integer signedness and overflow fixes.
7870 (Fx_register_dnd_atom, x_handle_dnd_message):
7871 Use ptrdiff_t, not size_t, since we prefer signed.
7872 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7873 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7874 x_dnd_atoms_size and x_dnd_atoms_length.
7875
c2d1e36d
PE
7876 * doprnt.c: Prefer signed to unsigned when either works.
7877 * eval.c (verror):
7878 * doprnt.c (doprnt):
7879 * lisp.h (doprnt):
7880 * xdisp.c (vmessage):
7881 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7882 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7883 prefer signed arithmetic to avoid comparison confusion.
7884 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7885 but is a bit tricky.
7886
0e926e56
PE
7887 Assume freestanding C89 headers, string.h, stdlib.h.
7888 * data.c, doprnt.c, floatfns.c, print.c:
7889 Include float.h unconditionally.
7890 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7891 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7892 * regex.c: Likewise for stddef.h, string.h.
7893 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7894 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7895 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7896 (STDC_HEADERS): Remove obsolete defines.
7897 * sysdep.c: Include limits.h unconditionally.
7898
9cfdb3ec
PE
7899 Assume support for memcmp, memcpy, memmove, memset.
7900 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7901 * regex.c (memcmp, memcpy):
7902 Remove; we assume C89 now.
7903
7904 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7905 (__malloc_safe_bcopy): Remove; no longer needed.
7906
cf950e6b 7907 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7908 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7909 well either way, and we prefer signed to unsigned.
7910
dbf38e02
LMI
79112011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7912
7913 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7914 closes the connection while we're reading (bug#9182).
7915
d6f0886c 79162011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7917
d6f0886c
JD
7918 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7919 are specified (Bug#9168).
24e0f6b1 7920
2eb1f9e6
PE
79212011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7922
7923 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7924 Found by GCC static checking and --with-wide-int on a 32-bit host.
7925
22381272 79262011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7927
7928 * xdisp.c (compute_display_string_pos): Fix logic of caching
7929 previous display string position. Initialize cached_prev_pos to
7930 -1. Fixes slow-down at the beginning of a buffer.
7931
f25e39b4
EZ
79322011-07-24 Eli Zaretskii <eliz@gnu.org>
7933
7934 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7935 for attrs[LFACE_FONTSET_INDEX].
7936
04c4b52e
PE
79372011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7938
7939 * xml.c (parse_region): Remove unused local
7940 that was recently introduced.
7941
c1734fbd
EZ
79422011-07-23 Eli Zaretskii <eliz@gnu.org>
7943
be18c5a5
EZ
7944 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7945 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7946
c1734fbd
EZ
7947 * xdisp.c (move_it_in_display_line_to): Record the best matching
7948 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
7949 exit if none of the characters scanned was an exact match.
7950 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
7951 when exact match is impossible due to invisible text, and the
7952 lines are truncated.
7953
a258d627
JD
79542011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7955
7956 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7957 for OSX >= 10.7.
7958
b6d5a689
EZ
79592011-07-22 Eli Zaretskii <eliz@gnu.org>
7960
0f74f785
EZ
7961 Fix a significant slow-down of cursor motion with C-n, C-p,
7962 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7963 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 7964 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
7965 (next_element_from_buffer): Call compute_stop_pos_backwards to
7966 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
7967 base_level_stop.
7968 (reseat): Don't look for prev_stop, as that could mean a very long
7969 run.
7970 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7971 <cached_disp_overlay_modiff>: Cache for last found display string
7972 position.
551918c1 7973 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
7974 about the same buffer in the same area of character positions, and
7975 the buffer wasn't changed since the time the display string
7976 position was cached.
551918c1 7977
b2d0c91a
EZ
79782011-07-22 Eli Zaretskii <eliz@gnu.org>
7979
7980 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7981 is an integer, which is important for empty lines. (Bug#9149)
7982
043604ee
CY
79832011-07-22 Chong Yidong <cyd@stupidchicken.com>
7984
7985 * frame.c (Fmodify_frame_parameters): In tty case, update the
7986 default face if necessary (Bug#4238).
7987
da4adb04
CY
79882011-07-21 Chong Yidong <cyd@stupidchicken.com>
7989
7990 * editfns.c (Fstring_to_char): No need to explain what a character
7991 is in the docstring (Bug#6576).
7992
9abd0532
LMI
79932011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7994
7995 * xml.c (parse_region): Make sure we always return a tree.
7996
36881d16
HK
79972011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7998
7999 * xml.c (parse_region): If a document contains only comments,
8000 return that, too.
8001
1e98674d
LMI
80022011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8003
8004 * xml.c (make_dom): Return comments, too.
8005
590bd467
PE
80062011-07-19 Paul Eggert <eggert@cs.ucla.edu>
8007
8008 Port to OpenBSD.
8009 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
8010 and the surrounding thread.
8011 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
8012 rather than fgets, and retry after EINTR. Otherwise, 'emacs
8013 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
8014 timer goes off.
8015 * s/openbsd.h (BROKEN_SIGIO): Define.
8016 * unexelf.c (unexec) [__OpenBSD__]:
8017 Don't update the .mdebug section of the Alpha COFF symbol table.
8018
f41628b2
LMI
80192011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8020
8021 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
8022 (bug#8460).
8023
b59b67c5
PE
80242011-07-18 Paul Eggert <eggert@cs.ucla.edu>
8025
15e3a074
PE
8026 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
8027 This fixes some race conditions on the permissions of any newly
8028 created file.
8029
41bed37d
PE
8030 * alloc.c (valid_pointer_p): Use pipe, not open.
8031 This fixes some permissions issues when debugging.
8032
b59b67c5
PE
8033 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
8034 If fchown fails to set both uid and gid, try to set just gid,
8035 as that is sometimes allowed. Adjust the file's mode to eliminate
8036 setuid or setgid bits that are inappropriate if fchown fails.
8037
925a6be7
SM
80382011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8039
8040 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
8041 to compare Lisp_Objects.
8042 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
8043 global_gnutls_log_level, don't mistake it for a Lisp_Object.
8044 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
8045
52968808
AS
80462011-07-17 Andreas Schwab <schwab@linux-m68k.org>
8047
0a6a104b
AS
8048 * lread.c (read_integer): Unread even EOF character.
8049 (read1): Likewise. Properly record start position of symbol.
8050
52968808
AS
8051 * lread.c (read1): Read `#:' as empty uninterned symbol if no
8052 symbol character follows.
8053
9e381cdd
PE
80542011-07-17 Paul Eggert <eggert@cs.ucla.edu>
8055
8056 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
8057 This works around a problem with the previous change to Fcopy_file.
8058 Recent glibc declares fchown with __attribute__((warn_unused_result)),
8059 and without this change, GCC might complain about discarding
8060 fchown's return value.
8061
b5641435
JB
80622011-07-16 Juanma Barranquero <lekktu@gmail.com>
8063
8064 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
8065
a8031457
PE
80662011-07-16 Paul Eggert <eggert@cs.ucla.edu>
8067
8068 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
8069
dd889327
LMI
80702011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
8071
750c33f7
LMI
8072 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
8073 it's used from the C level.
8074
dd889327
LMI
8075 * process.c: Use the same condition for POLL_FOR_INPUT in both
8076 keyboard.c and process.c (bug#1858).
8077
87e86684
LM
80782011-07-09 Lawrence Mitchell <wence@gmx.li>
8079
8080 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
8081 (Fgnutls_boot): Use it.
8082
64348f40
AS
80832011-07-15 Andreas Schwab <schwab@linux-m68k.org>
8084
8085 * doc.c (Fsubstitute_command_keys): Revert last change.
8086
1d698799
LMI
80872011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
8088
f863868c
LMI
8089 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
8090 quotes the next character, and doesn't affect other longer
8091 sequences (bug#8935).
8092
1d698799
LMI
8093 * lread.c (syms_of_lread): Clarify that is isn't only
8094 `eval-buffer' and `eval-defun' that's affected by
8095 `lexical-binding' (bug#8460).
8096
aa4b6df6
EZ
80972011-07-15 Eli Zaretskii <eliz@gnu.org>
8098
8099 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 8100 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 8101
5d856da6
PE
81022011-07-14 Paul Eggert <eggert@cs.ucla.edu>
8103
ad6042bb
PE
8104 Fix minor problems found by static checking.
8105 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
8106 (elsz): Now a signed constant, not a size_t var. We prefer signed
8107 types to unsigned, to avoid integer comparison confusion. Without
8108 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
8109 "cannot optimize loop, the loop counter may overflow", a symptom
8110 of the confusion.
f00bbb22 8111 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
8112 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
8113
6468f31c
LMI
81142011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8115
49080b10
LMI
8116 * search.c (Fre_search_backward): Mention `case-fold-search' in
8117 all the re_search_* functions (bug#8138).
8118
6468f31c
LMI
8119 * keyboard.c (Fopen_dribble_file): Document when the file is
8120 closed (bug#8056).
8121
c965adc5
EZ
81222011-07-14 Eli Zaretskii <eliz@gnu.org>
8123
df9733bf
EZ
8124 * bidi.c (bidi_dump_cached_states): Fix format of displaying
8125 bidi_cache_idx.
8126
0bb23927
EZ
8127 Support bidi reordering of display and overlay strings.
8128 * xdisp.c (compute_display_string_pos)
8129 (compute_display_string_end): Accept additional argument STRING.
8130 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
8131 (reseat_to_string): Initialize bidi_it->string.s and
8132 bidi_it->string.schars.
8133 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
8134 NULL (avoids a crash in bidi_paragraph_init).
8135 Initialize itb.string.lstring.
0bb23927
EZ
8136 (init_iterator): Call bidi_init_it only of a valid
8137 buffer position was specified. Initialize paragraph_embedding to
8138 L2R.
8139 (reseat_to_string): Initialize the bidi iterator.
8140 (display_string): If we need to ignore text properties of
8141 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
8142 original value of -1 will not work with bidi.)
8143 (compute_display_string_pos): First arg is now struct
8144 `text_pos *'; all callers changed. Support display properties on
8145 Lisp strings.
8146 (compute_display_string_end): Support display properties on Lisp
8147 strings.
8148 (init_iterator, reseat_1, reseat_to_string): Initialize the
8149 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
8150 when iterating on a string not from display properties).
640c8776
SM
8151 (compute_display_string_pos, compute_display_string_end):
8152 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
8153 arrow keys.
8154 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
8155 base_level_stop; instead, set base_level_stop to BEGV.
8156 Fixes crashes in vertical-motion.
0bb23927
EZ
8157 (next_element_from_buffer): Improve commentary for when
8158 the iterator is before prev_stop.
8159 (init_iterator): Initialize bidi_p from the default value of
8160 bidi-display-reordering, not from buffer-local value. Use the
8161 buffer-local value only if initializing for buffer iteration.
8162 (handle_invisible_prop): Support invisible properties on strings
8163 that are being bidi-reordered.
8164 (set_iterator_to_next): Support bidi reordering of C strings and
8165 Lisp strings.
8166 (next_element_from_string): Support bidi reordering of Lisp
8167 strings.
8168 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
8169 (display_string): Support display of R2L glyph rows.
8170 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
8171 (init_iterator): Don't initialize it->bidi_p for strings
8172 here.
8173 (reseat_to_string): Initialize it->bidi_p for strings here.
8174 (next_element_from_string, next_element_from_c_string)
8175 (next_element_from_buffer): Add xassert's for correspondence
8176 between IT's object being iterated and it->bidi_it.string
8177 structure.
8178 (face_before_or_after_it_pos): Support bidi iteration.
8179 (next_element_from_c_string): Handle the case of the first string
8180 character that is not the first one in the visual order.
8181 (get_visually_first_element): New function, refactored from common
8182 parts of next_element_from_buffer, next_element_from_string, and
8183 next_element_from_c_string.
8184 (tool_bar_lines_needed, redisplay_tool_bar)
8185 (display_menu_bar): Force left-to-right direction. Add a FIXME
8186 comment for making that be controlled by a user option.
8187 (push_it, pop_it): Save and restore the state of the
8188 bidi iterator. Save and restore the bidi_p flag.
8189 (pop_it): Iterate out of display property for string iteration as
8190 well.
8191 (iterate_out_of_display_property): Support iteration over strings.
8192 (handle_single_display_spec): Set up it->bidi_it for iteration
8193 over a display string, and call bidi_init_it.
8194 (handle_single_display_spec, next_overlay_string)
8195 (get_overlay_strings_1, push_display_prop): Set up the bidi
8196 iterator for displaying display or overlay strings.
8197 (forward_to_next_line_start): Don't use the shortcut if
8198 bidi-iterating.
8199 (back_to_previous_visible_line_start): If handle_display_prop
8200 pushed the iterator stack, restore the internal state of the bidi
8201 iterator by calling bidi_pop_it same number of times.
8202 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
8203 and we are bidi-iterating, don't decrement the iterator position;
8204 instead, set the first_elt flag in the bidi iterator, to produce
8205 the same effect.
8206 (reseat_1): Remove redundant setting of string_from_display_prop_p.
8207 (push_display_prop): xassert that we are iterating a buffer.
8208 (push_it, pop_it): Save and restore paragraph_embedding member.
8209 (handle_single_display_spec, next_overlay_string)
8210 (get_overlay_strings_1, reseat_1, reseat_to_string)
8211 (push_display_prop): Set up the `unibyte' member of bidi_it.string
8212 correctly. Don't assume unibyte strings are not bidi-reordered.
8213 (compute_display_string_pos)
8214 (compute_display_string_end): Fix handling the case of C string.
8215 (push_it, pop_it): Save and restore from_disp_prop_p.
8216 (handle_single_display_spec, push_display_prop): Set the
8217 from_disp_prop_p flag.
8218 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
8219 (pop_it): Call iterate_out_of_display_property only if we are
8220 popping after iteration over a string that came from a display
8221 property. Fix a typo in popping stretch info. Add an assertion
8222 for verifying that the iterator position is in sync with the bidi
8223 iterator.
8224 (handle_single_display_spec, get_overlay_strings_1)
8225 (push_display_prop): Fix initialization of paragraph direction for
8226 string when that of the parent object is not yet determined.
8227 (reseat_1): Call bidi_init_it to resync the bidi
8228 iterator with IT's position. (Bug#7616)
8229 (find_row_edges): If ROW->start.pos gives position
8230 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
8231 (handle_stop, back_to_previous_visible_line_start, reseat_1):
8232 Reset the from_disp_prop_p flag.
8233 (SAVE_IT, RESTORE_IT): New macros.
8234 (pos_visible_p, face_before_or_after_it_pos)
8235 (back_to_previous_visible_line_start)
8236 (move_it_in_display_line_to, move_it_in_display_line)
8237 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8238 (try_scrolling, redisplay_window, display_line): Use them when
8239 saving a temporary copy of the iterator and restoring it back.
8240 (back_to_previous_visible_line_start, reseat_1)
8241 (init_iterator): Empty the bidi cache "stack".
8242 (move_it_in_display_line_to): If iterator ended up at
8243 EOL, but we never saw any buffer positions smaller than
8244 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8245 motion in bidi-reordered lines.
8246 (move_it_in_display_line_to): Record prev_method and prev_pos
8247 immediately before the call to set_iterator_to_next. Fixes cursor
8248 motion in bidi-reordered lines with stretch glyphs and strings
8249 displayed in margins. (Bug#8133) (Bug#8867)
8250 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8251 TO_CHARPOS.
640c8776
SM
8252 (pos_visible_p): Support positions in bidi-reordered lines.
8253 Save and restore bidi cache.
0bb23927
EZ
8254
8255 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8256 (bidi_paragraph_info): Delete unused struct.
8257 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8258 (bidi_cache_start): New variable.
8259 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8260 to zero.
8261 (bidi_cache_fetch_state, bidi_cache_search)
8262 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8263 (bidi_cache_find, bidi_peek_at_next_level)
8264 (bidi_level_of_next_char, bidi_find_other_level_edge)
8265 (bidi_move_to_visually_next): Compare cache index with
8266 bidi_cache_start rather than with zero.
8267 (bidi_fetch_char): Accept new argument STRING; all callers
8268 changed. Support iteration over a string. Support strings with
8269 display properties. Support unibyte strings. Fix the type of
8270 `len' according to what STRING_CHAR_AND_LENGTH expects.
8271 (bidi_paragraph_init, bidi_resolve_explicit_1)
8272 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
8273 (bidi_level_of_next_char, bidi_move_to_visually_next):
8274 Support iteration over a string.
0bb23927
EZ
8275 (bidi_set_sor_type, bidi_resolve_explicit_1)
8276 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8277 can now be zero (for strings); special values 0 and -1 were
8278 changed to -1 and -2, respectively.
8279 (bidi_char_at_pos): New function.
8280 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8281 Call it instead of FETCH_MULTIBYTE_CHAR.
8282 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8283 initialized to valid values.
8284 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8285 values.
8286 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8287 the test for valid cached positions. Fix the logic for looking up
8288 the sentinel state in the cache. GCPRO the Lisp string we are
8289 iterating.
8290 (bidi_push_it, bidi_pop_it): New functions.
8291 (bidi_initialize): Initialize the bidi cache start stack pointer.
8292 (bidi_cache_ensure_space): New function, refactored from part of
8293 bidi_cache_iterator_state. Don't assume the required size is just
8294 one BIDI_CACHE_CHUNK away.
8295 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8296 (bidi_count_bytes, bidi_char_at_pos): New functions.
8297 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8298 always valid if bidi_cache_idx is valid.
8299 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8300 is valid if it's going to be used.
8301 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8302 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
8303 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8304 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
8305 (bidi_find_other_level_edge, bidi_cache_start_stack):
8306 All variables related to cache indices are now EMACS_INT.
c965adc5 8307
0bb23927
EZ
8308 * dispextern.h (struct bidi_string_data): New structure.
8309 (struct bidi_it): New member `string'. Make flag members be 1-bit
8310 fields, and put them last in the struct.
640c8776
SM
8311 (compute_display_string_pos, compute_display_string_end):
8312 Update prototypes.
0bb23927
EZ
8313 (bidi_push_it, bidi_pop_it): Add prototypes.
8314 (struct iterator_stack_entry): New members bidi_p,
8315 paragraph_embedding, and from_disp_prop_p.
8316 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
8317 (bidi_shelve_cache, bidi_unshelve_cache):
8318 Declare prototypes.
0bb23927
EZ
8319
8320 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
8321 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
8322 and vector-like objects.
8323
8324 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
8325 cache around display iteration.
8326
8327 * window.c (Fwindow_end, window_scroll_pixel_based)
8328 (displayed_window_lines, Frecenter): Save and restore the bidi
8329 cache around display iteration.
8330
3bbd2265
LMI
83312011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8332
8333 * editfns.c (Fdelete_region): Clarify the use of the named
8334 parameters (bug#6788).
8335
adc47434
MR
83362011-07-14 Martin Rudalics <rudalics@gmx.at>
8337
8338 * indent.c (Fvertical_motion): Set and restore w->pointm when
8339 saving and restoring the window's buffer (Bug#9006).
8340
837c31f8
LMI
83412011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8342
8343 * editfns.c (Fstring_to_char): Clarify just what is returned
8344 (bug#6576). Text by Eli Zaretskii.
8345
ac389d0c
JB
83462011-07-13 Juanma Barranquero <lekktu@gmail.com>
8347
8348 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8349
0be0ce47
EZ
83502011-07-13 Eli Zaretskii <eliz@gnu.org>
8351
8352 * buffer.c (mmap_find): Fix a typo.
8353
cd18e7e3
JB
83542011-07-13 Johan Bockgård <bojohan@gnu.org>
8355
8356 Fix execution of x selection hooks.
8357 * xselect.c (Qx_lost_selection_functions)
8358 (Qx_sent_selection_functions): New vars.
8359 (syms_of_xselect): DEFSYM them.
8360 (x_handle_selection_request): Pass Qx_sent_selection_functions
8361 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8362 (x_handle_selection_clear,x_clear_frame_selections):
8363 Pass Qx_lost_selection_functions rather than
8364 Vx_lost_selection_functions to Frun_hook_with_args.
8365
47ea7f44
PE
83662011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8367
ac389d0c 8368 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8369 The old code sometimes used this field without initializing it.
8370
47ea7f44
PE
8371 * alloc.c (gc_sweep): Don't read past end of array.
8372 In theory, the old code could also have corrupted Emacs internals,
8373 though it'd be very unlikely.
8374
bc985c87
AS
83752011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8376
8377 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8378 argument. (Bug#4026)
bc985c87 8379
0cf34688
LMI
83802011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8381
b3dadd76
LMI
8382 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8383 key" (bug#4257).
8384
0cf34688
LMI
8385 * window.c (Fset_window_start): Doc fix (bug#4199).
8386 (Fset_window_hscroll): Ditto.
8387
270768cd
PE
83882011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8389
077e3dda 8390 Fix minor new problems caught by GCC 4.6.1.
270768cd 8391 * term.c (init_tty): Remove unused local.
490011a6 8392 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8393 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8394 not used otherwise.
270768cd 8395
b1f58454
CY
83962011-07-12 Chong Yidong <cyd@stupidchicken.com>
8397
8398 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8399
22b9578d
LMI
84002011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8401
6e70ab07
LMI
8402 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8403 are the mini-buffer and the echo area (bug#3320).
8404
22b9578d
LMI
8405 * term.c (init_tty): Remove support for supdup, c10 and perq
8406 terminals, which are no longer supported (bug#1482).
8407
8974cc9f
JB
84082011-07-10 Johan Bockgård <bojohan@gnu.org>
8409
8410 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8411
a560d974
JD
84122011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8413
8414 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8415 for non-popups (Bug#3642).
8416
1dae0f0a
AS
84172011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8418
268c2c36 8419 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8420 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8421 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8422 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8423 * data.c (fmod): Likewise.
8424 * dispnew.c (swap_glyphs_in_rows): Likewise.
8425 * emacs.c (memory_warning_signal): Likewise.
8426 * floatfns.c (float_error): Likewise.
8427 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8428 (otf_open, font_otf_capability, generate_otf_features)
8429 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8430 Likewise.
8431 * image.c (pbm_read_file): Likewise.
8432 * indent.c (string_display_width): Likewise.
8433 * intervals.c (check_for_interval, search_for_interval)
8434 (inc_interval_count, count_intervals, root_interval)
8435 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8436 * lread.c (defalias): Likewise.
268c2c36 8437 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8438 * regex.c (set_image_of_range_1, set_image_of_range)
8439 (regex_grow_registers): Likewise.
8440 * sysdep.c (strerror): Likewise.
8441 * termcap.c (valid_filename_p, tprint, main): Likewise.
8442 * tparam.c (main): Likewise.
8443 * unexhp9k800.c (run_time_remap, save_data_space)
8444 (update_file_ptrs, read_header, write_header, calculate_checksum)
8445 (copy_file, copy_rest, display_header): Likewise.
8446 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8447 Likewise.
8448 * xdisp.c (check_it): Likewise.
8449 * xfaces.c (register_color, unregister_color, unregister_colors):
8450 Likewise.
8451 * xfns.c (print_fontset_result): Likewise.
8452 * xrdb.c (member, fatal, main): Likewise.
8453
99033785
PE
84542011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8455
8456 Fix minor problems found by static checking (Bug#9031).
8457 * chartab.c (char_table_set_range, map_sub_char_table):
8458 Remove unused locals.
8459 (uniprop_table): Now static.
8460 * composite.c (_work_char): Remove unused static var.
8461
9cb2ac56
JB
84622011-07-09 Juanma Barranquero <lekktu@gmail.com>
8463
8464 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8465
f25661f0
JD
84662011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8467
8468 * gtkutil.c (qttip_cb): Remove code without function.
8469
8278c4fe
EZ
84702011-07-09 Eli Zaretskii <eliz@gnu.org>
8471
8472 * w32.c (pthread_sigmask): New stub.
8473
1692ae2d 84742011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8475
8a6ebd58 8476 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8477 sigprocmask is portable only for single-threaded applications, and
8478 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8479 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8480 (LIBES): Use it.
8481 * callproc.c (Fcall_process):
8482 * process.c (create_process):
8483 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8484 Use pthread_sigmask, not sigprocmask.
123403e4 8485
1b854618
JD
84862011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8487
8488 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8489 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8490 wrong (Bug#8591).
8491
3fe4b549
JD
84922011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8493
0ce7e563
JD
8494 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8495 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8496 (xg_hide_tooltip): Fix comment.
8497
3fe4b549
JD
8498 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8499 in registerServicesMenuSendTypes.
8500 (validRequestorForSendType): Don't check ns_return_types.
8501
8502 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8503 ns_return_type.
8504
5df75e47
JR
85052011-07-08 Jason Rumney <jasonr@gnu.org>
8506
22610910
JR
8507 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8508 SH_SHOW for hidden windows (Bug#5482).
8509
5df75e47
JR
8510 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8511 frame struct members of non-existent frames (Bug#6284).
8512
699c10bd
JD
85132011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8514
4393663b
JD
8515 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8516 variable firstTime not needed on OSX >= 10.6.
8517 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8518 >= 10.5. Use setKnobProportion, setDoubleValue.
8519
8520 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8521 (MAC_OS_X_VERSION_10_5): Define if not defined.
8522 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8523 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8524 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8525
8526 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8527 cString and lossyCString on OSX >= 10.4.
4393663b 8528
58179cce 8529 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8530 sizeToFit on OSX >= 10.2.
8531
8532 * nsimage.m (allocInitFromFile): Don't use deprecated method
8533 bestRepresentationForDevice on OSX >= 10.6.
8534
8535 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8536 to avoid warning.
8537
8538 * emacs.c: Declare unexec_init_emacs_zone.
8539
a63e0781
JD
8540 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8541
699c10bd
JD
8542 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8543
8544 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8545 on svcsMenu (Bug#8842).
8546
8547 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8548 ns_return_types.
8549 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8550
8551 * nsterm.m (QUTF8_STRING): Declare.
8552 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8553 (validRequestorForSendType): Return type is (id).
8554 Change indexOfObjectIdenticalTo to indexOfObject.
8555 Check if we have local selection before returning self (Bug#8842).
8556 (writeSelectionToPasteboard): Put local selection into paste board
8557 if we have a local selection (Bug#8842).
8558 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8559
8560 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8561 (ns_get_local_selection): Declare.
8562
54e10184
LMI
85632011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8564
9888ff71
LMI
8565 * keymap.c (describe_map_tree): Don't insert a double newline at
8566 the end of the buffer (bug#1169) and return whether we inserted
8567 something.
8568
54e10184
LMI
8569 * callint.c (Fcall_interactively): Change "reading args" to
8570 "providing args" to try to clarify what it does (bug#1010).
8571
15fa4783
KH
85722011-07-07 Kenichi Handa <handa@m17n.org>
8573
8574 * composite.c (composition_compute_stop_pos): Ignore a static
8575 composition starting before CHARPOS (Bug#8915).
8576
8577 * xdisp.c (handle_composition_prop): Likewise.
8578
a8815b00
EZ
85792011-07-07 Eli Zaretskii <eliz@gnu.org>
8580
8581 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8582 (Bug#9015)
8583
ef7b981d 85842011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8585
8586 * character.h (unicode_category_t): New enum type.
8587
8588 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8589 (Qchar_code_property_table): New variable.
8590 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8591 (UNIPROP_COMPRESSED_FORM_P): New macros.
8592 (char_table_ascii): Uncompress the compressed values.
8593 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8594 Uncompress the compressed values.
ac389d0c 8595 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8596 (char_table_ref_and_range): Uncompress the compressed values.
8597 (sub_char_table_set): New arg is_uniprop. Callers changed.
8598 Uncompress the compressed values.
8599 (sub_char_table_set_range): Args changed. Callers changed.
8600 (char_table_set_range): Adjuted for the above change.
8601 (map_sub_char_table): Delete args default_val and parent. Add arg
8602 top. Give decoded values to a Lisp function.
640c8776 8603 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8604 values to a Lisp function. Gcpro more variables.
8605 (uniprop_table_uncompress)
8606 (uniprop_decode_value_run_length): New functions.
8607 (uniprop_decoder, uniprop_decoder_count): New variables.
8608 (uniprop_get_decoder, uniprop_encode_value_character)
8609 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8610 New functions.
8611 (uniprop_encoder, uniprop_encoder_count): New variables.
8612 (uniprop_get_encoder, uniprop_table)
8613 (Funicode_property_table_internal, Fget_unicode_property_internal)
8614 (Fput_unicode_property_internal): New functions.
8615 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8616 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8617 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8618 char-code-property-alist.
8619
640c8776 8620 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8621 Vunicode_category_table.
8622
640c8776 8623 * font.c (font_range): Adjust for the change of
c805dec0
KH
8624 Vunicode_category_table.
8625
76b397fb
DN
86262011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8627
8628 * m/iris4d.h: Remove file, move contents ...
8629 * s/irix6-5.h: ... here.
8630
22b4128e
PE
86312011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8632
8633 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8634 * alloc.c (mark_buffer):
8635 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8636 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8637 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8638 This isn't true in general, and it's particularly not true
8639 if Emacs is configured with --with-wide-int.
8640 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8641 New macros, used in the buffer.c change.
8642
869795d6
JD
86432011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8644
8645 * xsettings.c: Use both GConf and GSettings if both are available.
8646 (store_config_changed_event): Add comment.
8647 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8648 (store_tool_bar_style_changed): New functions.
5e617bc2 8649 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8650 (struct xsettings): Move font inside HAVE_XFT.
8651 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8652 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8653 Move inside HAVE_XFT.
640c8776 8654 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8655 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8656 also.
8657 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8658 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8659 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8660 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8661 (parse_settings): Move check for font inside HAVE_XFT.
8662 (read_settings, apply_xft_settings): Add comment.
8663 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8664 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8665 call store_font_name_changed.
8666 (xft_settings_event): Add comment.
8667 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8668 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8669 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8670 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8671 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8672 (xsettings_get_system_font, xsettings_get_system_normal_font):
8673 Add comment.
869795d6 8674
d8ed26bd
PE
86752011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 Random fixes. E.g., (random) never returned negative values.
8678 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8679 subseconds part to the entropy, as that's a bit more random.
8680 Prefer signed to unsigned, since the signedness doesn't matter and
8681 in general we prefer signed. When given a limit, use a
8682 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8683 latter isn't right if USE_2_TAGS_FOR_INTS.
8684 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8685 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8686
cabf1cac
SM
86872011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8688
8689 * textprop.c (text_property_stickiness):
8690 Obey Vtext_property_default_nonsticky.
8691 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8692 * w32fns.c (syms_of_w32fns):
8693 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8694
6e9b2be9
PE
86952011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8696
8697 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8698 This is more efficient than Ffile_directory_p and avoids a minor race.
8699
90186c68
LMI
87002011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8701
7c301272
LMI
8702 * buffer.c (Foverlay_put): Say what the return value is
8703 (bug#7835).
8704
c4f2d8d4
LMI
8705 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8706 is a directory before asking whether to use the file name
8707 (bug#7564).
ad637907
LMI
8708 (barf_or_query_if_file_exists): Make the "File is a directory"
8709 error be more correct.
c4f2d8d4 8710
90186c68
LMI
8711 * fns.c (Frequire): Remove the mention of the .gz files, since
8712 that's installation-specific, but keep the mention of
8713 `get-load-suffixes'.
8714
da64016e
PE
87152011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8718 Report string overflow if the output is too long.
8719
7d47b580
JB
87202011-07-04 Juanma Barranquero <lekktu@gmail.com>
8721
a555cb87
JB
8722 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8723 (syms_of_gnutls): Remove duplicate DEFSYM for
8724 Qgnutls_bootprop_verify_hostname_error, an error for
8725 Qgnutls_bootprop_verify_error (which is no longer used).
8726
7d47b580
JB
8727 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8728 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8729 Also (re)move comments that are misplaced or no longer relevant.
8730
1e49bfab
LMI
87312011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8732
8733 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8734
1485f4c0
CY
87352011-07-03 Chong Yidong <cyd@stupidchicken.com>
8736
8737 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8738 and background color parameters if they have been changed.
8739
a9ab721e
LMI
87402011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8741
8742 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8743
cf7cff57
PE
87442011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8745
2e13213d
PE
8746 * xsettings.c (SYSTEM_FONT): Define only when used.
8747 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8748
cf7cff57
PE
8749 * keymap.c (access_keymap_1): Now static.
8750
7a8e04f7
CY
87512011-07-02 Chong Yidong <cyd@stupidchicken.com>
8752
8753 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8754 leave any prefix arg for the up event (Bug#1586).
8755
61352f62
LMI
87562011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8757
69bb1ef7
LMI
8758 * lread.c (syms_of_lread): Mention single symbols defined by
8759 `defvar' or `defconst' (bug#7154).
8760
61352f62 8761 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8762 (Frequire): Mention get-load-suffixes.
61352f62 8763
28545e04
MR
87642011-07-02 Martin Rudalics <rudalics@gmx.at>
8765
8766 * window.h (window): Remove clone_number slot.
8767 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8768 Remove.
8769 (make_parent_window, make_window, saved_window)
8770 (Fset_window_configuration, save_window_save): Don't deal with
8771 clone numbers.
8772 * buffer.c (Qclone_number): Remove declaration.
8773 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8774
3349e122
SM
87752011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8776
8777 Add multiple inheritance to keymaps.
8778 * keymap.c (Fmake_composed_keymap): New function.
8779 (Fset_keymap_parent): Simplify.
8780 (fix_submap_inheritance): Remove.
8781 (access_keymap_1): New function extracted from access_keymap to handle
8782 embedded parents and handle lists of maps.
8783 (access_keymap): Use it.
8784 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8785 (Fcopy_keymap): Handle embedded parents.
8786 (Fcommand_remapping, define_as_prefix): Simplify.
8787 (Fkey_binding): Simplify.
8788 (syms_of_keymap): Move minibuffer-local-completion-map,
8789 minibuffer-local-filename-completion-map,
8790 minibuffer-local-must-match-map, and
8791 minibuffer-local-filename-must-match-map to Elisp.
8792 (syms_of_keymap): Defsubr make-composed-keymap.
8793 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8794 (parse_menu_item): Trivial simplification.
8795
3279eb87
GM
87962011-07-01 Glenn Morris <rgm@gnu.org>
8797
8798 * Makefile.in (SETTINGS_LIBS): Fix typo.
8799
4550efdf
KI
88002011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8801
8802 * coding.c (Fencode_coding_string): Record the last coding system
8803 used, as the function doc string says (bug#8738).
8804
0949d2b6
JD
88052011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8806
8807 * xsettings.c (store_monospaced_changed): Take new font as arg and
8808 check for change against current_mono_font.
8809 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8810 (emacs_settings_constructor, emacs_settings_get_property)
8811 (emacs_settings_set_property, emacs_settings_class_init)
8812 (emacs_settings_init, gsettings_obj): Remove.
8813 (something_changedCB): New function for HAVE_GSETTINGS.
8814 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8815 with value as argument.
8816 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8817 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8818 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8819 "changed".
8820
8821 * xgselect.c: Add defined (HAVE_GSETTINGS).
8822 (xgselect_initialize): Ditto.
8823
8824 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8825 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8826 xg_select.
8827
bbc6b304
PE
88282011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8829
8830 * eval.c (struct backtrace): Simplify and port the data structure.
8831 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8832 signed bit field, as this assumption is not portable and it makes
8833 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8834 "char debug_on_exit : 1" as this is not portable either; instead,
8835 use the portable "unsigned int debug_on_exit : 1". Remove unused
8836 member evalargs. Remove obsolete comments about cc bombing out.
8837
9851bfc5
JD
88382011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8839
51bb811f 8840 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8841 Let HAVE_GSETTINGS override HAVE_GCONF.
8842 (store_monospaced_changed): New function.
8843 (EMACS_SETTINGS): A new type derived from GObject to handle
8844 GSettings notifications.
8845 (emacs_settings_constructor, emacs_settings_get_property)
8846 (emacs_settings_set_property, emacs_settings_class_init):
8847 New functions.
8848 (gsettings_client, gsettings_obj): New variables.
8849 (GSETTINGS_SCHEMA): New define.
8850 (something_changedCB): Call store_monospaced_changed.
8851 (init_gsettings): New function.
8852 (xsettings_initialize): Call init_gsettings.
8853 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8854 to NULL.
8855
640c8776 8856 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8857 GCONF_CFLAGS/LIBS.
8858
5386012d
MR
88592011-06-29 Martin Rudalics <rudalics@gmx.at>
8860
8861 * window.c (resize_root_window, grow_mini_window)
8862 (shrink_mini_window): Rename Qresize_root_window to
8863 Qwindow_resize_root_window and Qresize_root_window_vertically to
8864 Qwindow_resize_root_window_vertically.
8865
f13e0b08
PE
88662011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8867
8868 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8869
94515237
JB
88702011-06-27 Juanma Barranquero <lekktu@gmail.com>
8871
8872 * makefile.w32-in: Redesign dependencies so they reflect more
8873 clearly which files are directly included by each source file,
8874 and not through other includes.
8875
e43b6e43
MR
88762011-06-27 Martin Rudalics <rudalics@gmx.at>
8877
8878 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8879 (sort_overlays, overlay_strings): When an overlay's clone number
8880 matches the window's clone number process the overlay even if
8881 the overlay's window property doesn't match the current window.
8882
d68443dc
MR
8883 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8884 (Fwindow_hchild): Rename to Fwindow_left_child.
8885 (Fwindow_next): Rename to Fwindow_next_sibling.
8886 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8887 (resize_window_check): Rename to window_resize_check.
8888 (resize_window_apply): Rename to window_resize_apply.
8889 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8890 (Fdelete_other_windows_internal, resize_frame_windows)
8891 (Fsplit_window_internal, Fdelete_window_internal)
8892 (grow_mini_window, shrink_mini_window)
8893 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8894
c7e73be5
JD
88952011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8896
8897 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8898 (emacs_fixed_set_min_size): Remove.
8899 (emacs_fixed_new): Take frame as argument.
8900
8901 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8902 (_EmacsFixedPrivate): Remove minwidth/height.
8903 Add struct frame *f.
8904 (emacs_fixed_init): Initialize priv->f.
8905 (get_parent_class, emacs_fixed_set_min_size): Remove.
8906 (emacs_fixed_new): Set priv->f to argument.
8907 (emacs_fixed_get_preferred_width)
8908 (emacs_fixed_get_preferred_height): Use min_width/height from
8909 frames size_hint to set minimum and natural (Bug#8919).
8910 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8911 and use min_width/height from frames size_hint to set
8912 min_width/height (Bug#8919).
8913
8914 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8915 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8916 Fix indentation.
c7e73be5 8917
cf99dcf8
EZ
89182011-06-26 Eli Zaretskii <eliz@gnu.org>
8919
8920 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8921 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8922 called at ZV.
8923
029529ac
CY
89242011-06-26 Chong Yidong <cyd@stupidchicken.com>
8925
8926 * process.c (wait_reading_process_output): Bypass select if
8927 waiting for a cell while ignoring keyboard input, and input is
8928 pending. Suggested by Jan Djärv (Bug#8869).
8929
7a7ef429
PE
89302011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8931
8932 Use gnulib's dup2 module instead of rolling our own.
8933 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8934
11fdef7d 89352011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8936
8937 * dispnew.c (scrolling_window): Before scrolling, turn off a
8938 mouse-highlight in the window being scrolled.
8939
cd3520a4
JB
89402011-06-24 Juanma Barranquero <lekktu@gmail.com>
8941
8942 Move DEFSYM to lisp.h and use everywhere.
8943
8944 * character.h (DEFSYM): Move declaration...
8945 * lisp.h (DEFSYM): ...here.
8946
8947 * gnutls.c:
8948 * minibuf.c:
8949 * w32menu.c:
8950 * w32proc.c:
8951 * w32select.c: Don't include character.h.
8952
8953 * alloc.c (syms_of_alloc):
8954 * buffer.c (syms_of_buffer):
8955 * bytecode.c (syms_of_bytecode):
8956 * callint.c (syms_of_callint):
8957 * casefiddle.c (syms_of_casefiddle):
8958 * casetab.c (init_casetab_once):
8959 * category.c (init_category_once, syms_of_category):
8960 * ccl.c (syms_of_ccl):
8961 * cmds.c (syms_of_cmds):
8962 * composite.c (syms_of_composite):
8963 * dbusbind.c (syms_of_dbusbind):
8964 * dired.c (syms_of_dired):
8965 * dispnew.c (syms_of_display):
8966 * doc.c (syms_of_doc):
8967 * editfns.c (syms_of_editfns):
8968 * emacs.c (syms_of_emacs):
8969 * eval.c (syms_of_eval):
8970 * fileio.c (syms_of_fileio):
8971 * fns.c (syms_of_fns):
8972 * frame.c (syms_of_frame):
8973 * fringe.c (syms_of_fringe):
8974 * insdel.c (syms_of_insdel):
8975 * keymap.c (syms_of_keymap):
8976 * lread.c (init_obarray, syms_of_lread):
8977 * macros.c (syms_of_macros):
8978 * msdos.c (syms_of_msdos):
8979 * print.c (syms_of_print):
8980 * process.c (syms_of_process):
8981 * search.c (syms_of_search):
8982 * sound.c (syms_of_sound):
8983 * syntax.c (init_syntax_once, syms_of_syntax):
8984 * terminal.c (syms_of_terminal):
8985 * textprop.c (syms_of_textprop):
8986 * undo.c (syms_of_undo):
8987 * w32.c (globals_of_w32):
8988 * window.c (syms_of_window):
8989 * xdisp.c (syms_of_xdisp):
8990 * xfaces.c (syms_of_xfaces):
8991 * xfns.c (syms_of_xfns):
8992 * xmenu.c (syms_of_xmenu):
8993 * xsettings.c (syms_of_xsettings):
8994 * xterm.c (syms_of_xterm): Use DEFSYM.
8995
4228cf16
TZ
89962011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8997
cd3520a4 8998 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 8999
7fcccf1e
PE
90002011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9001
7efb4e0e
PE
9002 Integer and buffer overflow fixes (Bug#8873).
9003
ff5844ad
PE
9004 * print.c (printchar, strout): Check for string overflow.
9005 (PRINTPREPARE, printchar, strout):
9006 Don't set size unless allocation succeeds.
9007
90532f02
PE
9008 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
9009 for sizes. Check for string overflow more accurately.
9010 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
9011
6d84508d
PE
9012 * macros.c: Integer and buffer overflow fixes.
9013 * keyboard.h (struct keyboard.kbd_macro_bufsize):
9014 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
9015 Use ptrdiff_t, not int, for sizes.
9016 Don't increment bufsize until after realloc succeeds.
9017 Check for size-calculation overflow.
9018 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
9019
437b2cb4
PE
9020 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
9021
8b9ac8b4
PE
9022 * lread.c: Integer overflow fixes.
9023 (read_integer): Radix is now EMACS_INT, not int,
9024 to improve quality of diagnostics for out-of-range radices.
9025 Calculate buffer size correctly for out-of-range radices.
9026 (read1): Check for integer overflow in radices, and in
9027 read-circle numbers.
82cb60d3
PE
9028 (read_escape): Avoid int overflow.
9029 (Fload, openp, read_buffer_size, read1)
9030 (substitute_object_recurse, read_vector, read_list, map_obarray):
9031 Use ptrdiff_t, not int, for sizes.
9032 (read1): Use EMACS_INT, not int, for sizes.
20270765 9033 Check for size overflow.
8b9ac8b4 9034
7fcccf1e
PE
9035 * image.c (cache_image): Check for size arithmetic overflow.
9036
bfbbd7e7
PE
9037 * lread.c: Integer overflow issues.
9038 (saved_doc_string_size, saved_doc_string_length)
9039 (prev_saved_doc_string_size, prev_saved_doc_string_length):
9040 Now ptrdiff_t, not int.
9041 (read1): Don't assume doc string length fits in int. Check for
9042 out-of-range doc string lengths.
9043 (read_list): Don't assume file position fits in int.
39019e54 9044 (read_escape): Check for hex character overflow.
bfbbd7e7 9045
4e323265
LL
90462011-06-22 Leo Liu <sdl.web@gmail.com>
9047
9048 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
9049 Move to minibuffer.el.
9050
85fece3e
PE
90512011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9052
20b84ce9 9053 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
9054 The following patches are for when GLYPH_DEBUG && !XASSERT.
9055 * dispextern.h (trace_redisplay_p, dump_glyph_string):
9056 * dispnew.c (flush_stdout):
9057 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
9058 Mark as externally visible.
9059 * dispnew.c (check_window_matrix_pointers): Now static.
9060 * dispnew.c (window_to_frame_vpos):
9061 * xfns.c (unwind_create_frame):
9062 * xterm.c (x_check_font): Remove unused local.
9063 * scroll.c (CHECK_BOUNDS):
9064 * xfaces.c (cache_fache): Rename local to avoid shadowing.
9065 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
9066 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
9067 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
9068 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
9069 Now static.
9070 (debug_method_add): Use va_list and vsprintf rather than relying
9071 on undefined behavior with wrong number of arguments.
9072 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
9073 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
9074 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
9075 since we're not interested in debugging glyphs with old libraries.
9076 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
9077 GCC 4.6.0's static checking.
9078
0766b489
PE
90792011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9080
31fd4b32
PE
9081 Integer overflow and signedness fixes (Bug#8873).
9082 A few related buffer overrun fixes, too.
9083
b79e8648
PE
9084 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
9085
0766b489
PE
9086 * dispextern.h (struct face.stipple):
9087 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
9088 (x_bitmap_mask, x_allocate_bitmap_record)
9089 (x_create_bitmap_from_data, x_create_bitmap_from_file)
9090 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
9091 (x_create_bitmap_from_xpm_data):
9092 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
9093 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
9094 (.bitmaps_last):
9095 * xfaces.c (load_pixmap):
9096 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
9097 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
9098 (.bitmaps_last, struct x_output.icon_bitmap):
9099 Use ptrdiff_t, not int, for bitmap indexes.
9100 (x_allocate_bitmap_record): Check for size overflow.
9101 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
9102
b081724f
PE
9103 Use ptrdiff_t, not int, for overlay counts.
9104 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
9105 * editfns.c (overlays_around, get_pos_property):
9106 * textprop.c (get_char_property_and_overlay):
9107 * xdisp.c (next_overlay_change, note_mouse_highlight):
9108 * xfaces.c (face_at_buffer_position):
21514da7
PE
9109 * buffer.c (OVERLAY_COUNT_MAX): New macro.
9110 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
9111 (Fnext_overlay_change, Fprevious_overlay_change)
9112 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 9113 Use ptrdiff_t, not int, for sizes.
21514da7 9114 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 9115
3de73e5e
PE
9116 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
9117
2606c57b
PE
9118 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
9119 (x_session_initialize): Do not assume string length fits in int.
9120
aaafe47a
PE
9121 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
9122 This is unlikely, but can occur if DPI is outlandish.
9123
2674ddc8 9124 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
9125 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
9126
28154962
PE
9127 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
9128 * xrdb.c (magic_file_p, search_magic_path):
9129 Omit last arg SUFFIX; it was always 0. All callers changed.
9130 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
9131
7de51af5
PE
9132 * xfont.c (xfont_match): Avoid need for strlen.
9133
25ed6cc3
PE
9134 * xfns.c: Don't assume strlen fits in int.
9135 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
9136
4eab31dd
PE
9137 * xdisp.c (message_log_check_duplicate): Return intmax_t,
9138 not unsigned long, as we prefer signed integers. All callers changed.
9139 Detect integer overflow in repeat count.
9140 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 9141 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 9142
171e2a58
PE
9143 * termcap.c: Don't assume sizes fit in int and never overflow.
9144 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
9145 (gobble_line): Check for size-calculation overflow.
9146
ad39faca 9147 * minibuf.c (Fread_buffer):
6e5bb2dc 9148 * lread.c (intern, intern_c_string):
74ca2eb3
PE
9149 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
9150 Don't assume string length fits in int.
9151
52c61c22 9152 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
9153 * gtkutil.c (style_changed_cb): Avoid need for strlen.
9154
b5b8c9e5
PE
9155 * font.c: Don't assume string length fits in int.
9156 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
9157 Use ptrdiff_t, not int.
ccd6111c
PE
9158 (font_intern_prop): Don't assume string length fits in int.
9159 Don't assume integer property fits in fixnum.
9160 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 9161
882f0d81 9162 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 9163 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
9164 Reformulate so as not to need the command string.
9165 Invoke gzip -cd rather than gunzip, as it's more portable.
9166 (lock_info_type, lock_file_1, lock_file):
9167 Don't assume pid_t and time_t fit in unsigned long.
9168 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
9169 (current_lock_owner): Prefer signed type for sizes.
9170 Use memcpy, not strncpy, where memcpy is what is really wanted.
9171 Don't assume (via atoi) that time_t and pid_t fit in int.
9172 Check for time_t and/or pid_t out of range, e.g., via a network share.
9173 Don't alloca where an auto var works fine.
9174
93f4cf88
PE
9175 * fileio.c: Fix some integer overflow issues.
9176 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
9177 Don't assume string length fits in int.
9178 (directory_file_name): Don't assume string length fits in long.
9179 (make_temp_name): Don't assume pid fits in int, or that its print
9180 length is less than 20.
9181
f3e92b69
PE
9182 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
9183
1bfdaf10
PE
9184 * coding.c (make_subsidiaries): Don't assume string length fits in int.
9185
35016e9a
PE
9186 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
9187
3d1e65a1
PE
9188 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
9189 We prefer signed integers, even for size calculations.
9190
0b963a93
PE
9191 * emacs.c: Don't assume string length fits in 'int'.
9192 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
9193 (main): Don't invoke strlen when not needed.
9194
573f4b54
PE
9195 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
9196 (XD_DEBUG_MESSAGE): Don't waste a byte.
9197
989f33ba
PE
9198 * callproc.c (getenv_internal_1, getenv_internal)
9199 (Fgetenv_internal):
965d34eb
PE
9200 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
9201
e4d29b33
PE
9202 * lread.c (invalid_syntax): Omit length argument.
9203 All uses changed. This doesn't fix a bug, but it simplifies the
9204 code away from its former Hollerith-constant appearance, and it's
9205 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 9206 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 9207
eb49b136
PE
9208 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
9209 This didn't break anything, but it didn't help either.
9210 It's confusing to put a bogus integer in a place where the actual
9211 value does not matter.
9f62aeb1 9212 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 9213 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 9214
15375a22
PE
9215 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
9216 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
9217 implementation.
b61cc01c
PE
9218 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
9219 We prefer signed types, and the value cannot exceed the EMACS_INT
9220 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
9221 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
9222 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
9223 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 9224
53b2623d
PE
9225 * indent.c (sane_tab_width): New function.
9226 (current_column, scan_for_column, Findent_to, position_indentation)
9227 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 9228 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 9229
51cab52b 9230 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 9231
f2ed8a70
PE
9232 * lisp.h (lint_assume): New macro.
9233 * composite.c (composition_gstring_put_cache):
9234 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
9235
abe80cc6
PE
9236 * editfns.c, insdel.c:
9237 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 9238
b02c740e
PE
9239 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9240
ebc96716
PE
9241 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9242
b4e50fa0 9243 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 9244 Use much-faster test for byte-length change.
311d5d7c 9245 Don't assume string byte-length fits in 'int'.
a4cf38e4 9246 Check that character arg fits in 'int'.
85461888 9247 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 9248
c0c1ee9f
PE
9249 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9250
a498d7f4
PE
9251 * fns.c (concat): Catch string overflow earlier.
9252 Do not rely on integer wraparound.
9253
51cab52b
PE
9254 * dispextern.h (struct it.overlay_strings_charpos)
9255 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
9256 * xdisp.c (forward_to_next_line_start)
9257 (back_to_previous_visible_line_start)
9258 (reseat_at_next_visible_line_start, next_element_from_buffer):
9259 Don't arbitrarily truncate the value of 'selective' to int.
9260
76031fad
PE
9261 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9262
5eb55db9
PE
9263 * composite.c: Don't truncate sizes to 'int'.
9264 (composition_gstring_p, composition_reseat_it)
9265 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
9266 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9267 not EMACS_UINT, for indexes.
5eb55db9 9268
0703a717
PE
9269 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9270
d6202519
PE
9271 * buffer.c: Include <verify.h>.
9272 (struct sortvec.priority, struct sortstr.priority):
8961a454 9273 Now EMACS_INT, not int.
c20998a7 9274 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
9275 (struct sortstr.size, record_overlay_string)
9276 (struct sortstrlist.size, struct sortlist.used):
9277 Don't truncate size to int.
9278 (record_overlay_string): Check for size-calculation overflow.
d6202519 9279 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 9280
d5a19415
JM
92812011-06-22 Jim Meyering <meyering@redhat.com>
9282
029529ac 9283 Don't leak an XBM-image-sized buffer
d5a19415
JM
9284 * image.c (xbm_load): Free the image buffer after using it.
9285
a9041e6c
PE
92862011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9287
9288 Port to Sun C.
9289 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9290 that Sun C diagnosed.
9291 * fns.c (secure_hash): Fix pointer signedness issue.
9292 * intervals.c (static_offset_intervals): New function.
9293 (offset_intervals): Use it.
9294
7f3f739f
LL
92952011-06-21 Leo Liu <sdl.web@gmail.com>
9296
9297 * deps.mk (fns.o):
9298 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9299 sha512.h.
9300
9301 * fns.c (secure_hash): Rename from crypto_hash_function and change
9302 the first arg to accept symbols.
5b66d427 9303 (Fsecure_hash): New primitive.
7f3f739f
LL
9304 (syms_of_fns): New symbols.
9305
76147d94
DD
93062011-06-20 Deniz Dogan <deniz@dogan.se>
9307
9308 * process.c (Fset_process_buffer): Clarify return value in
9309 docstring.
9310
7d7d0045
CY
93112011-06-18 Chong Yidong <cyd@stupidchicken.com>
9312
9313 * dispnew.c (add_window_display_history): Use BVAR.
9314
9315 * xdisp.c (debug_method_add): Use BVAR.
9316 (check_window_end, dump_glyph_matrix, dump_glyph)
9317 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
9318
9319 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
9320 Likewise.
9321
9322 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
9323 check till after the cache is created in init_frame_faces.
9324
ff2bc410
SM
93252011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
9326
9327 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9328
28177add
PE
93292011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9330
dd3482fe
PE
9331 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9332 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9333 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9334
393d71f3 9335 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9336 * fileio.c (Finsert_file_contents):
9337 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9338 Remove the old (too-loose) buffer overflow checks.
9339 They weren't needed, since make_gap checks for buffer overflow.
9340 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9341 The old code merely checked for Emacs fixnum overflow, and relied
9342 on undefined (wraparound) behavior. The new code avoids undefined
9343 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9344
2e6813b0 9345 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9346 Tune. Don't use wider integers than needed. Don't use alloca.
9347 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9348
599a9e4f
PE
9349 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9350
99561444
PE
9351 * insdel.c, lisp.h (buffer_overflow): New function.
9352 (insert_from_buffer_1, replace_range, replace_range_2):
9353 * insdel.c (make_gap_larger):
9354 * editfns.c (Finsert_char):
9355 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9356
28177add
PE
9357 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9358
e69dafad
PE
93592011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9360
4baa020d 9361 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9362
b1c46f02
PE
9363 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9364 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9365
e69dafad
PE
9366 * fileio.c: Don't assume EMACS_INT fits in off_t.
9367 (emacs_lseek): New static function.
9368 (Finsert_file_contents, Fwrite_region): Use it.
9369 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9370
566684ea
PE
9371 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9372
e6966cd6
PE
9373 * fns.c: Don't overflow int when computing a list length.
9374 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9375 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9376 truncation on 64-bit hosts. Check for QUIT every
9377 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9378 faster and is responsive enough.
9379 (Flength): Report an error instead of overflowing an integer.
9380 (Fsafe_length): Return a float if the value is not representable
9381 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9382 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9383 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9384
dd0b0efb
PE
9385 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9386 (header_size, word_size): New constants.
9387 (allocate_vectorlike): Don't check size overflow here.
9388 (allocate_vector): Check it here instead, since this is the only
9389 caller of allocate_vectorlike that could cause overflow.
9390 Check that the new vector's length is representable as a fixnum.
9391
86fe5cfe
PE
9392 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9393 The previous code was bogus. For example, next_almost_prime (32)
9394 returned 39, which is undesirable as it is a multiple of 3; and
9395 next_almost_prime (24) returned 25, which is a multiple of 5 so
9396 why was the code bothering to check for multiples of 7?
9397
80e88859
PE
9398 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9399
4a2f0ad6
PE
9400 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9401
f66c7cf8
PE
9402 Variadic C functions now count arguments with ptrdiff_t.
9403 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9404 Back then I didn't know that the Emacs coding style prefers signed int.
9405 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9406 were being counted with int, which may truncate counts on 64-bit
9407 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9408 * lisp.h (struct Lisp_Subr.function.aMANY)
9409 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9410 Arg counts are now ptrdiff_t, not size_t.
9411 All variadic functions and their callers changed accordingly.
9412 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9413 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9414 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9415 * callint.c (Fcall_interactively): Check arg count for overflow,
9416 to avoid potential buffer overrun. Use signed char, not 'int',
9417 for 'varies' array, so that we needn't bother to check its size
9418 calculation for overflow.
9419 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9420 * eval.c (apply_lambda):
9421 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9422 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9423 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9424
a1759b76
PE
9425 * callint.c (Fcall_interactively): Don't use index var as event count.
9426
d96be9fc
PE
9427 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9428 * mem-limits.h (SIZE): Remove; no longer used.
9429
a690a978 9430 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9431
578c21e6
PE
9432 Remove unnecessary casts.
9433 * xterm.c (x_term_init):
9434 * xfns.c (x_set_border_pixel):
9435 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9436 These aren't needed now that we assume ANSI C.
9437
96f53c6c
PE
9438 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9439 It's more likely to cause problems (due to unsigned overflow)
9440 than to cure them.
9441
83c77d31
PE
9442 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9443
ee2079f1
PE
9444 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9445
6da65536
PE
9446 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9447
7147c4a4
PE
9448 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9449
193e32d9
PE
9450 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9451
e5533da6
PE
9452 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9453
9910e595
PE
9454 GLYPH_CODE_FACE returns EMACS_INT, not int.
9455 * dispextern.h (merge_faces):
9456 * xfaces.c (merge_faces):
01103c44
PE
9457 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9458 Don't assume EMACS_INT fits in int.
9910e595 9459
2638320e
PE
9460 * character.h (CHAR_VALID_P): Remove unused parameter.
9461 * fontset.c, lisp.h, xdisp.c: All uses changed.
9462
045eb8d9
PE
9463 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9464
c1f134b5
PE
9465 * fns.c (concat): Minor tuning based on overflow analysis.
9466 This doesn't fix any bugs. Use int to hold character, instead
9467 of constantly refetching from Emacs object. Use XFASTINT, not
9468 XINT, for value known to be a character. Don't bother comparing
9469 a single byte to 0400, as it's always less.
9470
395fcb93 9471 * floatfns.c (Fexpt):
327eeec8
PE
9472 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9473
abbd3d23
PE
9474 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9475 for characters.
9476
684a03ef
PE
9477 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9478
0fed43f3
PE
9479 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9480 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9481 incorrectly succeed when S was a string, because 4294967386 was
9482 truncated before it was used.
9483
8fd02eb7
PE
9484 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9485 Otherwise, an out-of-range integer could cause undefined behavior
9486 on a 64-bit host.
9487
f8c86b69
PE
9488 * composite.c: Use int, not EMACS_INT, for characters.
9489 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9490 EMACS_INT, for values that are known to be in character range.
9491 This doesn't fix any bugs but is the usual style inside Emacs and
9492 may generate better code on 32-bit machines.
9493
34206dd2
PE
9494 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9495 This is for reasons similar to the recent CHAR_STRING fix.
9496 * charset.c (Fencode_char): Check that character arg is actually
9497 a character. Pass an int to ENCODE_CHAR.
9498 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9499 wider than 'int', as a compile-time check to prevent future regressions
9500 in this area.
9501
c5958d4c 9502 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9503
9504 Make sure a 64-bit char is never passed to CHAR_STRING.
9505 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9506 by silently ignoring the top 32 bits, allowing some values
9507 that were far too large to be valid characters.
9508 * character.h: Include <verify.h>.
9509 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9510 arguments are no wider than unsigned, as a compile-time check
9511 to prevent future regressions in this area.
9512 * data.c (Faset):
01103c44 9513 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9514 (Fsubst_char_in_region):
9515 * fns.c (concat):
9516 * xdisp.c (decode_mode_spec_coding):
9517 Adjust to CHAR_STRING's new requirement.
9518 * editfns.c (Finsert_char, Fsubst_char_in_region):
9519 * fns.c (concat): Check that character args are actually
9520 characters. Without this test, these functions did the wrong
9521 thing with wildly out-of-range values on 64-bit hosts.
9522
d37ca623
PE
9523 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9524 These casts should not be needed on 32-bit hosts, either.
9525 * keyboard.c (read_char):
9526 * lread.c (Fload): Remove casts to unsigned.
9527
ea204efb
PE
9528 * lisp.h (UNSIGNED_CMP): New macro.
9529 This fixes comparison bugs on 64-bit hosts.
9530 (ASCII_CHAR_P): Use it.
9531 * casefiddle.c (casify_object):
01103c44 9532 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9533 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9534 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9535 * dispextern.h (FACE_FROM_ID):
9536 * keyboard.c (read_char): Use UNSIGNED_CMP.
9537
41cb286c
PE
9538 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9539 not to EMACS_INT, to avoid GCC warning.
9540
4a1b9832
PE
9541 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9542
55daad71
PE
9543 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9544 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9545 isn't needed on 32-bit machines.
8f95c75c 9546
01103c44
PE
9547 * buffer.c (Fgenerate_new_buffer_name):
9548 Use EMACS_INT for count, not int.
0ceccced 9549 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9550
9551 * data.c (Qcompiled_function): Now static.
9552
c6f072e7
PE
9553 * window.c (window_body_lines): Now static.
9554
20ce5912
PE
9555 * image.c (gif_load): Rename local to avoid shadowing.
9556
9c4c5f81
PE
9557 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9558 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9559 * alloc.c (make_save_value): Integer argument is now of type
9560 ptrdiff_t, not int.
9561 (mark_object): Use ptrdiff_t, not int.
9562 * lisp.h (pD): New macro.
9563 * print.c (print_object): Use it.
9564
c0c5c8ae
PE
9565 * alloc.c: Use EMACS_INT, not int, to count objects.
9566 (total_conses, total_markers, total_symbols, total_vector_size)
9567 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9568 (total_free_floats, total_floats, total_free_intervals)
9569 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9570 Now EMACS_INT, not int. All uses changed.
9571 (Fgarbage_collect): Compute overall total using a double, so that
9572 integer overflow is less likely to be a problem. Check for overflow
9573 when converting back to an integer.
5a25e253
PE
9574 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9575 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9576 These were 'int' variables that could overflow on 64-bit hosts;
9577 they were never used, so remove them instead of repairing them.
211a0b2a 9578 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9579 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9580 Previously, this ceilinged at INT_MAX, but that doesn't work on
9581 64-bit machines.
e46bb31a 9582 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9583
c78baabf 9584 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9585 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9586 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9587 when a (possibly-narrower) signed value would do just as well.
9588 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9589
c9d624c6
PE
9590 * alloc.c: Catch some string size overflows that we were missing.
9591 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9592 for convenience in STRING_BYTES_MAX.
9593 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9594 The definition here is exact; the one in lisp.h was approximate.
9595 (allocate_string_data): Check for string overflow. This catches
9596 some instances we weren't catching before. Also, it catches
9597 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9598 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9599 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9600
c9d624c6
PE
9601 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9602 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9603 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9604
353032ce
PE
9605 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9606
2bccce07
PE
9607 * alloc.c (Fmake_string): Check for out-of-range init.
9608
0ac30604
SM
96092011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9610
9611 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9612
c195f2de
JD
96132011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9614
9615 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9616 xg_get_default_scrollbar_width.
9617
9618 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9619 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9620 (style_changed_cb): Call update_theme_scrollbar_width and call
9621 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9622 all frames (Bug#8505).
9623 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9624 Call gtk_window_set_resizable if HAVE_GTK3.
9625 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9626 and height if HAVE_GTK3 (Bug#8505).
9627 (scroll_bar_width_for_theme): New variable.
9628 (update_theme_scrollbar_width): New function.
9629 (xg_get_default_scrollbar_width): Move code to
9630 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9631 (xg_initialize): Call update_theme_scrollbar_width.
9632
9633 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9634
9635 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9636
e10ac9f1
MR
96372011-06-12 Martin Rudalics <rudalics@gmx.at>
9638
9639 * frame.c (make_frame): Call other_buffer_safely instead of
9640 other_buffer.
9641
9642 * window.c (temp_output_buffer_show): Call display_buffer with
9643 second argument Vtemp_buffer_show_specifiers and reset latter
9644 immediately after the call.
9645 (Vtemp_buffer_show_specifiers): New variable.
9646 (auto_window_vscroll_p, next_screen_context_lines)
9647 (Vscroll_preserve_screen_position): Remove leading asterisks from
9648 doc-strings.
9649
2d3c217e 96502011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9651
7b7f97e8 9652 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9653 * buffer.c (Qclone_number): Remove for now, as it's unused.
9654 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9655 (record_buffer): Remove unused local.
9656 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9657 (set_frame_buffer_list): Remove; unused.
9658 * frame.h (other_visible_frames): Remove decl.
9659 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9660 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9661 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9662 if HAVE_GPM.
9663 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9664 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9665 Define only if HAVE_GPM.
9666 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9667 (update_hints_inhibit): Remove; never set. All uses removed.
9668 * widgetprv.h (emacsFrameClassRec): Remove decl.
9669 * window.c (delete_deletable_window): Now returns void, since it
9670 wasn't returning anything.
9671 (compare_window_configurations): Remove unused locals.
9672 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9673 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9674 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9675 the same widths as pointers. This follows up on the 2011-05-06 patch.
9676 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9677 * xterm.h: Likewise.
9678 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9679
1384b89e
JB
96802011-06-12 Juanma Barranquero <lekktu@gmail.com>
9681
9682 * makefile.w32-in: Update dependencies.
9683 (LISP_H): Add lib/intprops.h.
9684
1100a63c
CY
96852011-06-11 Chong Yidong <cyd@stupidchicken.com>
9686
9687 * image.c (gif_load): Add animation frame delay to the metadata.
9688 (syms_of_image): Use DEFSYM. New symbol `delay'.
9689
6198ccd0
MR
96902011-06-11 Martin Rudalics <rudalics@gmx.at>
9691
9692 * window.c (delete_deletable_window): Re-add.
9693 (Fset_window_configuration): Rewrite to handle dead buffers and
9694 consequently deletable windows.
9695 (window_tree, Fwindow_tree): Remove. Supply functionality in
9696 window.el.
9697 (compare_window_configurations): Simplify code.
9698
b6e3633c
AS
96992011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9700
1ab0dee5
AS
9701 * image.c (imagemagick_load_image): Fix type mismatch.
9702 (Fimagemagick_types): Likewise.
9703
b6e3633c
AS
9704 * window.h (replace_buffer_in_windows): Declare.
9705
9397e56f
MR
97062011-06-11 Martin Rudalics <rudalics@gmx.at>
9707
9708 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9709 Qclone_number. Remove external declaration of Qdelete_window.
9710 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9711 code.
640c8776
SM
9712 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9713 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9714 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9715 buffer list implementation.
9716 (other_buffer_safely): New function.
9717 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9718 calls to replace_buffer_in_windows and
9719 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9720 if allowed.
9721 (record_buffer): Inhibit quitting and rewrite using quittable
9722 functions. Run Qbuffer_list_update_hook if allowed.
9723 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9724 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9725 Move switch-to-buffer to window.el.
9397e56f
MR
9726 (bury-buffer): Move to window.el.
9727 (Vbuffer_list_update_hook): New variable.
9728
9729 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9730 section.
9731
9732 * window.h (resize_frame_windows): Move up in code.
9733 (Fwindow_frame): Remove EXFUN.
9734 (replace_buffer_in_all_windows): Remove prototype.
9735 (replace_buffer_in_windows_safely): Add prototype.
9736
9737 * window.c: Declare Qdelete_window static again. Move down
9738 declaration of select_count.
9739 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9740 (Fother_window): Move to window.el.
9741 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9742 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9743 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9744 window.el.
9745 (replace_buffer_in_windows): Implement by calling
9746 Qreplace_buffer_in_windows.
9747 (replace_buffer_in_all_windows): Remove with some functionality
9748 moved into replace_buffer_in_windows_safely.
9749 (replace_buffer_in_windows_safely): New function.
9750 (select_window_norecord, select_frame_norecord): Move in front
9751 of run_window_configuration_change_hook. Remove now obsolete
9752 declarations.
640c8776
SM
9753 (Fset_window_buffer): Rewrite doc-string.
9754 Call Qrecord_window_buffer.
9397e56f
MR
9755 (keys_of_window): Move binding for other-window to window.el.
9756
b50691aa
CY
97572011-06-11 Chong Yidong <cyd@stupidchicken.com>
9758
9759 * dispextern.h (struct image): Replace data member, whose int_val
9760 and ptr_val fields were not used by anything, with a single
9761 lisp_val object.
9762
9763 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9764 (gif_clear_image, gif_load, imagemagick_load_image)
9765 (gs_clear_image, gs_load): Callers changed.
9766
3f754b86
PE
97672011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9768
cca69397
PE
9769 * buffer.h: Include <time.h>, for time_t.
9770 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9771
109e28d0
PE
9772 Fix minor problems found by static checking.
9773
60737f02
PE
9774 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9775
4b66faf3
PE
9776 Make identifiers static if they are not used in other modules.
9777 * data.c (Qcompiled_function, Qframe, Qvector):
9778 * image.c (QimageMagick, Qsvg):
9779 * minibuf.c (Qmetadata):
9780 * window.c (resize_window_check, resize_root_window): Now static.
9781 * window.h (resize_window_check, resize_root_window): Remove decls.
9782
109e28d0
PE
9783 * window.c (window_deletion_count, delete_deletable_window):
9784 Remove; unused.
46a4ce9e
PE
9785 (window_body_lines): Now static.
9786 (Fdelete_other_windows_internal): Mark vars as initialized.
9787 Make sure 'resize_failed' is initialized.
9788 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9789 (resize_window_apply): Remove unused local.
9790 * window.h (delete_deletable_window): Remove decl.
9791
109e28d0 9792 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9793 (imagemagick_load_image): Fix pointer signedness problem by changing
9794 last arg from unsigned char * to char *. All uses changed.
9795 Also, fix a local for similar reasons.
9796 Remove unused locals. Remove locals to avoid shadowing.
9797 (fn_rsvg_handle_free): Remove; unused.
9798 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9799 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9800
3f754b86
PE
9801 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9802
2547adb1
CY
98032011-06-10 Chong Yidong <cyd@stupidchicken.com>
9804
9805 * image.c (gif_load): Fix omitted cast error introduced by
9806 2011-06-06 change.
9807
2c8e37d4
MR
98082011-06-10 Martin Rudalics <rudalics@gmx.at>
9809
9810 * window.h (resize_proportionally, orig_total_lines)
9811 (orig_top_line): Remove from window structure.
9812 (set_window_height, set_window_width, change_window_heights)
9813 (Fdelete_window): Remove prototypes.
9814 (resize_frame_windows): Remove duplicate declaration.
9815
440a42e3
EZ
98162011-06-10 Eli Zaretskii <eliz@gnu.org>
9817
9818 * window.h (resize_frame_windows, resize_window_check)
9819 (delete_deletable_window, resize_root_window)
9820 (resize_frame_windows): Declare prototypes.
9821
9822 * window.c (resize_window_apply): Make definition be "static" to
9823 match the prototype.
9824
562dd5e9
MR
98252011-06-10 Martin Rudalics <rudalics@gmx.at>
9826
9827 * window.c: Remove declarations of Qwindow_size_fixed,
9828 window_min_size_1, window_min_size_2, window_min_size,
9829 size_window, window_fixed_size_p, enlarge_window, delete_window.
9830 Remove static from declaration of Qdelete_window, it's
9831 temporarily needed by Fbury_buffer.
9832 (replace_window): Don't assign orig_top_line and
9833 orig_total_lines.
9834 (Fdelete_window, delete_window): Remove. Window deletion is
9835 handled by window.el.
640c8776
SM
9836 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9837 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9838 (Fdelete_other_windows): Remove. Deleting other windows is
9839 handled by window.el.
9840 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9841 handled in window.el.
9842 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9843 Window minimum sizes are handled in window.el.
9844 (shrink_windows, size_window, set_window_height)
9845 (set_window_width, change_window_heights, window_height)
9846 (window_width, CURBEG, CURSIZE, enlarge_window)
9847 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9848 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9849 handled in window.el.
9850 (make_dummy_parent): Rename to make_parent_window and give it a
9851 second argument horflag.
9852 (make_window): Don't set resize_proportionally any more.
9853 (Fsplit_window): Remove. Windows are split in window.el.
9854 (save_restore_action, save_restore_orig_size)
9855 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9856 Resize mini windows in window.el.
9857 (grow_mini_window, shrink_mini_window): Implement by calling
9858 Qresize_root_window_vertically, resize_window_check and
9859 resize_window_apply.
640c8776
SM
9860 (saved_window, Fset_window_configuration, save_window_save):
9861 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9862 resize_proportionally.
9863 (window_min_height, window_min_width): Move to window.el.
9864 (keys_of_window): Move bindings for delete-other-windows,
9865 split-window, delete-window and enlarge-window to window.el.
9866
9867 * buffer.c: Temporarily extern Qdelete_window.
9868 (Fbury_buffer): Temporarily call Qdelete_window instead of
9869 Fdelete_window (Fbury_buffer will move to window.el soon).
9870
9871 * frame.c (set_menu_bar_lines_1): Remove code handling
9872 orig_top_line and orig_total_lines.
9873
9874 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9875 set_window_height but set heights directly.
9876 (change_frame_size_1): Use resize_frame_windows.
9877
9878 * xdisp.c (init_xdisp): Don't use set_window_height but set
9879 heights directly.
9880
640c8776
SM
9881 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9882 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9883 run_window_configuration_change_hook.
9884
9885 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9886 instead of change_window_heights and run
9887 run_window_configuration_change_hook.
9888
1a13852e
MR
98892011-06-09 Martin Rudalics <rudalics@gmx.at>
9890
9891 * window.c (replace_window): Rename second argument REPLACEMENT to
9892 NEW. New third argument SETFLAG. Rewrite.
9893 (delete_window, make_dummy_parent): Call replace_window with
9894 third argument 1.
9895 (window_list_1): Move down in code.
9896 (run_window_configuration_change_hook): Move set_buffer part
9897 before select_frame_norecord part in order to unwind correctly.
9898 Rename count1 to count.
9899 (recombine_windows, delete_deletable_window, resize_root_window)
9900 (Fdelete_other_windows_internal)
9901 (Frun_window_configuration_change_hook, make_parent_window)
9902 (resize_window_check, resize_window_apply, Fresize_window_apply)
9903 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9904 (Fdelete_window_internal, Fresize_mini_window_internal):
9905 New functions.
1a13852e
MR
9906 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9907
f3d1777e
MR
99082011-06-08 Martin Rudalics <rudalics@gmx.at>
9909
496e208e
MR
9910 * window.h (window): Add some new members to window structure -
9911 normal_lines, normal_cols, new_total, new_normal, clone_number,
9912 splits, nest, prev_buffers, next_buffers.
9913 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9914 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9915
f3d1777e
MR
9916 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9917 Remove.
496e208e
MR
9918 (make_dummy_parent): Set new members of windows structure.
9919 (make_window): Move down in code. Handle new members of window
9920 structure.
9921 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9922 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9923 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9924 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9925 (Fset_window_next_buffers, Fset_window_clone_number):
9926 New functions.
496e208e
MR
9927 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9928 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9929 Doc-string fixes.
9930 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9931 Argument WINDOW can be now internal window too.
9932 (Fwindow_use_time): Move up in code.
9933 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9934 Rewrite doc-string.
9935 (Fset_window_configuration, saved_window)
9936 (Fcurrent_window_configuration, save_window_save): Handle new
9937 members of window structure.
b9e809c2
MR
9938 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9939 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9940 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9941 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9942 Qget_mru_window, Qresize_root_window,
9943 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9944 Qauto_buffer_name; staticpro them.
f3d1777e 9945
abde8f8c
MR
99462011-06-07 Martin Rudalics <rudalics@gmx.at>
9947
9948 * window.c (Fwindow_total_size, Fwindow_left_column)
9949 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9950 (Fwindow_list_1): New functions.
9951 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
9952 (Fwindow_width, Fscroll_left, Fscroll_right):
9953 Use window_body_cols instead of window_box_text_cols.
9954 (delete_window, Fset_window_configuration):
9955 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
9956 (delete_all_subwindows): Take a window as argument and not a
9957 structure. Rewrite.
190b47e6
MR
9958 (window_loop): Remove handling of GET_LRU_WINDOW and
9959 GET_LARGEST_WINDOW.
9960 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
9961
9962 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
9963 window_box_text_cols. delete_all_subwindows now takes a
9964 Lisp_Object as argument.
abde8f8c 9965
640c8776
SM
9966 * indent.c (compute_motion, Fcompute_motion):
9967 Use window_body_cols instead of window_box_text_cols.
abde8f8c 9968
fa8a67e6
MR
9969 * frame.c (delete_frame): Call delete_all_subwindows with root
9970 window as argument.
9971
a54e3482
DC
99722011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9973
9974 * fns.c (Fputhash): Document return value.
9975
60002bf5
CY
99762011-06-06 Chong Yidong <cyd@stupidchicken.com>
9977
9978 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9979
0c671da6 99802011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 9981
b862a52a 9982 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 9983
be44ca6c
PE
9984 Check for overflow when converting integer to cons and back.
9985 * charset.c (Fdefine_charset_internal, Fdecode_char):
9986 Use cons_to_unsigned to catch overflow.
9987 (Fencode_char): Use INTEGER_TO_CONS.
9988 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9989 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9990 * data.c (long_to_cons, cons_to_long): Remove.
9991 (cons_to_unsigned, cons_to_signed): New functions.
9992 These signal an error for invalid or out-of-range values.
9993 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9994 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9995 * font.c (Ffont_variation_glyphs):
9996 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9997 * lisp.h: Include <intprops.h>.
9998 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9999 (cons_to_signed, cons_to_unsigned): New decls.
10000 (long_to_cons, cons_to_long): Remove decls.
10001 * undo.c (record_first_change): Use INTEGER_TO_CONS.
10002 (Fprimitive_undo): Use CONS_TO_INTEGER.
10003 * xfns.c (Fx_window_property): Likewise.
10004 * xselect.c: Include <limits.h>.
10005 (x_own_selection, selection_data_to_lisp_data):
10006 Use INTEGER_TO_CONS.
10007 (x_handle_selection_request, x_handle_selection_clear)
10008 (x_get_foreign_selection, Fx_disown_selection_internal)
10009 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
10010 (lisp_data_to_selection_data): Use cons_to_unsigned.
10011 (x_fill_property_data): Use cons_to_signed.
10012 Report values out of range.
10013
d1f3d2af
PE
10014 Check for buffer and string overflow more precisely.
10015 * buffer.h (BUF_BYTES_MAX): New macro.
10016 * lisp.h (STRING_BYTES_MAX): New macro.
10017 * alloc.c (Fmake_string):
10018 * character.c (string_escape_byte8):
10019 * coding.c (coding_alloc_by_realloc):
10020 * doprnt.c (doprnt):
10021 * editfns.c (Fformat):
10022 * eval.c (verror):
10023 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
10024 since they may not be the same number.
10025 * editfns.c (Finsert_char):
10026 * fileio.c (Finsert_file_contents):
10027 Likewise for BUF_BYTES_MAX.
10028
dd52fcea
PE
10029 * image.c: Use ptrdiff_t, not int, for sizes.
10030 (slurp_file): Switch from int to ptrdiff_t.
10031 All uses changed.
10032 (slurp_file): Check that file size fits in both size_t (for
10033 malloc) and ptrdiff_t (for sanity and safety).
10034
7f9bbdbb
PE
10035 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
10036 if b->modtime has its maximal value.
10037
dfe18f82
PE
10038 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
10039
84acfcf0
PE
10040 Don't assume time_t can fit into int.
10041 * buffer.h (struct buffer.modtime): Now time_t, not int.
10042 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
10043 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
10044
ccd9a01a
PE
10045 Minor fixes for signed vs unsigned integers.
10046 * character.h (MAYBE_UNIFY_CHAR):
10047 * charset.c (maybe_unify_char):
10048 * keyboard.c (read_char, reorder_modifiers):
10049 XINT -> XFASTINT, since the integer must be nonnegative.
10050 * ftfont.c (ftfont_spec_pattern):
10051 * keymap.c (access_keymap, silly_event_symbol_error):
10052 XUINT -> XFASTINT, since the integer must be nonnegative.
10053 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
10054 since it makes no difference and we prefer signed.
10055 * keyboard.c (record_char): Use XUINT when all the neighbors do.
10056 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
10057 nonnegative.
10058
d6d100dd
SM
100592011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
10060
10061 * window.h (Fwindow_frame): Declare.
10062
2b6148e4
PE
100632011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10064
10065 * alloc.c: Simplify handling of large-request failures (Bug#8800).
10066 (SPARE_MEMORY): Always define.
10067 (LARGE_REQUEST): Remove.
10068 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
10069
f230ecc9
MR
100702011-06-06 Martin Rudalics <rudalics@gmx.at>
10071
727e958e
MR
10072 * lisp.h: Move EXFUNS for Fframe_root_window,
10073 Fframe_first_window and Fset_frame_selected_window to window.h.
10074
10075 * window.h: Move EXFUNS for Fframe_root_window,
10076 Fframe_first_window and Fset_frame_selected_window here from
10077 lisp.h.
10078
10079 * frame.c (Fwindow_frame, Fframe_first_window)
10080 (Fframe_root_window, Fframe_selected_window)
10081 (Fset_frame_selected_window): Move to window.c.
10082 (Factive_minibuffer_window): Move to minibuf.c.
10083 (Fother_visible_frames_p): New function.
10084
10085 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
10086
f230ecc9
MR
10087 * window.c (decode_window, decode_any_window): Move up in code.
10088 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
10089 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
10090 (Fwindow_buffer): Move up and rewrite doc-string.
10091 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
10092 (Fwindow_prev): New functions.
727e958e
MR
10093 (Fwindow_frame): Move here from frame.c. Accept any window as
10094 argument.
10095 (Fframe_root_window, Fframe_first_window)
10096 (Fframe_selected_window): Move here from frame.c. Accept frame
10097 or arbitrary window as argument. Update doc-strings.
10098 (Fminibuffer_window): Move up in code.
10099 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
10100 (Fset_frame_selected_window): Move here from frame.c.
10101 Marginal rewrite.
727e958e
MR
10102 (Fselected_window, select_window, Fselect_window): Move up in
10103 code. Minor doc-string fixes.
f230ecc9 10104
4d09bcf6
PE
101052011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10106
10107 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
10108 Do not assume that spare memory exists; that assumption is valid
10109 only if SYSTEM_MALLOC.
10110 (LARGE_REQUEST): New macro, so that the issue of large requests
10111 is separated from the issue of spare memory.
10112
810928a2
AS
101132011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10114
172418ad
AS
10115 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
10116 format. (Bug#8806)
10117
43f862f7
AS
10118 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
10119
810928a2
AS
10120 * xfns.c (x_set_scroll_bar_default_width): Move declarations
10121 before statements.
10122
a059fe24
JD
101232011-06-05 Jan Djärv <jan.h.d@swipnet.se>
10124
10125 * gtkutil.c (xg_get_default_scrollbar_width): New function.
10126
10127 * gtkutil.h: Declare xg_get_default_scrollbar_width.
10128
10129 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
10130 min width by calling x_set_scroll_bar_default_width (Bug#8505).
10131
989bf368
JB
101322011-06-05 Juanma Barranquero <lekktu@gmail.com>
10133
10134 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
10135
4b80f674
CY
101362011-06-04 Chong Yidong <cyd@stupidchicken.com>
10137
10138 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
10139 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
10140 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
10141 New error handlers.
4b80f674
CY
10142 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
10143 Obey Vx_select_enable_clipboard_manager. Catch errors in
10144 x_clipboard_manager_save (Bug#8779).
10145 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 10146 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 10147
99a33b77 101482011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
10149
10150 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
10151
99a33b77 101522011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
10153
10154 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
10155 in the current matrix if keep_current_p is non-zero.
10156
8264569d
EZ
101572011-06-04 Eli Zaretskii <eliz@gnu.org>
10158
10159 * bidi.c (bidi_level_of_next_char): Fix last change.
10160
57f97249
EZ
101612011-06-03 Eli Zaretskii <eliz@gnu.org>
10162
fec2107c 10163 Support bidi reordering of text covered by display properties.
57f97249 10164
fec2107c
EZ
10165 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
10166 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
10167 (bidi_cache_search, bidi_cache_iterator_state)
10168 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
10169 (bidi_level_of_next_char, bidi_move_to_visually_next):
10170 Support character positions inside a run of characters covered by a
fec2107c
EZ
10171 display string.
10172 (bidi_paragraph_init, bidi_resolve_explicit_1)
10173 (bidi_level_of_next_char): Call bidi_fetch_char and
10174 bidi_fetch_char_advance instead of FETCH_CHAR and
10175 FETCH_CHAR_ADVANCE.
10176 (bidi_init_it): Initialize new members.
10177 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
10178 definitions.
10179 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
10180 instead of using explicit *_CHAR codes.
d6d100dd
SM
10181 (bidi_resolve_explicit, bidi_resolve_weak):
10182 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
10183 bidirectional text is supported only in multibyte buffers.
10184 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
10185 it to initialize the frame_window_p member of struct bidi_it.
10186 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
10187 (bidi_resolve_explicit, bidi_resolve_weak)
10188 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
10189 bidi_it->nchars is non-positive.
10190 (bidi_level_of_next_char): Don't try to lookup the cache for the
10191 next/previous character if nothing is cached there yet, or if we
10192 were just reseat()'ed to a new position.
c40e2fb2 10193
0e14fe90
EZ
10194 * xdisp.c (set_cursor_from_row): Set start and stop points
10195 according to the row's direction when priming the loop that looks
10196 for the glyph on which to display cursor.
10197 (single_display_spec_intangible_p): Function deleted.
10198 (display_prop_intangible_p): Reimplement to call
10199 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
10200 Accept 3 additional arguments needed by handle_display_spec.
10201 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
10202 values: lists, `(when COND...)' forms, etc.
10203 (single_display_spec_string_p): Support property values that are
10204 lists with the argument STRING its top-level element.
10205 (display_prop_string_p): Fix the condition for processing a
10206 property that is a list to be consistent with handle_display_spec.
fec2107c 10207 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
10208 last portion of handle_display_prop.
10209 (compute_display_string_pos): Accept additional argument
10210 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
10211 value of a `display' property is a "replacing spec".
10212 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
10213 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
10214 the display property, but just return a value indicating whether
10215 the display property will replace the characters it covers.
10216 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
10217 frame_window_p members of struct bidi_it.
d6d100dd
SM
10218 (compute_display_string_pos, compute_display_string_end):
10219 New functions.
fec2107c
EZ
10220 (push_it): Accept second argument POSITION, where pop_it should
10221 jump to continue iteration.
10222 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 10223
fec2107c
EZ
10224 * keyboard.c (adjust_point_for_property): Adjust the call to
10225 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
10226
10227 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
10228 (bidi_init_it): Update prototypes.
10229 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
10230 (compute_display_string_pos, compute_display_string_end):
10231 Declare prototypes.
fec2107c
EZ
10232 (struct bidi_it): New members nchars and disp_pos. ch_len is now
10233 EMACS_INT.
fc6f18ce 10234
40087514 102352011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 10236
57f53182
PE
10237 Malloc failure behavior now depends on size of allocation.
10238 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10239 * lisp.h: Change signatures accordingly.
10240 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10241 All callers changed. (Bug#8762)
10242
10243 * gnutls.c: Use Emacs's memory allocators.
10244 Without this change, the gnutls library would invoke malloc etc.
10245 directly, which causes problems on non-SYNC_INPUT hosts, and which
10246 runs afoul of improving memory_full behavior. (Bug#8761)
10247 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10248 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10249 xfree instead of the default malloc, realloc, free.
10250 (Fgnutls_boot): No need to check for memory allocation failure,
10251 since xmalloc does that for us.
10252
ac32cd99 10253 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
10254 * category.c (hash_get_category_set):
10255 * ccl.c (ccl_driver):
10256 * charset.c (Fdefine_charset_internal):
10257 * charset.h (struct charset.hash_index):
10258 * composite.c (get_composition_id, gstring_lookup_cache)
10259 (composition_gstring_put_cache):
10260 * composite.h (struct composition.hash_index):
10261 * dispextern.h (struct image.hash):
10262 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10263 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10264 (hashfn_equal, hashfn_user_defined, make_hash_table)
10265 (maybe_resize_hash_table, hash_lookup, hash_put)
10266 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10267 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10268 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10269 * image.c (make_image, search_image_cache, lookup_image)
10270 (xpm_put_color_table_h):
10271 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 10272 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 10273 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 10274 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
10275 * alloc.c (allocate_vectorlike):
10276 Check for overflow in vector size calculations.
10277 * ccl.c (ccl_driver):
10278 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
10279 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10280 need to be updated by these changes.
40087514
PE
10281 * fns.c (make_hash_table, maybe_resize_hash_table):
10282 Check for integer overflow with large hash tables.
0de4bb68
PE
10283 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10284 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10285 (SXHASH_REDUCE): New macro.
10286 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10287 Use it instead of discarding useful hash info with large hash values.
10288 (sxhash_float): New function.
10289 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10290 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
10291 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10292 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
10293 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10294 Adjust signatures to match updated version of code.
10295 (consing_since_gc): Now EMACS_INT, since a single hash table can
10296 use more than INT_MAX bytes.
10297
698d32e2
DN
102982011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10299
10300 Make it possible to build with GCC-4.6+ -O2 -flto.
10301
10302 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10303
fd6fa53f
SM
103042011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10305
10306 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10307 Call minibuffer-inactive-mode.
10308
864db017
JB
103092011-05-31 Juanma Barranquero <lekktu@gmail.com>
10310
10311 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10312 Update dependencies.
10313
2ad0baf4
DN
103142011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10315
10316 * data.c (init_data): Remove code for UTS, this system is not
10317 supported anymore.
10318
4fcc2638
DN
103192011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10320
10321 Don't force ./temacs to start in terminal mode.
10322
10323 * frame.c (make_initial_frame): Initialize faces in all cases, not
10324 only when CANNOT_DUMP is defined.
10325 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
10326
c56e0fd5
DN
103272011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10328
10329 * dispnew.c (add_window_display_history): Use const for the string
10330 pointer. Remove declaration, not needed.
10331
333d54da 103322011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10333
55d4c1b2 10334 Use 'inline', not 'INLINE'.
333d54da 10335 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10336 * alloc.c, fontset.c (INLINE): Remove.
10337 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10338 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10339 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10340 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10341 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10342
738db178
DN
103432011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10344
10345 Make it possible to run ./temacs.
10346
10347 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10348 syms_of_callproc does the same thing. Remove test for
10349 "initialized", do it in the caller.
10350 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10351
620c53a6
SM
103522011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10353
10354 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10355 (read_minibuf): Use get_minibuffer.
10356 (syms_of_minibuf): Use DEFSYM.
10357 (Qmetadata): New var.
10358 * data.c (Qbuffer): Don't make it static.
10359 (syms_of_data): Use DEFSYM.
10360
e003a292
PE
103612011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10362
10363 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10364 (CCL_CODE_MIN): New macro.
10365
ed008a6d
PE
103662011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10367
3687c2ef
PE
10368 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10369
ed008a6d
PE
10370 * eval.c (Qdebug): Now static.
10371 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10372 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10373 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10374
d66c4c7c
CY
103752011-05-29 Chong Yidong <cyd@stupidchicken.com>
10376
10377 * image.c: Various fixes to ImageMagick code comments.
10378 (Fimagemagick_types): Doc fix.
10379
5fbc2025
PE
103802011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10381
0196f88a
PE
10382 Minor fixes prompted by GCC 4.6.0 warnings.
10383
10384 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10385
5fbc2025
PE
10386 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10387 (x_clipboard_manager_save_all): Move extern decl to ...
10388 * xterm.h: ... here, so that it can be checked for consistency.
10389
1dd3c2d9
CY
103902011-05-29 Chong Yidong <cyd@stupidchicken.com>
10391
10392 * xselect.c (x_clipboard_manager_save_frame)
10393 (x_clipboard_manager_save_all): New functions.
10394 (Fx_clipboard_manager_save): Lisp function deleted.
10395
10396 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10397 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10398
10399 * xterm.h: Update prototype.
10400
5ba6571d
WX
104012011-05-28 William Xu <william.xwl@gmail.com>
10402
10403 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10404 exiting (Bug#8239).
10405
3eaff834
JM
104062011-05-28 Jim Meyering <meyering@redhat.com>
10407
e1900994 10408 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10409 * fns.c (to_uchar): Define.
10410 (crypto_hash_function): Use it to convert some newly-signed
10411 variables to unsigned, to avoid sign-extension bugs. For example,
10412 without this change, (md5 "truc") would evaluate to
10413 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10414 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10415 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10416
0f6990a7
PE
104172011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10418
10419 Integer overflow fixes.
c8a9ca5a 10420
08686060
PE
10421 * dbusbind.c: Serial number integer overflow fixes.
10422 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10423 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10424 to hold a serial number that is too large for a fixnum.
10425 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10426 Check for serial numbers out of range. Decode any serial number
59568bf0 10427 that was so large that it became a float. (Bug#8722)
08686060 10428
2d1fc3c7
PE
10429 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10430 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10431 Use XFASTINT rather than XUINT when numbers are nonnegative.
10432 (xd_append_arg, Fdbus_method_return_internal):
10433 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10434 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10435 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10436 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10437 (Bug#8722)
2d1fc3c7 10438
c8a9ca5a
PE
10439 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10440
519e1d69
PE
10441 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10442
6df6ae42 10443 ccl: Add integer overflow checks.
30569699
PE
10444 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10445 (IN_INT_RANGE): New macros.
10446 (ccl_driver): Use them to check for integer overflow when
10447 decoding a CCL program. Many of the new checks are whether XINT (x)
10448 fits in int; it doesn't always, on 64-bit hosts. The new version
10449 doesn't catch all possible integer overflows, but it's an
847044ea 10450 improvement. (Bug#8719)
30569699 10451
c11285dc
PE
10452 * alloc.c (make_event_array): Use XINT, not XUINT.
10453 There's no need for unsigned here.
10454
fdccd48e
PE
10455 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10456 This follows up to the 2011-05-06 change that substituted uintptr_t
10457 for EMACS_INT. This case wasn't caught back then.
10458
37910ab2
PE
10459 Rework Fformat to avoid integer overflow issues.
10460 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10461 now (part of C89). Include <verify.h>.
10462 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10463 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10464 (Fformat): Avoid the prepass trying to compute sizes; it was only
10465 approximate and thus did not catch overflow reliably. Instead, walk
10466 through the format just once, formatting and computing sizes as we go,
10467 checking for integer overflow at every step, and allocating a larger
10468 buffer as needed. Keep track separately whether the format is
10469 multibyte. Keep only the most-recently calculated precision, rather
10470 than them all. Record whether each argument has been converted to
10471 string. Use EMACS_INT, not int, for byte and char and arg counts.
10472 Support field widths and precisions larger than INT_MAX. Avoid
10473 sprintf's undefined behavior with conversion specifications such as %#d
10474 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10475 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10476 formatting out-of-range floating point numbers with int
9173deec 10477 formats. (Bug#8668)
37910ab2 10478
2e6578fb
PE
10479 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10480
0ae6bdee
PE
10481 * data.c: Avoid integer truncation in expressions involving floats.
10482 * data.c: Include <intprops.h>.
10483 (arith_driver): When there's an integer overflow in an expression
10484 involving floating point, convert the integers to floating point
10485 so that the resulting value does not suffer from catastrophic
10486 integer truncation. For example, on a 64-bit host (* 4
10487 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10488 Do not rely on undefined behavior after integer overflow.
10489
de883a70
PE
10490 merge count_size_as_multibyte, parse_str_to_multibyte
10491 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10492 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10493 Check for integer overflow.
10494 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10495 since it's now a duplicate of the other. This is more of
10496 a character than a buffer op, so better that it's in character.c.
10497 * fns.c, print.c: Adjust to above changes.
10498
2ff916cb
PE
104992011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10500
10501 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10502
f1b54466
PE
105032011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10504
fb1ac845
PE
10505 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10506 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10507 (x_clipboard_manager_save): Now static.
10508 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10509
f1b54466
PE
10510 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10511 (crypto_hash_function): Now static.
10512 Fix pointer signedness problems. Avoid unnecessary initializations.
10513
a9f737ee
CY
105142011-05-27 Chong Yidong <cyd@stupidchicken.com>
10515
10516 * termhooks.h (Vselection_alist): Make it terminal-local.
10517
10518 * terminal.c (create_terminal): Initialize it.
10519
10520 * xselect.c: Support for clipboard managers.
10521 (Vselection_alist): Move to termhooks.h as terminal-local var.
10522 (LOCAL_SELECTION): New macro.
10523 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10524 (symbol_to_x_atom): Remove gratuitous arg.
10525 (x_handle_selection_request, lisp_data_to_selection_data)
10526 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10527 (x_own_selection, x_get_local_selection, x_convert_selection):
10528 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10529 (some_frame_on_display): Delete unused function.
10530 (Fx_own_selection_internal, Fx_get_selection_internal)
10531 (Fx_disown_selection_internal, Fx_selection_owner_p)
10532 (Fx_selection_exists_p): New optional frame arg.
10533 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10534 (x_handle_selection_clear): Don't treat other terminals with the
10535 same keyboard specially. Use the terminal-local Vselection_alist.
10536 (x_clear_frame_selections): Use Frun_hook_with_args.
10537
10538 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10539
10540 * xterm.h: Add support for those atoms.
10541
e067f0c1
CY
105422011-05-26 Chong Yidong <cyd@stupidchicken.com>
10543
10544 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10545 (converted_selections, conversion_fail_tag): New global variables.
10546 (x_selection_request_lisp_error): Free the above.
10547 (x_get_local_selection): Remove unnecessary code.
10548 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10549 of converted selections stored in converted_selections.
10550 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10551 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10552 (x_convert_selection): New function.
10553 (x_handle_selection_event): Simplify.
10554 (x_get_foreign_selection): Don't ignore incoming requests while
10555 waiting for an answer; this will fail when we implement
10556 SAVE_TARGETS, and seems unnecessary anyway.
10557 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10558 (Vx_sent_selection_functions): Doc fix.
10559
0f4aebc0
LL
105602011-05-26 Leo Liu <sdl.web@gmail.com>
10561
10562 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10563
e61124cd
YM
105642011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10565
10566 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10567
10568 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10569 for fringe update if it has periodic bitmap.
ac389d0c 10570 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10571 and fringe_bitmap_periodic_p.
10572
10573 * fringe.c (get_fringe_bitmap_data): New function.
10574 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10575 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10576 row. Mark glyph row for fringe update if periodicity changed.
10577
10578 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10579 for fringe update unless it has periodic bitmap.
10580
f16d9837
KH
105812011-05-25 Kenichi Handa <handa@m17n.org>
10582
10583 * xdisp.c (get_next_display_element): Set correct it->face_id for
10584 a static composition.
10585
e1b90ef6
LL
105862011-05-24 Leo Liu <sdl.web@gmail.com>
10587
10588 * deps.mk (fns.o):
10589 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10590
10591 * fns.c (crypto_hash_function, Fsha1): New function.
10592 (Fmd5): Use crypto_hash_function.
10593 (syms_of_fns): Add Ssha1.
10594
7400048f
PE
105952011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10596
10597 * gnutls.c: Remove unused macros.
10598 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10599 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10600 Remove macros that are defined and never used.
10601 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10602
abb71cf4
CY
106032011-05-22 Chong Yidong <cyd@stupidchicken.com>
10604
10605 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10606 (Fx_get_selection_internal): Minor cleanup.
10607 (Fx_own_selection_internal): Rename arguments for consistency with
10608 select.el.
10609
6307db39
PE
106102011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10611
10612 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10613
f3d4e0a4
CY
106142011-05-22 Chong Yidong <cyd@stupidchicken.com>
10615
10616 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10617
4d8ade89
YM
106182011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10619
10620 * dispnew.c (scrolling_window): Don't exclude the case that the
10621 last enabled row in the desired matrix touches the bottom boundary.
10622
32078c8d
GM
106232011-05-21 Glenn Morris <rgm@gnu.org>
10624
10625 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10626 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10627 and add some more files.
32078c8d 10628
7285dc67
EZ
106292011-05-20 Eli Zaretskii <eliz@gnu.org>
10630
10631 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10632 report_file_error introduced by the change from 2011-05-07.
10633
89d1bd22
PE
106342011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 * systime.h (Time): Define only if emacs is defined.
10637 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10638 where the include path doesn't have X11/X.h by default. See
10639 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10640
cd394be1 106412011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10642
10643 * composite.c (find_automatic_composition): Fix previous change.
10644
b9704ad9
GM
106452011-05-20 Glenn Morris <rgm@gnu.org>
10646
10647 * lisp.mk: New file, split from Makefile.in.
10648 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10649 (shortlisp): Remove.
10650 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10651
4a720484
GM
106522011-05-19 Glenn Morris <rgm@gnu.org>
10653
10654 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10655 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10656 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10657 (lisp): Set the order to that of loadup.el.
10658 (shortlisp): Make it a copy of $lisp.
10659 (SOME_MACHINE_LISP): Remove.
10660 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10661 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10662
a28d4396
KH
106632011-05-18 Kenichi Handa <handa@m17n.org>
10664
10665 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10666 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10667 (find_automatic_composition): Mostly rewrite for efficiency.
10668
a2b1fa8e
JB
106692011-05-18 Juanma Barranquero <lekktu@gmail.com>
10670
10671 * makefile.w32-in: Update dependencies.
10672
8e1f5610
CS
106732011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10674
10675 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10676 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10677
7025ee00 106782011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10679
cdfa6eab
PE
10680 Fix some integer overflow issues, such as string length overflow.
10681
06d6db33
PE
10682 * insdel.c (count_size_as_multibyte): Check for string overflow.
10683
2b4560a8
PE
10684 * character.c (lisp_string_width): Check for string overflow.
10685 Use EMACS_INT, not int, for string indexes and lengths; in
10686 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10687 the resulting string length overflows an EMACS_INT; instead,
10688 report a string overflow if no precision given. When checking for
10689 precision exhaustion, use a check that cannot possibly have
10690 integer overflow. (Bug#8675)
10691 * character.h (lisp_string_width): Adjust to new signature.
10692
cb93f9be
PE
10693 * alloc.c (string_overflow): New function.
10694 (Fmake_string): Use it. This doesn't change behavior, but saves
10695 a few bytes and will simplify future changes.
10696 * character.c (string_escape_byte8): Likewise.
10697 * lisp.h (string_overflow): New decl.
10698
1a1f3366
PE
10699 Fixups, following up to the user-interface timestamp change.
10700 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10701 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10702 * msdos.c (mouse_get_pos): Likewise.
10703 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10704 * w32gui.h (Time): Define by including "systime.h" rather than by
10705 declaring it ourselves. (Bug#8664)
10706
d4e3e4d3
PE
10707 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10708 * image.c (clear_image_cache): Likewise.
10709
f6a24d19
PE
10710 * term.c (term_mouse_position): Don't assume time_t wraparound.
10711
08dc5ae6
PE
10712 Be more systematic about user-interface timestamps.
10713 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10714 and sometimes 'EMACS_UINT', to represent these timestamps.
10715 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10716 This makes the code easier to follow, and makes it easier to catch
10717 integer overflow bugs such as Bug#8664.
10718 * frame.c (Fmouse_position, Fmouse_pixel_position):
10719 Use Time, not unsigned long, for user-interface timestamps.
10720 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10721 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10722 * keyboard.h (last_event_timestamp): Likewise.
10723 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10724 * menu.h (xmenu_show): Likewise.
10725 * term.c (term_mouse_position): Likewise.
10726 * termhooks.h (struct input_event.timestamp): Likewise.
10727 (struct terminal.mouse_position_hook): Likewise.
10728 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10729 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10730 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10731 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10732 what it was before.
10733 * menu.h, termhooks.h: Include "systime.h", for Time.
10734
8e55734a
PE
10735 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10736 Don't assume that the difference between two unsigned long values
10737 can fit into an integer. At this point, we know button_down_time
10738 <= event->timestamp, so the difference must be nonnegative, so
10739 there's no need to cast the result if double-click-time is
10740 nonnegative, as it should be; check that it's nonnegative, just in
10741 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10742 apart (about 25 days). (Bug#8664)
8e55734a 10743
841f1b75 10744 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10745 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10746
3e26f69c
PE
10747 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10748 that always fit in int. Use a sentinel instead of a counter, to
10749 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10750 * frame.h (struct frame): Use int for menu_bar_items_used
10751 instead of EMACS_INT, since it always fits in int.
3e26f69c 10752
5cc152c0
PE
10753 * menu.c (grow_menu_items): Check for int overflow.
10754
d89eb65e
PE
10755 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10756
5235bd3e
PE
10757 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10758 Before, the code was not consistent. These values cannot exceed
10759 2**31 - 1 so there's no need to make them unsigned.
10760 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10761 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10762 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10763 as modifiers.
10764 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10765
bc827e23
PE
10766 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10767 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10768 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10769 presumably because the widths might not match.
10770
78eb494e
PE
10771 * window.c (size_window): Avoid needless test at loop start.
10772
04f2d78b
CB
107732011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10774
10775 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10776
d2fc7e3d 107772011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10778
10779 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10780
d2fc7e3d 107812011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10782
10783 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10784 `width' to `bar_area_x' and `bar_area_width', respectively.
10785 (x_scroll_run): Take account of fringe background extension.
10786
04f2d78b
CB
10787 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10788 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10789 `bar_area_width', respectively.
10790 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10791 background extension.
10792
79b70037
GM
107932011-05-10 Jim Meyering <meyering@redhat.com>
10794
10795 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10796
2f142cc5
JB
107972011-05-10 Juanma Barranquero <lekktu@gmail.com>
10798
10799 * image.c (Finit_image_library): Return t for built-in image types,
10800 like pbm and xbm. (Bug#8640)
10801
57679c86
AS
108022011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10803
10804 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10805
888c9e86
EZ
108062011-05-07 Eli Zaretskii <eliz@gnu.org>
10807
b0512a1d
EZ
10808 * w32console.c (Fset_screen_color): Doc fix.
10809 (Fget_screen_color): New function.
10810 (syms_of_ntterm): Defsubr it.
10811
7285dc67
EZ
10812 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10813 unlink the temporary file if Fcall_process didn't create it in the
10814 first place.
10815 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10816 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10817 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10818 cue to call_process_cleanup not to close that handle.
10819
4d3fcc8e
BK
108202011-05-07 Ben Key <bkey76@gmail.com>
10821
10822 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10823 one of two shell specific rules, either bootstrap-temacs-CMD or
10824 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10825 to the previous implementation of the bootstrap-temacs rule.
10826 The bootstrap-temacs-CMD rule is similar to the previous
10827 implementation of the bootstrap-temacs rule except that it
10828 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10829 variable.
10830
10831 These changes, along with some changes to nt/configure.bat,
10832 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10833 earlier fix to add support for --cflags and --ldflags options
10834 that include quotes so that it works whether make uses cmd or
10835 sh as the shell.
10836
b4289b64
MA
108372011-05-06 Michael Albinus <michael.albinus@gmx.de>
10838
10839 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10840 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10841 is a constant.
10842 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10843 a string. Handle both cases.
10844 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10845 (Fdbus_register_method): Use Qinvalid_function.
10846
af4c0e28
JB
108472011-05-06 Juanma Barranquero <lekktu@gmail.com>
10848
10849 * makefile.w32-in: Update dependencies.
10850 (LISP_H): Add inttypes.h and stdin.h.
10851 (PROCESS_H): Add unistd.h.
10852
c51453d9
EZ
108532011-05-06 Eli Zaretskii <eliz@gnu.org>
10854
10855 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10856 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10857
8ff0ac3c 108582011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10859
4c4b566b
PE
10860 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10861
aab2b9b5
PE
10862 * term.c (vfatal): Remove stray call to va_end.
10863 It's not needed and the C Standard doesn't allow it here anyway.
10864
c378da0b
PE
10865 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10866 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10867
288b08c7
PE
10868 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10869 bytes.
10870
e3601888
PE
10871 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10872
db6c0e74
PE
10873 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10874
dd5963ea
PE
10875 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10876
88c9450f
PE
10877 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10878
2f9442b8
PE
10879 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10880
c032b5f8
PE
10881 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10882 * charset.c (Fdefine_charset_internal): Don't initialize
10883 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10884 32-bit int (Bug#8600).
a108c10b
PE
10885
10886 * lread.c (read_integer): Be more consistent with string-to-number.
10887 Use string_to_number to do the actual conversion; this avoids
10888 rounding errors and fixes some other screwups. Without this fix,
10889 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10890 (digit_to_number): Move earlier, for benefit of read_integer.
10891 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10892 not a digit in any supported base. (Bug#8602)
a108c10b 10893
ad5f9eea
PE
10894 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10895
aec1708a
PE
10896 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10897 to match comment at start of function. This also removes a
10898 GCC warning about overflow in a 32+64-bit port.
10899
47be4ab5
PE
10900 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10901
371cac43
PE
10902 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10903 Reported by Stefan Monnier in
10904 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10905 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10906 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10907
d01a7826
PE
10908 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10909 (EMACS_UINTPTR): Likewise, with uintptr_t.
10910
7fd47d5c
PE
10911 * lisp.h: Prefer 64-bit EMACS_INT if available.
10912 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10913 on 32-bit hosts that have 64-bit int, so that they can access
10914 large files.
122b0c86
PE
10915 However, temporarily disable this change unless the temporary
10916 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10917
8727937b
PE
10918 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10919
8ac068ac
PE
10920 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10921 This removes an assumption that EMACS_INT and long are the same
10922 width as pointers. The assumption is true for Emacs porting targets
10923 now, but we want to make other targets possible.
10924 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10925 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10926 In the rest of the code, change types of integers that hold casted
10927 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10928 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10929 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10930 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10931 No need to cast type when ORing.
10932 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10933 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10934 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10935 assume EMACS_INT is the same width as char *.
10936 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10937 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10938 Remove no-longer-needed casts.
10939 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10940 (xg_tool_bar_help_callback, xg_make_tool_item):
10941 Use EMACS_INTPTR to hold an integer
10942 that will be cast to void *; this can avoid a GCC warning
10943 if EMACS_INT is not the same width as void *.
10944 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10945 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10946 (current_message_1, set_message_1):
10947 Use a local to convert to proper width without a cast.
10948 * xmenu.c (dialog_selection_callback): Likewise.
10949
ede49d71
PE
10950 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10951 Also, don't assume VALBITS / RAND_BITS is less than 5,
10952 and don't rely on undefined behavior when shifting a 1 left into
10953 the sign bit.
10954 * lisp.h (get_random): Change signature to match.
10955
2f30ecd0
PE
10956 * lread.c (hash_string): Use size_t, not int, for hash computation.
10957 Normally we prefer signed values; but hashing is special, because
10958 it's better to use unsigned division on hash table sizes so that
10959 the remainder is nonnegative. Also, size_t is the natural width
10960 for hashing into memory. The previous code used 'int', which doesn't
10961 retain enough info to hash well into very large tables.
10962 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10963
2a866e7b
PE
10964 * dbusbind.c: Don't possibly lose pointer info when converting.
10965 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10966 Use XPNTR rather than XHASH, so that the high-order bits of
10967 the pointer aren't lost when converting through void *.
10968
51639eac
PE
10969 * eval.c (Fautoload): Don't double-shift a pointer.
10970
92394119
PE
10971 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10972
dbdb9a7c
JB
109732011-05-06 Juanma Barranquero <lekktu@gmail.com>
10974
10975 * gnutls.c (DEF_GNUTLS_FN):
10976 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10977
db7a0b4f
AS
109782011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10979
10980 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10981 marker. (Bug#8610)
10982
cd394be1 109832011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
10984
10985 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10986 New version that can reserve upto 2GB of heap space.
10987
f7ff1b0f 109882011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
10989
10990 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10991
639c109b
TZ
109922011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10993
10994 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10995 `gnutls_certificate_set_x509_key_file'.
10996
d2127135
JB
109972011-05-05 Juanma Barranquero <lekktu@gmail.com>
10998
10999 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
11000 Update dependencies.
11001
e968f4f3
JB
110022011-05-04 Juanma Barranquero <lekktu@gmail.com>
11003
11004 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
11005 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11006 Remove unused parameter `fildes'.
11007 * process.c (read_process_output, send_process): Don't pass it.
11008
84d358f0
JB
110092011-05-04 Juanma Barranquero <lekktu@gmail.com>
11010
11011 Fix previous change: the library cache is defined in w32.c.
11012 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
11013 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
11014
0898ca10
JB
110152011-05-04 Juanma Barranquero <lekktu@gmail.com>
11016
11017 Implement dynamic loading of GnuTLS on Windows.
11018
11019 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
11020 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
11021 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11022 Declare.
11023
11024 * gnutls.c (Qgnutls_dll): Define.
11025 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
11026 (gnutls_*): Declare function pointers.
11027 (init_gnutls_functions): New function to initialize function pointers.
11028 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
11029 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
11030 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11031 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
11032 (emacs_gnutls_write, emacs_gnutls_read)
11033 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
11034 (Fgnutls_available_p): New function.
11035 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
11036 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
11037 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
11038
11039 * image.c: Include w32.h.
11040 (Vimage_type_cache): Delete.
11041 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
11042 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
11043 (w32_delayed_load): Move to w32.c.
11044
11045 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
11046
11047 * w32.c (QCloaded_from, Vlibrary_cache): Define.
11048 (w32_delayed_load): Move from image.c. When loading a library, record
11049 its filename in the :loaded-from property of the library id.
11050 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
11051 Initialize and staticpro them.
11052 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
11053
11054 * process.c: Include lisp.h before w32.h, not after.
11055 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
11056 instead of gnutls_record_check_pending.
11057
11058 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
11059
ff4de4aa
TZ
110602011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
11061
11062 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
11063 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
11064 as passed in.
11065
abe95abb
JD
110662011-05-03 Jan Djärv <jan.h.d@swipnet.se>
11067
11068 * xterm.c (x_set_frame_alpha): Do not set property on anything
11069 else than FRAME_X_OUTER_WINDOW (Bug#8608).
11070
e16e55d4
JB
110712011-05-02 Juanma Barranquero <lekktu@gmail.com>
11072
11073 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
11074
bafcf6a5
JB
110752011-05-02 Juanma Barranquero <lekktu@gmail.com>
11076
11077 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
11078 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
11079 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
11080 (gnutls_global_initialized, Qgnutls_bootprop_priority)
11081 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
11082 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
11083 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
11084 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
11085 (Qgnutls_bootprop_callbacks_verify): Make static.
11086
e7a6747f
AS
110872011-05-01 Andreas Schwab <schwab@linux-m68k.org>
11088
19ed11ba
AS
11089 * callproc.c: Indentation fixup.
11090
e7a6747f 11091 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
11092 (wait_for_termination, interruptible_wait_for_termination):
11093 Move after wait_for_termination_1.
e7a6747f 11094
1ef14cb4
LMI
110952011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
11096
11097 * sysdep.c (interruptible_wait_for_termination): New function
11098 which is like wait_for_termination, but allows keyboard
11099 interruptions.
11100
11101 * callproc.c (Fcall_process): Add (:file "file") as an option for
11102 the STDOUT buffer.
11103 (Fcall_process_region): Ditto.
11104
330d880c
EZ
111052011-04-30 Eli Zaretskii <eliz@gnu.org>
11106
8db90b73
EZ
11107 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
11108 rather than `XVECTOR (FOO)->size'.
11109
330d880c
EZ
11110 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
11111 inttypes.h, as a gnulib replacement is used if it not available in
11112 system headers.
11113
15cbd324
EZ
111142011-04-21 Eli Zaretskii <eliz@gnu.org>
11115
11116 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
11117 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
11118 of MOST_POSITIVE_FIXNUM. (Bug#8528)
11119
11120 * coding.c (coding_alloc_by_realloc): Error out if destination
11121 will grow beyond MOST_POSITIVE_FIXNUM.
11122 (decode_coding_emacs_mule): Abort if there isn't enough place in
11123 charbuf for the composition carryover bytes. Reserve an extra
11124 space for up to 2 characters produced in a loop.
11125 (decode_coding_iso_2022): Abort if there isn't enough place in
11126 charbuf for the composition carryover bytes.
11127
111282011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 11129
ae940cca
EZ
11130 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
11131 aborting when %lld or %lll format is passed.
11132 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
11133 %llo or %llx format is passed. (Bug#8545)
11134
03ab8921
EZ
11135 * window.c (window_scroll_line_based): Use a marker instead of
11136 simple variables to record original value of point. (Bug#7952)
11137
afda1437
EZ
11138 * doprnt.c (doprnt): Fix the case where a multibyte sequence
11139 produced by %s or %c overflows available buffer space. (Bug#8545)
11140
f76dee0c
PE
111412011-04-28 Paul Eggert <eggert@cs.ucla.edu>
11142
11143 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 11144 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 11145
fdc5744d
JB
111462011-04-28 Juanma Barranquero <lekktu@gmail.com>
11147
11148 * w32.c (init_environment): Warn about defaulting HOME to C:\.
11149
638f053a
JB
111502011-04-28 Juanma Barranquero <lekktu@gmail.com>
11151
11152 * keyboard.c (Qdelayed_warnings_hook): Define.
11153 (command_loop_1): Run `delayed-warnings-hook'
11154 if Vdelayed_warnings_list is non-nil.
11155 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
11156 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
11157
d178f871
EZ
111582011-04-28 Eli Zaretskii <eliz@gnu.org>
11159
11160 * doprnt.c (doprnt): Don't return value smaller than the buffer
11161 size if the message was truncated. (Bug#8545).
11162
b124fd93
JB
111632011-04-28 Juanma Barranquero <lekktu@gmail.com>
11164
11165 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
11166 (Fx_window_property): #if-0 the whole functions, not just the bodies.
11167
e810457d
PE
111682011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11169
11170 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
11171
ea51cceb
JB
111722011-04-27 Juanma Barranquero <lekktu@gmail.com>
11173
11174 * makefile.w32-in: Update dependencies.
11175
94dcfacf
EZ
111762011-04-27 Eli Zaretskii <eliz@gnu.org>
11177
11178 Improve `doprnt' and its usage. (Bug#8545)
11179 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
11180 `format_end'. Remove support for %l as a conversion specifier.
11181 Don't use xrealloc. Improve diagnostics when the %l size modifier
11182 is used. Update the commentary.
11183
11184 * eval.c (verror): Simplify calculation of size_t.
11185
11186 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
11187 messages.
11188
f61f41d7
PE
111892011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
11190
11191 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
11192 change.
11193
96fb4434
PE
111942011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11195
11196 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
11197 This makes this file independent of the recent pseudovector change.
11198
671875da 111992011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 11200
69e9b5a3
PE
11201 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
11202
b5f869a7 11203 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 11204 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 11205 Remove unused local.
c8926152 11206 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 11207
841a1577 11208 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
11209 GCC 4.6.0 optimizes based on type-based alias analysis.
11210 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
11211 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
11212 != &v->size, and therefore "v->size = 1; b->size = 2; return
11213 v->size;" must therefore return 1. This assumption is incorrect
11214 for Emacs, since it type-puns struct Lisp_Vector * with many other
11215 types. To fix this problem, this patch adds a new type struct
f904488f 11216 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
11217 and pseudovectors, and helps optimizing compilers not get fooled
11218 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
11219 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
11220 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
11221 the size member.
eab3844f
PE
11222 (XSETPVECTYPE): Rewrite in terms of new macro.
11223 (XSETPVECTYPESIZE): New macro, specifying both type and size.
11224 This is a bit clearer, and further avoids the possibility of
11225 undesirable aliasing.
11226 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 11227 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
11228 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
11229 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
11230 (ASIZE): Now uses header.size rather than size.
11231 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
11232 to avoid the hassle of writing XVECTOR (foo)->header.size.
11233 (struct vectorlike_header): New type.
eab3844f
PE
11234 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
11235 object, to help avoid aliasing.
11236 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
11237 (SUBRP): Likewise, since Lisp_Subr is a special case.
11238 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11239 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11240 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 11241 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
11242 changed to be "header.size" and "header.next".
11243 * buffer.h (struct buffer): Likewise.
11244 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11245 * frame.h (struct frame): Likewise.
11246 * process.h (struct Lisp_Process): Likewise.
11247 * termhooks.h (struct terminal): Likewise.
11248 * window.c (struct save_window_data, struct saved_window): Likewise.
11249 * window.h (struct window): Likewise.
11250 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11251 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11252 * buffer.c (init_buffer_once): Likewise.
11253 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11254 special case.
11255 * process.c (Fformat_network_address): Use local var for size,
11256 for brevity.
11257
0df1eac5
PE
11258 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11259
847ab9d1 11260 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
11261 * data.c (atof): Remove decl; no longer used or needed.
11262 (digit_to_number): Move to lread.c.
11263 (Fstring_to_number): Use new string_to_number function, to be
11264 consistent with how the Lisp reader treats infinities and NaNs.
11265 Do not assume that floating-point numbers represent EMACS_INT
11266 without losing information; this is not true on most 64-bit hosts.
11267 Avoid double-rounding errors, by insisting on integers when
11268 parsing non-base-10 numbers, as the documentation specifies.
11269 * lisp.h (string_to_number): New decl, replacing ...
11270 (isfloat_string): Remove.
bc0a5c13 11271 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 11272 (read1): Do not accept +. and -. as integers; this
452f4150
PE
11273 appears to have been a coding error. Similarly, do not accept
11274 strings like +-1e0 as floating point numbers. Do not report
11275 overflow for integer overflows unless the base is not 10 which
11276 means we have no simple and reliable way to continue.
11277 Break out the floating-point parsing into a new
11278 function string_to_number, so that Fstring_to_number parses
11279 floating point numbers consistently with the Lisp reader.
04f2d78b 11280 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
11281 (E_CHAR, EXP_INT): Remove, replacing with ...
11282 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11283 (string_to_number): New function, replacing isfloat_string.
11284 This function checks for valid syntax and produces the resulting
11285 Lisp float number too. Rework it so that string-to-number
bc0a5c13 11286 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
11287 so that overflow for non-base-10 numbers is reported only when
11288 there's no portable and simple way to convert to floating point.
452f4150 11289
67769ffc
PE
11290 * textprop.c (set_text_properties_1): Rewrite for clarity,
11291 and to avoid GCC warning about integer overflow.
11292
c20db43f
PE
11293 * intervals.h (struct interval): Use EMACS_INT for members
11294 where EMACS_UINT might cause problems. See
11295 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11296 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11297 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11298 All uses changed.
37aa2f85
PE
11299 (offset_intervals): Tell GCC not to worry about length overflow
11300 when negating a negative length.
c20db43f 11301
2538aa2f
PE
11302 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11303 (overrun_check_free): Likewise.
11304
f2d3008d
PE
11305 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11306 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11307 word size.
11308
ec8df744
PE
11309 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11310 (gnutls_make_error): Rename local to avoid shadowing.
11311 (gnutls_emacs_global_deinit): ifdef out; not used.
11312 (Fgnutls_boot): Use const for pointer to readonly storage.
11313 Comment out unused local. Fix pointer signedness problems.
11314
640ee02d
PE
11315 * lread.c (openp): Don't stuff size_t into an 'int'.
11316 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11317 about possible signed overflow.
11318
6048fb2a
PE
11319 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11320 (GDK_KEY_g): Don't define if already defined.
11321 (xg_prepare_tooltip): Avoid pointer signedness problem.
11322 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
11323
fa3c87e1
PE
11324 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
11325 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
11326
2172544b
PE
11327 * xfns.c (Fx_window_property): Simplify a bit,
11328 to make a bit faster and to avoid GCC 4.6.0 warning.
11329 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11330
9b821a21
PE
11331 * fns.c (internal_equal): Don't assume size_t fits in int.
11332
3c616cfa
PE
11333 * alloc.c (compact_small_strings): Tighten assertion a little.
11334
c2982e87
PE
11335 Replace pEd with more-general pI, and fix some printf arg casts.
11336 * lisp.h (pI): New macro, generalizing old pEd macro to other
11337 conversion specifiers. For example, use "...%"pI"d..." rather
11338 than "...%"pEd"...".
11339 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11340 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11341 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11342 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11343 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11344 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11345 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11346 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11347 64-bit hosts.
11348 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11349 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11350 * print.c (safe_debug_print, print_object): Likewise.
11351 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11352 to int.
6f04d126
PE
11353 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11354 avoiding the 0 flag, which is not portable.
c2982e87
PE
11355 * process.c (Fmake_network_process): Use pI to avoid cast.
11356 * region-cache.c (pp_cache): Likewise.
11357 * xdisp.c (decode_mode_spec): Likewise.
11358 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11359 behavior on 64-bit hosts with printf arg.
6f04d126 11360 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11361 (x_stop_queuing_selection_requests): Likewise.
11362 (x_get_window_property): Don't truncate byte count to an 'int'
11363 when tracing.
0b432f21 11364
5e073ec7
PE
11365 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11366 here, since it parses constructs like leading '-' and spaces,
11367 which are not wanted; and it overflows with large numbers.
11368 Instead, simply match F[0-9]+, which is what is wanted anyway.
11369
36372bf9
PE
11370 * alloc.c: Remove unportable assumptions about struct layout.
11371 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11372 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11373 (allocate_vectorlike, make_pure_vector): Use the new macros,
11374 plus offsetof, to remove unportable assumptions about struct layout.
11375 These assumptions hold on all porting targets that I know of, but
11376 they are not guaranteed, they're easy to remove, and removing them
11377 makes further changes easier.
11378
0b432f21
PE
11379 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11380 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11381 (string_overrun_cookie): Now const. Use initializers that
11382 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11383 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11384 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11385 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11386 multiple of sizeof (EMACS_INT); it need not be, if
11387 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11388 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11389
895009e1
JB
113902011-04-26 Juanma Barranquero <lekktu@gmail.com>
11391
11392 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11393
6a7a1b0b
TZ
113942011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11395
11396 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11397 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11398 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11399
841a1577 114002011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11401
11402 * lisp.h (Qdebug): List symbol.
895009e1 11403 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11404 * keyboard.c (debug-on-event): New variable.
11405 (handle_user_signal): Break into debugger when debug-on-event
11406 matches the current signal symbol.
11407
f2d3ba6f
DN
114082011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11409
11410 * alloc.c (check_sblock, check_string_bytes)
11411 (check_string_free_list): Convert to standard C.
11412
42ce4c63
TZ
114132011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11414
11415 * w32.c (emacs_gnutls_push): Fix typo.
11416
825cd63c
EZ
114172011-04-25 Eli Zaretskii <eliz@gnu.org>
11418
fb11d64d
EZ
11419 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11420 "cast to pointer from integer of different size".
11421
825cd63c
EZ
11422 Improve doprnt and its use in verror. (Bug#8545)
11423 * doprnt.c (doprnt): Document the set of format control sequences
11424 supported by the function. Use SAFE_ALLOCA instead of always
11425 using `alloca'.
11426
11427 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11428 is one byte too soon. Don't use xrealloc; instead xfree and
11429 xmalloc anew.
11430
e061a11b
TZ
114312011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11432
11433 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11434 callbacks stage.
11435
11436 * gnutls.c: Renamed global_initialized to
11437 gnutls_global_initialized. Added internals for the
11438 :verify-hostname-error, :verify-error, and :verify-flags
11439 parameters of `gnutls-boot' and documented those parameters in the
11440 docstring. Start callback support.
9173deec
JB
11441 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11442 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11443 on error. Return error code.
e061a11b
TZ
11444 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11445 (emacs_gnutls_read): Likewise.
11446 (Fgnutls_boot): Return handshake error code.
11447 (emacs_gnutls_handle_error): New function.
11448 (wsaerror_to_errno): Likewise.
11449
11450 * w32.h (emacs_gnutls_pull): Add prototype.
11451 (emacs_gnutls_push): Likewise.
11452
11453 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11454 (emacs_gnutls_push): Likewise.
11455
114562011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11457
11458 * process.c (wait_reading_process_output): Check if GnuTLS
11459 buffered some data internally if no FDs are set for TLS
11460 connections.
11461
11462 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11463 (LIBS): Link to USER_LIBS.
11464 ($(BLD)/gnutls.$(0)): New target.
11465
fa6996bc
EZ
114662011-04-24 Eli Zaretskii <eliz@gnu.org>
11467
eb35682e
EZ
11468 * xdisp.c (handle_single_display_spec): Rename the
11469 display_replaced_before_p argument into display_replaced_p, to
11470 make it consistent with the commentary. Fix typos in the
11471 commentary.
11472
e2ad650c
EZ
11473 * textprop.c (syms_of_textprop): Remove dead code.
11474 (copy_text_properties): Delete obsolete commentary about an
11475 interface that was deleted long ago. Fix typos in the description
11476 of arguments.
11477
1b2de274
EZ
11478 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11479 to changes in oldXMenu/XMenu.h from 2011-04-16.
11480 <menu_help_message, prev_menu_help_message>: Constify.
11481 (IT_menu_make_room): menu->help_text is now `const char **';
11482 adjust.
11483
11484 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11485 to changes in oldXMenu/XMenu.h from 2011-04-16.
11486 (struct XMenu): Declare `help_text' `const char **'.
11487
11488 * xfaces.c <Qunspecified>: Make extern again.
11489
11490 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11491 required by POSIX.
1b2de274 11492
762b15be
EZ
11493 * doc.c (get_doc_string): Improve the format passed to `error'.
11494
11495 * doprnt.c (doprnt): Improve commentary.
11496
11497 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11498
11499 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11500 them with etags.
11501
f1052e5d
EZ
11502 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11503 changes in globals.h immediately force recompilation.
762b15be
EZ
11504 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11505 $(CURDIR)/s/ms-w32.h.
11506 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11507
fa6996bc
EZ
11508 * character.c (Fchar_direction): Function deleted.
11509 (syms_of_character): Don't defsubr it.
11510 <char-direction-table>: Deleted.
11511
e6c3da20
EZ
115122011-04-23 Eli Zaretskii <eliz@gnu.org>
11513
11514 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11515 * doprnt.c: Include limits.h.
11516 (SIZE_MAX): New macro.
04f2d78b
CB
11517 (doprnt): Return a size_t value. 2nd arg is now size_t.
11518 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11519 Improve overflow protection. Support `l' modifier for integer
11520 conversions. Support %l conversion. Don't assume an EMACS_INT
11521 argument for integer conversions and for %c.
11522
11523 * lisp.h (doprnt): Restore prototype.
11524
11525 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11526 $(SRC)/character.h.
11527
11528 * Makefile.in (base_obj): Add back doprnt.o.
11529
11530 * deps.mk (doprnt.o): Add back prerequisites.
11531 (callint.o): Depend on character.h.
11532
11533 * eval.c (internal_lisp_condition_case): Include the handler
11534 representation in the error message.
11535 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11536 when breaking from the loop.
11537
11538 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11539
11540 * callint.c (Fcall_interactively): When displaying error message
11541 about invalid control letter, pass the character's codepoint, not
11542 a pointer to its multibyte form. Improve display of the character
11543 in octal and display also its hex code.
11544
11545 * character.c (char_string): Use %x to display the (unsigned)
11546 codepoint of an invalid character, to avoid displaying a bogus
11547 negative value.
11548
11549 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11550 `error', not SYMBOL_NAME itself.
11551
11552 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11553 character arguments to `error'.
11554
11555 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11556 to `error' in error message about FINAL_CHAR argument. Make sure
11557 FINAL_CHAR is a character, and use %c when it is passed as
11558 argument to `error'.
11559
4ffd0d6b 115602011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11561
11562 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11563
11564 * w32.c: Include <time.h>.
11565 (sys_localtime): New function.
11566
4ffd0d6b 115672011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11568
11569 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11570
4ffd0d6b 11571 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11572
4ffd0d6b 115732011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11574
4ffd0d6b
GM
11575 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11576 zombies (Bug#8467).
aac0c6e3 11577
04c56954
EZ
115782011-04-19 Eli Zaretskii <eliz@gnu.org>
11579
11580 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11581 gl_state.e_property when gl_state.object is Qt.
11582
11583 * insdel.c (make_gap_larger): Remove limitation of buffer size
11584 to <= INT_MAX.
11585
16a43933
CY
115862011-04-18 Chong Yidong <cyd@stupidchicken.com>
11587
11588 * xdisp.c (lookup_glyphless_char_display)
11589 (produce_glyphless_glyph): Handle cons cell entry in
11590 glyphless-char-display.
11591 (Vglyphless_char_display): Document it.
11592
11593 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11594 glyphless-char-display.
11595
4581706e
CY
115962011-04-17 Chong Yidong <cyd@stupidchicken.com>
11597
11598 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11599
11600 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11601
11602 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11603 definition for no-X builds.
11604
4887c6e2 116052011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11606
fd35b6f9
PE
11607 Static checks with GCC 4.6.0 and non-default toolkits.
11608
5c1ccb01
PE
11609 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11610
006c5daa
PE
11611 * process.c (keyboard_bit_set): Define only if SIGIO.
11612 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11613 (send_process): Repair possible setjmp clobbering.
11614
efc736d3
PE
11615 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11616
4e2fe2e6
PE
11617 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11618
f97334a2
PE
11619 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11620
4e75f29d
PE
11621 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11622 Define only if needed.
11623
90efadd1
PE
11624 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11625 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11626 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11627
3c647824
PE
11628 * dispextern.h (struct redisplay_interface): Rename param
11629 to avoid shadowing.
e264f262 11630 * termhooks.h (struct terminal): Likewise.
761383f4 11631 * xterm.c (xembed_send_message): Likewise.
3c647824 11632
b58c5c4a
PE
11633 * insdel.c (make_gap_smaller): Define only if
11634 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11635
cad59032
PE
11636 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11637 it.
11638
c339dc2e
PE
11639 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11640 so that we aren't warned about unused symbols.
11641
91a3e27b
PE
11642 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11643
399c71d3 11644 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11645
8ffc96f5
PE
11646 * xfns.c (x_real_positions): Mark locals as initialized.
11647
eef9bc79
PE
11648 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11649
098db9dd
PE
11650 * xterm.c: Fix problems found by static analysis with other toolkits.
11651 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11652 (x_dispatch_event): Declare static if USE_GTK, and
11653 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11654 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11655 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11656 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11657 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11658
eb18f6cc
PE
11659 * xmenu.c (menu_help_callback): Pointer type fixes.
11660 Use const pointers when pointing at readonly data. Avoid pointer
11661 signedness clashes.
11662 (FALSE): Remove unused macro.
11663 (update_frame_menubar): Remove unused decl.
11664
1fe72bf8
PE
11665 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11666
60d9e1db
PE
11667 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11668 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11669 (single_menu_item): Rename local to avoid shadowing.
11670
39261c26
PE
11671 * keyboard.c (make_lispy_event): Remove unused local var.
11672
018c5e19
PE
11673 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11674 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11675
63d2b86e
PE
11676 * bitmaps: Change bitmaps from unsigned char back to the X11
11677 compatible char. Avoid the old compiler warnings about
11678 out-of-range initializers by using, for example, '\xab' rather
11679 than 0xab.
11680
aefd87e1
PE
11681 * xgselect.c (xgselect_initialize): Check vs interface
11682 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11683
bf501fb9
PE
11684 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11685
e9829fdf
PE
11686 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11687 to read-only memory.
11688
1086c095
PE
11689 * fns.c (vector): Remove; this old hack is no longer needed.
11690
2baccd04 11691 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11692 Remove unused var.
dde42981 11693 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11694
72391843 11695 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11696
436c16df 11697 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11698 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11699 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11700
92bb796d 11701 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11702 (x_term_init): Remove local to avoid shadowing.
92bb796d 11703
764430a3 11704 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11705
11706 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11707 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11708
d1dfb56c
EZ
117092011-04-16 Eli Zaretskii <eliz@gnu.org>
11710
c4354cb4
EZ
11711 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11712
d1dfb56c
EZ
11713 Fix regex.c, syntax.c and friends for buffers > 2GB.
11714 * syntax.h (struct gl_state_s): Declare character position members
11715 EMACS_INT.
11716
11717 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11718
04f2d78b
CB
11719 * textprop.c (verify_interval_modification, interval_of):
11720 Declare arguments EMACS_INT.
d1dfb56c
EZ
11721
11722 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11723 EMACS_INT.
11724
11725 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11726
11727 * indent.c (Fvertical_motion): Local variable it_start is now
11728 EMACS_INT.
11729
11730 * regex.c (re_match, re_match_2, re_match_2_internal)
11731 (bcmp_translate, regcomp, regexec, print_double_string)
11732 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11733 (re_compile_pattern, re_exec): Declare arguments and local
11734 variables `size_t' and `ssize_t' and return values `regoff_t', as
11735 appropriate.
11736 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11737 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11738 <compile_stack_type>: `size' and `avail' are now `size_t'.
11739
11740 * regex.h <regoff_t>: Use ssize_t, not int.
11741 (re_search, re_search_2, re_match, re_match_2): Arguments that
11742 specify buffer/string position and length are now ssize_t and
11743 size_t. Return type is regoff_t.
11744
613052cd
BK
117452011-04-16 Ben Key <bkey76@gmail.com>
11746
11747 * nsfont.m: Fixed bugs in ns_get_family and
11748 ns_descriptor_to_entity that were caused by using free to
11749 deallocate memory blocks that were allocated by xmalloc (via
11750 xstrdup). This caused Emacs to crash when compiled with
11751 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11752 --enable-checking=xmallocoverrun). xfree is now used to
11753 deallocate these memory blocks.
11754
4170f62f 117552011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11756
71b41406
PE
11757 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11758
9587a89d
PE
11759 emacs_write: Accept and return EMACS_INT for sizes.
11760 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11761 et seq.
11762 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11763 Accept and return EMACS_INT.
11764 (emacs_gnutls_write): Return the number of bytes written on
11765 partial writes.
11766 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11767 (emacs_read, emacs_write): Remove check for negative size, as the
11768 Emacs source code has been audited now.
9587a89d
PE
11769 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11770 (emacs_read, emacs_write): Use it.
273a5f82
PE
11771 * process.c (send_process): Adjust to the new signatures of
11772 emacs_write and emacs_gnutls_write. Do not attempt to store
11773 a byte offset into an 'int'; it might overflow.
9587a89d 11774 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11775
3e047f51
PE
11776 * sound.c: Don't assume sizes fit in 'int'.
11777 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11778 Return EMACS_INT, not int.
3e047f51 11779 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11780 Accept EMACS_INT, not int.
11781 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11782 record read return values.
11783
cc39a9db
BK
117842011-04-15 Ben Key <bkey76@gmail.com>
11785
c9d0ec6d
JB
11786 * keyboard.c (Qundefined): Don't declare static since it is used
11787 in nsfns.m.
11788 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11789 static since they are used in nsfont.m.
cc39a9db 11790
6c60eb9f
SM
117912011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11792
11793 * process.c (Qprocessp): Don't declare static.
11794 * lisp.h (Qprocessp): Declare again.
11795
7990b61a
JB
117962011-04-15 Juanma Barranquero <lekktu@gmail.com>
11797
11798 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11799
5d4cb038
PE
118002011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11801
8bd7b830 11802 Improve C-level modularity by making more things 'static'.
cd64ea1d 11803
e3b27b31
PE
11804 Don't publish debugger-only interfaces to other modules.
11805 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11806 (verify_bytepos, count_markers): Move decls to the only modules
11807 that need them.
11808 * region-cache.h (pp_cache): Likewise.
11809 * window.h (check_all_windows): Likewise.
11810 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11811
5d4cb038
PE
11812 * sysdep.c (croak): Now static, if
11813 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11814 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11815
11816 * alloc.c (refill_memory_reserve): Now static if
11817 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11818 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11819
e87b6180
PE
11820 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11821 Define only if USE_LUCID.
11822
ac64929e
PE
11823 * xrdb.c (x_customization_string, x_rm_string): Now static.
11824
6f37259d
PE
11825 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11826 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11827
1683e3ab
PE
11828 * xdisp.c (draw_row_with_mouse_face): Now static.
11829 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11830
de9c2632
PE
11831 * window.h (check_all_windows): Mark externally visible.
11832
2b96acb7
PE
11833 * window.c (window_deletion_count): Now static.
11834
11835 * undo.c: Make symbols static if they're not exported.
11836 (last_undo_buffer, last_boundary_position, pending_boundary):
11837 Now static.
11838
50436f33
PE
11839 * textprop.c (interval_insert_behind_hooks): Now static.
11840 (interval_insert_in_front_hooks): Likewise.
11841
64520e5c
PE
11842 * term.c: Make symbols static if they're not exported.
11843 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11844 (max_frame_lines, tty_set_terminal_modes):
11845 (tty_reset_terminal_modes, tty_turn_off_highlight):
11846 (get_tty_terminal): Now static.
11847 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11848 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11849 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11850 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11851 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11852
1fa53021
PE
11853 * sysdep.c: Make symbols static if they're not exported.
11854 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11855 Now static.
11856 (sigprocmask_set, full_mask): Remove; unused.
11857 (wait_debugging): Mark as visible.
11858 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11859 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11860
d4b43b22
PE
11861 * syntax.c (syntax_temp): Define only if !__GNUC__.
11862
b7c513d0
PE
11863 * sound.c (current_sound_device, current_sound): Now static.
11864
989b29ad
PE
11865 * search.c (searchbufs, searchbuf_head): Now static.
11866
13a55a78
PE
11867 * scroll.c (scroll_cost): Remove; unused.
11868 * dispextern.h (scroll_cost): Remove decl.
11869
de68a1fc
PE
11870 * region-cache.h (pp_cache): Mark as externally visible.
11871
40ccffa6
PE
11872 * process.c: Make symbols static if they're not exported.
11873 (process_tick, update_tick, create_process, chan_process):
11874 (Vprocess_alist, proc_buffered_char, datagram_access):
11875 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11876 (deactivate_process): Mark defn as static, as well as decl.
11877 * lisp.h (create_process): Remove decl.
11878 * process.h (chan_process, Vprocess_alist): Remove decls.
11879
ad64fc97
PE
11880 * print.c: Make symbols static if they're not exported.
11881 (print_depth, new_backquote_output, being_printed, print_buffer):
11882 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11883 (print_interval, print_number_index, initial_stderr_stream):
11884 Now static.
11885 * lisp.h (Fprinc): Remove decl.
11886 (debug_output_compilation_hack): Mark as externally visible.
11887
adddb265
PE
11888 * sysdep.c (croak): Move decl from here to syssignal.h.
11889 * syssignal.h (croak): Put it here, so the API can be checked when
11890 'croak' is called from dissociate_if_controlling_tty.
11891
1717ede2
PE
11892 * minibuf.c: Make symbols static if they're not exported.
11893 (minibuf_save_list, choose_minibuf_frame): Now static.
11894 * lisp.h (choose_minibuf_frame): Remove decl.
11895
fa5fb2bc
PE
11896 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11897
1e3890d1
PE
11898 * lread.c: Make symbols static if they're not exported.
11899 (read_objects, initial_obarray, oblookup_last_bucket_number):
11900 Now static.
11901 (make_symbol): Remove; unused.
11902 * lisp.h (initial_obarray, make_symbol): Remove decls.
11903
8a1414fa
PE
11904 * keyboard.c: Make symbols static if they're not exported.
11905 (single_kboard, recent_keys_index, total_keys, recent_keys):
11906 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11907 (this_single_command_key_start, echoing, last_auto_save):
11908 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11909 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11910 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11911 (Vlispy_mouse_stem, double_click_count):
11912 Now static.
11913 (force_auto_save_soon): Define only if SIGDANGER.
11914 (ignore_mouse_drag_p): Now static if
11915 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11916 (print_help): Remove; unused.
11917 (stop_character, last_timer_event): Mark as externally visible.
11918 * keyboard.h (ignore_mouse_drag_p): Declare only if
11919 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11920 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11921 * lisp.h (echoing): Remove decl.
11922 (force_auto_save_soon): Declare only if SIGDANGER.
11923 * xdisp.c (redisplay_window): Simplify code, to make it more
11924 obvious that ignore_mouse_drag_p is not accessed if !defined
11925 USE_GTK && !defined HAVE_NS.
11926
93ea6e8f
PE
11927 * intervals.c: Make symbols static if they're not exported.
11928 (merge_properties_sticky, merge_interval_right, delete_interval):
11929 Now static.
11930 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11931
77382fcc
PE
11932 * insdel.c: Make symbols static if they're not exported.
11933 However, leave prepare_to_modify_buffer alone. It's never
11934 called from outside this function, but that appears to be a bug.
11935 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11936 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11937 (adjust_after_replace_noundo): Remove; unused.
11938 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 11939 (signal_before_change): Remove decls.
77382fcc 11940
9306c32e
PE
11941 * indent.c (val_compute_motion, val_vmotion): Now static.
11942
cd44d2eb
PE
11943 * image.c: Make symbols static if they're not exported.
11944 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11945 if USE_GTK.
11946 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11947 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11948
ad9a7a06
PE
11949 * fringe.c (standard_bitmaps): Now static.
11950 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11951
81626931
PE
11952 * frame.c: Make symbols static if they're not exported.
11953 (x_report_frame_params, make_terminal_frame): Now static.
11954 (get_frame_param): Now static, unless HAVE_NS.
11955 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11956 (x_get_resource_string): Remove; not used.
11957 * frame.h (make_terminal_frame, x_report_frame_params):
11958 (x_get_resource_string); Remove decls.
11959 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11960 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11961
239f9db9
PE
11962 * font.c, fontset.c: Make symbols static if they're not exported.
11963 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11964 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11965 * font.c (font_close_object): Now static.
11966 * font.h (font_close_object): Remove.
11967 * fontset.c (FONTSET_OBJLIST): Remove.
11968 (free_realized_fontset) #if-0 the body, which does nothing.
11969 (face_suitable_for_char_p): #if-0, as it's never called.
11970 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
11971 * xfaces.c (face_at_string_position):
11972 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
11973 since 0 is always ASCII.
11974
dfcf3579
PE
11975 * fns.c (weak_hash_tables): Now static.
11976
5045092b
PE
11977 * fileio.c: Make symbols static if they're not exported.
11978 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11979 (Vwrite_region_annotation_buffers): Now static.
11980
57a96f5c
PE
11981 * eval.c: Make symbols static if they're not exported.
11982 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11983 * lisp.h (backtrace_list): Remove decl.
11984
35f08c38
PE
11985 * emacs.c: Make symbols static if they're not exported.
11986 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11987 (fatal_error_code, fatal_error_signal_hook, standard_args):
11988 Now static.
11989 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11990 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11991 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11992 * lisp.h (fatal_error_signal_hook): Remove decl.
11993 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11994
f44bd759
PE
11995 * editfns.c: Move a (normally-unused) function to its only use.
11996 * editfns.c, lisp.h (get_operating_system_release): Remove.
11997 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11998 worth the hassle of breaking this out.
11999
b532497d
PE
12000 * xterm.c: Make symbols static if they're not exported.
12001 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
12002 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
12003 (x_destroy_window, x_delete_display):
12004 Now static.
12005 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
12006 (x_mouse_leave): Remove; unused.
12007 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
12008 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
12009 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
12010 Remove decls.
12011 (x_mouse_leave): Declare only if WINDOWSNT.
12012 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
12013 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
12014 USE_X_TOOLKIT.
12015
1675728f
PE
12016 * ftxfont.c: Make symbols static if they're not exported.
12017 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
12018 HAVE_FREETYPE.
12019 * font.h (ftxfont_driver): Likewise.
12020
e4cebfca
PE
12021 * xfns.c: Make symbols static if they're not exported.
12022 (x_last_font_name, x_display_info_for_name):
12023 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
12024 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
12025 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
12026 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
12027 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
12028 (last_show_tip_args): Now static.
12029 (xic_defaut_fontset, xic_create_fontsetname): Define only if
12030 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
12031 (x_screen_planes): Remove; unused.
12032 * dispextern.h (x_screen_planes): Remove decl.
12033
5bf46f05
PE
12034 * dispnew.c: Make symbols static if they're not exported.
12035 * dispextern.h (redraw_garbaged_frames, scrolling):
12036 (increment_row_positions): Remove.
12037 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
12038 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
12039 Now static.
12040 (redraw_garbaged_frames): Remove; unused.
12041
435f4c28
PE
12042 * xfaces.c: Make symbols static if they're not exported.
12043 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
12044 Remove decls.
12045 * xterm.h (defined_color): Remove decls.
12046 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
12047 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
12048 (menu_face_changed_default, defined_color, free_realized_face):
12049 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
12050 (ascii_face_of_lisp_face): Remove; unused.
12051
8524aef3
PE
12052 * xdisp.c: Make symbols static if they're not exported.
12053 * dispextern.h (scratch_glyph_row, window_box_edges):
12054 (glyph_to_pixel_coords, set_cursor_from_row):
12055 (get_next_display_element, set_iterator_to_next):
12056 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
12057 (show_mouse_face): Remove decls
12058 * frame.h (message_buf_print): Likewise.
12059 * lisp.h (pop_message, set_message, check_point_in_composition):
12060 Likewise.
12061 * xterm.h (set_vertical_scroll_bar): Likewise.
12062 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
12063 (message_buf_print, scratch_glyph_row, displayed_buffer):
12064 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
12065 (get_next_display_element, show_mouse_face, window_box_edges):
12066 (frame_to_window_pixel_xy, check_point_in_composition):
12067 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
12068 (glyph_to_pixel_coords): Remove; unused.
12069
16390cd2
PE
12070 * dired.c (file_name_completion): Now static.
12071
12072 * dbusbind.c (xd_in_read_queued_messages): Now static.
12073
a25f4dfa
PE
12074 * lisp.h (circular_list_error, FOREACH): Remove; unused.
12075 * data.c (circular_list_error): Remove.
12076
14a9c8df
PE
12077 * commands.h (last_point_position, last_point_position_buffer):
12078 (last_point_position_window): Remove decls.
12079 * keyboard.c: Make these variables static.
12080
04f2d78b
CB
12081 * coding.h (coding, code_convert_region, encode_coding_gap):
12082 Remove decls.
74ab6df5
PE
12083 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
12084 (iso_code_class, detect_coding, code_convert_region): Now static.
12085 (encode_coding_gap): Remove; unused.
12086
38dfbee1
PE
12087 * chartab.c (chartab_chars, chartab_bits): Now static.
12088
a2cb4e63
PE
12089 * charset.h (charset_iso_8859_1): Remove decl.
12090 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
12091 Now static.
12092
127198fd
PE
12093 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
12094 * ccl.c (Vccl_program_table): Now static.
12095 (check_ccl_update): Remove; unused.
12096
d85b608f
PE
12097 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
12098 * category.h: ... from here.
12099 * category.c (check_category_table, set_category_set): Now static.
12100
31cd66f3
PE
12101 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
12102 * lisp.h: Remove these decls.
12103
c358e587
PE
12104 * buffer.c (buffer_count): Remove unused var.
12105
e78aecca
PE
12106 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
12107 so that it's not optimized away.
12108 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
12109 * dispextern.h (bidi_dump_cached_states): Remove, since it's
12110 exported only to the debugger.
12111
e192d7d3 12112 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 12113 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 12114
92470028
PE
12115 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
12116 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
12117 was inaccessible from Lisp.
12118 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
12119 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
12120
244ed907
PE
12121 alloc.c: Import and export fewer symbols, and remove unused items.
12122 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
12123 is defined.
12124 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
12125 it's not optimized away by whole-program optimization.
12126 (message_enable_multibyte, free_misc): Remove.
12127 (catchlist, handlerlist, mark_backtrace):
12128 Declare only if BYTE_MARK_STACK.
12129 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12130 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
12131 (message_enable_multibyte): Remove decl.
12132 (free_misc, interval_free_list, float_block, float_block_index):
12133 (n_float_blocks, float_free_list, cons_block, cons_block_index):
12134 (cons_free_list, last_marked_index):
12135 Now static.
12136 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
12137 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
12138 (mark_backtrace): Define only if BYTE_MARK_STACK.
12139 * xdisp.c (message_enable_multibyte): Now static.
12140
61c2b50e 12141 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
12142 This makes it easier for human readers (and static analyzers)
12143 to see whether these variables are used from other modules.
12144 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
12145 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
12146 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
12147 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
12148 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
12149 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
12150 * xmenu.c, xselect.c:
12151 Declare Q* vars static if they are not used in other modules.
12152 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
12153 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
12154 Remove decls of unexported vars.
12155 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
12156
95c82688
PE
12157 * lisp.h (DEFINE_FUNC): Make sname 'static'.
12158
16a97296
PE
12159 Make Emacs functions such as Fatom 'static' by default.
12160 This makes it easier for human readers (and static analyzers)
12161 to see whether these functions can be called from other modules.
12162 DEFUN now defines a static function. To make the function external
12163 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
12164 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
12165 (Finit_image_library):
16a97296
PE
12166 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
12167 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
12168 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
12169 Remove decls, since these functions are now static.
12170 (Funintern, Fget_internal_run_time): New decls, since these functions
12171 were already external.
95c82688 12172
16a97296
PE
12173 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
12174 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
12175 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
12176 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
12177 * keyboard.c, keymap.c, lread.c:
12178 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
12179 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
12180 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
12181 Mark functions with DEFUE instead of DEFUN,
12182 if they are used in other modules.
12183 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
12184 decls for now-static functions.
12185 * buffer.h (Fdelete_overlay): Remove decl.
12186 * callproc.c (Fgetenv_internal): Mark as internal.
12187 * composite.c (Fremove_list_of_text_properties): Remove decl.
12188 (Fcomposition_get_gstring): New forward static decl.
12189 * composite.h (Fcomposite_get_gstring): Remove decl.
12190 * dired.c (Ffile_attributes): New forward static decl.
12191 * doc.c (Fdocumntation_property): New forward static decl.
12192 * eval.c (Ffetch_bytecode): New forward static decl.
12193 (Funintern): Remove extern decl; now in .h file where it belongs.
12194 * fileio.c (Fmake_symbolic_link): New forward static decl.
12195 * image.c (Finit_image_library): New forward static decl.
12196 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
12197 * intervals.h (Fprevious_property_change):
12198 (Fremove_list_of_text_properties): Remove decls.
12199 * keyboard.c (Fthis_command_keys): Remove decl.
12200 (Fcommand_execute): New forward static decl.
12201 * keymap.c (Flookup_key): New forward static decl.
12202 (Fcopy_keymap): Now static.
12203 * keymap.h (Flookup_key): Remove decl.
12204 * process.c (Fget_process): New forward static decl.
12205 (Fprocess_datagram_address): Mark as internal.
12206 * syntax.c (Fsyntax_table_p): New forward static decl.
12207 (skip_chars): Remove duplicate decl.
12208 * textprop.c (Fprevious_property_change): New forward static decl.
12209 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
12210 Now internal.
12211 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
12212 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
12213
785bbd42
PE
12214 * editfns.c (Fformat): Remove unreachable code.
12215
8b913b57
AS
122162011-04-14 Andreas Schwab <schwab@linux-m68k.org>
12217
12218 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
12219 change. (Bug#8496)
12220
a6744a35
EZ
122212011-04-13 Eli Zaretskii <eliz@gnu.org>
12222
12223 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
12224 when at ZV. (Bug#8487)
12225
e7974947
AS
122262011-04-12 Andreas Schwab <schwab@linux-m68k.org>
12227
baad03f0
AS
12228 * charset.c (Fclear_charset_maps): Use xfree instead of free.
12229 (Bug#8437)
12230 * keyboard.c (parse_tool_bar_item): Likewise.
12231 * sound.c (sound_cleanup, alsa_close): Likewise.
12232 * termcap.c (tgetent): Likewise.
12233 * xfns.c (x_default_font_parameter): Likewise.
12234 * xsettings.c (read_and_apply_settings): Likewise.
12235
e7974947
AS
12236 * alloc.c (overrun_check_malloc, overrun_check_realloc)
12237 (overrun_check_free): Protoize.
12238
28272684
PE
122392011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12240
12241 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12242 since callers should never pass a negative size.
12243 Change the signature to match that of plain 'read' and 'write'; see
12244 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12245 * lisp.h: Update prototypes of emacs_write and emacs_read.
12246
11997c76
EZ
122472011-04-11 Eli Zaretskii <eliz@gnu.org>
12248
12249 * xdisp.c (redisplay_window): Don't try to determine the character
12250 position of the scroll margin if the window start point w->startp
e896f03c 12251 is outside the buffer's accessible region. (Bug#8468)
11997c76 12252
8a2cbd72
EZ
122532011-04-10 Eli Zaretskii <eliz@gnu.org>
12254
12255 Fix write-region and its subroutines for buffers > 2GB.
12256 * fileio.c (a_write, e_write): Modify declaration of arguments and
12257 local variables to support buffers larger than 2GB.
12258 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12259
12260 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12261 argument, local variables, and return value.
12262
12263 * lisp.h: Update prototypes of emacs_write and emacs_read.
12264
12265 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12266
4073e537 122672011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 12268
1ebfdcb6
PE
12269 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12270
b2ded58d
PE
12271 Fix more problems found by GCC 4.6.0's static checks.
12272
7d66342c
PE
12273 * xdisp.c (vmessage): Use a better test for character truncation.
12274
bbf47d44
PE
12275 * charset.c (load_charset_map): <, not <=, for optimization,
12276 and to avoid potential problems with integer overflow.
9248994d 12277 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 12278 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 12279 * editfns.c (Fformat): Likewise.
1e69125e 12280 * syntax.c (skip_chars): Likewise.
3befa583 12281
e3019616
PE
12282 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12283 This also lets GCC 4.6.0 generate slightly better loop code.
12284
becfa255
PE
12285 * callint.c (Fcall_interactively): <, not <=, for optimization.
12286 (Fcall_interactively): Count the number of arguments produced,
12287 not the number of arguments given. This is simpler and lets GCC
12288 4.6.0 generate slightly better code.
12289
dae0cd48
PE
12290 * ftfont.c: Distingish more carefully between FcChar8 and char.
12291 The previous code passed unsigned char * to a functions like
12292 strlen and xstrcasecmp that expect char *, which does not
12293 conform to the C standard.
12294 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12295 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12296 char * when the C standard requires it.
12297
76032d70
PE
12298 * keyboard.c (read_char): Remove unused var.
12299
eb3f1cc8
PE
12300 * eval.c: Port to Windows vsnprintf (Bug#8435).
12301 Include <limits.h>.
12302 (SIZE_MAX): Define if the headers do not.
12303 (verror): Do not give up if vsnprintf returns a negative count.
12304 Instead, grow the buffer. This ports to Windows vsnprintf, which
12305 does not conform to C99. Problem reported by Eli Zaretskii.
12306 Also, simplify the allocation scheme, by avoiding the need for
12307 calling realloc, and removing the ALLOCATED variable.
12308
70476b54
PE
12309 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12310
12020a9e
PE
12311 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12312 But keep the doprint source code for now, as we might revamp it
12313 and use it again (Bug#8435).
ea6c7ae6
PE
12314 * lisp.h (doprnt): Remove.
12315 * Makefile.in (base_obj): Remove doprnt.o.
12316 * deps.mk (doprnt.o): Remove.
12317
5fdb398c
PE
12318 error: Print 32- and 64-bit integers portably (Bug#8435).
12319 Without this change, on typical 64-bit hosts error ("...%d...", N)
12320 was used to print both 32- and 64-bit integers N, which relied on
12321 undefined behavior.
61bdb816 12322 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
12323 * lisp.h (error, verror): Mark as printf-like functions.
12324 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
12325 Report overflow in size calculations when allocating printf buffer.
12326 Do not truncate output string at its first null byte.
12327 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12328 Truncate the output at a character boundary, since vsnprintf does not
12329 do that.
12330 * charset.c (check_iso_charset_parameter): Convert internal
12331 character to string before calling 'error', since %c now has the
12332 printf meaning.
12333 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12334 overflow when computing char to be passed to 'error'. Do not
12335 pass Lisp_Object to 'error'; pass the integer instead.
12336 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12337 formatted with plain %d.
12338
b189fa66
PE
12339 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12340
bff87ef0
PE
12341 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12342
7e2cac20
PE
12343 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12344
ce4d90b5
PE
12345 * xterm.c (x_catch_errors): Remove duplicate declaration.
12346
266c9547
PE
12347 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12348
79c49ad2
PE
12349 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12350
368f4090
JM
123512011-04-10 Jim Meyering <meyering@redhat.com>
12352
12353 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12354 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12355 return ssize_t not "int", and use size_t as the buffer length.
12356 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12357 * gnutls.h: Update declarations.
12358 * process.c (read_process_output): Use ssize_t, to match.
12359 (send_process): Likewise.
12360
a32d4040
CY
123612011-04-09 Chong Yidong <cyd@stupidchicken.com>
12362
12363 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12364
8546720e 123652011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12366
04f2d78b
CB
12367 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12368 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12369
8546720e
GM
12370 * xterm.c (handle_one_xevent):
12371 * xmenu.c (create_and_show_popup_menu):
12372 * xselect.c (x_decline_selection_request)
12373 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12374
0a2f5c1a 123752011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12376
12377 Fix some uses of `int' instead of EMACS_INT.
12378 * search.c (string_match_1, fast_string_match)
12379 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12380 (scan_buffer, find_next_newline_no_quit)
12381 (find_before_next_newline, search_command, Freplace_match)
12382 (Fmatch_data): Make some `int' variables be EMACS_INT.
12383
12384 * xdisp.c (display_count_lines): 3rd argument and return value now
12385 EMACS_INT. All callers changed.
12386 (pint2hrstr): Last argument is now EMACS_INT.
12387
12388 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12389 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12390 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12391 (decode_coding_utf_16, decode_coding_emacs_mule)
12392 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12393 (decode_coding_ccl, decode_coding_charset)
12394 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12395 (decode_coding_iso_2022, decode_coding_emacs_mule)
12396 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12397 <char_offset, last_offset>: Declare EMACS_INT.
12398 (encode_coding_utf_8, encode_coding_utf_16)
12399 (encode_coding_emacs_mule, encode_invocation_designation)
12400 (encode_designation_at_bol, encode_coding_iso_2022)
12401 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12402 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12403 Declare EMACS_INT.
12404 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12405 (encode_invocation_designation): Last argument P_NCHARS is now
12406 EMACS_INT.
12407 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12408 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12409
12410 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12411 All users changed.
12412
12413 * ccl.c (Fccl_execute_on_string): Declare some variables
12414 EMACS_INT.
12415
8546720e 124162011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12417
12418 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12419
4e19a977
CS
124202011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12421
12422 * process.c (Fformat_network_address): Doc fix.
12423
87302331
R
124242011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12425
ee7683eb 12426 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12427
cbb59342
CY
124282011-04-08 Chong Yidong <cyd@stupidchicken.com>
12429
12430 * keyboard.c (read_char): Call Lisp function help-form-show,
12431 instead of using internal_with_output_to_temp_buffer.
12432 (Qhelp_form_show): New var.
e0d38eeb 12433 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12434
12435 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12436
12437 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12438
e67a13ab
CY
124392011-04-06 Chong Yidong <cyd@stupidchicken.com>
12440
04f2d78b
CB
12441 * process.c (Flist_processes): Remove to Lisp.
12442 (list_processes_1): Delete.
e67a13ab 12443
973f782d
EZ
124442011-04-06 Eli Zaretskii <eliz@gnu.org>
12445
7c106b1e
EZ
12446 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12447
973f782d
EZ
12448 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12449
41cf7d1a 124502011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12451
ca23cc88
PE
12452 Fix more problems found by GCC 4.6.0's static checks.
12453
f390e2d5
PE
12454 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12455
42eea0d0
PE
12456 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12457
b69769da 12458 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12459
f9541e84
PE
12460 * xdisp.c (vmessage): Mark as a printf-like function.
12461
13841b55
PE
12462 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12463
c136c10f
PE
12464 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12465
5e2d4a30
PE
12466 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12467 printf-like functions.
12468 (tiff_load): Add casts to remove these marks before passing them
12469 to system-supplied API.
12470
583f48b9
PE
12471 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12472
b25d760e
PE
12473 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12474 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12475 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12476 directly, rather than having caller test rule sign. This avoids
12477 some unnecessary tests.
12478 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12479 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12480 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12481
bc7b6697 12482 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12483 (xfont_open): Avoid unnecessary tests.
bc7b6697 12484
27ccc379
PE
12485 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12486
dcd5c89a
PE
12487 * composite.h, composite.c (composition_gstring_put_cache):
12488 Use EMACS_INT, not int, for length.
12489
b13a45c6
PE
12490 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12491 breaking out part of COMPOSITION_DECODE_RULE.
12492 (COMPOSITION_DECODE_RULE): Use it.
12493 * composite.c (get_composition_id): Remove unused local vars,
12494 by using the new macro.
12495
1e792e4d
PE
12496 * textprop.c (set_text_properties_1): Change while to do-while,
12497 since the condition is always true at first.
12498
dc6c6455 12499 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12500 (interval_deletion_adjustment): Return unsigned value.
12501 All uses changed.
dc6c6455 12502
aba7731a
PE
12503 * process.c (list_processes_1, create_pty, read_process_output):
12504 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12505 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12506 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12507 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12508 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12509
fdfc4bf3
PE
12510 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12511
fca8fe46 12512 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12513 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12514
06a0259a 12515 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12516 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12517 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12518
e7b9e80f
PE
12519 * print.c (print_error_message): Avoid int overflow.
12520
56201685
PE
12521 * font.c (font_list_entities): Redo for clarity,
12522 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12523
78834453 12524 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12525 (font_score): Avoid potential overflow in diff calculation.
78834453 12526
0bc0b309 12527 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12528 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12529
e610eaca
PE
12530 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12531
b895abce
PE
12532 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12533 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12534 can always succeed if overflow has undefined behavior.
12535
1f1d9321 12536 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12537 (wordify): Omit three unnecessary tests.
1f1d9321 12538
c59478bc
PE
12539 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12540 All callers changed. This avoids the need for an unused var.
12541
79b73827
PE
12542 * casefiddle.c (casify_region): Remove var that is set but not used.
12543
a4db5dfe
PE
12544 * dired.c (file_name_completion): Remove var that is set but not used.
12545
43aae36e
PE
12546 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12547
2a47c44d 12548 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12549 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12550
a37c69bf
PE
12551 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12552 Check for integer overflow on size calculations.
12553
328ab8e7
PE
12554 * buffer.c (Fprevious_overlay_change): Remove var that is set
12555 but not used.
12556
e5a2a5cb
PE
12557 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12558 Remove vars that are set but not used.
8d84a6eb 12559 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12560 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12561
a60e5f68
PE
12562 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12563
f661cb61 12564 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12565 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12566
f0397f5a
PE
12567 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12568 that are set but not used.
12569
8664db06 12570 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12571 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12572
6abdaa4a
PE
12573 * xselect.c (x_get_local_selection, x_handle_property_notify):
12574 Remove vars that are set but not used.
12575
0ce7538d 12576 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12577 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12578
9ae848fc
PE
12579 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12580 Remove var that is set but not used.
0b918413
PE
12581 (scroll_bar_windows_size): Now size_t, not int.
12582 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12583 Check for overflow.
9ae848fc 12584
a5a62657
PE
12585 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12586 (map_tty_color) [!defined MSDOS]: Likewise.
12587
5c5cdd39
PE
12588 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12589
66ebf983
PE
12590 * coding.c: Remove vars that are set but not used.
12591 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12592 All callers changed.
12593 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12594 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12595 (decode_coding_charset): Remove vars that are set but not used.
12596
1be4d761
PE
12597 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12598 that is set but not used.
12599
47553fa8
PE
12600 * print.c (print_object): Remove var that is set but not used.
12601
1f7196bf 12602 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12603 The gnulib version avoids calling malloc in the usual case,
12604 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12605 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12606 * filelock.c (current_lock_owner): Likewise.
12607 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12608 * sysdep.c: Include allocator.h, careadlinkat.h.
12609 (emacs_no_realloc_allocator): New static constant.
12610 (emacs_readlink): New function.
fdb61804
PE
12611 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12612 ../lib/careadlinkat.h.
d1fdcab7 12613
f84c17c7
SM
126142011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12615
12616 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12617 first non-nil return value).
12618
ef3862ad
JD
126192011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12620
12621 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12622 if not defined (Bug#8403).
12623
376a7006
JB
126242011-04-02 Juanma Barranquero <lekktu@gmail.com>
12625
12626 * xdisp.c (display_count_lines): Remove parameter `start',
12627 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12628 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12629 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12630 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12631 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12632 and thereabouts. All callers changed.
12633 (get_per_char_metric): Remove parameter `f', unused since
12634 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12635
6ca3801d
JM
126362011-04-02 Jim Meyering <meyering@redhat.com>
12637
12638 do not dereference NULL upon failed strdup
12639 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12640 (ns_get_family): Likewise.
12641
d8e2b5ba
JB
126422011-04-02 Juanma Barranquero <lekktu@gmail.com>
12643
12644 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12645
8c74fcbd
JD
126462011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12647
12648 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12649 later (Bug#8403).
12650
7200d79c
SM
126512011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12652
03408648 12653 Add lexical binding.
7200d79c 12654
03408648
SM
12655 * window.c (Ftemp_output_buffer_show): New fun.
12656 (Fsave_window_excursion):
12657 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12658
12659 * lread.c (lisp_file_lexically_bound_p): New function.
12660 (Fload): Bind Qlexical_binding.
12661 (readevalloop): Remove `evalfun' arg.
12662 Bind Qinternal_interpreter_environment.
12663 (Feval_buffer): Bind Qlexical_binding.
12664 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12665 Mark as dynamic.
12666 (syms_of_lread): Declare `lexical-binding'.
12667
12668 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12669
12670 * keyboard.c (eval_dyn): New fun.
12671 (menu_item_eval_property): Use it.
ca105506
SM
12672
12673 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12674
03408648
SM
12675 * fns.c (concat, mapcar1): Accept byte-code-functions.
12676
12677 * eval.c (Fsetq): Handle lexical vars.
12678 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12679 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12680 (FletX, Flet): Obey lexical binding.
12681 (Fcommandp): Handle closures.
12682 (Feval): New `lexical' arg.
12683 (eval_sub): New function extracted from Feval. Use it almost
12684 everywhere where Feval was used. Look up vars in lexical env.
12685 Handle closures.
12686 (Ffunctionp): Move from subr.el.
12687 (Ffuncall): Handle closures.
12688 (apply_lambda): Remove `eval_flags'.
12689 (funcall_lambda): Handle closures and new byte-code-functions.
12690 (Fspecial_variable_p): New function.
12691 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12692 but without exporting it to Lisp.
23aba0ea 12693
23aba0ea 12694 * doc.c (Fdocumentation, store_function_docstring):
03408648 12695 * data.c (Finteractive_form): Handle closures.
23aba0ea 12696
03408648
SM
12697 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12698 interactive spec.
ba83908c 12699
04f2d78b
CB
12700 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12701 New byte-codes.
03408648
SM
12702 (exec_byte_code): New function extracted from Fbyte_code to handle new
12703 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12704
03408648 12705 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12706
03408648 12707 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12708
e2abce01
JB
127092011-03-31 Juanma Barranquero <lekktu@gmail.com>
12710
12711 * xdisp.c (redisplay_internal): Fix prototype.
12712
63696a73 127132011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12714
63696a73 12715 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12716 (try_scrolling): Use it when setting scroll_limit.
12717 Limit scrolling to 100 screen lines.
63696a73
EZ
12718 (redisplay_window): Even when falling back on "recentering",
12719 position point in the window according to scroll-conservatively,
12720 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12721
12722 (try_scrolling): When point is above the window, allow searching
12723 as far as scroll_max, or one screenful, to compute vertical
12724 distance from PT to the scroll margin position. This prevents
12725 try_scrolling from unnecessarily failing when
12726 scroll-conservatively is set to a value slightly larger than the
12727 window height. Clean up the case of PT below the margin at bottom
12728 of window: scroll_max can no longer be INT_MAX. When aggressive
12729 scrolling is in use, don't let point enter the opposite scroll
12730 margin as result of the scroll.
12731 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12732 threshold of 100 lines for never-recentering scrolling.
12733
e4cc2dfc
JB
127342011-03-31 Juanma Barranquero <lekktu@gmail.com>
12735
12736 * dispextern.h (move_it_by_lines):
12737 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12738 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12739 (message_log_check_duplicate): Remove parameters `prev_bol' and
12740 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12741 (redisplay_internal): Remove parameter `preserve_echo_area',
12742 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12743
12744 * indent.c (Fvertical_motion):
12745 * window.c (window_scroll_pixel_based, Frecenter):
12746 Don't pass `need_y_p' to `move_it_by_lines'.
12747
1c470562
SM
127482011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12749
44f230aa
SM
12750 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12751 steal a few bits to be more compact.
12752 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12753 Remove unneeded casts.
12754
1c470562
SM
12755 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12756
888adce9
ZK
127572011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12758
12759 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12760 binding" message (bug#7967).
12761
f838ed7b
PE
127622011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12763
77861b95
PE
12764 Fix more problems found by GCC 4.6.0's static checks.
12765
de6dbc14
PE
12766 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12767 Remove unused local var.
12768
f838ed7b
PE
12769 * editfns.c (Fmessage_box): Remove unused local var.
12770
792c7b2b
PE
12771 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12772 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12773 Omit unused local vars.
c499e557 12774 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12775 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12776 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12777 Omit unused local var.
12778
ba0165e1
PE
12779 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12780 Don't assume string length fits in int.
32ad8845 12781 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12782 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12783
3c59b4c9
PE
12784 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12785 instead of alloca (Bug#8344).
12786
a3eed478 12787 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12788 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12789
eb4d412d
PE
12790 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12791
1658b401
PE
12792 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12793 concerns.
12794
12795 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12796
12797 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12798
9a2c6e05
PE
12799 * keyboard.c (syms_of_keyboard): Use the same style as later
12800 in this function when indexing through an array. This also
12801 works around GCC bug 48267.
12802
03d0a109
PE
12803 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12804
44f730c8
PE
12805 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12806
fe75f926
PE
12807 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12808 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12809
ffa8c828
PE
12810 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12811 This avoids undefined behavior on integer overflow, and is a bit
12812 more convenient anyway since it is compared to a size_t variable.
12813
c5101a77
PE
12814 Variadic C functions now count arguments with size_t, not int.
12815 This avoids an unnecessary limitation on 64-bit machines, which
12816 caused (substring ...) to crash on large vectors (Bug#8344).
12817 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12818 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12819 All variadic functions and their callers changed accordingly.
c5101a77
PE
12820 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12821 * data.c (arith_driver, float_arith_driver): Likewise.
12822 * editfns.c (general_insert_function): Likewise.
12823 * eval.c (struct backtrace.nargs, interactive_p)
12824 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12825 (funcall_lambda, mark_backtrace): Likewise.
12826 * fns.c (concat): Likewise.
12827 * frame.c (x_set_frame_parameters): Likewise.
12828 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12829 0 if not found, not -1. All callers changed.
12830
dd3f25f7
PE
12831 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12832 (stack_copy_size): Now size_t, not int.
12833 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12834
461c2ab9
JB
128352011-03-28 Juanma Barranquero <lekktu@gmail.com>
12836
12837 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12838 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12839 All callers changed.
12840
12841 * lisp.h (multibyte_char_to_unibyte):
12842 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12843 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12844 * character.h (CHAR_TO_BYTE8):
12845 * cmds.c (internal_self_insert):
12846 * editfns.c (general_insert_function):
12847 * keymap.c (push_key_description):
12848 * search.c (Freplace_match):
12849 * xdisp.c (message_dolog, set_message_1): All callers changed.
12850
f6d62986
SM
128512011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12852
12853 * keyboard.c (safe_run_hook_funcall): New function.
12854 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12855 don't set the hook to nil, but remove the offending function instead.
12856 (Qcommand_hook_internal): Remove, unused.
12857 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12858 Vcommand_hook_internal.
12859
12860 * eval.c (enum run_hooks_condition): Remove.
12861 (funcall_nil, funcall_not): New functions.
12862 (run_hook_with_args): Call each function through a `funcall' argument.
12863 Remove `cond' argument, now redundant.
12864 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12865 (Frun_hook_with_args_until_failure): Adjust accordingly.
12866 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12867
1db5b1ad
JB
128682011-03-28 Juanma Barranquero <lekktu@gmail.com>
12869
12870 * dispextern.h (string_buffer_position): Remove declaration.
12871
12872 * print.c (strout): Remove parameter `multibyte', unused since
12873 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12874
12875 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12876 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12877 All callers changed.
12878
12879 * w32.c (_wsa_errlist): Use braces for struct initializers.
12880
12881 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12882 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12883 All callers changed.
12884 (string_buffer_position): Likewise. Also, make static (it's never
12885 used outside xdisp.c).
12886 (cursor_row_p): Remove parameter `w', unused since
12887 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12888 (decode_mode_spec): Remove parameter `precision', introduced during
12889 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12890 All callers changed.
12891
5ffb62aa
JD
128922011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12893
12894 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12895
461c2ab9 128962011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12897
12898 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12899 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12900 (ns_update_auto_hide_menu_bar): New functions.
12901 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12902 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12903 ns_constrain_all_frames.
12904 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12905 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12906
5c380ffb
JD
129072011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12908
12909 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12910
9af30bdf
GM
129112011-03-27 Glenn Morris <rgm@gnu.org>
12912
12913 * syssignal.h: Replace RETSIGTYPE with void.
12914 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12915 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12916 Replace SIGTYPE with void everywhere.
12917 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12918 * s/template.h (SIGTYPE): Remove commented out definition.
12919
e2abce01
JB
129202011-03-26 Eli Zaretskii <eliz@gnu.org>
12921
12922 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12923 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12924
f868cd8a
JB
129252011-03-26 Juanma Barranquero <lekktu@gmail.com>
12926
59eb0929
JB
12927 * w32.c (read_unc_volume): Use parameter `henum', instead of
12928 global variable `wget_enum_handle'.
12929
12930 * keymap.c (describe_vector): Remove parameters `indices' and
12931 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12932 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12933
f868cd8a
JB
12934 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12935
12936 * keyboard.c (timer_check): Remove parameter `do_it_now',
12937 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12938 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12939 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12940
12941 * keyboard.c (read_char):
12942 * w32menu.c (w32_menu_display_help):
12943 * xmenu.c (show_help_event, menu_help_callback):
12944 Adjust calls to `show_help_echo'.
12945
12946 * gtkutil.c (xg_maybe_add_timer):
12947 * keyboard.c (readable_events):
12948 * process.c (wait_reading_process_output):
12949 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12950
12951 * insdel.c (adjust_markers_gap_motion):
12952 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12953 (gap_left, gap_right): Don't call it.
12954
2ecf6fdb
CY
129552011-03-25 Chong Yidong <cyd@stupidchicken.com>
12956
12957 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12958 incurred during fontification.
12959
6b1f9ba4
JB
129602011-03-25 Juanma Barranquero <lekktu@gmail.com>
12961
12962 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12963 (DEFVAR_PER_BUFFER): Don't pass it.
12964
12965 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12966 (scrolling_window): Don't pass it.
12967
0f4a96b5
JB
129682011-03-25 Juanma Barranquero <lekktu@gmail.com>
12969
12970 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12971
12972 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12973 and `suffix'.
12974 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12975 of variables specific to SELinux and computation of `encoded_absname'.
12976
12977 * image.c (XPutPixel): Remove unused variable `height'.
12978
12979 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12980
12981 * unexw32.c (get_section_info): Remove unused variable `section'.
12982
12983 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12984 (system_process_attributes): Remove unused variable `sess'.
12985 (sys_read): Remove unused variable `err'.
12986
12987 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12988 (w32_wnd_proc): Remove unused variable `isdead'.
12989 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12990 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12991 (x_create_tip_frame): Remove unused variable `tem'.
12992
12993 * w32inevt.c (w32_console_read_socket):
12994 Remove unused variable `no_events'.
12995
12996 * w32term.c (x_draw_composite_glyph_string_foreground):
12997 Remove unused variable `width'.
12998
1149507c
JB
129992011-03-24 Juanma Barranquero <lekktu@gmail.com>
13000
13001 * w32term.c (x_set_glyph_string_clipping):
13002 Don't pass uninitialized region to CombineRgn.
13003
9c88f339
JB
130042011-03-23 Juanma Barranquero <lekktu@gmail.com>
13005
13006 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
13007 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
13008 (Fx_close_connection): Remove unused variable `i'.
13009
13010 * w32font.c (w32font_draw): Return number of glyphs.
13011 (w32font_open_internal): Remove unused variable `i'.
13012 (w32font_driver): Add missing initializer.
13013
13014 * w32menu.c (utf8to16): Remove unused variable `utf16'.
13015 (fill_in_menu): Remove unused variable `items_added'.
13016
13017 * w32term.c (last_mouse_press_frame): Remove static global variable.
13018 (w32_clip_to_row): Remove unused variable `f'.
13019 (x_delete_terminal): Remove unused variable `i'.
13020
13021 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
13022 (NOTHING): Remove unused static global variable.
13023 (uniscribe_check_otf): Remove unused variable `table'.
13024 (uniscribe_font_driver): Add missing initializers.
13025
dee091a3
JD
130262011-03-23 Julien Danjou <julien@danjou.info>
13027
13028 * term.c (Fsuspend_tty, Fresume_tty):
13029 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
13030 * window.c (temp_output_buffer_show):
13031 * insdel.c (signal_before_change):
13032 * frame.c (Fhandle_switch_frame):
13033 * fileio.c (Fdo_auto_save):
13034 * emacs.c (Fkill_emacs):
13035 * editfns.c (save_excursion_restore):
13036 * cmds.c (internal_self_insert):
13037 * callint.c (Fcall_interactively):
13038 * buffer.c (Fkill_all_local_variables):
13039 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
13040 Use Frun_hooks.
0f4a96b5 13041 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 13042 unconditionally since it does the check itself.
dee091a3 13043
2c520ab5 130442011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 13045
c9c49752
PE
13046 Fix more problems found by GCC 4.5.2's static checks.
13047
8abc3f12
PE
13048 * coding.c (encode_coding_raw_text): Avoid unnecessary test
13049 the first time through the loop, since we know p0 < p1 then.
13050 This also avoids a gcc -Wstrict-overflow warning.
13051
a2d26660
PE
13052 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
13053 leading to a memory leak, possible in functions like
13054 load_charset_map_from_file that can allocate an unbounded number
b12ef411 13055 of objects (Bug#8318).
a2d26660 13056
916c72e9
PE
13057 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
13058 that could (at least in theory) be that large.
13059
19ab8a18
PE
13060 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
13061 This is less likely to overflow, and avoids undefined behavior if
13062 overflow does occur. All callers changed. Use strtoul to scan
13063 for the unsigned long integer.
b7cbbd6f
PE
13064 (pint2hrstr): Simplify and tune code slightly.
13065 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 13066
f0641eff
PE
13067 * scroll.c (do_scrolling): Work around GCC bug 48228.
13068 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
13069
7f650bb9
PE
13070 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
13071 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
13072 (validate_x_resource_name): Simplify count usage.
13073 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 13074
37dd57d1
PE
13075 * fileio.c (Fcopy_file): Report error if fchown or fchmod
13076 fail (Bug#8306).
81e56e61 13077
699979fc 13078 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 13079
401bf9b4
PE
13080 * process.c (Fmake_network_process): Use socklen_t, not int,
13081 where POSIX says socklen_t is required in portable programs.
13082 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 13083 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
13084 (Fmake_network_process, server_accept_connection):
13085 (wait_reading_process_output, read_process_output):
13086 Likewise.
13087
b93aacde
PE
13088 * process.c: Rename or move locals to avoid shadowing.
13089 (list_processes_1, Fmake_network_process):
13090 (read_process_output_error_handler, exec_sentinel_error_handler):
13091 Rename or move locals.
4dc343ee 13092 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 13093 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 13094 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 13095 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 13096 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 13097
af8a867c 13098 Make tparam.h and terminfo.c consistent.
44f230aa
SM
13099 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
13100 Include tparam.h instead, since it declares them.
af8a867c
PE
13101 * cm.h (PC): Remove extern decl; tparam.h now does this.
13102 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
13103 * terminfo.c: Include tparam.h, to check interfaces.
13104 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
13105 (tparam): Adjust signature to match interface in tparam.h;
13106 this removes some undefined behavior. Check that outstring and len
13107 are zero, which they always are with Emacs.
13108 * tparam.h (PC, BC, UP): New extern decls.
13109
0248044d 13110 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 13111 (xftfont_open): Rename locals to avoid shadowing.
0248044d 13112
8ff096c1 13113 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
13114 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
13115 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 13116 (ftfont_list): Remove unused local.
49eaafba
PE
13117 (get_adstyle_property, ftfont_pattern_entity):
13118 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
13119 Rename locals to avoid shadowing.
8ff096c1 13120
e2be39f6
PE
13121 * xfont.c (xfont_list_family): Mark var as initialized.
13122
c9735e30
PE
13123 * xml.c (make_dom): Now static.
13124
8f5201ae
PE
13125 * composite.c (composition_compute_stop_pos): Rename local to
13126 avoid shadowing.
b246f932
PE
13127 (composition_reseat_it): Remove unused locals.
13128 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 13129 (composition_update_it): Mark var as initialized.
11b61122
PE
13130 (find_automatic_composition): Mark vars as initialized,
13131 with a FIXME (Bug#8290).
8f5201ae 13132
760fbc2c
PE
13133 character.h: Rename locals to avoid shadowing.
13134 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
13135 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
13136 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
13137 (BUF_DEC_POS): Be more systematic about renaming local temporaries
13138 to avoid shadowing.
13139
ff08eb85
PE
13140 * textprop.c (property_change_between_p): Remove; unused.
13141
fc7bf025
PE
13142 * intervals.c (interval_start_pos): Now static.
13143
235d7abc
PE
13144 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
13145
44f230aa
SM
13146 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
13147 Rename locals to avoid shadowing.
3e7d6594 13148
50060332
PE
13149 * sound.c (wav_play, au_play, Fplay_sound_internal):
13150 Fix pointer signedness.
d01f234b 13151 (alsa_choose_format): Remove unused local var.
c83b8872
PE
13152 (wav_play): Initialize a variable to 0, to prevent undefined
13153 behavior (Bug#8278).
50060332 13154
c4fc4e30
PE
13155 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
13156
918436ed
PE
13157 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
13158
c939f91b
PE
13159 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
13160 clobbering (Bug#8298).
b9c7f648
PE
13161 * sysdep.c (sys_subshell): Likewise.
13162 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 13163
6bd8c144
PE
13164 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
13165 This should get cleaned up, so that child_setup has the
13166 same signature on all platforms.
13167
7710357c 13168 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 13169 (relocate_fd): Rename locals to avoid shadowing.
7710357c 13170
c59da222
CY
131712011-03-22 Chong Yidong <cyd@stupidchicken.com>
13172
13173 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
13174 not to be necessary, and produces flickering.
13175
66b87493
GM
131762011-03-20 Glenn Morris <rgm@gnu.org>
13177
13178 * config.in: Remove file.
13179
45b6f6d5
JB
131802011-03-20 Juanma Barranquero <lekktu@gmail.com>
13181
13182 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
13183 are now in src/globals.h.
13184 (syms_of_minibuf): Remove spurious & from previous change.
13185
cd394be1 131862011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
13187
13188 * minibuf.c (completing-read-function): New variable.
13189 (completing-read-default): Rename from completing-read.
13190 (completing-read): Call completing-read-function.
13191
b14e3e21
CY
131922011-03-19 Juanma Barranquero <lekktu@gmail.com>
13193
13194 * xfaces.c (Fx_load_color_file):
13195 Read color file from absolute filename (bug#8250).
13196
f2b726e6
JB
131972011-03-19 Juanma Barranquero <lekktu@gmail.com>
13198
13199 * makefile.w32-in: Update dependencies.
13200
09f6ff02
EZ
132012011-03-17 Eli Zaretskii <eliz@gnu.org>
13202
13203 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
13204
29a6015a
PE
132052011-03-17 Paul Eggert <eggert@cs.ucla.edu>
13206
a3a6c54e
PE
13207 Fix more problems found by GCC 4.5.2's static checks.
13208
b766f867
PE
13209 * process.c (make_serial_process_unwind, send_process_trap):
13210 (sigchld_handler): Now static.
13211
be02381c
PE
13212 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
13213 That way, the code declares only the vars that it needs.
13214 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
13215 * s/cygwin.h (PTY_ITERATION): Likewise.
13216 * s/darwin.h (PTY_ITERATION): Likewise.
13217 * s/gnu-linux.h (PTY_ITERATION): Likewise.
13218
57048744
PE
13219 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
13220 * process.c (allocate_pty): Don't declare stb unless it's needed.
13221
7914961c 13222 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
13223 (CONSTANTLIM): Remove; unused.
13224 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
13225 Define only if needed.
7914961c 13226
b3967b18
PE
13227 * unexelf.c (unexec): Name an expression,
13228 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
13229 Use a different way to cause a compilation error if anyone uses
13230 n rather than nn, a way that does not involve shadowing.
73366a00 13231 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 13232
29a6015a
PE
13233 * deps.mk (unexalpha.o): Remove; unused.
13234
43cfc33e 13235 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 13236 * unexec.h: New file.
ce701a33
PE
13237 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13238 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13239 Depend on unexec.h.
13240 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13241 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13242 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 13243 Change as necessary to match prototype in unexec.h.
ce701a33 13244
01f44d5a
PE
13245 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13246 shadowing.
4f63c6bb 13247 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 13248
a6670b0b
PE
13249 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13250 Rename locals to avoid shadowing.
13251
cef2010d 13252 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 13253 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 13254
d4d7173a
PE
13255 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13256
f08b802a
PE
13257 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13258 warning when compiling print.c.
13259
3ddb0639
PE
13260 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13261 instead of using an uninitialized var.
5ad03b97 13262 (font_sort_entities): Mark var as initialized.
3ddb0639 13263
170a2692
PE
13264 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13265
e663c700
PE
13266 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13267 pointers to constants.
89bc529a 13268 (font_parse_fcname): Remove unused vars.
7b81e2d0 13269 (font_delete_unmatched): Now static.
ea838e10 13270 (font_get_spec): Remove; unused.
13a547c6
PE
13271 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13272 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13273 Rename or move locals to avoid shadowing.
e663c700 13274
2a80c887 13275 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 13276 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 13277
1384fa33 13278 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 13279 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 13280
8b2c52e9
PE
13281 * alloc.c (mark_backtrace): Move decl from here ...
13282 * lisp.h: ... to here, so that it can be checked.
13283
475545b5 13284 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 13285 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
13286 (lisp_indirect_variable): Name an expression,
13287 to avoid gcc -Wbad-function-cast warning.
1faed8ae 13288 (Fdefvar): Rename locals to avoid shadowing.
475545b5 13289
b1349114 13290 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 13291 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 13292 Use const pointer when appropriate.
b1349114 13293
a2928364
PE
13294 * lisp.h (get_system_name, get_operating_system_release):
13295 Move decls here, to check interfaces.
13296 * process.c (get_operating_system_release): Move decl to lisp.h.
13297 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
13298 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13299 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13300 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
13301 (Fformat_time_string, Fencode_time, Finsert_char):
13302 (Ftranslate_region_internal, Fformat):
13303 Rename or remove local vars to avoid shadowing.
9710023e 13304 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 13305
a415e694
PE
13306 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13307 avoid shadowing.
13308
8ef4622d
PE
13309 * lisp.h (eassert): Check that the argument compiles, even if
13310 ENABLE_CHECKING is not defined.
13311
946f9a5b
PE
13312 * data.c (Findirect_variable): Name an expression, to avoid
13313 gcc -Wbad-function-cast warning.
112396d6 13314 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 13315 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
13316 (Fmake_variable_buffer_local, Fmake_local_variable):
13317 Mark variables as initialized.
52746918 13318 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 13319
e5aab7e7 13320 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
13321 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
13322 Rename locals to avoid shadowing.
dff45157
PE
13323 (mark_stack): Move local variables into the #ifdef region where
13324 they're used.
7bc26fdb
PE
13325 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
13326 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13327 needed otherwise.
13328 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13329 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13330 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13331
e5aab7e7
PE
13332 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13333 avoids undefined behavior in theory.
13334
4da60324
PE
13335 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13336
88043301
PE
13337 Use functions, not macros, for up- and down-casing (Bug#8254).
13338 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13339 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13340 to use the following functions instead of these macros.
13341 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13342 EMACS_INT, since callers assume the returned value fits in int.
13343 (upcase1): Likewise, for UPCASE_TABLE.
13344 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13345 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13346 the race-condition problem in the old DOWNCASE.
88043301 13347
19ed5445
PE
13348 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13349 Rename locals to avoid shadowing.
13350 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13351 (regex_compile, re_search_2, re_match_2_internal):
13352 Remove unused local vars.
952db0d7
PE
13353 (FREE_VAR): Rewrite so as not to use empty "else",
13354 which gcc can warn about.
da053e48 13355 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13356 (RETALLOC_IF): Define only if needed.
13357 (WORDCHAR_P): Likewise. This one is never needed, but is used
13358 only in a comment talking about a compiler bug, so put inside
13359 the #if 0 of that comment.
13360 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13361 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13362 Remove; unused.
19ed5445 13363
1f3561e4 13364 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13365 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13366 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13367
ded6f8f7
PE
13368 * search.c (simple_search): Remove unused var.
13369
dbd37a95
PE
13370 * dired.c (compile_pattern): Move decl from here ...
13371 * lisp.h: ... to here, so that it can be checked.
13372 (struct re_registers): New forward decl.
13373
7e47afad
PE
13374 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13375
85f24f61
PE
13376 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13377 All uses changed.
13378 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13379 Rename locals to avoid shadowing.
5671df8f 13380 (Fvertical_motion): Mark locals as initialized.
85f24f61 13381
181aa2be 13382 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13383 (casify_region): Mark local as initialized.
181aa2be 13384
930d429c
PE
13385 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13386
7082eac6
PE
13387 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13388 New macros, so that the caller can use some names other than
13389 gcpro1, gcpro2, etc.
13390 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13391 of the new macros.
13392 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13393 argument, for consistency with GCPRO2_VAR, etc: it is now the
13394 prefix of the variable, not the variable itself. All uses
13395 changed.
38b2c076
PE
13396 * dired.c (directory_files_internal, file_name_completion):
13397 Rename locals to avoid shadowing.
13398
15206ed9
PE
13399 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13400 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13401 dired.c's scmp function, had undefined behavior.
13402 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13403 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13404 * buffer.h: ... to here, because these macros use current_buffer,
13405 and the new implementation with inline functions needs to have
13406 current_buffer in scope now, rather than later when the macros
13407 are used.
13408 (downcase, upcase1): New static inline functions.
13409 (DOWNCASE, UPCASE1): Reimplement using these functions.
13410 This avoids undefined behavior in expressions like
13411 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13412 from race conditions in accessing the global variables
13413 case_temp1 and case_temp2.
13414 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13415 * lisp.h (case_temp1, case_temp2): Remove their decls.
13416 * character.h (ASCII_CHAR_P): Move from here ...
13417 * lisp.h: ... to here, so that the inline functions mentioned
13418 above can use them.
13419
4a6bea26
PE
13420 * dired.c (directory_files_internal_unwind): Now static.
13421
f14b7e14
PE
13422 * fileio.c (file_name_as_directory, directory_file_name):
13423 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13424 Now static.
2893f146
PE
13425 (file_name_as_directory): Use const pointers when appropriate.
13426 (Fexpand_file_name): Likewise. In particular, newdir might
13427 point at constant storage, so make it a const pointer.
fd4ead52 13428 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13429 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13430 signedness issues.
f839df0c
PE
13431 (Fset_file_times, Finsert_file_contents, auto_save_error):
13432 Rename locals to avoid shadowing.
f14b7e14 13433
5716756e 13434 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13435 (Ftry_completion, Fall_completions): Rename or remove locals
13436 to avoid shadowing.
5716756e 13437
b4c3046a
PE
13438 * marker.c (bytepos_to_charpos): Remove; unused.
13439
b45db522
PE
13440 * lisp.h (verify_bytepos, count_markers): New decls,
13441 so that gcc does not warn that these functions aren't declared.
13442
85876d07
PE
13443 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13444 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13445 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13446 (copy_text): Remove unused local var.
85876d07 13447
03d78a21 13448 * filelock.c (within_one_second): Now static.
b3dd38ab 13449 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13450
5df8f01b
PE
13451 * buffer.c (fix_overlays_before): Mark locals as initialized.
13452 (fix_start_end_in_overlays): Likewise. This function should be
13453 simplified by using pointers-to-pointers, but that's a different
13454 matter.
b1d876f1 13455 (switch_to_buffer_1): Now static.
8f54f30a
PE
13456 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13457 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13458
a70072c9 13459 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13460 Fix pointer signedness issue.
edced198
PE
13461 (sys_subshell): Mark local as volatile if checking for lint,
13462 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13463 (MAXPATHLEN): Define only if needed.
a70072c9 13464
a0977c44
PE
13465 * process.c (serial_open, serial_configure): Move decls from here ...
13466 * systty.h: ... to here, so that they can be checked.
13467
a884fdcc
PE
13468 * fns.c (get_random, seed_random): Move extern decls from here ...
13469 * lisp.h: ... to here, so that they can be checked.
13470
604efe86 13471 * sysdep.c (reset_io): Now static.
b8950c94 13472 (wait_for_termination_signal): Remove; unused.
604efe86 13473
38fc62d9
PE
13474 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13475 (copy_keymap_item, append_key, push_text_char_description):
13476 Now static.
1004a21a 13477 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13478 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13479 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13480 (describe_map_tree):
13481 Rename locals to avoid shadowing.
38fc62d9 13482
2f2650da
PE
13483 * keyboard.c: Declare functions static if they are not used elsewhere.
13484 (echo_char, echo_dash, cmd_error, top_level_2):
13485 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13486 (read_char, kbd_buffer_get_event, make_lispy_position):
13487 (make_lispy_event, make_lispy_movement, apply_modifiers):
13488 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13489 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13490 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13491 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13492 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13493
a053e86c 13494 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13495 (mark_kboards): Move decl here ...
13496 * alloc.c (mark_kboards): ... from here.
a053e86c 13497
4752793e
PE
13498 * lisp.h (force_auto_save_soon): New decl.
13499
74f10ca7 13500 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13501 (DEFINE_DUMMY_FUNCTION): New macro.
13502 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13503 Use it.
c03cd23f
PE
13504 (main): Add casts to avoid warnings
13505 if GCC considers string literals to be constants.
74f10ca7 13506
022e70d4
PE
13507 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13508
59d6fe83
PE
13509 * dbusbind.c: Pointer signedness fixes.
13510 (xd_signature, xd_append_arg, xd_initialize):
13511 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13512 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13513 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13514 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13515
78320123
PE
13516 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13517 if GCC considers string literals to be constants.
49cebcca 13518 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13519
35ac2a97
SM
135202011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13521
fb103ca9
SM
13522 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13523 (print_preprocess, print_object): New macro to fix last change.
13524
35ac2a97
SM
13525 * print.c (print_preprocess): Don't forget font objects.
13526
62973b41
JB
135272011-03-16 Juanma Barranquero <lekktu@gmail.com>
13528
13529 * emacs.c (USAGE3): Doc fixes.
13530
0e48bb22
AS
135312011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13532
13533 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13534 structure.
13535
7684e57b
JB
135362011-03-14 Juanma Barranquero <lekktu@gmail.com>
13537
13538 * lisp.h (VWindow_system, Qfile_name_history):
13539 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13540 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13541 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13542
13543 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13544 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13545
13546 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13547 * w32console.c (detect_input_pending, read_input_pending)
13548 (encode_terminal_code):
13549 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13550 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13551 (w32_system_caret_y, Qfile_name_history):
13552 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13553 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13554 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13555 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13556 * w32proc.c (Qlocal, report_file_error):
13557 * w32term.c (Vwindow_system, updating_frame):
13558 * w32uniscribe.c (initialized, uniscribe_font_driver):
13559 Remove unneeded extern declarations.
13560
2aa46d6c
CY
135612011-03-14 Chong Yidong <cyd@stupidchicken.com>
13562
c96bbc66 13563 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13564
cffc6f3b
CY
135652011-03-13 Chong Yidong <cyd@stupidchicken.com>
13566
13567 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13568 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13569 These macros can no longer be used for assignment.
13570
44f230aa
SM
13571 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13572 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13573 (record_buffer_markers, fetch_buffer_markers): New functions for
13574 recording and fetching special buffer markers.
13575 (set_buffer_internal_1, set_buffer_temp): Use them.
13576
13577 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13578
13579 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13580
13581 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13582 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13583
13584 * xdisp.c (hscroll_window_tree):
13585 (reconsider_clip_changes): Use PT instead of BUF_PT.
13586
d251f04b
EZ
135872011-03-13 Eli Zaretskii <eliz@gnu.org>
13588
13589 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13590 $(EMACS_ROOT)/lib/intprops.h.
13591
f0c77cd1
PE
135922011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13593
3eca4629
PE
13594 Fix more problems found by GCC 4.5.2's static checks.
13595
7c86ee98
PE
13596 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13597 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13598 (xg_free_frame_widgets): Make it clear that a local variable is
13599 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13600 (gdk_window_get_screen): Make it clear that this macro is needed
13601 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13602 (int_gtk_range_get_value): New function, which avoids a diagnostic
13603 from gcc -Wbad-function-cast.
13604 (xg_set_toolkit_scroll_bar_thumb): Use it.
13605 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13606 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13607 (get_utf8_string, xg_get_file_with_chooser):
13608 Rename locals to avoid shadowing.
13609 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13610
41729b81
PE
13611 * xgselect.c (xg_select): Remove unused var.
13612
f0c77cd1
PE
13613 * image.c (four_corners_best): Mark locals as initialized.
13614 (gif_load): Initialize transparent_p to zero (Bug#8238).
13615 Mark another local as initialized.
ec6cf4c6 13616 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13617
ce0ad53d 13618 * image.c (clear_image_cache): Now static.
d5d5a617 13619 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13620 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13621 (x_edge_detection): Remove unnecessary cast that
13622 gcc -Wbad-function-cast diagnoses.
2037898d 13623 (gif_load): Fix pointer signedness.
6ae141d6
PE
13624 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13625 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13626
33383987 136272011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13628
d32df629
PE
13629 Improve quality of tests for time stamp overflow.
13630 For example, without this patch (encode-time 0 0 0 1 1
13631 1152921504606846976) returns the obviously-bogus value (-948597
13632 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13633 reports time overflow. See
13634 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13635 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13636 * editfns.c: Include limits.h and intprops.h.
13637 (TIME_T_MIN, TIME_T_MAX): New macros.
13638 (time_overflow): Move earlier, to before first use.
13639 (hi_time, lo_time): New functions, for an accurate test for
13640 out-of-range times.
13641 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13642 (Fget_internal_run_time): Don't assume time_t fits in int.
13643 (make_time): Use list2 instead of Fcons twice.
13644 (Fdecode_time): More accurate test for out-of-range times.
13645 (check_tm_member): New function.
13646 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13647 (lisp_time_argument): Don't rely on undefined left-shift and
13648 right-shift behavior when checking for time stamp overflow.
8be6f318 13649
fe31d94c
PE
13650 * editfns.c (time_overflow): New function, refactoring common code.
13651 (Fformat_time_string, Fdecode_time, Fencode_time):
13652 (Fcurrent_time_string): Use it.
13653
8be6f318
PE
13654 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13655 * dired.c (make_time): Move to ...
13656 * editfns.c (make_time): ... here.
13657 * systime.h: Note the move.
13658
09d9db2c 136592011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13660
126bc0dc
YM
13661 * fringe.c (update_window_fringes): Remove unused variables.
13662
c47cbdfd
YM
13663 * unexmacosx.c (copy_data_segment): Also copy __got section.
13664 (Bug#8223)
13665
7ac80be9
EZ
136662011-03-12 Eli Zaretskii <eliz@gnu.org>
13667
c96bbc66 13668 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13669 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13670 Constify `char *' arguments and their references according to
13671 prototypes in tparam.h.
13672
ecb0f94d 13673 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13674
7ac80be9
EZ
13675 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13676 Adapt all references accordingly.
13677
13678 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13679
ef1fd07e
TT
136802011-03-11 Tom Tromey <tromey@redhat.com>
13681
13682 * buffer.c (syms_of_buffer): Remove obsolete comment.
13683
7ef4b50c
EZ
136842011-03-11 Eli Zaretskii <eliz@gnu.org>
13685
13686 * termhooks.h (encode_terminal_code): Declare prototype.
13687
13688 * msdos.c (encode_terminal_code): Don't declare prototype.
13689
13690 * term.c (encode_terminal_code): Now external again, used by
13691 w32console.c and msdos.c.
13692
44f230aa
SM
13693 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13694 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13695
4b1ec863 136962011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13697
1714f52b 13698 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13699
4b1ec863
PE
13700 * fringe.c (update_window_fringes): Mark locals as initialized
13701 (Bug#8227).
13702 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13703
524c7aa6
PE
13704 * alloc.c (mark_fringe_data): Move decl from here ...
13705 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13706 to check its interface.
13707 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13708
a5c0af81 13709 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13710 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13711 (fontset_font): Mark local as initialized.
a9a06e0b 13712 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13713
b4716021
PE
13714 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13715
811e9bac 13716 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13717 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13718 (x_own_selection, Fx_disown_selection_internal): Rename locals
13719 to avoid shadowing.
13720 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13721
7e3ab302
PE
13722 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13723 so that the caller can use some name other than gcpro1.
13724 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13725 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13726 (Fx_backspace_delete_keys_p):
13727 Use them to avoid shadowing, and rename vars to avoid shadowing.
13728 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13729 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13730 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13731 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13732 Remove unused locals.
7e3ab302
PE
13733 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13734 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13735 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13736 macros.
f78faa98 13737
e2b13473
PE
13738 * xterm.h (x_mouse_leave): New decl.
13739
77f23912
PE
13740 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13741 Remove unused functions.
cdf4ba58
PE
13742 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13743 (x_calc_absolute_position): Now static.
7411c686 13744 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13745 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13746 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13747 unless they are used.
38d0b34a
PE
13748 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13749 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13750 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13751 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13752 (x_error_catcher, x_connection_closed, x_error_handler):
13753 (x_error_quitter, xembed_send_message, x_iconify_frame):
13754 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13755 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13756 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13757
44f230aa
SM
13758 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13759 Rename or move locals to avoid shadowing.
6b463e58 13760 (tty_defined_color, merge_face_heights): Now static.
5967d051 13761 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13762 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13763 does not deduce is never used uninitialized.
73719eba
PE
13764 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13765 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13766
426994c3 13767 * terminal.c (store_terminal_param): Now static.
5489860b 13768
032f1620 13769 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13770 (set_frame_menubar): Remove unused local.
d4323972 13771 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13772 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13773 since they might point to immutable storage.
281585b0
PE
13774 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13775 since it's unused otherwise.
032f1620 13776
367c19e5 13777 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13778 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13779 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13780 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13781 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13782 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13783 does not deduce are never used uninitialized.
70739cbe 13784
07b48fa9
PE
13785 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13786
8868a238 13787 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13788 * window.c (window_loop, size_window):
13789 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13790
7e5cf297 13791 * window.c (display_buffer): Now static.
d6550a9f
PE
13792 (size_window): Mark variables that gcc -Wuninitialized
13793 does not deduce are never used uninitialized.
a586633d
PE
13794 * window.h (check_all_windows): New decl, to forestall
13795 gcc -Wmissing-prototypes diagnostic.
5b555da1 13796 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13797
f6095868
PE
13798 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13799 shadowing.
13800 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13801 Include <limits.h>.
13802 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13803 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13804 (load_charset_map): Mark variables that gcc -Wuninitialized
13805 does not deduce are never used uninitialized.
53df7c11 13806 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13807
f38b440c
PE
13808 * coding.c (coding_set_source, coding_set_destination):
13809 Use "else { /* comment */ }" rather than "else /* comment */;"
13810 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13811 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13812 a block, when the outer 'i' will do.
13813 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13814 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13815 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13816 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13817 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13818 Rename locals to avoid shadowing.
13819 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13820 * coding.c (emacs_mule_char, encode_invocation_designation):
13821 Now static, since they're not used elsewhere.
413bb2db 13822 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13823 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13824 (decode_coding_emacs_mule): Mark variables that gcc
13825 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13826 (detect_coding_iso_2022): Initialize a local variable that might
13827 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13828 this initialization is needed. (Bug#8211)
5f58e762
PE
13829 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13830 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13831 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13832 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13833 Remove unused macros.
f38b440c 13834
232b38b9 13835 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13836 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13837 * character.c (string_count_byte8): Likewise.
232b38b9 13838
fb90da1b
PE
13839 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13840 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13841
fb93dbc2
PE
13842 * chartab.c (copy_sub_char_table): Now static, since it's not used
13843 elsewhere.
5c156ace
PE
13844 (sub_char_table_ref_and_range, char_table_ref_and_range):
13845 Rename locals to avoid shadowing.
bbcd0949 13846 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13847
7d3b3862 13848 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13849 (BIDI_BOB): Remove unused macro.
7d3b3862 13850
6be7d3da
PE
13851 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13852 deduce are never used uninitialized.
c2ed9c8b 13853 * term.c (encode_terminal_code): Likewise.
6be7d3da 13854
75f8807f 13855 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13856
50938595
PE
13857 * tparam.h: New file.
13858 * term.c, tparam.h: Include it.
13859 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13860 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13861 Move these decls to tparam.h, and make them agree with what
13862 is actually in tparam.c. The previous trick of using incompatible
13863 decls in different modules does not conform to the C standard.
13864 All callers of tparam changed to use tparam's actual API.
13865 * tparam.c (tparam1, tparam, tgoto):
13866 Use const pointers where appropriate.
13867
fbceeba2
PE
13868 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13869 * cm.h (struct cm): Likewise.
13870 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13871 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13872 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13873 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13874 (turn_on_face, init_tty): Likewise.
13875 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13876
7f3f1250
PE
13877 * term.c (term_mouse_position): Rename local to avoid shadowing.
13878
e6ca6543
PE
13879 * alloc.c (mark_ttys): Move decl from here ...
13880 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13881
c40f8d15
AS
138822011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13883
13884 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13885
cfe0661d
JB
138862011-03-09 Juanma Barranquero <lekktu@gmail.com>
13887
13888 * search.c (compile_pattern_1): Remove argument regp, unused since
13889 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13890 (compile_pattern): Don't pass it.
13891
0afb4571
J
138922011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13893
13894 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13895 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13896 for ! HAVE_GTK3.
13897 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13898
13899 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13900
13901 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13902 gdk_window_get_screen, gdk_window_get_geometry,
13903 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13904 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13905 (xg_get_pixbuf_from_pixmap): New function.
13906 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13907 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13908 Call xg_get_pixbuf_from_pixmap instead of
13909 gdk_pixbuf_get_from_drawable.
13910 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13911 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13912 (xg_check_special_colors): Use GtkStyleContext and its functions
13913 for HAVE_GTK3.
13914 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13915 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13916 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13917 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13918 Call gtk_widget_get_preferred_size.
0afb4571
J
13919 (xg_frame_resized): gdk_window_get_geometry only takes 5
13920 parameters.
44f230aa
SM
13921 (xg_win_to_widget, xg_event_is_for_menubar):
13922 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13923 (xg_set_widget_bg): New function.
13924 (delete_cb): New function.
895009e1 13925 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13926 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13927 (xg_set_background_color): Call xg_set_widget_bg.
13928 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13929 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13930 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13931 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13932 if ! HAVE_GTK3.
13933 (update_frame_tool_bar): Call gtk_widget_hide.
13934 (xg_initialize): Use GDK_KEY_g.
13935
13936 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13937 if ! HAVE_GTK3
13938 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13939
13940 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13941 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13942 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13943
1c2cc4ef
JB
139442011-03-08 Juanma Barranquero <lekktu@gmail.com>
13945
13946 * w32xfns.c (select_palette): Check success of RealizePalette against
13947 GDI_ERROR, not zero.
13948
33383987 13949See ChangeLog.11 for earlier changes.
aac0c6e3
MR
13950
13951;; Local Variables:
13952;; coding: utf-8
aac0c6e3
MR
13953;; End:
13954
2f097256 13955 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
13956
13957 This file is part of GNU Emacs.
13958
13959 GNU Emacs is free software: you can redistribute it and/or modify
13960 it under the terms of the GNU General Public License as published by
13961 the Free Software Foundation, either version 3 of the License, or
13962 (at your option) any later version.
13963
13964 GNU Emacs is distributed in the hope that it will be useful,
13965 but WITHOUT ANY WARRANTY; without even the implied warranty of
13966 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13967 GNU General Public License for more details.
13968
13969 You should have received a copy of the GNU General Public License
13970 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.