src/makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
776f29e1
JB
12012-09-05 Juanma Barranquero <lekktu@gmail.com>
2
3 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4
7f7e0167
LI
52012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6
7 * eval.c (call_debugger): Make the function non-static so that we
8 can call it from set_message.
9
10 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
11 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
12
cf29dd84
PE
132012-09-04 Paul Eggert <eggert@cs.ucla.edu>
14
15 Give more-useful info on a fatal error (Bug#12328).
16 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
17 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
18 of doing the work ourselves.
19 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
20 do most of the work.
21 (fatal_error_backtrace): New function, taken from the guts
22 of the old fatal_error_signal, but with a new option to output
23 a backtrace.
24 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
25 info about the signal than just its number.
26 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
27 * sysdep.c: Include <execinfo.h>
28 (emacs_backtrace): New function, taken partly from the previous
29 code of the 'die' function.
30 (emacs_abort): Call fatal_error_backtrace rather than abort.
31
972debf2
SM
322012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
33
34 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
35 eager (load-time) macro-expansion.
36 * lisp.mk (lisp): Add macroexp.
37
1088b922
PE
382012-09-04 Paul Eggert <eggert@cs.ucla.edu>
39
40 Simplify redefinition of 'abort' (Bug#12316).
41 Do not try to redefine the 'abort' function. Instead, redo
42 the code so that it calls 'emacs_abort' rather than 'abort'.
43 This removes the need for the NO_ABORT configure-time macro
44 and makes it easier to change the abort code to do a backtrace.
45 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
46 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
47 Remove; sysdep.c's emacs_abort now takes its place.
48 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
49 'abort' changed to use 'emacs_abort'.
50 * msdos.c (dos_abort) [defined abort]: Remove; not used.
51 (abort) [!defined abort]: Rename to ...
52 (emacs_abort): ... new name.
53 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
54 the place of the old 'abort' in emacs.c.
55 * w32.c, w32fns.c (abort): Do not #undef.
56 * w32.c (emacs_abort): Rename from w32_abort.
57
30934d33
EZ
582012-09-04 Eli Zaretskii <eliz@gnu.org>
59
60 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
61 offsets[j].dv, since the y axis of the screen coordinates points
62 down, while the y axis of the font definition coordinates points
63 up. This fixes display of Arabic diacritics such as KASRA and
64 KASRATAN. (Bug#11860)
65
af26b72c
PE
662012-09-04 Paul Eggert <eggert@cs.ucla.edu>
67
68 Be more systematic about _setjmp vs setjmp.
69 * alloc.c (test_setjmp, mark_stack):
70 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
71 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
72 (png_load, my_error_exit, jpeg_load):
73 * process.c (send_process_trap, send_process):
74 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
75 The underscored versions are up to 30x faster on some hosts.
76 Formerly, the code used setjmp+longjmp sometimes and
77 _setjmp+_longjmp at other times, with no particular reason to
78 prefer setjmp+longjmp.
79
26d4541d
PE
802012-09-03 Paul Eggert <eggert@cs.ucla.edu>
81
d42f4f0f 82 Fix minor problem found by static checking.
26d4541d 83 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 84
c5e28e39
MR
852012-09-03 Martin Rudalics <rudalics@gmx.at>
86
87 * buffer.c (Fdelete_all_overlays): New function.
88
3eab3ca9
CY
892012-09-03 Chong Yidong <cyd@gnu.org>
90
91 * gtkutil.c: Add extern decl for Qxft.
92
c04889f8
PE
932012-09-02 Paul Eggert <eggert@cs.ucla.edu>
94
1882aa38
PE
95 * emacs.c, eval.c: Use bool for boolean.
96 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
97 (malloc_using_checking) [DOUG_LEA_MALLOC]:
98 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
99 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
100 (main, decode_env_path, Fdaemon_initialized):
101 * eval.c (call_debugger, Finteractive_p, interactive_p):
102 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
103 (maybe_call_debugger, Fbacktrace):
104 * process.c (read_process_output, exec_sentinel):
105 Use bool for booleans.
106 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
107 All callers changed.
108 * eval.c (interactive_p): Omit always-true boolean argument
109 EXCLUDE_SUBRS_P. All callers changed.
110 * dispextern.h, lisp.h: Reflect above API changes.
111 * firstfile.c (dummy): Use the address of 'main', whose signature
112 won't change, instead of the address of 'initialize', whose
113 signature just changed from int to bool.
114 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
115 * msdos.c (fatal_error_in_progress): ... from here.
116 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
117 of incrementing it.
118 (redisplay_internal, unwind_redisplay): Simply clear
119 REDISPLAYING_P when unwinding, instead of saving its previous,
120 always-false value and then restoring it.
121
a411ac43
PE
122 Clean up some extern decls.
123 Mostly, this hoists extern decls out of .c files and into .h files.
124 That way, we're more likely to catch errors if the interfaces change.
125 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
126 declare xg_mark_data.
127 * dispextern.h (x_frame_parm_handlers):
128 * font.h (Qxft):
129 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
130 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
131 (Qultra_bold, Qoblique, Qitalic):
132 Move extern decl here from .c file.
133 * alloc.c (xg_mark_data) [USE_GTK]:
134 * doc.c (Qclosure):
135 * eval.c (Qlexical_binding):
136 * fns.c (time) [!HAVE_UNISTD_H]:
137 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
138 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
139 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
140 * lread.c (Qinternal_interpreter_environment):
141 * minibuf.c (Qbuffer):
142 * process.c (QCfamily, QCfilter):
143 * widget.c (free_frame_faces):
144 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
145 * xfont.c (x_clear_errors):
146 * xterm.c (x_frame_parm_handlers):
147 Remove now-redundant extern decls.
148 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
149 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
150 Now static.
151 * xfaces.c: Remove unnecessary static decls.
152 * xterm.c (updating_frame): Remove decl of nonexistent object.
153
c04889f8
PE
154 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
155 when building globals.h, as the objects that are not built on
156 this host are not needed to compile C files on this host.
157
8b339673
JD
1582012-09-02 Jan Djärv <jan.h.d@swipnet.se>
159
160 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
161
162 * frame.h: Add missing prototype for x_wm_set_size_hint.
163
a08d4ba7
PE
1642012-09-02 Paul Eggert <eggert@cs.ucla.edu>
165
166 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
167 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
168 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
169 (Fsubstitute_command_keys):
170 * editfns.c (region_limit, find_field, Fconstrain_to_field)
171 (save_excursion_save, save_excursion_restore)
172 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
173 (format_time_string, general_insert_function)
174 (make_buffer_string, make_buffer_string_both)
175 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
176 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
177 (copy_text, insert_1, insert_1_both, insert_from_string)
178 (insert_from_string_before_markers, insert_from_string_1)
179 (insert_from_buffer, insert_from_buffer_1, replace_range)
180 (replace_range_2, del_range_1, del_range_byte, del_range_both)
181 (del_range_2, modify_region):
182 * intervals.c (intervals_equal, balance_possible_root_interval)
183 (adjust_intervals_for_insertion, merge_properties_sticky)
184 (graft_intervals_into_buffer, lookup_char_property)
185 (adjust_for_invis_intang, set_point_both)
186 (get_property_and_range, compare_string_intervals)
187 (set_intervals_multibyte_1, set_intervals_multibyte):
188 * keyboard.c (decode_timer):
189 Use bool for boolean.
190 * intervals.h, lisp.h, systime.h: Reflect above API changes.
191 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
192
48c948de
CY
1932012-09-02 Chong Yidong <cyd@gnu.org>
194
195 * keymap.c (push_key_description): Print M-TAB as C-M-i
196 (Bug#11758).
197
6c49a40b
JB
1982012-09-02 Juanma Barranquero <lekktu@gmail.com>
199
200 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
201 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
202 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
203 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
204 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
205 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
206 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
207
4dfbd238
EZ
2082012-09-01 Eli Zaretskii <eliz@gnu.org>
209
7e510e28
EZ
210 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
211 more than one grapheme cluster passed to the shaper: compute the
212 offset adjustment values separately for each cluster. (Bug#11860)
213
4dfbd238
EZ
214 * image.c: Restore mistakenly removed inclusion of w32.h. Without
215 it, GCC doesn't see prototypes of w32_delayed_load, and complains
216 about implicit conversions from integer to pointer.
217
86571ae0
DC
2182012-09-01 Daniel Colascione <dancol@dancol.org>
219
220 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
221 system used too early.
222
0e23ef9d
PE
2232012-09-01 Paul Eggert <eggert@cs.ucla.edu>
224
225 Better seed support for (random).
226 * emacs.c (main): Call init_random.
227 * fns.c (Frandom): Set the seed from a string argument, if given.
228 Remove long-obsolete Gentzel cruft.
229 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
230 (init_random): New function.
231
17a2cbbd
DC
2322012-09-01 Daniel Colascione <dancol@dancol.org>
233
234 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
235 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
236 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
237 x_wm_set_size_hint, x_query_colors, x_real_positions,
238 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
239 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
240 all of which have been moved to common code.
241
242 * xfaces.c: Include TERM_HEADER instead of listing all possible
243 window-system headers.
244
245 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
246 to match header.
247
248 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
249 directly accessing frame internals.
250
f18cbb28 251 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
252 globals_of_w32font.
253
254 * process.c: Include TERM_HEADER instead of listing all possible
255 window-system headers.
256
257 * nsterm.h: Remove declarations now in frame.h. Define
258 FRAME_X_SCREEN, FRAME_X_VISUAL.
259
260 * menu.c: Include TERM_HEADER instead of listing all possible
261 window-system headers.
262
263 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
264 window system.
265
266 * keyboard.c: Include TERM_HEADER instead of listing all possible
267 window-system headers.
268
269 * image.c: Include TERM_HEADER instead of listing all possible
270 window-system headers. Declare Vlibrary_cache when compiling for
271 Windows.
272
273 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
274 window system declarations.
275
276 * frame.h: Move common functions here: set_frame_menubar,
277 x_set_window_size, x_sync, x_get_focus_frame,
278 x_set_mouse_position, x_set_mouse_pixel_position,
279 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
280 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
281 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
282 x_activate_menubar, x_real_positions, x_bitmap_icon,
283 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
284 and x_query_colors.
285
286 * frame.c: Include TERM_HEADER instead of listing all possible
287 window-system headers.
288
289 * font.c: Include TERM_HEADER instead of listing all possible
290 window-system headers.
291
292 * emacs.c: Include TERM_HEADER.
293
f18cbb28
EZ
294 * dispnew.c: Include TERM_HEADER instead of listing all possible
295 window-system headers.
17a2cbbd 296
f18cbb28 297 * ccl.h: Include character.h.
17a2cbbd
DC
298
299 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
300 the current window system; include in list of objects to link into
301 Emacs.
302
c650a5de
DA
3032012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
304
305 Remove mark_ttys function and fix tty_display_info initialization.
306 * lisp.h (mark_ttys): Remove prototype.
307 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
308 to mark_ttys because all possible values of 'top_frame' slot are
309 the frames which are reachable from Vframe_list.
310 * term.c (mark_ttys): Remove.
311 (init_tty): Safely initialize 'top_frame' slot with Qnil.
312
4e0f6479
DA
3132012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
314
315 Change struct frame bitfields from unsigned char to unsigned.
316 * frame.h (struct frame): Change type of 'display_preempted',
317 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
318 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
319 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
320 bitfields from unsigned char to unsigned.
321
8b96a52c
DA
3222012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
323
324 Remove unused member of struct x_output and struct w32_output.
325 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
326 * w32term.h (struct w32_output): Likewise.
327
b4444c8a
JD
3282012-08-30 Jan Djärv <jan.h.d@swipnet.se>
329
330 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
331 does not become zero (Bug#12234).
332
b98521db
PE
3332012-08-30 Paul Eggert <eggert@cs.ucla.edu>
334
335 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
336 for GCC 4.7.1 x86-64.
337
31d02438
GM
3382012-08-30 Glenn Morris <rgm@gnu.org>
339
340 * lread.c (init_lread): For out-of-tree builds, only add the
341 source directory's site-lisp dir to the load-path if it exists,
342 consistent with in-tree builds. (Bug#12302)
343
7f8941d8
JD
3442012-08-28 Jan Djärv <jan.h.d@swipnet.se>
345
346 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
347 button_values to NULL. Call setStykeMask so dialogs get a close button.
348 (windowShouldClose:): Set window_closed.
349 (dealloc): New member, free button_values.
350 (process_dialog:): Make member function. Remove window argument,
351 replace window with self. Count buttons and allocate and store values
352 in button_values.
353 (addButton:value:row:): value is int with the name tag. Call setTag
354 with tag. Remove return self, declare return value as void.
355 (addString:row:): Remove return self, declare return value as void.
356 (addSplit): Remove return self, declare return value as void.
357 (clicked:): Remove return self, declare return value as void.
358 Set dialog_return to button_values[seltag]. Code formatting change.
359 (initFromContents:isQuestion:): Adjust call to process_dialog.
360 Code formatting change.
361 (timeout_handler:): Set timer_fired to YES.
362 (runDialogAt:): Set timer_fired to NO.
363 Handle click on close button as quit.
364
365 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
366 Add window_closed and button_values. Add void as return value for
367 add(Button|String|Split). addButton takes int instead of Lisp_Object.
368 Add process_dialog as new member.
369
eada0861 3702012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 371
eada0861
GM
372 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
373 is not one of the heaps we manage. (Bug#12242)
374
3752012-08-28 Glenn Morris <rgm@gnu.org>
376
377 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
378
457294dd
MR
3792012-08-28 Martin Rudalics <rudalics@gmx.at>
380
381 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
382 auto-buffer-name window parameter. Install revision of reverted
383 fix.
457294dd 384
4f2daf31
DA
3852012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
386
387 Do not allow to set major mode for a dead buffer.
388 * buffer.c (Fset_buffer_major_mode): Signal an error
389 if the buffer is dead.
390 (Fother_buffer, other_buffer_safely): Remove redundant
391 nested declaration.
392
66322887
DA
3932012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
394
395 Always use set_buffer_if_live to restore original buffer at unwind.
396 * buffer.h (record_unwind_current_buffer): New function.
397 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
398 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
399 * undo.c, window.c: Adjust users.
400 * buffer.c (set_buffer_if_live): Fix comment.
401
a3d794a1
DA
4022012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
403
404 Fix usage of set_buffer_internal.
405 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
406 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
407 * coding.c (decode_coding): Omit redundant test.
408 * fileio.c (decide_coding_unwind): Likewise.
409 * fns.c (secure_hash): Likewise.
410 * insdel.c (modify_region): Likewise.
411 * keyboard.c (command_loop_1): Likewise.
412 * print.c (PRINTFINISH): Likewise.
413 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
414
59ea14cd
PE
4152012-08-27 Paul Eggert <eggert@cs.ucla.edu>
416
417 * dispnew.c: Use bool for boolean.
418 (frame_garbaged, display_completed, delayed_size_change)
419 (fonts_changed_p, add_window_display_history)
420 (add_frame_display_history, verify_row_hash)
421 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
422 (row_equal_p, realloc_glyph_pool)
423 (allocate_matrices_for_frame_redisplay)
424 (showing_window_margins_p)
425 (adjust_frame_glyphs_for_frame_redisplay)
426 (build_frame_matrix_from_leaf_window, make_current)
427 (mirrored_line_dance, mirror_line_dance, update_frame)
428 (update_window_tree, update_single_window)
429 (check_current_matrix_flags, update_window, update_text_area)
430 (update_window_line, set_window_update_flags, scrolling_window)
431 (update_frame_1, scrolling, buffer_posn_from_coords)
432 (do_pending_window_change, change_frame_size)
433 (change_frame_size_1, sit_for):
434 Use bool for boolean.
435 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
436 and remove last int (actually boolean) argument, which was always 0.
437 All callers changed.
438 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
439 * dispextern.h (struct composition_it): Use bool for boolean.
440 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
441 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
442 * dired.c (file_name_completion):
443 Use bool for boolean. (This was missed in an earlier change.)
444
95072a94
MR
4452012-08-27 Martin Rudalics <rudalics@gmx.at>
446
447 * window.c (Fset_window_configuration): Revert first part of
448 last change.
449
0f19feff
JD
4502012-08-27 Jan Djärv <jan.h.d@swipnet.se>
451
452 * nsterm.h (NSPanel): New class variable dialog_return.
453
454 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
455 dialog_return.
456 (windowShouldClose:): Use stop instead of stopModalWithCode.
457 (clicked:): Ditto, and also set dialog_return (Bug#12258).
458 (timeout_handler:): Use stop instead of abortModal. Send a dummy
459 event.
460 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
461 modal loop returns.
462
f10fe38f
PE
4632012-08-27 Paul Eggert <eggert@cs.ucla.edu>
464
de1339b0
PE
465 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
466 * composite.c (find_composition, composition_gstring_p)
467 (composition_reseat_it, find_automatic_composition):
468 * data.c (let_shadows_buffer_binding_p)
469 (let_shadows_global_binding_p, set_internal, make_blv)
470 (Fmake_variable_buffer_local, Fmake_local_variable)
471 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
472 (cons_to_signed, arith_driver):
473 * dbusbind.c (xd_in_read_queued_messages):
474 * dired.c (directory_files_internal, file_name_completion):
475 Use bool for booleans.
476 * dired.c (file_name_completion):
477 * process.h (fd_callback):
478 Omit int (actually boolean) argument. It wasn't being used.
479 All uses changed.
480 * composite.h, lisp.h: Reflect above API changes.
481
f10fe38f
PE
482 * cmds.c, coding.c: Use bool for booleans.
483 * cmds.c (move_point, Fself_insert_command):
484 * coding.h (struct composition status, struct coding_system):
485 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
486 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
487 (emacs_mule_char, decode_coding_emacs_mule)
488 (encode_coding_emacs_mule, detect_coding_iso_2022)
489 (decode_coding_iso_2022, encode_invocation_designation)
490 (encode_designation_at_bol, encode_coding_iso_2022)
491 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
492 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
493 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
494 (encode_coding_raw_text, detect_coding_charset)
495 (decode_coding_charset, encode_coding_charset, detect_eol)
496 (detect_coding, get_translation_table, produce_chars)
497 (consume_chars, reused_workbuf_in_use)
498 (make_conversion_work_buffer, code_conversion_save)
499 (decode_coding_object, encode_coding_object)
500 (detect_coding_system, char_encodable_p)
501 (Funencodable_char_position, code_convert_region)
502 (code_convert_string, code_convert_string_norecord)
503 (Fset_coding_system_priority):
504 * fileio.c (Finsert_file_contents):
505 Use bool for booleans.
506 * coding.h, lisp.h: Reflect above API changes.
507 * coding.c: Remove unnecessary static function decls.
508 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
509 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
510 not a boolean 'int', since callers never look at the return value.
511 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
512 * coding.h (decoding_buffer_size, encoding_buffer_size)
513 (emacs_mule_string_char): Remove unused extern decls.
514 (struct iso_2022_spec, struct coding_system):
515 Use 'unsigned int : 1' for boolean fields, since there's more than one.
516 (struct emacs_mule_spec): Remove unused field 'full_support'.
517 All initializations removed.
518 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
519
5474c384
DA
5202012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
521
f10fe38f 522 Fix spare memory change (Bug#12286).
5474c384
DA
523 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
524 (valid_lisp_object_p): Likewise.
525
c4b6914d
MR
5262012-08-27 Martin Rudalics <rudalics@gmx.at>
527
528 * window.c (Fset_window_configuration): Record any window's old
529 buffer if it's replaced (see Bug#8789). If the new current
530 buffer doesn't appear in the selected window, go to its old
531 point (Bug#12208).
532
35aaa1ea
DA
5332012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
534
535 Special MEM_TYPE_SPARE to denote reserved memory.
536 * alloc.c (enum mem_type): New memory type.
537 (refill_memory_reserve): Use new type for spare memory.
538 This prevents live_cons_p and live_string_p from incorrect
539 detection of uninitialized objects from spare memory as live.
540
6af64513
PE
5412012-08-26 Paul Eggert <eggert@cs.ucla.edu>
542
8b2e00a3
PE
543 Spelling fixes.
544 * Makefile.in (.PHONY): versioclean -> versionclean.
545
b52d6985
PE
546 Remove unused external symbols.
547 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
548 * window.c (Qwindow_valid_p, decode_valid_window):
549 Now static, not extern.
550 * data.c (Qinterval): Remove; unused.
551 (syms_of_data): Do not define 'interval'.
552 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
553 * window.h (decode_valid_window):
554 Remove decls.
555
d5172d4f
PE
556 * character.c, charset.c, chartab.c: Use bool for booleans.
557 * character.c (lisp_string_width, string_count_byte8)
558 (string_escape_byte8):
559 * charset.c (charset_map_loaded, load_charset_map, read_hex):
560 (load_charset_map_from_file, map_charset_chars)
561 (Fdefine_charset_internal, define_charset_internal)
562 (Fdeclare_equiv_charset, find_charsets_in_text)
563 (Ffind_charset_region, char_charset, Fiso_charset):
564 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
565 (sub_char_table_set, sub_char_table_set_range)
566 (char_table_set_range, optimize_sub_char_table)
567 (map_sub_char_table):
568 Use bool for boolean.
569 * character.c (str_to_unibyte): Omit last boolean argument; it was
570 always 0. All callers changed.
571 * character.h, charset.h: Adjust to match previous changes.
572 * character.h (char_printable_p): Remove decl of nonexistent function.
573 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
574 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
575 are all boolean, so make them single-bit bitfields.
576
6af64513
PE
577 * lisp.h (ASET): Remove attempt to detect side effects.
578 It was meant to be temporary and it often doesn't work,
579 because when IDX has side effects the behavior of IDX==IDX
580 is undefined. See Stefan Monnier in
581 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
582
e1f29348
BR
5832012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
584
585 * lisp.h (functionp): New function (extracted from Ffunctionp).
586 (FUNCTIONP): Use it.
587 * eval.c (Ffunctionp): Use it.
588
17c05d74
PE
5892012-08-25 Paul Eggert <eggert@cs.ucla.edu>
590
0f46bc75
PE
591 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
592 as that's faster and simpler than static storage. Don't bother
593 with the g_main_context_query overhead if g_main_context_pending
594 says no events are pending.
595 (gfds, gfds_size): Remove these static vars.
596 (xgselect_initialize): Remove; no longer needed.
597 All uses and decls removed.
598
ee4c0f69
PE
599 * emacs.c (fatal_error_signal_hook): Remove.
600 All uses removed. This leftover from old code was always 0.
601
17c05d74
PE
602 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
603 * casefiddle.c (casify_object, casify_region):
604 * casetab.c (set_case_table):
605 * category.c, category.h (word_boundary_p):
606 * category.h (CHAR_HAS_CATEGORY):
607 Use bool for booleans, instead of int.
608
391ceac5
EZ
6092012-08-25 Eli Zaretskii <eliz@gnu.org>
610
611 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
612
2f221583
PE
6132012-08-25 Paul Eggert <eggert@cs.ucla.edu>
614
f4a681b0
PE
615 On assertion failure, print backtrace if available.
616 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
617 (die) [ENABLE_CHECKING]: Print a backtrace if available.
618 * Makefile.in (LIB_EXECINFO): New macro.
619 (LIBES): Use it.
620
2f221583
PE
621 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
622 * bytecode.c (exec_byte_code):
623 * callint.c (check_mark, Fcall_interactively):
624 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
625 (getenv_internal, sync_process_alive, call_process_exited):
626 * lisp.h (USE_SAFE_ALLOCA):
627 Use bool for booleans, instead of int.
628 * lisp.h, process.h: Adjust prototypes to match above changes.
629 * callint.c (Fcall_interactively): Don't assume the mark's
630 offset fits in 'int'.
631
37ef52bb
PE
6322012-08-24 Paul Eggert <eggert@cs.ucla.edu>
633
634 * buffer.c, buffer.h: Use bool for boolean.
635 * buffer.c (reset_buffer_local_variables)
636 (buffer_lisp_local_variables, Fset_buffer_modified_p)
637 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
638 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
639 (overlay_touches_p, overlay_strings, Foverlay_put)
640 (report_overlay_modification, call_overlay_mod_hooks):
641 (mmap_enlarge, mmap_set_vars):
642 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
643 Use bool for booleans, instead of int.
644 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
645 since the 1-or-0 return value is always ignored anyway.
646 (mmap_initialized_p):
647 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
648 * buffer.h, lisp.h: Adjust prototypes to match above changes.
649
2cc21167
PE
6502012-08-23 Paul Eggert <eggert@cs.ucla.edu>
651
652 * bidi.c: Use bool for boolean.
653 This is a bit more readable, and makes the text segment of bidi.o
654 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
655 Presumably it's faster too.
656 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
657 Now bool.
658 (bidi_cache_find_level_change, bidi_cache_iterator_state)
659 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
660 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
661 (bidi_explicit_dir_char, bidi_level_of_next_char)
662 (bidi_find_other_level_edge, bidi_move_to_visually_next):
663 Use bool for booleans, instead of int.
664 * dispextern.h (bidi_init_it, bidi_paragraph_init)
665 (bidi_unshelve_cache): Adjust decls to match code.
666
7db4ddf4
MR
6672012-08-23 Martin Rudalics <rudalics@gmx.at>
668
669 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
670 argument.
671
b1bb8011
PE
6722012-08-23 Paul Eggert <eggert@cs.ucla.edu>
673
674 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
675 * atimer.h: Include <stdbool.h>.
676
ff687885
DN
6772012-08-22 Dan Nicolaescu <dann@gnu.org>
678
679 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
680 compile time tests instead of run time tests on systems that do
681 not use them.
682 (FRAME_MAC_P): Remove leftover from deleted code.
683 * frame.c (syms_of_frame): Remove leftover from deleted code.
684
4ce7a138
JD
6852012-08-22 Jan Djärv <jan.h.d@swipnet.se>
686
687 * nsterm.m (insertText:): Don't clear modifiers if code is space.
688
d733ec6d
PE
6892012-08-22 Paul Eggert <eggert@cs.ucla.edu>
690
691 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
692 Otherwise, the compiler complains about (A?B:C) where B is void
693 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
694 (fontset_add): Return void, for FONTSET_ADD.
695
d0d2d26f
PE
6962012-08-21 Paul Eggert <eggert@cs.ucla.edu>
697
fce31d69
PE
698 * alloc.c: Use bool for booleans.
699 (gc_in_progress, abort_on_gc)
700 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
701 (dont_register_blocks) [GC_MALLOC_CHECK]:
702 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
703 (check_string_bytes, make_specified_string, memory_full)
704 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
705 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
706 (mark_stack, valid_pointer_p, make_pure_string)
707 (Fgarbage_collect, survives_gc_p, gc_sweep):
708 Use bool for booleans, instead of int.
709 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
710 Remove unused local.
711 * alloc.c (PURE_POINTER_P):
712 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
713 * editfns.c (Fformat):
714 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
715 (Fdo_auto_save):
716 * fns.c (sweep_weak_table):
717 * lisp.h (suppress_checking, push_message, survives_gc_p)
718 (make_pure_string, gc_in_progress, abort_on_gc):
719 * lread.c (readchar, read1):
720 * print.c (Fprin1_to_string):
721 * xdisp.c (push_message):
722 Use bool for booleans affected directly or indirectly by
723 alloc.c's changes.
724
d0d2d26f
PE
725 Make recently-introduced setters macros.
726 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
727 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
728 (set_fontset_default, set_fontset_fallback): Rename from their
729 upper-case counterparts, and make them functions rather than macros.
730 This is more consistent with the other recently-introduced setters.
731 These don't need to be inline, since they're local.
732
d18e2bb6
JD
7332012-08-21 Jan Djärv <jan.h.d@swipnet.se>
734
735 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
736 the loop (Bug#12247).
737
1b9d9d16
PE
7382012-08-21 Paul Eggert <eggert@cs.ucla.edu>
739
740 * lisp.h (vcopy): Use memcpy rather than our own loop.
741 This fixes a performance regression introduced by the recent
742 addition of vcopy. This means 'vcopy' will need to be modified
743 for a copying collector, but that's OK. Also, tighten the
744 checking in the assertion.
745
b2f09701
EZ
7462012-08-21 Eli Zaretskii <eliz@gnu.org>
747
748 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
749 components for RTL text (Bug#11860). Adjust X-OFFSET of each
750 non-base glyph for the width of the base character, according to
e1f29348
BR
751 what x_draw_composite_glyph_string_foreground expects.
752 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
753 expectations, to produce correct width of the composed character.
754 Reverse the sign of the DU offset produced by ScriptPlace.
755
9b994fed
PE
7562012-08-21 Paul Eggert <eggert@cs.ucla.edu>
757
758 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
759
086ca913
DA
7602012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
761
762 Avoid direct writes to contents member of struct Lisp_Vector.
763 * lisp.h (vcopy): New function to copy data into vector.
764 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
765 * fns.c (Ffillarray): Use ASET.
766 * keyboard.c (timer_check_2): Use AREF and ASET.
767 (append_tool_bar_item, Frecent_keys): Use vcopy.
768 * lread.c (read_vector): Use ASET.
769 * msdos.c (Frecent_doskeys): Use vcopy.
770 * xface.c (Finternal_copy_lisp_face): Use vcopy.
771 (Finternal_merge_in_global_face): Use ASET and vcopy.
772 * xfont.c (xfont_list_pattern): Likewise.
773
5481664a
MR
7742012-08-21 Martin Rudalics <rudalics@gmx.at>
775
776 * window.c (Fwindow_point): For the selected window always return
777 the position of its buffer's point.
778 (Fset_window_point): For the selected window always go in its
779 buffer to the specified position.
780
6d470bdd
DA
7812012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
782
783 Setter macros for fontsets.
784 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
785 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
786 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
787 Adjust users.
788
24564fe1
GM
7892012-08-20 Glenn Morris <rgm@gnu.org>
790
791 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
792 Don't assume that `ln -f' works.
793
0a05a035
EZ
7942012-08-20 Eli Zaretskii <eliz@gnu.org>
795
796 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
797 and later about non-assignments with no effect. See discussion at
798 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
799 details.
800
e46f2325
DA
8012012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
802
803 Inline setter functions for Lisp_Objects slots of struct specbinding.
804 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
805 Adjust users.
806
734fbd86
MR
8072012-08-20 Martin Rudalics <rudalics@gmx.at>
808
809 * window.c (select_window): Always make selected window's buffer
810 current.
811
f1a95992
DA
8122012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
813
814 Use AREF and ASET for docstrings of category tables.
815 * category.h (CATEGORY_DOCSTRING): Use AREF.
816 (SET_CATEGORY_DOCSTRING): Use ASET.
817 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
818
e83064be
DA
8192012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
820
821 Inline setter functions for hash table members.
822 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
823 (set_hash_hash, set_hash_index): Rename with _slot suffix.
824 (set_hash_key_and_value, set_hash_index, set_hash_next)
825 (set_hash_hash): New functions.
826 * charset.c, fns.c: Adjust users.
827
4ce60d2e
DA
8282012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
829
830 Inline getter and setter functions for per-buffer values.
831 * buffer.h (per_buffer_default, set_per_buffer_default)
832 (per_buffer_value, set_per_buffer_value): New functions.
833 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
834 * buffer.c, data.c: Adjust users.
835
c06c9690
JB
8362012-08-20 Juanma Barranquero <lekktu@gmail.com>
837
838 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
839
32bd4250
PE
8402012-08-19 Paul Eggert <eggert@cs.ucla.edu>
841
bad03192 842 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
843 as gnulib does this if the system doesn't.
844 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
845 Remove declaration. MS-Windows declares it on stdlib.h which is
846 included by conf_post.h.
b69a6d22
PE
847 * emacs.c (environ) [DOUG_LEA_MALLOC]:
848 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
849 * vm-limit.c: Include <unistd.h>, for 'environ'.
850
22d7feb2
PE
851 * unexaix.c, unexcoff.c: Include "mem-limits.h".
852 (start_of_data): Remove decl; mem-limits.h provides it.
853
32bd4250
PE
854 * xdisp.c (handle_invisible_prop): Make it a bit faster
855 and avoid a gcc -Wmaybe-uninitialized diagnostic.
856
450809af
CY
8572012-08-19 Chong Yidong <cyd@gnu.org>
858
859 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
860 ends (Bug#3874).
861
9e677988
AS
8622012-08-19 Andreas Schwab <schwab@linux-m68k.org>
863
6b1319ce
AS
864 * .gdbinit: Use call instead of set when calling a function in the
865 inferior.
866
9e677988
AS
867 * data.c (set_internal): Don't use set_blv_found.
868 (Fkill_local_variable): Likewise.
869
d7191076
AA
8702012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
871
872 * nsfont.m (ns_ascii_average_width): Ensure the string
873 ascii_printable is initialized with a null-terminated character
874 array. Otherwise, it can contain undesired extra characters.
875
e757f1c6
PE
8762012-08-18 Paul Eggert <eggert@cs.ucla.edu>
877
878 port new setting code to Sun C 5.8 2005/10/13
879 * chartab.c, lisp.h (char_table_set, char_table_set_range):
880 Return void, not Lisp_Object. Otherwise, the compiler
881 complains about (A?B:C) where B is void and C is Lisp_Object
882 when compiling CHAR_TABLE_SET, due to the recent change to
883 the API of sub_char_table_set_contents.
884
a999ce26
CY
8852012-08-18 Chong Yidong <cyd@gnu.org>
886
887 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
888 for the string case (Bug#3874).
889
3f22b86f
PE
8902012-08-18 Paul Eggert <eggert@cs.ucla.edu>
891
39eb03f1
PE
892 * buffer.h (BSET): Remove (Bug#12215).
893 Replace all uses with calls to new setter functions.
894 (bset_bidi_paragraph_direction, bset_case_canon_table)
895 (bset_case_eqv_table, bset_directory, bset_display_count)
896 (bset_display_time, bset_downcase_table)
897 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
898 (bset_last_selected_window, bset_local_var_alist)
899 (bset_mark_active, bset_point_before_scroll, bset_read_only)
900 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
901 (bset_width_table):
902 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
903 (bset_auto_fill_function, bset_auto_save_file_format)
904 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
905 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
906 (bset_cache_long_line_scans, bset_case_fold_search)
907 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
908 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
909 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
910 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
911 (bset_header_line_format, bset_indicate_buffer_boundaries)
912 (bset_indicate_empty_lines, bset_invisibility_spec)
913 (bset_left_fringe_width, bset_major_mode, bset_mark)
914 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
915 (bset_name, bset_overwrite_mode, bset_pt_marker)
916 (bset_right_fringe_width, bset_save_length)
917 (bset_scroll_bar_width, bset_scroll_down_aggressively)
918 (bset_scroll_up_aggressively, bset_selective_display)
919 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
920 (bset_word_wrap, bset_zv_marker):
921 * category.c (bset_category_table):
922 * syntax.c (bset_syntax_table):
923 New setter functions.
924
6a09a33b
PE
925 * process.h (PSET): Remove (Bug#12215).
926 Replace all uses with calls to new setter functions.
927 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
928 (PROCESS_INLINE): New macro.
929 (pset_childp): New setter function.
930 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
931 * process.c (PROCESS_INLINE):
932 Define to EXTERN_INLINE, so that the corresponding functions
933 are compiled into code.
934 (pset_buffer, pset_command, pset_decode_coding_system)
935 (pset_decoding_buf, pset_encode_coding_system)
936 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
937 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
938 (pset_type, pset_write_queue): New setter functions.
939
e8c17b81
PE
940 * window.h (WSET): Remove (Bug#12215).
941 Replace all uses with calls to new setter functions.
942 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
943 (WINDOW_INLINE): New macro.
944 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
945 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
946 (wset_total_lines, wset_vertical_scroll_bar)
947 (wset_window_end_pos, wset_window_end_valid)
948 (wset_window_end_vpos): New setter functions.
949 * window.c (WINDOW_INLINE):
950 Define to EXTERN_INLINE, so that the corresponding functions
951 are compiled into code.
952 (wset_combination_limit, wset_dedicated, wset_display_table)
953 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
954 (wset_new_normal, wset_new_total, wset_next_buffers)
955 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
956 (wset_prev_buffers, wset_right_fringe_width)
957 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
958 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
959 (wset_window_parameters):
960 * xdisp.c (wset_base_line_number, wset_base_line_pos)
961 (wset_column_number_displayed, wset_region_showing):
962 New setter functions.
963
3f22b86f
PE
964 * termhooks.h (TSET): Remove (Bug#12215).
965 Replace all uses with calls to new setter functions.
966 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
967 (TERMHOOKS_INLINE): New macro.
968 (tset_charset_list, tset_selection_alist): New setter functions.
969 * terminal.c (TERMHOOKS_INLINE):
970 Define to EXTERN_INLINE, so that the corresponding functions
971 are compiled into code.
972 (tset_param_alist): New setter function.
973
742af32f
PE
9742012-08-17 Paul Eggert <eggert@cs.ucla.edu>
975
15dbb4d6
PE
976 * keyboard.h (KSET): Remove (Bug#12215).
977 Replace all uses with calls to new setter functions.
978 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
979 (KEYBOARD_INLINE): New macro.
980 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
981 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
982 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
983 New setter functions.
984 * keyboard.c (KEYBOARD_INLINE):
985 Define to EXTERN_INLINE, so that the corresponding functions
986 are compiled into code.
987 (kset_echo_string, kset_kbd_queue)
988 (kset_keyboard_translate_table, kset_last_prefix_arg)
989 (kset_last_repeatable_command, kset_local_function_key_map)
990 (kset_overriding_terminal_local_map, kset_real_last_command)
991 (kset_system_key_syms): New setter functions.
992
f00af5b1
PE
993 * frame.h (FSET): Remove (Bug#12215).
994 Replace all uses with calls to new setter functions.
995 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
996 (FRAME_INLINE): New macro.
997 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
998 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
999 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1000 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1001 (fset_param_alist, fset_root_window, fset_scroll_bars)
1002 (fset_selected_window, fset_title, fset_tool_bar_items)
1003 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1004 * frame.c (FRAME_INLINE):
1005 Define to EXTERN_INLINE, so that the corresponding functions
1006 are compiled into code.
1007 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1008
0c94c8d6
PE
1009 A few more naming-convention fixes for getters and setters.
1010 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1011 and rename from buffer_overlays_set_before.
1012 (set_buffer_overlays_after): Move here from buffer.h, and rename
1013 from buffer_overlays_set_after.
1014 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1015 All uses changed.
1016 (set_buffer_intervals): Rename from buffer_set_intervals.
1017 * intervals.c (set_interval_object): Move here from intervals.h,
1018 and rename from interval_set_object.
1019 (set_interval_left): Move here from intervals.h, and rename from
1020 interval_set_left.
1021 (set_interval_right): Move here from intervals.h, and rename from
1022 interval_set_right.
1023 (copy_interval_parent): Move here from intervals.h, and rename from
1024 interval_copy_parent.
1025 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1026 (set_interval_plist): Rename from interval_set_plist.
1027 Return void, not Lisp_Object, since no caller uses the result.
1028 * lisp.h (string_intervals): Rename from string_get_intervals.
1029 (set_string_intervals): Rename from string_set_intervals.
1030
34dabdb7
PE
1031 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1032 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 1033 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
1034 All uses changed. See the end of
1035 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1036
742af32f
PE
1037 * lisp.h (CSET): Remove (Bug#12215).
1038 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1039 (set_char_table_purpose): New functions,
1040 replacing CSET. All uses changed. For example, replace
1041 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 1042 "set_char_table_parent (char_table, parent);".
742af32f
PE
1043 The old version was confusing because it used the same name
1044 'parent' for two different things.
1045
a04e2c62
DA
10462012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1047
1048 Functions to get and set Lisp_Object fields of buffer-local variables.
1049 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1050 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1051 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1052 * data.c, eval.c, frame.c: Adjust users.
1053
383dcbf9
CY
10542012-08-17 Chong Yidong <cyd@gnu.org>
1055
1056 * xfaces.c (merge_face_vectors): If the target font specfies a
1057 font spec, make the font's attributes take precedence over
1058 directly-specified attributes.
1059 (merge_face_ref): Recognize :font.
1060
44386687
DA
10612012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1062
1063 Do not use memcpy for copying intervals.
1064 * intervals.c (reproduce_interval): New function.
1065 (reproduce_tree, reproduce_tree_obj): Use it.
1066 (reproduce_tree_obj): Remove prototype.
1067
927c7216
PE
10682012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1069
1070 * lisp.h (duration_to_sec_usec): Remove unused decl.
1071
93044f7b
AA
10722012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1073
1074 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1075 to an allocated instance of NSString, not to the class itself.
1076
9851e4a5
JB
10772012-08-17 Juanma Barranquero <lekktu@gmail.com>
1078
1079 * makefile.w32-in (C_CTYPE_H): New macro.
1080 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1081 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1082 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1083
620f13b0
PE
10842012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1085
1086 Use ASCII tests for character types.
1087 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1088 * xfns.c, xterm.c:
1089 Don't include <ctype.h>; was not needed.
1090 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1091 * sysdep.c, xfaces.c:
1092 Include <c-ctype.h> instead of <ctype.h>.
1093 * nsterm.m: Include <c-ctype.h>.
1094 * charset.c (read_hex):
1095 * doc.c (Fsnarf_documentation):
1096 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1097 (DRIVE_LETTER) [DOS_NT]:
1098 (Ffile_name_directory, Fexpand_file_name)
1099 (Fsubstitute_in_file_name):
1100 * font.c (font_parse_xlfd, font_parse_fcname):
1101 * frame.c (x_set_font_backend):
1102 * gtkutil.c (xg_get_font):
1103 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1104 * nsimage.m (hexchar):
1105 * nsterm.m (ns_xlfd_to_fontname):
1106 * sysdep.c (system_process_attributes):
1107 * xfaces.c (hash_string_case_insensitive):
1108 Use C-locale tests instead of locale-specific tests for character
1109 types, since we want the ASCII interpretation here, not the
1110 interpretation suitable for whatever happens to be the current locale.
1111
52162052
MR
11122012-08-16 Martin Rudalics <rudalics@gmx.at>
1113
1114 Consistently check windows for validity/liveness
1115 (Bug#11984, Bug#12025, Bug#12026).
1116 * lisp.h (CHECK_VALID_WINDOW): New macro.
1117 * window.c (decode_window): Rename to decode_live_window.
1118 (decode_valid_window, Fwindow_valid_p): New functions.
1119 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1120 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1121 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1122 (Fwindow_prev_sibling, Fwindow_combination_limit)
1123 (Fset_window_combination_limit, Fwindow_use_time)
1124 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1125 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1126 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1127 (Fwindow_hscroll, Fset_window_hscroll)
1128 (Fwindow_redisplay_end_trigger)
1129 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1130 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1131 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1132 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1133 (Fwindow_end, Fset_window_point, Fset_window_start)
1134 (Fpos_visible_in_window_p, Fwindow_line_height)
1135 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1136 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1137 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1138 (Fset_window_parameter, Fwindow_display_table)
1139 (Fset_window_display_table, Fdelete_other_windows_internal)
1140 (Fset_window_buffer, Fset_window_new_total)
1141 (Fset_window_new_normal, Fdelete_window_internal)
1142 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1143 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1144 (Fwindow_scroll_bars): Check whether argument window is a valid or
1145 live window. Update doc-strings.
1146 (syms_of_window): New symbol Qwindow_valid_p.
1147 * keyboard.c (Fposn_at_x_y): Check whether argument
1148 frame_or_window denotes a valid window.
1149
2751c80f
DA
11502012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1151
1152 Fix previous char table change.
1153 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1154 * chartab.c (optimize_sub_char_table): Likewise.
1155
032a42c8
CY
11562012-08-16 Chong Yidong <cyd@gnu.org>
1157
a2d19368
CY
1158 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1159
032a42c8
CY
1160 * xfont.c (xfont_open):
1161 * xftfont.c (xftfont_open): Set the font's max_width field.
1162
1163 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1164 min_width to space_width and average_width to the average over
1165 printable ASCII characters.
1166 (ns_char_width): Code cleanup.
1167 (ns_ascii_average_width): New utility function.
1168
1169 * font.h (struct font): Update comments.
1170
a098c930
DA
11712012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1172
032a42c8 1173 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
1174 * lisp.h (CSET): New macro.
1175 (char_table_set_extras, char_table_set_contents)
1176 (sub_char_table_set_contents): New function.
1177 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1178 * syntax.c: Adjust users.
1179
8be3a09c
SM
11802012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1181
1182 * eval.c (eval_sub): Bind lexical-binding.
1183 * lread.c (Qlexical_binding): Make non-static.
1184
ac4845a6
JD
11852012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1186
ddee6515
JD
1187 * nsmenu.m (popupSession): Remove.
1188 (pop_down_menu): Remove endModalSession.
1189 (timeout_handler:): New method.
1190 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1191 Call runModalForWindow. Check timer_fired when it returns.
1192 If not set, cancel timer and break out of loop.
1193 Otherwise loop again, with a new timeout.
1194
1195 * nsterm.m: Include fcntl.h if present.
1196 (fd_entry, t_readfds, inNsSelect): Remove.
1197 (select_writefds, select_valid, select_timeout, selfds)
1198 (select_mutex, apploopnr): Add.
1199 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1200 Otherwise call kbd_buffer_store_event.
1201 (ns_send_appdefined): Remove release of fd_entry.
1202 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1203 Increment and decrement apploopnr.
1204 (ns_select): If no file descriptors, just do a NSTimer.
1205 Otherwise copy read/write masks and start select thread (fd_handler).
1206 Start main loop and wait for application defined event.
1207 Inform select thread to stop selecting after main loop is exited.
1208 (ns_term_init): Create selfds pipe and set non-blocking.
1209 Initialize select_mutex. Start the select thread (fd_handler).
1210 (fd_handler:): Loop forever, wait for info from the main thread
1211 to either start or stop selecting. When select returns, send
1212 and appdefined event.
1213 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1214 If not call kbd_buffer_store_event.
1215
1216 * nsterm.h (EmacsApp): fd_handler takes id argument.
1217 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1218
ac4845a6
JD
1219 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1220
eb424fe3
EZ
12212012-08-15 Eli Zaretskii <eliz@gnu.org>
1222
1223 * region-cache.c (move_cache_gap): Update gap_len using the actual
1224 growth of the boundaries array. Do not change cache_len.
1225 (Bug#12196)
1226
4e6a86c6
DA
12272012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1228
1229 Generalize and cleanup font subsystem checks.
1230 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
1231 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1232 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 1233
5bf192ca
DA
12342012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1235
1236 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1237
f2045622
CY
12382012-08-15 Chong Yidong <cyd@gnu.org>
1239
8be3a09c
SM
1240 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1241 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1242 extract the font descriptor instead of just the font name.
1243 In that case, return a font spec instead of a string.
f2045622
CY
1244 (x_last_font_name): Move to this file from xfns.c.
1245
1246 * xfns.c (Fx_select_font): The return value can also be a font
1247 spec. Move x_last_font_name management to gtkutil.c.
1248
1249 * xfaces.c: Make font weight and style symbols non-static.
1250
7f6feb56
SM
12512012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1252
1253 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1254 (bug#12117).
1255
fecbd8ff
SM
12562012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1257
1258 * alloc.c (Fgarbage_collect): Use plural form consistently.
1259
9b8d5165
EZ
12602012-08-14 Eli Zaretskii <eliz@gnu.org>
1261
1262 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1263 iteration through the command loop. Fixes a problem whereby mouse
1264 movements are ignored until the first mouse click.
1265
f5d9e83a
PE
12662012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1267
1268 Use bool, not int, for Lisp booleans.
1269 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1270 makes Emacs a bit smaller and presumably a bit faster.
1271 * lisp.h: Include <stdbool.h>.
1272 (struct Lisp_Boolfwd, defvar_bool):
1273 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1274 * regex.c [!emacs]: Include <stdbool.h>.
1275 (false, true): Remove; <stdbool.h> does this for us now.
1276
55802e4a
CY
12772012-08-14 Chong Yidong <cyd@gnu.org>
1278
4abcdac8
CY
1279 * character.c (Fcharacterp): Doc fix (Bug#12076).
1280
1281 * data.c (Findirect_variable): Doc fix (Bug#11040).
1282
55802e4a
CY
1283 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1284
1285 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 1286 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 1287
8e99d072
BR
12882012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1289
1290 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1291 (bug#12022).
1292
08908aca
MR
12932012-08-14 Martin Rudalics <rudalics@gmx.at>
1294
1295 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1296 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1297 * minibuf.c (choose_minibuf_frame, read_minibuf):
1298 * w32fns.c (x_create_tip_frame):
1299 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1300 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1301
56120d6f
PE
13022012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1303
1304 * intervals.c (offset_intervals): Remove obsolete comment.
1305
67b77c0b
AS
13062012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1307
1308 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1309
f48b82fd
GR
13102012-08-14 Gergely Risko <gergely@risko.hu>
1311
1312 * coding.c (decode_coding): Record buffer modification before
1313 disabling undo_list (Bug#11773).
1314
fd318b54
DA
13152012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1316
1317 Revert and cleanup some recent overlay changes.
1318 * buffer.h (enum overlay_type): Remove.
1319 (buffer_get_overlays, buffer_set_overlays): Likewise.
1320 (buffer_set_overlays_before, buffer_set_overlays_after):
1321 New function. Adjust users.
1322 (unchain_both): Add eassert.
1323
41a62dd9
DA
13242012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1325
1326 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1327
5884c324
PE
13282012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1329
1330 * gtkutil.c (xg_mark_data): Don't assume C99.
1331
ca06f160
JD
13322012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1333
1334 * gtkutil.c (xg_frame_tb_info): New struct.
1335 (TB_INFO_KEY): New define.
1336 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1337 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1338 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1339 if not present.
1340 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1341 is up to date. Otherwise store new data.
1342 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1343
7864a3f7
DA
13442012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1345
1346 Use KSET for write access to Lisp_Object members of struct kboard.
1347 * keyboard.h (KSET): New macro.
1348 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1349 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1350 * xterm.c: Adjust users.
1351
4c31be61
DA
13522012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1353
1354 Use BSET for write access to Lisp_Object members of struct buffer.
1355 * buffer.h (BSET): New macro.
1356 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1357 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1358 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1359 * window.c, xdisp.c, xfns.c: Adjust users.
1360
14ae4239
BT
13612012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1362
1363 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1364
32bcadb4
JD
13652012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1366
3d29b2ce
JD
1367 * nsterm.m (not_in_argv): New function.
1368 (application:openFile, application:openTempFile:):
1369 (application:openFileWithoutUI:, application:openFiles:): Open file
1370 if not_in_argv returns non-zero (bug#12171).
1371
32bcadb4 1372 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
1373 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1374 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
1375 (xg_get_font_name): Use those functions/macros here.
1376 Reported by Frans Oilinki <moilinki@gmail.com>.
1377
9ff9402d 13782012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
1379
1380 * unexmacosx.c (copy_data_segment): Copy initialized data in
1381 statically linked libraries from input file rather than memory.
1382
db74a5fc
YM
1383 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1384 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1385 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1386
25e65510
GM
13872012-08-10 Glenn Morris <rgm@gnu.org>
1388
1389 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1390 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1391
7961135c
DA
13922012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1393
1394 Fix last change to allow compilation with low optimization levels.
1395 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1396 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1397
42b3a444
DA
13982012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1399
1400 Use common inline syntax in intervals.h.
1401 * intervals.h (INTERVALS_INLINE): New macro.
1402 Change all users from LISP_INLINE.
1403
9fb0c957
DA
14042012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1405
1406 Define Qnone once for all platforms.
1407 * frame.c (Qnone): Define here.
1408 (syms_of_frame): DEFSYM it.
1409 * lisp.h (Qnone): New declaration.
1410 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1411 * xfns.c: Remove duplication. Adjust users.
1412
65e8ee52
DA
14132012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1414
1415 Remove unused macros from intervals.h.
1416 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1417 * intervals.c: Adjust comment.
1418
9b855fd6
EZ
14192012-08-10 Eli Zaretskii <eliz@gnu.org>
1420
1421 * w32fns.c <w32_unicode_gui>: New static variable.
1422 (globals_of_w32fns): Initialize it according to os_subtype.
1423 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1424 testing os_subtype.
1425
39cb9e56 14262012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
1427 Eli Zaretskii <eliz@gnu.org>
1428
1429 Fix bug #10299 with Unicode characters sent by customized
1430 keyboards created by MSKLC.
1431 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1432 (w32_init_class): Use it to initialize the Emacs class with either
1433 ANSI or Unicode API calls.
1434 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1435 later.
1436 (w32_wnd_proc): If the character code sent by WM_CHAR or
1437 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1438 original message. Call DefWindowProcW on NT and later.
1439
9374581a
GM
14402012-08-10 Glenn Morris <rgm@gnu.org>
1441
4b94e8cf
GM
1442 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1443
9374581a
GM
1444 * lisp.h (DIRECTORY_SEP): Let configure set it.
1445
a2752828
DA
14462012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1447
1448 Use TSET for write access to Lisp_Object slots of struct terminal.
1449 * termhooks.h (TSET): New macro.
1450 * coding.c, terminal.c, xselect.c: Adjust users.
1451
cc92c454
SM
14522012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1453
1454 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1455 the failing expression, include them in the error message.
1456 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1457 * lisp.h (internal_condition_case_n): Update declaration.
1458
4cb3e6b3
DA
14592012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1460
1461 Inline functions to examine and change buffer overlays.
1462 * buffer.c (unchain_both): New function.
1463 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1464 (buffer_has_overlays): New function.
1465 (enum overlay_type): New enum.
1466 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1467 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1468
8707c1e5
DA
14692012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1470
1471 Inline functions to examine and change buffer intervals.
1472 * alloc.c (mark_interval_tree): Remove.
1473 (MARK_INTERVAL_TREE): Simplify.
1474 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1475 * intervals.c (buffer_balance_intervals): New function.
1476 (graft_intervals_into_buffer): Adjust indentation.
1477 (set_intervals_multibyte): Simplify.
1478 * buffer.h (BUF_INTERVALS): Remove.
1479 (buffer_get_intervals, buffer_set_intervals): New function.
1480 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1481 * intervals.c, textprop.c: Adjust users.
1482
ad8c997f
DA
14832012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1484
1485 Inline functions to examine and change string intervals.
1486 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1487 (string_get_intervals, string_set_intervals): New function.
1488 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1489 * lread.c, print.c, textprop.c: Adjust users.
1490
32ac3a6b
GM
14912012-08-08 Glenn Morris <rgm@gnu.org>
1492
1493 * lisp.mk (lisp): Remove language/persian.elc.
1494
77c7bcb1
DA
14952012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1496
1497 Cleanup intervals.
1498 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1499 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
1500 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1501 Adjust comment. Move under #if 0.
77c7bcb1
DA
1502 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1503 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1504
9c08a8d4
DA
15052012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1506
1507 Check total length of intervals with eassert.
1508 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1509 * intervals.c: Change all users to eassert.
1510
26d16b35
EZ
15112012-08-07 Eli Zaretskii <eliz@gnu.org>
1512
14ae4239
BT
1513 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1514 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
1515 INTERNAL_FIELD in Lisp_Cons.
1516
c644523b
DA
15172012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1518
1519 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1520 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1521 name since all xname users are fixed long time ago. Do not
1522 use INTERNAL_FIELD.
1523 (set_symbol_name, set_symbol_function, set_symbol_plist):
1524 (set_symbol_next, set_overlay_plist): New function.
1525 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1526 (struct Lisp_Overlay): Likewise.
1527 (CVAR, MVAR, SVAR): Remove.
1528 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1529 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1530 * xterm.c: Adjust users.
1531 * .gdbinit: Change to use name field of struct Lisp_Symbol
1532 where appropriate.
1533
6a3d20cc
DA
15342012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1535
1536 Basic functions to set Lisp_Object and pointer slots of intervals.
1537 * intervals.h (interval_set_parent, interval_set_object):
1538 (interval_set_left, interval_set_right, interval_set_plist):
1539 (interval_copy_parent): New function.
1540 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
1541 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1542 Adjust indentation.
6a3d20cc
DA
1543 (INTERVAL_SIZE): Remove. Adjust users.
1544 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1545
4d2b044c
DA
15462012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1547
1548 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1549 * process.h (PGET): Remove.
1550 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1551 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1552
d3d50620
DA
15532012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1554
1555 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1556 * window.h (WGET): Remove.
1557 (struct window): Do not use INTERNAL_FIELD.
1558 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1559 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1560 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1561 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1562 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1563 Adjust users.
1564
d10a51dc
CY
15652012-08-07 Chong Yidong <cyd@gnu.org>
1566
1567 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1568 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1569 (Fdelete_window_internal): Signal an error if the window is not on
1570 a live frame (Bug#12025).
1571
e69b0960
DA
15722012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1573
1574 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1575 * frame.h (FGET): Remove.
1576 (struct frame): Do not use INTERNAL_FIELD.
1577 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1578 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1579 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1580 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1581
25a20a3a
JB
15822012-08-06 Juanma Barranquero <lekktu@gmail.com>
1583
1584 * w32.c: Silence compiler warnings.
1585 (map_w32_filename): Remove unused variable `is_fat'.
1586 (chase_symlinks): Add parentheses around expression.
1587
1c6f11f4
GM
15882012-08-06 Glenn Morris <rgm@gnu.org>
1589
1db4583a
GM
1590 * sysdep.c: Respect BROKEN_GETWD.
1591
1c6f11f4
GM
1592 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1593 Let configure handle it.
1594 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1595
2b90362b
DA
15962012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1597
1598 Use GCALIGNMENT where appropriate.
1599 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1600 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1601 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1602
5f50daf2
EZ
16032012-08-06 Eli Zaretskii <eliz@gnu.org>
1604
14ae4239
BT
1605 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1606 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 1607
cbcc7007
SM
16082012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1609
1610 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1611 that should be sufficient for everyone.
1612
4d365fa4
JD
16132012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1614
1615 * keyboard.c (timer_check_2): Add break so timer_check returns next
1616 timeout.
1617
dd86bd82
DA
16182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1619
1620 Fix Windows build errors introduced after converting to WGET and WSET.
1621 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1622 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1623
054e1668
JD
16242012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1625
1626 * nsterm.m (ns_frame_rehighlight): Use FSET.
1627
1628 * nsmenu.m (ns_update_menubar): Use FSET.
1629
21238f11
DA
16302012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1631
1632 Separate read and write access to Lisp_Object slots of Lisp_Process.
1633 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1634 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1635
077288cf
DA
16362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1637
1638 Separate read and write access to Lisp_Object slots of struct window.
1639 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1640 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1641 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1642 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1643 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1644 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1645 Adjust users.
1646
71688bd7
DA
16472012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1648
1649 Fix Windows build errors introduced after converting to FGET and FSET.
1650 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1651 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1652 (w32_judge_scroll_bars): Change to use FSET.
1653 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1654
f99bac93
DA
16552012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1656
1657 Fix replacement typo.
1658 * window.c (replace_window): Set root_window instead of
1659 selected_window. This fixes a total window subsystem
1660 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1661
8c2a0f2d
GM
16622012-08-06 Glenn Morris <rgm@gnu.org>
1663
1664 * lisp.mk (lisp): Add language/persian.elc.
1665
edd74c35
DA
16662012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1667
1668 Separate read and write access to Lisp_Object slots of struct frame.
1669 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1670 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1671 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1672 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1673 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1674
8671676c
AS
16752012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1676
1677 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1678
663e2b3f
DA
16792012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1680
1681 Generalize common compile-time constants.
1682 * lisp.h (header_size, bool_header_size, word_size): Now here.
1683 (struct Lisp_Vector): Add comment.
1684 (struct Lisp_Bool_Vector): Move up to define handy constants.
1685 (VECSIZE, PSEUDOVECSIZE): Simplify.
1686 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1687 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1688 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1689 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1690 * xfont.c, xmenu.c: Use word_size where appropriate.
1691
d32e47af
LM
16922012-08-05 Lawrence Mitchell <wence@gmx.li>
1693
1694 * search.c (Freplace_match): Treat \? in the replacement text
1695 literally (Bug#8161).
1696
e5d9c0d1
CY
16972012-08-05 Chong Yidong <cyd@gnu.org>
1698
1699 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1700 * frame.c (Vdelete_frame_functions):
1701 * emacs.c (Vkill_emacs_hook): Doc fix.
1702
8da0576b
EZ
17032012-08-04 Eli Zaretskii <eliz@gnu.org>
1704
1705 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1706 --with-x-toolkit=no builds.
1707 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1708
02676e5d
CY
17092012-08-04 Chong Yidong <cyd@gnu.org>
1710
1711 * syntax.c (Fmodify_syntax_entry): Doc fix.
1712
97147da9
EZ
17132012-08-04 Eli Zaretskii <eliz@gnu.org>
1714
76151e2c
EZ
1715 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1716 * w32.c (init_environment): Change the default values of many
1717 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
1718 them into environment when they were not already defined.
1719 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 1720 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
1721 (check_windows_init_file): Now external, not static.
1722 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
1723 called when Vload_path is already set up.
1724
1725 * w32.h (check_windows_init_file): Add prototype.
1726
1727 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1728 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1729 compatibility with Posix platforms.
1730 (main): Move the call to check_windows_init_file to here from
1731 w32.c.
1732 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1733 any, in the DEFALT argument into the root of the Emacs build or
1734 installation tree, as appropriate.
1735
1736 * callproc.c (init_callproc_1): Call decode_env_path instead of
1737 doing its equivalent by hand.
1738 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1739 the code that sets Vexec_path run on MS-Windows.
1740
1741 * lread.c (init_lread): Add comments to #ifdef's.
1742
97147da9
EZ
1743 * msdos.c (dos_set_window_size, IT_update_begin)
1744 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1745 instead of direct references.
1746
185ee146
PE
17472012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 Export DEFAULT_REHASH_* to GDB.
1750 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1751 Now constants, not macros.
1752
8834c57a
PE
17532012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1754
98c6f1e3
PE
1755 Remove unnecessary casts involving pointers.
1756 These casts are no longer needed now that we assume C89 or later,
1757 since they involve casting to or from void *.
1758 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1759 (make_pure_float, make_pure_vector):
1760 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1761 * macros.c (Fstart_kbd_macro):
1762 * menu.c (find_and_return_menu_selection):
1763 * minibuf.c (read_minibuf_noninteractive):
1764 * sysdep.c (closedir):
1765 * xdisp.c (x_produce_glyphs):
1766 * xfaces.c (compare_fonts_by_sort_order):
1767 * xfns.c (x_real_positions, select_visual):
1768 * xselect.c (x_stop_queuing_selection_requests)
1769 (x_get_window_property, x_get_window_property_as_lisp_data):
1770 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1771 Remove unnecessary pointer casts.
1772 * alloc.c (record_xmalloc): New function.
1773 * lisp.h (record_xmalloc): New decl.
1774 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1775 more like a function. This is because the pointer cast is not
1776 needed. All uses changed.
1777 * print.c (print_string, print_error_message): Avoid length recalc.
1778
8834c57a
PE
1779 Improve fix for macroexp crash with debugging (Bug#12118).
1780 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1781 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1782 not supposed to be invoked from the garbage collector.
1783 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1784 (gc_aset): New function, which is like ASET but can be
1785 used in the garbage collector.
1786 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1787 (set_hash_index): Use it instead of ASET.
1788
6dad7178
EZ
17892012-08-03 Eli Zaretskii <eliz@gnu.org>
1790
1791 Support symlinks on latest versions of MS-Windows.
1792 * w32.c: Include winioctl.h and aclapi.h.
1793 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1794 (revert_to_self): Forward declarations of static functions.
1795 <static BOOL g_b_init_get_security_info>:
1796 <g_b_init_create_symbolic_link>: New static flags.
1797 (globals_of_w32): Initialize them to zero.
1798 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1799 (map_w32_filename): Improve commentary. Simplify switch.
1800 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1801 headers (most versions of MinGW w32api don't).
1802 (get_security_info, create_symbolic_link)
1803 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1804 New functions.
1805 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1806 in the argument file name.
1807 (sys_access): Call unc_volume_file_attributes only if
1808 GetFileAttributes fails with network-related error codes.
1809 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1810 have the required privileges.
14ae4239 1811 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
1812 get_file_security_desc.
1813 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
1814 with addition of handling of symlinks and support for 'lstat'.
1815 If possible, get file's attributes and security information by
6dad7178
EZ
1816 handle, not by name. Produce S_IFLNK bit for symlinks, when
1817 called from 'lstat'.
1818 (stat, lstat): New functions, call 'stat_worker'.
1819 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1820 symlinks when the underlying filesystem supports them.
1821
f162bcc3
PE
18222012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1823
79ea6c20
PE
1824 Fix macroexp crash on Windows with debugging (Bug#12118).
1825 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1826 checking subscripts; problem introduced with the recent
1827 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1828 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1829 since it's used in non-static inline functions now.
1830
c0ce93fd
PE
1831 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1832 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 1833
f162bcc3
PE
1834 Use C99-style 'extern inline' if available.
1835 * buffer.h (BUFFER_INLINE):
1836 * category.h (CATEGORY_INLINE):
1837 * character.h (CHARACTER_INLINE):
1838 * charset.h (CHARSET_INLINE):
1839 * composite.h (COMPOSITE_INLINE):
1840 * dispextern.h (DISPEXTERN_INLINE):
1841 * lisp.h (LISP_INLINE):
1842 * systime.h (SYSTIME_INLINE):
1843 New macro, replacing 'static inline' in this header.
1844 * buffer.h, category.h, character.h, charset.h, composite.h:
1845 * dispextern.h, lisp.h, systime.h:
1846 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1847 * alloc.c (LISP_INLINE):
1848 * buffer.c (BUFFER_INLINE):
1849 * category.c (CATEGORY_INLINE):
1850 * character.c (CHARACTER_INLINE):
1851 * charset.c (CHARSET_INLINE):
1852 * composite.c (COMPOSITE_INLINE):
1853 * dispnew.c (DISPEXTERN_INLINE):
1854 * sysdep.c (SYSTIME_INLINE):
1855 Define to EXTERN_INLINE, so that the corresponding functions
1856 are compiled into code.
1857 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1858 (INLINE_HEADER_END): New macros.
1859 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1860 since it's used in non-static inline functions now.
a8333d03 1861 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 1862
837b365b
GM
18632012-08-02 Glenn Morris <rgm@gnu.org>
1864
d66b744d
GM
1865 * s/: Remove empty directory.
1866
837b365b
GM
1867 * s/ms-w32.h: Move to ../nt/inc.
1868 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1869 Update for new ms-w32.h location.
1870
13294f95
PE
18712012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1872
1873 Port to Solaris 8.
1874 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1875
90df0db3
GM
18762012-08-02 Glenn Morris <rgm@gnu.org>
1877
1878 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1879 hard-coding the path separator.
1880
4939150c
PE
18812012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1882
1883 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1884 This how ASET and AREF are supposed to work, and makes
1885 it easier to think about future improvements. See
1886 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1887 * charset.h (set_charset_attr): New function.
1888 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1889 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1890 (aref_addr): New function. All uses of &AREF(...) changed.
1891 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1892 (set_hash_index): New functions. All lvalue-style uses of
1893 HASH_KEY etc. changed.
1894 * keyboard.c (set_prop): New function. All lvalue-style uses
1895 of PROP changed.
1896
947b2afd
AA
18972012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1898
1899 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1900 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1901 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1902 * nsfns.m (ns_set_name_as_filename): Likewise.
1903 * nsmenu.m (ns_update_menubar): Likewise.
1904 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1905
4f5d0325
EZ
19062012-08-01 Eli Zaretskii <eliz@gnu.org>
1907
2008beae
EZ
1908 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1909 Adapt to latest changes in field names of the corresponding Lisp
288479f6 1910 objects.
2008beae 1911
4f5d0325
EZ
1912 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1913
fe3cc771
GM
19142012-08-01 Glenn Morris <rgm@gnu.org>
1915
1916 * s/msdos.h: Remove file.
1917 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1918 * Makefile.in (S_FILE): Remove.
1919 (config_h): Remove S_FILE.
1920
c90acc54
JB
19212012-08-01 Juanma Barranquero <lekktu@gmail.com>
1922
1923 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1924 Remove; moved to nt/config.nt.
1925
d8a05828
DA
19262012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1927
1928 Use INTERNAL_FIELD for conses and overlays.
1929 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1930 Remove obsolete comment.
1931 (MVAR): New macro.
1932 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1933 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1934
8271d590
DA
19352012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1936
1937 Use INTERNAL_FIELD for symbols.
1938 * lisp.h (SVAR): New macro. Adjust users.
1939 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1940 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1941
3193acd2
DA
19422012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1943
1944 Use INTERNAL_FIELD for processes.
1945 * process.h (PVAR): New macro. Adjust style.
1946 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1947 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1948
3a45383a
DA
19492012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1950
1951 Use INTERNAL_FIELD for windows.
1952 * window.h (WVAR): New macro.
1953 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1954 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1955 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1956 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1957 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1958 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1959
c1dbc63c
PE
19602012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1961
1962 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1963
5c0c0e8a
GM
19642012-08-01 Glenn Morris <rgm@gnu.org>
1965
1966 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1967 Move to configure.ac.
1968
552a99b4
JB
19692012-08-01 Juanma Barranquero <lekktu@gmail.com>
1970
1971 * makefile.w32-in (CONFIG_H): Update dependencies.
1972 (CONF_POST_H): New macro.
1973
1974 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1975
8d8e2dfe
GM
19762012-07-31 Glenn Morris <rgm@gnu.org>
1977
bc96620a
GM
1978 * Makefile.in (S_FILE): No longer set by configure.
1979
476b1b2d
GM
1980 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1981 is available.
1982 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1983
b2c7a106
GM
1984 * process.h (NULL_DEVICE):
1985 * emacs.c (SEPCHAR):
1986 * editfns.c (USER_FULL_NAME): Let configure set them.
1987
d53d062a
GM
1988 * s/README, s/template.h: Remove files.
1989
4515017f
GM
1990 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1991
8d8e2dfe
GM
1992 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1993 Move to configure.ac.
1994
5b20b3cc
EZ
19952012-07-31 Eli Zaretskii <eliz@gnu.org>
1996
1e0afd9a
EZ
1997 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1998 resulting renaming of 'struct frame' members.
1999
5b20b3cc
EZ
2000 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2001
2002 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2003 after introduction of FVAR.
2004
f1310128
JD
20052012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2006
79e721e0
JD
2007 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2008
2009 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2010 instead of compositeToPoint.
2011 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2012
8d7c7eed 2013 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 2014
e34f7f79
DA
20152012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2016
2017 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2018 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 2019 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
2020 (BVAR): Change to use INTERNAL_FIELD.
2021 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2022 (KVAR): Change to use INTERNAL_FIELD.
2023 * frame.h (FVAR): New macro.
2024 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
2025 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2026 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2027 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
2028 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2029
c09bfb2f
DA
20302012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2031
2032 Miscellaneous fixes for non-default X toolkits.
2033 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2034 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2035 Move under #ifdef USE_LUCID.
2036 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2037 definition and usage to avoid warnings.
2038
14c114ae
JD
20392012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2040
2041 * nsterm.m (openFiles): Fix previous checkin.
2042
3bd21e82
PE
20432012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2044
2045 * indent.c (compute_motion): Remove unused local.
2046
c1529ded
GM
20472012-07-31 Glenn Morris <rgm@gnu.org>
2048
400d5621
GM
2049 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2050
268e2432
GM
2051 * conf_post.h [USG5_4]:
2052 Move remaining contents of s/usg5-4-common.h here.
2053 * s/usg5-4-common.h: Remove file.
2054
7552f3ee
GM
2055 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2056 * s/irix6-5.h: Remove file.
2057
6a381852
GM
2058 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2059 * s/darwin.h: Remove file.
2060
c1529ded
GM
2061 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2062 * s/hpux10-20.h: Remove file, which is now empty.
2063
b429a4ee
GM
20642012-07-30 Glenn Morris <rgm@gnu.org>
2065
2066 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2067 * Makefile.in (config_h): Add conf_post.h.
2068 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2069
adff3182
JD
20702012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2071
2072 * nsterm.m (ns_do_open_file): New variable.
b9031d69 2073 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
2074 (openFile, openTempFile, openFileWithoutUI, openFiles):
2075 Open files only if ns_do_open_file.
adff3182 2076
c32af1e4
PE
20772012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2078
7393bcbb
PE
2079 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2080 This no-op macro hasn't been needed for many years.
2081 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2082
c32af1e4
PE
2083 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2084 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2085 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2086 gdb_make_enums_visible.
2087 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2088 (DIRECTORY_SEP): Now a constant, not a macro.
2089
302fc036
EZ
20902012-07-30 Eli Zaretskii <eliz@gnu.org>
2091
2092 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2093 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2094
2095 * w32term.c <w32_keyboard_codepage>: Renamed from
2096 keyboard_codepage and now external. All users changed.
2097
2098 * w32term.h: Add declaration of w32_keyboard_codepage.
2099
2100 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2101 the codepage to translate keys to Unicode. If this argument is
2102 -1, use the value returned by GetConsoleCP. All callers changed.
2103
88fb40b4
PE
21042012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2105
0aee6912
PE
2106 Update .PHONY listings in makefiles.
2107 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2108 bootstrap-clean, distclean, maintainer-clean, versioclean,
2109 extraclean, frc.
2110
88fb40b4
PE
2111 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2112 This is a bit clearer. Fix some commentary typos.
2113
0a763bd1
GM
21142012-07-30 Glenn Morris <rgm@gnu.org>
2115
32bac6d6
GM
2116 * s/netbsd.h: Let configure include signal.h if needed.
2117 Remove file, which is now empty.
2118
b65e7c46
GM
2119 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2120 Let configure set them.
2121 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2122 No more need to undefine.
0a763bd1 2123
169304bd
AS
21242012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2125
2126 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2127 non-single-byte char when adding meta modifier. (Bug#12090)
2128
6cd7a139
DA
21292012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2130
2131 Convert safe_call to use variable number of arguments.
2132 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2133 (safe_call2): Fix comment.
2134 * lisp.h (safe_call): Adjust prototype.
2135 * coding.c (encode_coding_object): Change to use safe_call2.
2136 * xfaces.c (merge_face_heights): Change to use safe_call1.
2137
d34d6ffc
GM
21382012-07-30 Glenn Morris <rgm@gnu.org>
2139
7b8a48e4 2140 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 2141 does that unconditionally. Remove file, which is now empty.
7b8a48e4 2142
d34d6ffc
GM
2143 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2144 Remove empty files.
2145
03a660a6
PE
21462012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2147
2148 Export to GDB most of lisp.h's remaining object-like macros.
2149 * lisp.h (min, max): Move earlier, because they're used earlier now.
2150 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2151 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2152 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2153 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2154 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2155 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2156 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2157 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2158 Now constants, for GDB. They need not be macros.
2159 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2160 Now constants, for GDB, as well as macros, for static initializers.
2161 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2162 Move to after the definition of struct Lisp_Char_Table,
2163 since the former now needs that type defined.
2164 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2165 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2166 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2167 New enums, for gdb_make_enums_visible.
2168 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 2169 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
2170 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2171 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2172 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2173 enum maxargs, enum MAX_ALLOCA.
2174 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2175 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2176 no longer needed, now that they are done in lisp.h.
2177
e499d0ee
DA
21782012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2179
2180 Cleanup string bytes checking.
2181 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2182 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2183 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2184 (check_sblock, compact_small_strings): Simplify.
2185
d5040d2d
PE
21862012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2187
2188 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2189 These macros are confusing and no longer need to be defined, as
2190 the enum values now suffice. All uses replaced with definiens.
2191 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2192
7f259ae6
JB
21932012-07-29 Juanma Barranquero <lekktu@gmail.com>
2194
2195 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2196 ($(BLD)/w32console.$(O)): Update dependencies.
2197
7e63e0c3
DA
21982012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2199
2200 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2201 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2202 time. Adjust users.
2203 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2204
ffd817eb
JD
22052012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2206
2207 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2208 setting sitelisp (Bug#12010).
2209
417a7a0e
EZ
22102012-07-29 Eli Zaretskii <eliz@gnu.org>
2211
14ae4239 2212 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
2213
2214 * w32heap.c (cache_system_info):
2215 * w32.c (sys_rename):
2216 * w32proc.c (find_child_console, sys_kill): All users changed.
2217
387d4d92
PE
22182012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2219
2220 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2221
55a6cca6
EZ
22222012-07-29 Eli Zaretskii <eliz@gnu.org>
2223
2224 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2225
dbcf001c
DA
22262012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2227
2228 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
2229 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2230 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 2231
e2688e4a
DA
22322012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2233
2234 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2235 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2236 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2237 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2238 (replace_range, replace_range_2, del_range_2): Change to eassert.
2239 * marker.c (byte_char_debug_check): Adjust style.
2240
b46a6a83
PE
22412012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2242
2243 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2244 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2245 long-ago-commented-out code that talks about "WIN32".
2246 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2247 All uses changed.
2248
e32a5799
PE
22492012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2252 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2253 Simplify by using alignof.
2254 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2255 * lisp.h: Include <stdalign.h>.
2256 (GCALIGNMENT): New macro and constant.
2257 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2258 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2259 (stdalign): New macro, if not already defined.
2260
df81cd29
EZ
22612012-07-28 Eli Zaretskii <eliz@gnu.org>
2262
01bd1b0d
EZ
2263 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2264 * w32inevt.c: Include w32inevt.h.
2265 (w32_read_console_input): New inline function, calls either
2266 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2267 w32_console_unicode_input.
2268 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2269 (w32_kbd_patch_key, key_event): Use the codepage returned by
2270 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2271 (key_event): use uChar.UnicodeChar only if
2272 w32_console_unicode_input is non-zero.
2273
2274 * w32console.c: Include w32heap.h.
2275 <w32_console_unicode_input>: New global variable.
2276 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2277 family of Windows, zero otherwise.
2278
2279 * w32inevt.h: Declare w32_console_unicode_input.
2280
df81cd29
EZ
2281 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2282 --without-x. (Bug#11742)
2283
c20fdd9e
PE
22842012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2285
2286 Adjust GDB to reflect pvec_type changes (Bug#12036).
2287 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
2288 2012-07-04 changes to pseudovector representation.
2289 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 2290
32770973 22912012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
2292
2293 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2294 bus address.
2295 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2296
3438fe21
EZ
22972012-07-27 Eli Zaretskii <eliz@gnu.org>
2298
bcfbc9de
EZ
2299 * alloc.c (listn): Fix the order the arguments are consed onto the
2300 list.
2301
3438fe21
EZ
2302 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2303 enumeration constants, as PURE and HEAP are too general, and clash
2304 with other headers and sources, such as gmalloc.c and the
2305 MS-Windows system headers. All users changed.
2306
eeaea515
DA
23072012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2308
2309 Revert last save_excursion_save and save_excursion_restore changes.
2310 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2311 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2312
073c88c2
DA
23132012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2314
2315 Fix recently-introduced typos in Windows port.
2316 Reported by Martin Rudalics <rudalics@gmx.at>.
2317 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 2318 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 2319
4706125e
PE
23202012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2321
2322 Improve GDB symbol export (Bug#12036).
2323 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2324 arms of an 'if', not using conditional expressions; otherwise GDB
2325 complains about the types in the unevaluated arm when the argument
2326 is an integer literal.
2327 (xgetint): Simplify expression.
2328 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2329 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2330 Zaretskii in <http://bugs.gnu.org/12036#13>.
2331 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2332 needed now that we have gdb_make_enums_visible.
2333 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2334 (enum enum_USE_LSB_TAG):
2335 New enum types, packaging up enums that need to be exported to GDB.
2336
694b6c97
DA
23372012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2338
2339 Utility function to make a list from specified amount of objects.
2340 * lisp.h (enum constype): New datatype.
2341 (listn): New prototype.
2342 * alloc.c (listn): New function.
2343 (Fmemory_use_count, syms_of_alloc): Use it.
2344 * buffer.c (syms_of_buffer): Likewise.
2345 * callint.c (syms_of_callint): Likewise.
2346 * charset.c (define_charset_internal): Likewise.
2347 * coding.c (syms_of_coding): Likewise.
2348 * keymap.c (syms_of_keymap): Likewise.
2349 * search.c (syms_of_search): Likewise.
2350 * syntax.c (syms_of_syntax): Likewise.
2351 * w32.c (init_environment): Likewise.
2352 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2353 * xdisp.c (syms_of_xdisp): Likewise.
2354 * xfns.c (syms_of_xfns): Likewise.
2355
6195f384
DA
23562012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2357
2358 Fast save_excursion_save and save_excursion_restore.
2359 * lisp.h (struct Lisp_Excursion): New data type.
2360 (PVEC_EXCURSION): New pseudovector type.
2361 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2362 to deal with it. Adjust comments.
2363 (init_marker, attach_marker): New prototype.
2364 (unchain_marker): Adjust prototype.
2365 * marker.c (attach_marker): Change to global.
2366 (init_marker): New function.
2367 * alloc.c (Fmake_marker, build_marker): Use it.
2368 (build_marker): More easserts.
2369 (mark_object): Handle struct Lisp_Excursion.
2370 * editfns.c (save_excursion_save, save_excursion_restore):
2371 Reimplement to use struct Lisp_Excursion. Add comments.
2372
5eceb8fb
PE
23732012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2374
2375 Fix export of symbols to GDB (Bug#12036).
2376 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2377 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2378 emacs.c, as this is a more-suitable home. Had this been done earlier
2379 the fix for 12036 would have avoided some of the problems noted in
2380 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2381 would have been more obvious.
562157c8
PE
2382 * emacs.c: Do not include <verify.h>; no longer needed.
2383 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
2384 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2385 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2386 Remove; now done in lisp.h.
2387 * lisp.h (PUBLISH_TO_GDB): New macro.
2388 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2389 (DATA_SEG_BITS): Use it.
2390 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2391 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2392 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2393 not be usable in #if. This simplifies things.
2394
d6749401
JB
23952012-07-26 Juanma Barranquero <lekktu@gmail.com>
2396
2397 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2398
1781b9e9
PE
23992012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2400
d89518db 2401 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
2402 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2403 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2404 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2405 Adjust to changes in lisp.h and emacs.c, by using
2406 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2407 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2408 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2409 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2410 instead of gdb_valbits.
2411 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2412 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2413 instead of gdb_array_mark_flag.
2414 (xboolvector): Get size from $->size, not $->header.size.
2415 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2416 (xreload, hook-run, hookpost-run): Remove.
2417 * emacs.c: Include <verify.h>.
2418 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2419 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2420 Remove.
2421 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2422 (gdb_USE_LSB_TAG): New enum constants.
2423 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2424 Also define these as enum constants, so they're visible to GDB.
2425 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2426 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2427 as constants, so they're visible to GDB.
2428 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2429 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2430 Now enum constants, not macros, so they're visible to GDB.
2431 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2432 more convenient now. All uses changed.
2433 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2434 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2435
3628596a
DA
24362012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2437
2438 Explicitly free restriction data that are not needed anymore.
2439 * editfns.c (save_restriction_restore): Free restriction data.
2440
7abaf5cc
SM
24412012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2442
2443 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2444 add argument, tune behavior, and adjust all callers.
2445
71f88e00
PE
24462012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2447
2448 Use typedef for EMACS_INT, EMACS_UINT.
2449 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2450 than macros. This simplifies debugging in the usual case, since
2451 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2452 and it allows expressions involving EMACS_INT casts.
2453 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2454
57ec3034
JD
24552012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2456
2457 * nsterm.m (ns_read_socket): Return early if there is a modal
2458 window (Bug#12043).
2459
8137e7b3
MR
24602012-07-25 Martin Rudalics <rudalics@gmx.at>
2461
2462 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2463 that FOCUS-FRAME can be omitted.
2464
04e9897c
DA
24652012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2466
2467 Adjust buffer text indirection counters at the end of Fkill_buffer.
2468 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2469 buffer is definitely dead. This should really fix an issue reported
2470 by Christoph Scholtes again. (Bug#12007).
2471 (init_buffer_once): Initialize indirection counters of
2472 buffer_defaults and buffer_local_symbols (for sanity and safety).
2473
8a0484e1
EZ
24742012-07-24 Eli Zaretskii <eliz@gnu.org>
2475
2476 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2477 and continuation glyphs on tooltip frames, leave them at zero.
2478 Avoids continued lines in tooltips. (Bug#11832)
2479
fa691a83
DA
24802012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2481
2482 Simplify copy_overlay.
04e9897c 2483 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
2484 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2485
436bc8e0
EZ
24862012-07-23 Eli Zaretskii <eliz@gnu.org>
2487
2488 * print.c (print_object): Don't crash when a frame's name is nil
2489 or invalid. (Bug#12025)
2490
2491 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2492 it signals an error when a tooltip frame is being created.
2493
d7a7fda3
DA
24942012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2495
2496 Cleanup miscellaneous objects allocation and initialization.
2497 * alloc.c (allocate_misc): Change to static. Add argument to
2498 specify the subtype. Adjust comment and users.
2499 (build_overlay): New function.
2500 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2501 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2502 (allocate_misc): Remove prototype.
2503 (build_overlay): Add prototype.
2504
25052012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
2506
2507 Swap buffer text indirection counters in Fbuffer_swap_text.
2508 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2509 This avoids crash reported by Christoph Scholtes at
2510 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2511
9d7fa573
JD
25122012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2513
2514 * nsmenu.m (Popdown_data): New struct.
2515 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2516 free Popdown_data.
2517 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2518 (initWithContentRect): Make imgView and contentView non-static
2519 and autorelease them. Also autorelease img and matrix (Bug#12005).
2520 (dealloc): Remove (Bug#12005).
2521
0dd6d66d
DA
25222012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2523
2524 Adjust consing_since_gc when objects are explicitly freed.
2525 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2526 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2527 (free_cons, free_misc): Subtract object size from consing_since_gc.
2528
d36d71df
DA
25292012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2530
2531 Simplify and cleanup markers positioning code.
2532 * marker.c (attach_marker): More useful eassert.
2533 (live_buffer, set_marker_internal): New function.
2534 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2535 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2536
fb9ea40f
PE
25372012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2538
2539 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2540 as it's limited by the amount of memory, not by INT_MAX.
2541
2d5c5f7d
EZ
25422012-07-21 Eli Zaretskii <eliz@gnu.org>
2543
07fb592e
EZ
2544 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2545 in special-event-map. See the discussion at
2546 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2547 for the reasons.
2548
37a9eac8 2549 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
2550 info.dwItemData. Fixes crashes on 64-bit Windows.
2551 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 2552
c4328746
JD
25532012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2554
2555 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 2556 (conversationIdentifier): Return value is NSInteger.
784051c4 2557 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 2558
6e5d1c12
CY
25592012-07-21 Chong Yidong <cyd@gnu.org>
2560
2561 * window.c (decode_any_window): Signal an error if the window is
2562 on a dead frame (Bug#11984).
2563
9928463d
DA
25642012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2565
2566 Add indirection counting to speed up Fkill_buffer.
2567 * buffer.h (struct buffer): New member.
2568 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2569 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2570 base buffer indirection counter.
2571 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2572 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2573 through buffer list if indirection counter is 0.
2574
f8643a6b
DA
25752012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2576
2577 Extend the value returned by Fgarbage_collect with heap statistics.
2578 * alloc.c (Qheap): New symbol.
2579 (syms_of_alloc): DEFSYM it.
2580 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2581 (Fmemory_free): Remove.
2582 (syms_of_alloc): Don't defsubr it.
2583 * buffer.c (Fcompact_buffer): Remove.
2584 (syms_of_buffer): Don't defsubr it.
2585
dac616ff
DA
25862012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2587
2588 Make maybe_gc inline.
2589 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2590 * lisp.h (consing_since_gc, gc_relative_threshold)
2591 (memory_full_cons_threshold): Revert declaration.
2592 (maybe_gc): Remove prototype, define as inline.
2593 * alloc.c: Remove old commented-out code.
2594 (consing_since_gc, gc_relative_threshold)
2595 (memory_full_cons_threshold): Revert to global.
2596 (maybe_gc): Remove.
2597
d7ea76b4
DA
25982012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2599
2600 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2601 * lisp.h (build_unibyte_string): New function.
2602 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2603 * sysdep.c, w32fns.c, xfns.c: Use it.
2604 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2605 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2606 Adjust users accordingly.
2607 * font.h (font_open_by_name): Adjust prototype.
2608
765e61e3
DA
26092012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2610
2611 Cleanup calls to Fgarbage_collect.
2612 * lisp.h (maybe_gc): New prototype.
2613 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2614 Remove declarations.
2615 * alloc.c (maybe_gc): New function.
2616 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2617 Make them static.
2618 * bytecode.c (MAYBE_GC): Use maybe_gc.
2619 * eval.c (eval_sub, Ffuncall): Likewise.
2620 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2621 to avoid dependency from auto-save feature.
2622
52b852c7
PE
26232012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2624
2625 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2626 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2627 'for_each_per_buffer_object_at'.
2628 All uses changed. It's better to use upper-case for macros that
2629 cannot be implemented as functions, to give the reader a clue
2630 that they're special.
2631
5db81e33
SM
26322012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2633
2634 * alloc.c (Fgarbage_collect): Tweak docstring.
2635
5b835e1d
DA
26362012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2637
2638 Tweak the value returned from Fgarbage_collect again.
2639 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2640 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2641 Adjust documentation.
2642 (total_vector_bytes): Rename to total_vector_slots, adjust
2643 accounting.
2644 (total_free_vector_bytes): Rename to total_free_vector_slots,
2645 adjust accounting.
2646 (Qstring_bytes, Qvector_slots): New symbols.
2647 (syms_of_alloc): DEFSYM them.
2648
9cd47b72
DA
26492012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2650
2651 Buffer compaction primitive which may be used from Lisp.
2652 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2653 (syms_of_buffer): Register Fcompact_buffer.
2654 * alloc.c (Fgarbage_collect): Use compact_buffer.
2655 * buffer.h (compact_buffer): New prototype.
2656 (struct buffer_text): New member.
2657
d17337e5
DA
26582012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2659
2660 New macro to iterate over all buffers, miscellaneous cleanups.
2661 * lisp.h (all_buffers): Remove declaration.
2662 * buffer.h (all_buffers): Add declaration, with comment.
2663 (for_each_buffer): New macro.
2664 * alloc.c (Fgarbage_collect, mark_object): Use it.
2665 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2666 (init_buffer): Likewise.
2667 * data.c (Fset_default): Likewise.
2668 * coding.c (code_conversion_restore): Remove redundant check
2669 for dead buffer.
2670 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2671
60cfd278
AS
26722012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2673
2674 Fix bug that created negative-length intervals.
2675 * intervals.c (merge_interval_right, merge_interval_left):
2676 Do not zero out this interval if it is absorbed by its children,
2677 as this interval's total length doesn't change in that case. See
2678 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2679
d06714cb
PE
26802012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2681
83713154
PE
2682 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2683 when invoking (make-bool-vector N t) and N is a positive
2684 multiple of 8 -- the last 8 bits were mistakenly cleared.
2685
d06714cb
PE
2686 Remove some struct layout assumptions in bool vectors.
2687 * alloc.c (bool_header_size): New constant.
2688 (header_size, word_size): Move earlier, as they're now used earlier.
2689 Use 'word_size' in a few more places, where it's appropriate.
2690 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2691 padding before the data member of a bool vector.
2692 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2693 than doing the check by hand with an abort ().
2694
464d5a5e
SM
26952012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2696
5fbc0409
SM
2697 * eval.c (Fdefvar): Don't check constants since we only set the var if
2698 it's not yet defined anyway (bug#11904).
2699
464d5a5e
SM
2700 * lisp.h (last_undo_boundary): Declare new var.
2701 * keyboard.c (command_loop_1): Set it.
2702 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2703 were auto-added by the command loop (bug#11774).
2704
8dc2e44a
AS
27052012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2706
2707 * w32font.c (Qsymbol): Remove local definition.
2708 (syms_of_w32font): Don't DEFSYM it.
2709
169925ec
DA
27102012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2711
2712 Fix sweep_vectors to handle large bool vectors correctly.
2713 * alloc.c (sweep_vectors): Account total_vector_bytes for
2714 bool vectors larger than VBLOCK_BYTES_MAX.
2715
5fbfb018
CY
27162012-07-18 Chong Yidong <cyd@gnu.org>
2717
2718 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2719 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2720
3ab6e069
DA
27212012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2722
2723 Return more descriptive data from Fgarbage_collect.
2724 Suggested by Stefan Monnier in
2725 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2726 * alloc.c (bounded_number): New function.
2727 (total_buffers, total_vectors): New variable.
2728 (total_string_size): Rename to total_string_bytes, adjust users.
2729 (total_vector_size): Rename to total_vector_bytes, adjust users.
2730 (sweep_vectors): Account total_vectors and total_vector_bytes.
2731 (Fgarbage_collect): New return value. Adjust documentation.
2732 (gc_sweep): Account total_buffers.
2733 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2734 (VECTOR_SIZE): Remove.
2735 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2736 (Qinterval, Qmisc): New symbols.
2737 (syms_of_data): Initialize them.
2738 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2739 (Qcons, Qbuffer): New declarations.
2740
6d02fe5b
PE
27412012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2742
2743 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2744 Round up, not down. Improve doc.
2745
b7ffe040
DA
27462012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2747
2748 Restore old code in allocate_string_data to avoid Faset breakage.
2749 Reported by Julien Danjou <julien@danjou.info> in
2750 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2751 * alloc.c (allocate_string_data): Restore old code with minor
2752 adjustments, fix comment to explain this subtle issue.
2753
4dc7c8d5
SM
27542012-07-17 Eli Zaretskii <eliz@gnu.org>
2755
2756 Remove FILE_SYSTEM_CASE.
2757 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2758
2759 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2760 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2761 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2762 call-process-region passes it through expand-file-name.
2763
2764 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2765
27662012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2767
2768 Fix crash when creating indirect buffer (Bug#11917)
2769 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2770 Don't handle unbound variables specially if non-zero.
2771 (Fbuffer_local_variables): Pass zero.
2772 (clone_per_buffer_values): Pass non-zero.
2773
27742012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2775
2776 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2777 to make the loop interruptible.
2778
27792012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2780
2781 * gnutls.c (emacs_gnutls_handshake): Only retry if
2782 GNUTLS_E_INTERRUPTED.
2783
cce7fefc
DA
27842012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2785
2786 Cleanup and convert miscellaneous checks to eassert.
2787 * alloc.c (mark_interval): Fix comment, partially rephrase
2788 old comment from intervals.h (see below).
2789 * intervals.c (find_interval, adjust_intervals_for_insertion)
2790 (delete_interval, adjust_intervals_for_deletion)
2791 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2792 Convert to eassert.
2793 (adjust_intervals_for_insertion, make_new_interval):
2794 Remove obsolete and unused code.
2795 * intervals.h (struct interval): Remove obsolete comment.
2796 * textprotp.c (erase_properties): Remove unused code.
2797 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2798 (Fremove_list_of_text_properties): Convert to eassert.
2799
9ea10cc3
CY
28002012-07-17 Chong Yidong <cyd@gnu.org>
2801
2802 * editfns.c (Finsert_char): Doc fix.
2803
3900d5de
DA
28042012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2805
2806 Fix previous change to make Fmemory_free always accurate.
2807 * alloc.c (make_interval): Update total_free_intervals.
2808 (make_float): Likewise for total_free_floats.
2809 (free_cons, Fcons): Likewise for total_free_conses.
2810 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2811 Likewise for total_free_vector_bytes.
2812 (Fmake_symbol): Likewise for total_free_symbols.
2813 (bytes_free): Remove.
2814
7098646f
DA
28152012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2816
2817 Simple free memory accounting feature.
2818 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2819 (sweep_vectors): Accumulate size of free vectors.
2820 (Fgarbage_collect): Setup bytes_free.
2821 (Fmemory_free): New function.
2822 (syms_of_alloc): Register it.
2823
22657b40
DA
28242012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2825
2826 Cleanup overlays checking.
2827 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2828 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2829 eassert and OVERLAYP.
2830 (sort_overlays): Change to use OVERLAYP.
2831
ddfc8813
RK
28322012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2833
2834 * editfns.c (Finsert_char): Make it interactive, and make the
2835 second arg optional. Copy interactive spec and docstring from
2836 ucs-insert.
2837
7c26cf3c
PE
28382012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2839
2840 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2841 Unlike the other wrapped functions, fabs has an unspecified
2842 effect on errno.
2843
5d127af9
JD
28442012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2845
2846 * nsterm.m (keyDown): Interpret flags without left/right bits
2847 as the left key (Bug#11670).
2848
6a0dd1d7
DA
28492012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2850
2851 Remove empty and useless init functions.
2852 * lisp.h (init_character_once, init_fns, init_image)
2853 (init_filelock, init_sound): Remove prototype.
2854 * character.c (init_character_once): Remove.
2855 * filelock.c (init_filelock): Likewise.
2856 * fns.c (init_fns): Likewise.
2857 * image.c (init_image): Likewise.
2858 * sound.c (init_sound): Likewise.
2859 * emacs.c (main): Adjust accordingly.
2860
7a6136fd
DA
28612012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2862
2863 * gtkutil.h: Tiny cleanups.
2864 (use_old_gtk_file_dialog): Remove useless declaration.
2865 (xg_uses_old_file_dialog): Add suggested const attribute.
2866
ce811ad9
EZ
28672012-07-15 Eli Zaretskii <eliz@gnu.org>
2868
2869 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2870 (bidi_paragraph_init): Use it to limit search forward for a strong
2871 directional character in abnormally large paragraphs full of
2872 neutral or weak characters. (Bug#11943)
2873
c9adfeaa
SF
28742012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2875
2876 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2877 the toolbar (Bug#9451).
2878 (xg_make_tool_item): Give the widget event box a transparent
2879 background.
2880
fff62aa9
DA
28812012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2882
2883 Cleanup basic allocation variables and functions.
2884 * alloc.c (ignore_warnings, init_intervals, init_float)
2885 (init_cons, init_symbol, init_marker): Remove.
2886 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2887 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2888 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2889 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2890 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2891 (staticidx, init_alloc_once, init_strings, free_ablock):
2892 Remove redundant initialization.
2893 * fns.c (init_weak_hash_tables): Remove.
2894 * lisp.h (init_weak_hash_tables): Remove prototype.
2895
9730daca
DA
28962012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2897
2898 Use zero_vector where appropriate.
2899 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2900 accordingly.
2901 * lisp.h (zero_vector): New declaration.
2902 * font.c (null_vector): Remove.
2903 (syms_of_font): Remove initialization and staticpro.
2904 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2905 * keymap.c (Faccessible_keymaps): Likewise.
2906
2e2d2a13
LL
29072012-07-15 Leo Liu <sdl.web@gmail.com>
2908
2909 * fringe.c: Fix typo in comments.
2910
cd276f6e
LL
29112012-07-14 Leo Liu <sdl.web@gmail.com>
2912
2913 * fringe.c: Add a new bitmap exclamation-mark.
2914
5a1131d9
EZ
29152012-07-14 Eli Zaretskii <eliz@gnu.org>
2916
2917 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2918
2919 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2920 (HAVE_MENUS): Don't define, defined by editing config.in with
2921 msdos/sed2v2.inp.
2922 (GMALLOC_INHIBIT_VALLOC): Don't define.
2923 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2924
22e983b7
JB
29252012-07-14 Juanma Barranquero <lekktu@gmail.com>
2926
2927 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2928
5b3f250f
GM
29292012-07-14 Glenn Morris <rgm@gnu.org>
2930
2931 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2932 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2933 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2934
33d63ff4
GM
29352012-07-13 Glenn Morris <rgm@gnu.org>
2936
5b633342
GM
2937 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2938
33d63ff4
GM
2939 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2940 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2941
b55b9f85
JD
29422012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2943
0dc8cf50
JD
2944 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2945 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2946 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2947 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2948 where appropriate.
2949 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2950 as boolean expression.
2951 (x_set_window_size): Remove unused variable toolbar.
2952 (ns_get_color_default, ns_mod_to_lisp): Remove.
2953 (ns_mouse_position): Remove unused variables xchar and ychar.
2954 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2955 (ns_set_vertical_scroll_bar): Remove unused variable count.
2956 (ns_delete_terminal): Remove unused variable i.
2957 (ns_term_init): Remove unused variables r, g and b.
2958 (mouseDown): Remove unused variable window.
2959 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2960 (initFrameFromEmacs): Remove unused variable vbextra.
2961 (mouseEntered): Remove unused variables p and dpyinfo.
2962 (mouseExited): Remove unused variables p and r.
2963 (ns_define_frame_cursor, ns_clear_frame_area)
2964 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2965 (menuDown): Assign [sender tag] to variable and cast the variable.
2966
2967 * nsterm.h (menuDown): Add id as type to argument sender.
2968 (ns_display_info_for_name): Add Lisp_Object argument.
2969 (ns_term_init): Add Lisp_Object argument.
2970 (ns_map_event_to_object): Add void argument.
2971 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2972 prototype with arguments and only declare if __OBJC__.
2973 (nxatoms_of_nsselect): Add void argument.
2974 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2975 (ns_alloc_autorelease_pool): Add void argument.
2976 (ns_release_autorelease_pool): Add void* argument.
2977 (ns_get_defaults_value): Add const char* argument.
2978
2979 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2980 (initFromContents): Use SSDATA where appropriate.
2981 (ns_update_menubar): Add braces to ambigous if-else.
2982 (initWithTitle): Put () around assignment in if statement.
2983 (ns_menu_show): Remove unused variables window and keymap.
2984 (update_frame_tool_bar): Remove unused variable selected_p.
2985 (initWithContentRect): Remove unused variable this_cmd_name.
2986
2987 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2988 appropriate.
2989 (setXBMColor): Remove unused variable len.
2990 (setPixmapData): Put () around assignment in loop statement.
2991
2992 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2993 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2994 where appropriate.
2995 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2996 around assignment in loop statement.
2997 (nsfont_open): Remove unused variable i.
2998 (nsfont_open): Remove unused variable len.
2999 (nsfont_draw): Remove unused variable cs.
3000
3001 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3002 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3003 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3004 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3005 (Fns_font_name, Fns_perform_service)
3006 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3007 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3008 (ns_set_name): Remove unused variable view.
3009 (x_set_menu_bar_lines): Remove unused variable olines.
3010 (x_set_tool_bar_lines): Remove unused variable root_window.
3011 (Fns_list_colors): Put () around assignment in while statement.
3012 (Fns_perform_service): Remove unused variable len.
3013 (Fns_display_usable_bounds): Remove unused variable top.
3014 (syms_of_nsfns): Remove unused variable i.
3015
b55b9f85
JD
3016 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3017 memcpy (Bug#11907).
3018
ed9265fc 30192012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
3020
3021 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3022 and free it with DestroyExceptionInfo (Bug#11558).
3023
ef099b57
JB
30242012-07-13 Juanma Barranquero <lekktu@gmail.com>
3025
3026 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3027 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3028 Set here, not in nt/config.nt.
3029
ea814a5d
EZ
30302012-07-13 Eli Zaretskii <eliz@gnu.org>
3031
3032 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3033 cursor overflow into the last glyph on display line when the right
3034 fringe is off. (Bug#11832)
3035
1a952767
PE
30362012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3037
3038 * xdisp.c (produce_special_glyphs): Now static.
3039 * dispextern.h (produce_special_glyphs): Remove decl.
3040
983188fd
GM
30412012-07-13 Glenn Morris <rgm@gnu.org>
3042
8d7c7eed 3043 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
3044 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3045
983188fd
GM
3046 * s/usg5-4-common.h (USG, USG5):
3047 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3048 * s/sol2-6.h (SOLARIS2):
3049 * s/irix6-5.h (IRIX6_5):
3050 * s/hpux10-20.h (USG, USG5, HPUX):
3051 * s/gnu-linux.h (USG, GNU_LINUX):
3052 * s/freebsd.h (BSD_SYSTEM):
3053 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3054 * s/cygwin.h (CYGWIN):
3055 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3056 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3057
d1e68667 30582012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
3059
3060 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 3061
6de0e799
GM
30622012-07-13 Glenn Morris <rgm@gnu.org>
3063
739ae010
GM
3064 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3065
dbee5793
GM
3066 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3067
6de0e799
GM
3068 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3069 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3070
b82da769
GM
30712012-07-12 Glenn Morris <rgm@gnu.org>
3072
4fae5a7a 3073 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
3074
3075 * process.c (init_process_emacs): Rename from init_process.
3076 The old name is also the name of a Mach system call.
3077 * lisp.h, emacs.c: Update for this name change.
3078 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3079 longer needed.
3080
5a979817
EZ
30812012-07-12 Eli Zaretskii <eliz@gnu.org>
3082
3083 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3084 memmove call that removes glyphs covered by the left truncation
3085 glyph. Improve commentary.
3086 (display_line): Fix display of continuation glyphs on GUI frames
3087 when the right fringe is turned off and variable-size fonts are
3088 used in the window. Move the code that appends a stretch glyph to
3089 produce_special_glyphs, so that it could be used for truncation
3090 and continuation glyphs alike.
3091 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3092 glyph of a suitably computed width, to align the special glyphs at
3093 the window margin. Code moved from display_line. (Bug#11832)
3094
3e91a053
GM
30952012-07-12 Glenn Morris <rgm@gnu.org>
3096
ba9e4b84
GM
3097 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3098
3099 * s/gnu-linux.h, s/hpux10-20.h:
3100 Do not unconditionally define HAVE_XRMSETDATABASE.
3101
3e91a053
GM
3102 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3103
b300b1f4
PE
31042012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 Fix typos that broke OS X build.
3107 Reported by Randal L. Schwartz in
3108 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3109 * nsterm.m (ns_timeout): Add missing local decl.
3110 (ns_get_color): snprintf -> sprintf, to fix typo.
3111
6e777848
GM
31122012-07-12 Glenn Morris <rgm@gnu.org>
3113
3f922c37
GM
3114 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3115 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3116 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3117 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3118
0ab7b23a
GM
3119 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3120 Move PTY_OPEN to configure.
3121
6e777848
GM
3122 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3123 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3124 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3125
4a7edc24
DA
31262012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3127
3128 Use empty_unibyte_string where applicable.
3129 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3130 * lread.c (read1): Likewise.
3131 * xsettings.c (syms_of_xsettings): Likewise.
3132
308aab79
GM
31332012-07-12 Glenn Morris <rgm@gnu.org>
3134
42bd1719
GM
3135 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3136 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
3137 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3138 * s/hpux10-20.h (RUN_TIME_REMAP):
3139 * s/bsd-common.h (TABDLY): Move to configure.
3140
3141 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3142
3143 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3144
ea0bbd17 3145 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 3146 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
3147
3148 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 3149
308aab79
GM
3150 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3151 * s/template.h: Move NARROWPROTO to configure.
3152
ee1cf5cf
GM
31532012-07-11 Glenn Morris <rgm@gnu.org>
3154
30fe9bf4
GM
3155 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3156 unused since 2011-01-17 change to systty.h.
3157
ee1cf5cf
GM
3158 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3159 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3160 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3161
63e47e07
PE
31622012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3163
3164 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3165
c43fb4c3
GM
31662012-07-11 Glenn Morris <rgm@gnu.org>
3167
3168 * s/darwin.h, s/gnu-linux.h, s/template.h:
3169 Move INTERRUPT_INPUT to configure.
3170
e8df9267
DA
31712012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3172
3173 Minor adjustments to interning code.
3174 * lisp.h (intern, intern_c_string): Redefine as static inline
3175 wrappers for intern_1 and intern_c_string_1, respectively.
3176 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
3177 * lread.c (intern_1, intern_c_string_1, oblookup):
3178 Simplify Vobarray checking.
e8df9267
DA
3179 * font.c (font_intern_prop): Likewise. Adjust comment.
3180 * w32font.c (intern_font_name): Likewise.
3181
34348bd4
AS
31822012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3183
d96a1e0c
AS
3184 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3185
34348bd4
AS
3186 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3187 of Fcar/Fcdr if possible.
3188 * font.c (check_otf_features): Likewise.
3189 * fontset.c (Fnew_fontset): Likewise.
3190 * gnutls.c (Fgnutls_boot): Likewise.
3191 * minibuf.c (read_minibuf): Likewise.
3192 * msdos.c (IT_set_frame_parameters): Likewise.
3193 * xmenu.c (Fx_popup_dialog): Likewise.
3194 * w32menu.c (Fx_popup_dialog): Likewise.
3195
c8add24e
GM
31962012-07-11 Glenn Morris <rgm@gnu.org>
3197
4b575b3c
GM
3198 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3199 since nothing has defined it on these platforms.
3200
09f4e3b0
GM
3201 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3202 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3203
172bedef
GM
3204 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3205 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3206 Move CLASH_DETECTION to configure.
3207
249685df
GM
3208 * s/gnu.h: Remove file, which is now empty.
3209
c8add24e
GM
3210 * s/gnu.h, s/gnu-linux.h:
3211 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3212
b41253a3
JW
32132012-07-11 John Wiegley <johnw@newartisans.com>
3214
3215 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3216 function attribute, so we only use it if it exists in the
3217 compiler.
3218
d923b542
DA
32192012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3220
3221 Avoid call to strlen in fast_c_string_match_ignore_case.
3222 * search.c (fast_c_string_match_ignore_case): Change to use
3223 length argument. Adjust users accordingly.
3224 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3225
5ebbef1d
PE
32262012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3227
bb352260
PE
3228 Assume mkdir, rmdir.
3229 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3230 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3231
57054ddd
PE
3232 Assume rename.
3233 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3234
b747d3f7
PE
3235 Assume perror.
3236 * s/hpux10-20.h (HAVE_PERROR): Remove.
3237 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3238 Remove dummy definition, as this problem was obsolete long ago.
3239
5ebbef1d
PE
3240 Assume strerror.
3241 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3242
984e7f30
DA
32432012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3244
3245 Avoid calls to strlen in font processing functions.
3246 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
3247 (font_open_by_name): Change to use length argument.
3248 Adjust users accordingly.
d923b542
DA
3249 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3250 Adjust prototypes.
3251 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3252 Change to return ptrdiff_t.
984e7f30
DA
3253 (xfont_list_pattern, xfont_match): Use length returned by
3254 xfont_decode_coding_xlfd.
3255 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3256
20e94fdd
GM
32572012-07-11 Glenn Morris <rgm@gnu.org>
3258
9d596af3
GM
3259 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3260 Move DONT_REOPEN_PTY to configure.
3261
20e94fdd
GM
3262 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3263 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3264
e99a530f
PE
32652012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3266
22ffb973
PE
3267 Remove "#define unix" that is no longer needed (Bug#11905).
3268 * s/aix4-2.h (unix): Remove; no longer needed.
3269
e9a9ae03
PE
3270 EMACS_TIME simplification (Bug#11875).
3271 This replaces macros (which typically do not work in GDB)
3272 with functions, typedefs and enums, making the code easier to debug.
3273 The functional style also makes code easier to read and maintain.
3274 * systime.h: Include <sys/time.h> on all hosts, not just if
3275 WINDOWSNT, since 'struct timeval' is needed in general.
3276 (EMACS_TIME): Now a typedef, not a macro.
3277 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3278 not macros.
3279 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3280 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3281 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3282 (EMACS_TIME_LE): Now functions, not macros.
3283 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3284 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3285 which are not functions. All uses rewritten to use:
3286 (make_emacs_time): New function.
3287 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3288 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3289 not functions. All uses rewritten to use the following, respectively:
3290 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3291 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 3292 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
3293 * fileio.c (Fcopy_file):
3294 * xterm.c (XTflash): Get the current time closer to when it's used.
3295 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3296
ffacb126
PE
3297 * bytecode.c (targets): Suppress -Woverride-init warnings.
3298
e99a530f
PE
3299 Simplify by avoiding confusing use of strncpy etc.
3300 * doc.c (Fsnarf_documentation):
3301 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3302 * frame.c (Fmake_terminal_frame):
3303 * gtkutil.c (get_utf8_string):
3304 * lread.c (openp):
3305 * nsmenu.m (ns_update_menubar):
3306 * regex.c (regerror):
3307 Prefer memcpy to strncpy and strncat when either will do.
3308 * fileio.c (Fsubstitute_in_file_name):
3309 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3310 (menu_separator_name_p):
3311 * nsmenu.m (ns_update_menubar):
3312 Prefer memcmp to strncmp when either will do.
3313 * nsterm.m: Include <ftoastr.h>.
3314 (ns_get_color):
3315 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3316 Prefer snprintf to strncpy.
3317 * nsterm.m (ns_term_init):
3318 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3319 * nsterm.m (ns_term_init):
3320 Avoid the need for strncpy, by using build_string or
3321 make_unibyte_string directly. Use dtoastr, not snprintf.
3322 * process.c (Fmake_network_process): Diagnose service names that
3323 are too long, rather than silently truncating them or creating
3324 non-null-terminated names.
3325 (Fnetwork_interface_info): Likewise, for interface names.
3326 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3327 Prefer sprintf to strncat.
3328 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3329 Prefer vsnprintf to vsprintf + strncpy.
3330
c59592b3
GM
33312012-07-10 Glenn Morris <rgm@gnu.org>
3332
3333 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3334 Clarify fallback case.
3335
7d7bbefd
DA
33362012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3337
3338 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3339 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3340 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 3341 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
3342 where argument type is known to be a Lisp_Cons.
3343
3a4c8000
TT
33442012-07-10 Tom Tromey <tromey@redhat.com>
3345
3346 * bytecode.c (BYTE_CODE_THREADED): New macro.
3347 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3348 (enum byte_code_op): New type.
3349 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3350 (exec_byte_code): Use them. Use token threading when applicable.
3351
2a0213a6
DA
33522012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3353
3354 Optimize pure C strings initialization.
3355 * lisp.h (make_pure_string): Fix prototype.
3356 (build_pure_c_string): New function, defined as static inline. This
3357 provides a better opportunity to optimize away calls to strlen when
3358 the function is called with compile-time constant argument.
3359 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3360 argument, adjust users accordingly. Use build_pure_c_string where
3361 appropriate.
3362 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3363 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3364 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3365
cb1caeaf
DA
33662012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3367
3368 Avoid calls to strlen in miscellaneous functions.
3369 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3370 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3371 * lread.c (openp): Likewise.
3372
c293e30c
DA
33732012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3374
3375 Avoid calls to strlen in path processing functions.
3376 * fileio.c (file_name_as_directory): Add comment. Change to add
3377 srclen argument and return the length of result. Adjust users
3378 accordingly.
3379 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
3380 swap 1st and 2nd arguments to obey the common convention.
3381 Adjust users accordingly.
c293e30c
DA
3382 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3383
9e059e3f
GM
33842012-07-10 Glenn Morris <rgm@gnu.org>
3385
d02eb359
GM
3386 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3387 Move PENDING_OUTPUT_COUNT definition to configure.
3388
882cf227
GM
3389 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3390 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3391 * s/gnu.h (DATA_START): Move definitions to configure.
3392
af6e839f
GM
3393 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3394 We include usg5-4-common.h, which defines them both.
3395
40289a12
GM
3396 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3397 O_RDONLY already includes it).
3398
9e059e3f
GM
3399 Stop ns builds setting the EMACSLOADPATH environment variable.
3400 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3401 Now it does not set EMACSLOADPATH, just returns the load-path string.
3402 * nsterm.h: Update accordingly.
3403 * lread.c [HAVE_NS]: Include nsterm.h.
3404 (init_lread) [HAVE_NS]: Use ns_load_path.
3405 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3406
7c4e8ec0
GM
34072012-07-09 Glenn Morris <rgm@gnu.org>
3408
d4f600ff
GM
3409 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3410 since the included bsd-common.h does so.
3411
cbb31951
GM
3412 Stop ns builds setting the EMACSPATH environment variable.
3413 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3414 (ns_init_paths): Do not set EMACSPATH.
3415 * nsterm.h (ns_exec_path): Add it.
3416 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3417 Use ns_exec_path.
3418
7c4e8ec0
GM
3419 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3420
26bccfae
PE
34212012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3422
a0bee46f
PE
3423 * process.c (wait_reading_process_output): 'waitchannels' was unset
3424 when read_kbd || !NILP (wait_for_cell); fix this.
3425
5994c183
PE
3426 Add GCC-style 'const' attribute to functions that can use it.
3427 * character.h (char_resolve_modifier_mask):
3428 * keyboard.h (make_ctrl_char):
3429 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3430 (init_character_once, next_almost_prime, init_fns, init_image)
3431 (flush_pending_output, init_sound):
3432 * mem-limits.h (start_of_data):
3433 * menu.h (finish_menu_items):
3434 Add ATTRIBUTE_CONST.
3435 * emacs.c (DEFINE_DUMMY_FUNCTION):
3436 Declare the dummy function with ATTRIBUTE_CONST.
3437 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3438 Add decls with ATTRIBUTE_CONST.
3439
26bccfae
PE
3440 Minor improvements to make_formatted_string.
3441 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3442 where int is good enough, as vsprintf returns an int.
3443 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3444
a8290ec3
DA
34452012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3446
3447 Use make_formatted_string to avoid double length calculation.
3448 * lisp.h (make_formatted_string): New prototype.
3449 * alloc.c (make_formatted_string): New function.
3450 * buffer.c (Fgenerate_new_buffer_name): Use it.
3451 * dbus.c (syms_of_dbusbind): Likewise.
3452 * editfns.c (Fcurrent_time_zone): Likewise.
3453 * filelock.c (get_boot_time): Likewise.
3454 * frame.c (make_terminal_frame, set_term_frame_name)
3455 (x_report_frame_params): Likewise.
3456 * image.c (gs_load): Likewise.
3457 * minibuf.c (get_minibuffer): Likewise.
3458 * msdos.c (dos_set_window_size): Likewise.
3459 * process.c (make_process): Likewise.
3460 * xdisp.c (ensure_echo_area_buffers): Likewise.
3461 * xsettings.c (apply_xft_settings): Likewise.
3462
d01ba2f1
GM
34632012-07-09 Glenn Morris <rgm@gnu.org>
3464
3465 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3466 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3467 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3468 * nsterm.h (ns_etc_directory): Add it.
3469 * callproc.c [HAVE_NS]: Include nsterm.h.
3470 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3471
f1f924b6
DA
34722012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3473
3474 Move marker debugging code under MARKER_DEBUG.
3475 * marker.c (MARKER_DEBUG): Move marker debugging code under
3476 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3477 for bootstrap with --enable-checking (~3x slowdown reported
3478 by Juanma Barranquero <lekktu@gmail.com>).
3479 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3480
ab531b66
PE
34812012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3482
3483 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3484 See <http://bugs.gnu.org/11825#29>.
3485
c4b3bc8a
EZ
34862012-07-08 Eli Zaretskii <eliz@gnu.org>
3487
3488 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3489 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
3490 (display_line): Add commentary about displaying truncation glyphs
3491 on GUI frames.
3492 (produce_special_glyphs): Move here from term.c.
3493
3494 * term.c (produce_special_glyphs): Move to xdisp.c.
3495
3496 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3497 section.
c4b3bc8a 3498
b676b881
AS
34992012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3500
f17c5273
AS
3501 * xdisp.c (display_line): Avoid warning about implicit declaration
3502 of FRAME_FONT.
3503
298819b9
AS
3504 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3505
b676b881
AS
3506 * lisp.h: Remove empty conditional.
3507
6045c4fd
PE
35082012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3509
b3350bf9
PE
3510 * lread.c (load_path_check): Now static.
3511
6045c4fd
PE
3512 Fix some minor --with-ns problems found by static checking.
3513 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3514 (x_set_font) [!HAVE_X_WINDOWS]:
3515 * image.c (xpm_load_image) [HAVE_NS]:
3516 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3517 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3518 Remove unused local.
3519 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3520 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3521 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3522 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3523 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3524 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3525 Fix pointer signedness problem.
3526 * xfaces.c (FRAME_X_FONT_TABLE):
3527 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3528
929e7845
GM
35292012-07-07 Glenn Morris <rgm@gnu.org>
3530
3531 * lread.c (load_path_check): New function, split from init_lread.
3532 (init_lread): Reorganize. Motivation:
3533 If EMACSLOADPATH is set, check/warn about that rather than the
3534 defaults, which we are not going to use. Hence we can remove
3535 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3536 Don't warn if site-lisp directories are missing.
3537 If not installed, start from a blank load-path, since
3538 PATH_LOADSEARCH refers to the eventual installation directories.
3539
58dd0aa4
EZ
35402012-07-07 Eli Zaretskii <eliz@gnu.org>
3541
3542 Support truncation and continuation glyphs on GUI frames, when
3543 fringes are disabled. (Bug#11832)
3544 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
3545 continuation glyphs even if on GUI frames.
3546 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
3547 or both, are absent.
3548 (start_display, move_it_in_display_line_to): Handle the case of a
3549 GUI frame without a fringe to display continuation or truncation
3550 glyphs.
3551 (insert_left_trunc_glyphs): Support GUI frames: make sure
3552 truncation glyphs overwrite enough glyphs from the current line to
3553 have sufficient space in pixels.
3554 (display_line): Support truncation and continuation glyphs on GUI
3555 frames. If some spare pixels are left on the line after inserting
3556 the truncation glyphs, fill that space with a stretch glyph of a
3557 suitably computed width.
3558
3559 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3560 produce_glyphs, to support GUI sessions.
3561
31571fd7
PE
35622012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3563
5a16b9bc
PE
3564 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3565
f3047c75
PE
3566 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3567
31571fd7
PE
3568 Do not require float-time's arg to fit in time_t (Bug#11825).
3569 This works better on hosts where time_t is unsigned, and where
3570 float-time is applied to the (negative) difference between two times.
3571 * editfns.c (decode_time_components): Last arg is now double *,
3572 not int *, and means to store all the result as a double, without
3573 worrying about whether the seconds part fits in time_t.
3574 All callers changed.
3575 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3576 All callers changed.
3577 (Ffloat_time): Do not fail merely because the specified time falls
3578 outside of time_t range.
3579
4516fbef
GM
35802012-07-07 Glenn Morris <rgm@gnu.org>
3581
3582 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3583 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3584 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3585
07adc2c6
JB
35862012-07-07 Juanma Barranquero <lekktu@gmail.com>
3587
3588 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3589 Update dependencies.
3590
3591 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3592
fd573f31
PE
35932012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3594
fee5959d
PE
3595 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3596 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3597 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3598 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3599 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3600 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3601
fd573f31
PE
3602 * xfont.c (compare_font_names): Redo to omit the need for casts.
3603
ddadbc0e
AS
36042012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3605
fca8d6b6
AS
3606 * xfns.c (Fx_change_window_property): Doc fix.
3607 * w32fns.c (Fx_change_window_property): Doc fix.
3608
ddadbc0e
AS
3609 * w32fns.c (Fx_window_property): Accept the same arguments as the
3610 X Windows version. Doc fix.
3611 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3612
ed9265fc 36132012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
3614 Eli Zaretskii <eliz@gnu.org>
3615
3616 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3617 Windows-specific code from nt/config.nt moved here.
3618 Obsolete settings removed.
3619
216ee680
PE
36202012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3621
3622 * process.c: Avoid unnecessary calls to gettime.
3623 (wait_reading_process_output): Don't get the time of day
3624 when gobbling data immediately and not waiting, as there's no need
3625 for it in that case. This removes a FIXME.
3626
bdd091e4
JD
36272012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3628
3629 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3630 is defined (Bug#11768).
3631
9d44f8ce
DA
36322012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3633
3634 Fix marker debugging code.
3635 * marker.c (byte_char_debug_check): Do not perform the check
3636 if buffer is not multibyte.
090bd7cb
JB
3637 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3638 Call byte_char_debug_check with correct arguments.
9d44f8ce 3639
90fc4786
DA
36402012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3641
3642 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
3643 * marker.c (byte_char_debug_check, count_markers):
3644 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
3645 (byte_debug_flag): Remove.
3646 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3647 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3648
7b7ae965
DA
36492012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3650
4e57b342
DA
3651 Avoid code repetition in marker-related functions.
3652 * marker.c (attach_marker): New function.
3653 (Fset_marker, set_marker_restricted, set_marker_both)
3654 (set_marker_restricted_both): Use it.
3655 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3656 Consistently rename charno to charpos.
3657 (marker_position): Add eassert.
3658 (marker_byte_position): Convert to eassert.
3659
36602012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3661
3662 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 3663 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 3664 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 3665
657924ff
DA
36662012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3667
3668 Introduce fast path for the widely used marker operation.
3669 * alloc.c (build_marker): New function.
3670 * lisp.h (build_marker): New prototype.
3671 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3672 * composite.c (autocmp_chars): Likewise.
3673 * editfns.c (buildmark): Remove.
3674 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3675 (save_restriction_save): Use build_marker.
3676 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3677 * window.c (save_window_save): Likewise.
3678
041a49a6
DA
36792012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3680
3681 Do not use Fdelete_overlay in delete_all_overlays
3682 to avoid redundant calls to unchain_overlay.
3683 * buffer.c (drop_overlay): New function.
3684 (delete_all_overlays, Fdelete_overlay): Use it.
3685 * minibuf.c (get_minibuffer): Fix comment.
3686
7dca65a4
PE
36872012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3688
3689 Port to OpenBSD 5.1 amd64.
3690 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3691 This is needed for OpenBSD, and should be harmless on all BSD systems.
3692 Also, include <sys/sysctl.h>, as it should be available on all
3693 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3694 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3695 use p_pid member, not kp_proc.pid.
3696
8eb876e2
GM
36972012-07-06 Glenn Morris <rgm@gnu.org>
3698
3699 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3700
38182d90
PE
37012012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3702
3703 More xmalloc and related cleanup.
3704 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3705 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3706 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3707 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3708 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3709 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3710 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3711 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3712 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3713 * xterm.c:
3714 Omit needless casts involving void * pointers and allocation.
3715 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3716 as the former is more robust if P's type is changed.
3717 Prefer xzalloc to xmalloc + memset 0.
3718 Simplify malloc-or-realloc to realloc.
3719 Don't worry about xmalloc returning a null pointer.
3720 Prefer xstrdup to xmalloc + strcpy.
3721 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3722 growing it.
3723 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3724 alloca of a constant.
3725
6dd5a677
EZ
37262012-07-05 Eli Zaretskii <eliz@gnu.org>
3727
3728 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3729 hscroll is larger than the line width. Fixes long and futile
3730 looping inside extend_face_to_end_of_line (on a TTY) producing
3731 glyphs that are not needed and thrown away.
3732
6b312f0f
DA
37332012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3734
3735 * marker.c (set_marker_restricted_both): Simplify by using
3736 clip_to_bounds.
3737
f520ef9b
PE
37382012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3739
3740 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3741
383b7c95
JD
37422012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3743
3744 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3745 not defined (Bug#11768).
3746 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3747 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3748 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3749 followed by gtk_box_set_homogeneous (Bug#11768).
3750 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
3751 (update_theme_scrollbar_width, xg_create_scroll_bar):
3752 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
3753 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3754 (is_box_type): New function (Bug#11768).
3755 (xg_tool_item_stale_p): Call is_box_type.
5293d758 3756 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
3757 with default display (Bug#11768).
3758
d6e7bf45
EZ
37592012-07-05 Eli Zaretskii <eliz@gnu.org>
3760
3761 * xdisp.c (window_hscroll_limited): New function.
3762 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3763 coordinates when window's hscroll is set to insanely large
3764 values. (Bug#11857)
3765
431391ec
JB
37662012-07-05 Juanma Barranquero <lekktu@gmail.com>
3767
3768 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3769 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3770
23f86fce
DA
37712012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3772
3773 Cleanup xmalloc.
3774 * lisp.h (xzalloc): New prototype. Omit needless casts.
3775 * alloc.c (xzalloc): New function. Omit needless casts.
3776 * charset.c: Omit needless casts. Convert all calls to
3777 xmalloc with following memset to xzalloc.
3778 * dispnew.c: Likewise.
3779 * fringe.c: Likewise.
3780 * image.c: Likewise.
3781 * sound.c: Likewise.
3782 * term.c: Likewise.
3783 * w32fns.c: Likewise.
3784 * w32font.c: Likewise.
3785 * w32term.c: Likewise.
3786 * xfaces.c: Likewise.
3787 * xfns.c: Likewise.
3788 * xterm.c: Likewise.
3789 * atimer.c: Omit needless casts.
3790 * buffer.c: Likewise.
3791 * callproc.c: Likewise.
3792 * ccl.c: Likewise.
3793 * coding.c: Likewise.
3794 * composite.c: Likewise.
3795 * doc.c: Likewise.
3796 * doprnt.c: Likewise.
3797 * editfns.c: Likewise.
3798 * emacs.c: Likewise.
3799 * eval.c: Likewise.
3800 * filelock.c: Likewise.
3801 * fns.c: Likewise.
3802 * gtkutil.c: Likewise.
3803 * keyboard.c: Likewise.
3804 * lisp.h: Likewise.
3805 * lread.c: Likewise.
3806 * minibuf.c: Likewise.
3807 * msdos.c: Likewise.
3808 * print.c: Likewise.
3809 * process.c: Likewise.
3810 * region-cache.c: Likewise.
3811 * search.c: Likewise.
3812 * sysdep.c: Likewise.
3813 * termcap.c: Likewise.
3814 * terminal.c: Likewise.
3815 * tparam.c: Likewise.
3816 * w16select.c: Likewise.
3817 * w32.c: Likewise.
3818 * w32reg.c: Likewise.
3819 * w32select.c: Likewise.
3820 * w32uniscribe.c: Likewise.
3821 * widget.c: Likewise.
3822 * xdisp.c: Likewise.
3823 * xmenu.c: Likewise.
3824 * xrdb.c: Likewise.
3825 * xselect.c: Likewise.
3826
0497dc44
PE
38272012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3828
3829 * fileio.c (time_error_value): Check the right error number.
3830 Problem reported by Troels Nielsen in
3831 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3832
356e7178
PE
38332012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3834
4e71fd89
PE
3835 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3836 This should be fixed in a better way; see Eli Zaretskii in
3837 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3838 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3839
f0941253
PE
3840 * fileio.c (time_error_value): Rename from special_mtime.
3841 The old name's problems were noted by Eli Zaretskii in
3842 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3843
065c9eb4
PE
3844 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3845 This variable's comment says Emacs needs at least one GDB-visible
3846 symbol of type enum pvec_type, to work around GDB problems.
3847 The symbol's value doesn't matter.
3848
356e7178
PE
3849 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3850 that causes compilation to fail on pre-C99 compilers.
3851
ed9265fc 38522012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
3853
3854 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3855 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3856
3884d954
DA
38572012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3858
d209e2fb 3859 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
3860 headers for buffer_defaults and buffer_local_symbols.
3861 Reported by Juanma Barranquero <lekktu@gmail.com>.
3862
ee28be33
SM
38632012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3864
3865 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3866 * lisp.h (enum pvec_type): Use fewer bits.
3867 (PSEUDOVECTOR_SIZE_BITS): New constant.
3868 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3869 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3870 change in pvec_type.
3871 (PSEUDOVECTOR_TYPEP): New macro.
3872 (TYPED_PSEUDOVECTORP): Use it.
3873 * fns.c (internal_equal): Adapt code to extract pvectype.
3874 * emacs.c (gdb_pvec_type): Update type.
3875 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3876 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3877 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3878 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3879 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3880 abusing vector->header.next.nbytes.
3881 (live_vector_p): Use PVEC_TYPE.
3882 (mark_object): Adapt code to extract pvectype. Use switch.
3883
c7f2cd7f
PE
38842012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3885
3886 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3887 Tighten new eassert a bit.
3888
8ce70ed2
DA
38892012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3890
3891 Fix compilation with --enable-gcc-warnings and -O1
3892 optimization level.
3893 * doprnt.c (doprnt): Change type of tem to int, initialize
3894 to avoid compiler warning. Add eassert.
3895 * search.c (simple_search): Initialize match_byte to avoid
3896 compiler warning. Add eassert.
3897
dea7f1e5
PE
38982012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3899
24a212eb
PE
3900 Avoid weird behavior with large horizontal scrolls.
3901 Without this change, for example, large hscroll values would
3902 mess up Emacs's display on Fedora 15 x86, presumably due to
3903 overflows in int calculations in the display code.
3904 Also, if buffers had long lines, Emacs would freeze.
3905 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3906 (set_window_hscroll): New function, containing the old guts of
3907 Fset_window_hscroll. Return the clipped value.
3908 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3909 This avoids the need to check against PTRDIFF_MAX.
3910
dea7f1e5
PE
3911 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3912
76046526
DA
39132012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3914
3915 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3916
39adff0d
PE
39172012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3918
63807d47
PE
3919 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3920 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3921 since GCC 4.4.6 issues a bogus warning for them.
3922
39adff0d
PE
3923 Fix bugs in file timestamp newness comparisons.
3924 * fileio.c (Ffile_newer_than_file_p):
3925 * lread.c (Fload): Use full timestamp resolution of files,
3926 not just the 1-second resolution, so that files that are only
3927 slightly newer still count as newer.
3928 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3929 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3930
dbeed9a6
PE
39312012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3932
3933 * fileio.c: Improve handling of file time marker. (Bug#11852)
3934 (special_mtime): New function.
3935 (Finsert_file_contents, Fverify_visited_file_modtime):
3936 Use it to set special mtime values consistently.
3937
636334d6
AS
39382012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3939
3940 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3941 marker for non-existing file. (Bug#11852)
3942
e2017fe2
GM
39432012-07-03 Glenn Morris <rgm@gnu.org>
3944
3945 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3946 and did not make it into globals.h).
3947
404dbd37
TT
39482012-07-03 Tom Tromey <tromey@redhat.com>
3949
3950 * window.c (Fset_window_margins, Fset_window_fringes)
3951 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3952 * textprop.c (Fprevious_property_change): No longer static.
3953 * syntax.c (Fsyntax_table_p): No longer static.
3954 * process.c (Fget_process, Fprocess_datagram_address): No longer
3955 static.
3956 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3957 * keyboard.c (Fcommand_execute): No longer static.
3958 Remove EXFUN.
3959 * insdel.c (Fcombine_after_change_execute): No longer static.
3960 * image.c (Finit_image_library): No longer static.
3961 * fileio.c (Fmake_symbolic_link): No longer static.
3962 * eval.c (Ffetch_bytecode): No longer static.
3963 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
3964 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3965 No longer static.
404dbd37
TT
3966 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3967 static.
3968 * dired.c (Ffile_attributes): No longer static.
3969 * composite.c (Fcomposition_get_gstring): No longer static.
3970 * callproc.c (Fgetenv_internal): No longer static.
3971
3972 * ccl.h: Remove EXFUNs.
3973 * buffer.h: Remove EXFUNs.
3974 * dispextern.h: Remove EXFUNs.
3975 * intervals.h: Remove EXFUNs.
3976 * fontset.h: Remove EXFUN.
3977 * font.h: Remove EXFUNs.
3978 * dosfns.c (system_process_attributes): Remove EXFUN.
3979 * keymap.h: Remove EXFUNs.
3980 * lisp.h: Remove EXFUNs.
3981 * w32term.h: Remove EXFUNs.
3982 * window.h: Remove EXFUNs.
3983 * xsettings.h: Remove EXFUN.
3984 * xterm.h: Remove EXFUN.
3985
8e4fd1e1
GM
39862012-07-03 Glenn Morris <rgm@gnu.org>
3987
3988 * lisp.h (Frandom): Make it visible to C.
3989 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3990 buffer for invisible buffers. (Bug#1229)
3991
ca95b3eb
DA
39922012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3993
3994 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3995 values which aren't power of 2.
14ae4239
BT
3996 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3997 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
3998 accordingly.
3999
7555c33f
SM
40002012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4001
4002 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4003
4004 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4005
d12e8f5a
DA
40062012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4007
4008 * alloc.c (allocate_vector_block): Remove redundant
4009 calls to mallopt if DOUG_LEA_MALLOC is defined.
4010 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4011 avoid calls to mallopt if zero_vector is returned.
4012
296094c3
DA
40132012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4014
4015 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4016 is enabled, avoid dereferencing NULL current_sblock if
4017 running undumped.
4018
36429c89
DA
40192012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4020
4021 Cleanup basic buffer management.
4022 * buffer.h (struct buffer): Change layout to use generic vector
4023 marking code. Fix some comments. Change type of 'clip_changed'
4024 to bitfield. Remove unused #ifndef old.
4025 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4026 (GET_OVERLAYS_AT): Fix indentation.
4027 (for_each_per_buffer_object_at): New macro.
4028 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4029 (Fbuffer_local_variables): Use it.
4030 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4031 * alloc.c (allocate_buffer): Adjust to match new layout of
4032 struct buffer. Fix comment.
4033 (mark_overlay): New function.
4034 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4035 Lisp area of struct buffer.
4036 (mark_object): Use it. Adjust marking of misc objects
4037 and related comments.
4038
3b3e4cac
PE
40392012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4040
4041 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4042 wrapper that is not needed because the wrapped code is a no-op (zero
4043 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4044 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4045
cf5c0175
DA
40462012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4047
4048 * alloc.c (mark_buffer): Simplify. Remove prototype.
4049 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 4050 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
4051 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4052 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 4053
ca26824c
GM
40542012-06-30 Glenn Morris <rgm@gnu.org>
4055
2e4c5312
GM
4056 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4057
ca26824c
GM
4058 * epaths.in (PATH_SITELOADSEARCH): New.
4059 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4060 This is rather than relying on --enable-locallisppath elements
4061 having "site-lisp" in their names. (Bug#10208#25, 11658)
4062
0d23c240
EZ
40632012-06-30 Eli Zaretskii <eliz@gnu.org>
4064
c9240d7a
EZ
4065 * w32proc.c (sys_select): Accept and ignore one more argument.
4066
4067 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4068
0d23c240 4069 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 4070 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
4071
4072 * sysdep.c: Don't include dos.h and dosfns.h.
4073
4074 * process.c (sys_select):
4075 * msdos.c (sys_select): Accept one more argument and ignore it.
4076
4077 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4078 adapt data types and code to that.
4079
4080 * dosfns.c:
4081 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4082 which clashes with the gnulib function of the same name.
4083
af5a5a98
AS
40842012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4085
c5e4379c
AS
4086 * font.c (font_style_to_value, font_style_symbolic)
4087 (font_prop_validate_style): Add type checks for values in
4088 font_style_table.
4089
af5a5a98
AS
4090 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4091 argument.
4092 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4093 uses.
4094
8d38f461
EZ
40952012-06-29 Eli Zaretskii <eliz@gnu.org>
4096
2e5a6631
EZ
4097 * xdisp.c (try_window_id): Undo last change.
4098
8d38f461
EZ
4099 * w32.c (getwd): Adjust commentary about startup_dir.
4100 (init_environment): Always call sys_access, even in non-MSVC
4101 builds. Don't chdir to the directory of the Emacs executable.
4102 This undoes code from 1997 which was justified by the need to
4103 "avoid conflicts when removing and renaming directories". But its
4104 downside was that every relative file name was being interpreted
4105 relative to the directory of the Emacs executable, which can never
4106 be TRT. In particular, it broke sys_access when called with
4107 relative file names.
4108 (sys_access): Map GetLastError to errno.
4109
2af3565e
DA
41102012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4111
4112 * window.h (struct window): Change type of 'fringes_outside_margins'
4113 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 4114 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
4115 Adjust comment.
4116 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4117 to ptrdiff_t.
4118
c8d3a25c 41192012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 4120
c8d3a25c
GM
4121 * gnutls.c (emacs_gnutls_handshake):
4122 Add QUIT to make the loop interruptible.
57570cd3 4123
c8d3a25c 41242012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 4125
c8d3a25c
GM
4126 * charset.c (init_charset): Make lack of etc/charsets fatal.
4127
3e984ee8
DA
41282012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4129
4130 * editfns.c (region_limit): Fix type mismatch.
4131
ef884f23
DA
41322012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4133
4134 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4135 undefined. Convert from xassert to eassert.
4136 * nsmenu.m: Convert from xassert to eassert.
4137 * nsterm.m: Likewise.
4138
7d7e0027
SM
41392012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4140
4141 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4142
aa754e6a
PE
41432012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4144
4145 Avoid integer overflow on scroll-left and scroll-right.
4146 * window.c (HSCROLL_MAX): New macro.
4147 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4148 overflow when requested scroll falls outside ptrdiff_t range.
4149
80b00b08
DA
41502012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4151
4152 * window.h (struct window): Change type of 'hscroll',
4153 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4154 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4155 Adjust users accordingly.
4156 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4157 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4158 from EMACS_INT to ptrdiff_t.
4159 (make_window): Omit redundant initialization.
4160
62b2bcf6
JB
41612012-06-28 Juanma Barranquero <lekktu@gmail.com>
4162
4163 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4164
45942c7d
DA
41652012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4166
4167 * window.h (struct window): Change type of 'use_time' and
4168 'sequence_number' from Lisp_Object to int.
4169 * frame.c (make_frame): Adjust users accordingly.
4170 * print.c (print_object): Likewise.
4171 * window.c (select_window, Fwindow_use_time, make_parent_window)
4172 (make_window): Likewise.
4173
e509cfa6
DA
41742012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4175
4176 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4177 enabled with --enable-checking=[all,glyphs] configure option.
4178 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4179 adjust comments accordingly.
4180 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4181 undefined, adjust comments accordingly.
4182 * image.c: Likewise.
4183 * scroll.c: Likewise.
4184 * w32fns.c: Likewise.
4185 * w32term.c: Likewise.
4186 * xdisp.c: Likewise.
4187 * xfaces.c: Likewise.
4188 * xfns.c: Likewise.
4189 * xterm.c: Likewise.
4190
a54e2c05
DA
41912012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 Generalize run-time debugging checks.
4194 * dispextern.h (XASSERTS): Remove.
4195 * fontset.c (xassert): Remove.
4196 Convert from xassert to eassert.
4197 * alloc.c: Convert from xassert to eassert.
4198 * bidi.c: Likewise.
4199 * dispnew.c: Likewise.
4200 * fns.c: Likewise.
4201 * fringe.c: Likewise.
4202 * ftfont.c: Likewise.
4203 * gtkutil.c: Likewise.
4204 * image.c: Likewise.
4205 * keyboard.c: Likewise.
4206 * menu.c: Likewise.
4207 * process.c: Likewise.
4208 * scroll.c: Likewise.
4209 * sound.c: Likewise.
4210 * term.c: Likewise.
4211 * w32console.c: Likewise.
4212 * w32fns.c: Likewise.
4213 * w32term.c: Likewise.
4214 * window.c: Likewise.
4215 * xdisp.c: Likewise.
4216 * xfaces.c: Likewise.
4217 * xfns.c: Likewise.
4218 * xselect.c: Likewise.
4219 * xterm.c: Likewise.
4220
1ec4b7b2
SM
42212012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4222
4223 * fns.c (maybe_resize_hash_table): Output message when growing the
4224 purify-hashtable.
4225
2014308a
DA
42262012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4227
4228 * alloc.c (allocate_string_data): Remove dead code.
4229 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4230 avoid GCC warning about unused macro.
4231
246155eb
DA
42322012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4233
4234 * alloc.c (allocate_string): Omit intervals initialization.
4235 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4236 as in make_pure_string and make_pure_c_string.
4237
43184b7b
DA
42382012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4239
d209e2fb 4240 * alloc.c (allocate_string): Fix last change.
43184b7b 4241
3fe6dd74
DA
42422012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4243
d209e2fb 4244 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
4245 to memset, add explicit initialization where appropriate.
4246
1ba6038a
GM
42472012-06-27 Glenn Morris <rgm@gnu.org>
4248
4249 * lisp.mk (lisp): Remove paths.elc.
4250
c89926a5
CY
42512012-06-27 Chong Yidong <cyd@gnu.org>
4252
4253 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4254
ed6b3510
JW
42552012-06-26 John Wiegley <johnw@newartisans.com>
4256
1ec4b7b2 4257 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
4258 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4259
ed6b3510
JW
4260 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4261 when building with Clang.
4262
8edd4a2b
SM
42632012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4264
4265 * eval.c (Fapply): Allow calling it with a single argument.
4266
f6f62d1b
EZ
42672012-06-26 Eli Zaretskii <eliz@gnu.org>
4268
4269 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4270 _stricmp and _strnicmp.
4271 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4272
62efea5e
DA
42732012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4274
4275 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4276 allocated window.
4277 (allocate_process): Likewise for new process.
8edd4a2b 4278 (allocate_terminal): Change to use offsetof.
62efea5e
DA
4279 (allocate_frame): Likewise.
4280 * frame.c (make_frame): Omit redundant initialization.
4281 * window.c (make_parent_window): Use memset.
4282 (make_window): Omit redundant initialization.
4283 * process.c (make_process): Omit redundant initialization.
4284 * terminal.c (create_terminal): Likewise.
4285
42997f4d
DA
42862012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4287
4288 * term.c (delete_tty): Remove redundant call to memset.
4289
1130ecfc
DA
42902012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4291
4292 * alloc.c: Remove build_string.
4293 * lisp.h: Define build_string as static inline. This provides
4294 a better opportunity to optimize away calls to strlen when the
4295 function is called with compile-time constant argument.
4296 * image.c (imagemagick_error): Convert to build_string.
4297 * w32proc.c (sys_spawnve): Likewise.
4298 * xterm.c (x_term_init): Likewise.
4299
cf38a720
PE
43002012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4301
99027bdd
PE
4302 Use sprintf return value instead of invoking strlen on result.
4303 In the old days this wasn't portable, since some sprintf
4304 implementations returned char *. But they died out years ago and
4305 Emacs already assumes sprintf returns int.
4306 Similarly for float_to_string.
4307 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4308 * ccl.c (ccl_driver):
4309 * character.c (string_escape_byte8):
4310 * data.c (Fnumber_to_string):
4311 * doprnt.c (doprnt):
4312 * print.c (print_object):
4313 * xdisp.c (message_dolog):
4314 * xfns.c (syms_of_xfns):
4315 Use sprintf or float_to_string result to avoid need to call strlen.
4316 * data.c (Fnumber_to_string):
4317 Use make_unibyte_string, since the string must be ASCII.
4318 * lisp.h, print.c (float_to_string): Now returns int length.
4319 * term.c (produce_glyphless_glyph):
4320 Use sprintf result rather than recomputing it.
4321
cf38a720
PE
4322 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4323 * Makefile.in (ALL_CFLAGS):
4324 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4325 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4326
3511c784
DA
43272012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4328
0a08eb21 4329 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
4330 strcasecmp if available.
4331 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4332
fb7da12e
AS
43332012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4334
4335 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4336 Avoid comma operator.
4337 * menu.c (push_submenu_start, push_submenu_end)
4338 (push_left_right_boundary, push_menu_pane): Likewise.
4339 * msdos.c (dos_rawgetc): Likewise.
4340
afa2ffd8
DA
43412012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4342
4343 * xfns.c (xic_create_fontsetname): Remove redundant calls
4344 to memset.
4345
b3b4476b
PE
43462012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4347
4495ff38
PE
4348 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4349 sprintf already null-terminates its output.
4350
b3b4476b
PE
4351 * xfns.c (x_window): Remove redundant cast.
4352
b00876c9
DA
43532012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4354
4355 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4356 `const char *' to `char *' to avoid compiler warning.
4357
d188e26b
PE
43582012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4359
885d1d74
PE
4360 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4361 instead of truncating it to 63 (admittedly a generous limit).
4362
d188e26b
PE
4363 * process.c: Fix spelling and caps in comments.
4364
e2f560b1
DN
43652012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4366
e86db54b 4367 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
4368 * sysdep.c (setpgrp): Remove definition, not used in this file.
4369
7583a3a1
JB
43702012-06-24 Juanma Barranquero <lekktu@gmail.com>
4371
4372 * makefile.w32-in: Update dependencies.
4373
696056c2
EZ
43742012-06-24 Eli Zaretskii <eliz@gnu.org>
4375
4376 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4377 (SYSTIME_H): Add nt/inc/sys/time.h.
4378
4379 * systime.h [WINDOWSNT]: Include sys/time.h.
4380
4381 * s/ms-w32.h (struct timespec): Definition moved from
4382 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4383
845ca893
PE
43842012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4385
4386 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4387 * buffer.h (buffer_slot_type_mismatch):
4388 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4389 * eval.c (unwind_to_catch):
4390 * image.c (my_png_error, my_error_exit):
4391 * keyboard.c (quit_throw_to_read_char, user_error)
4392 (Fexit_recursive_edit, Fabort_recursive_edit):
4393 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4394 (wrong_type_argument, buffer_overflow, __executable_start)
4395 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4396 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4397 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4398 (fatal):
4399 (child_setup) [!DOS_NT]:
4400 * lread.c (end_of_file_error, invalid_syntax):
4401 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4402 * puresize.h (pure_write_error):
4403 * search.c (matcher_overflow):
4404 * sound.c (sound_perror, alsa_sound_perror):
4405 * sysdep.c, syssignal.h (croak):
4406 * term.c (maybe_fatal, vfatal):
4407 * textprop.c (text_read_only):
4408 * undo.c (user_error):
4409 * unexmacosx.c (unexec_error):
4410 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4411 Use _Noreturn rather than NO_RETURN.
4412 No need for separate decl merely because of _Noreturn.
4413 * sound.c (sound_warning, parse_sound):
4414 Remove unnecessary forward decls.
4415
f1dd8073
PE
44162012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4417
4418 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4419 * lisp.h (WAIT_READING_MAX): New macro.
4420 * dispnew.c (Fsleep_for, sit_for):
4421 * keyboard.c (kbd_buffer_get_event):
4422 * process.c (Faccept_process_output):
4423 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4424 This improves on the previous patch, which introduced a bug
4425 when time_t is unsigned and as wide as intmax_t.
4426 See <http://bugs.gnu.org/9000#51>.
4427
b82c1755
EZ
44282012-06-23 Eli Zaretskii <eliz@gnu.org>
4429
4430 * dispnew.c (sit_for, Fsleep_for):
4431 * keyboard.c (kbd_buffer_get_event):
4432 * process.c (Faccept_process_output): Avoid compiler warnings when
4433 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4434
ca300656
JB
44352012-06-23 Juanma Barranquero <lekktu@gmail.com>
4436
049ec95b
JB
4437 * makefile.w32-in: Update dependencies.
4438
ca300656
JB
4439 * w32.c (ltime): Add return type and declare static.
4440 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4441
db7b8d06
PE
44422012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4443
4444 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4445 Privately reported by Herbert J. Skuhra.
4446 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4447 All uses changed.
4448 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4449 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4450
0bd8297f
EZ
44512012-06-23 Eli Zaretskii <eliz@gnu.org>
4452
96512555
EZ
4453 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4454 last argument of make_unibyte_string.
4455
0bd8297f
EZ
4456 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4457 language ID in the event parameters.
4458
4459 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4460 event.code, not the obscure "character set ID".
4461
63def6b6
CY
44622012-06-23 Chong Yidong <cyd@gnu.org>
4463
4464 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4465
e8a02204
EZ
44662012-06-23 Eli Zaretskii <eliz@gnu.org>
4467
388cdec0
EZ
4468 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4469 * w32.c (fdutimens): New function.
4470
4471 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4472
4473 * s/ms-w32.h (pselect): Redirect to sys_select.
4474
4475 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4476
e8a02204
EZ
4477 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4478 in the logic of incrementing and decrementing the value of
4479 use_relocatable_buffers.
4480
d054f3fb
PE
44812012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4482
4483 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4484 Privately reported by Herbert J. Skuhra.
4485 [__FreeBSD__]: Remove "*/" typo after "#include".
4486 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4487 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4488 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4489 Don't assume EMACS_TIME and struct timeval are the same type.
4490
d35af63c
PE
44912012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4492
4493 Support higher-resolution time stamps (Bug#9000).
4494 The time stamps are only nanosecond-resolution at the C level,
4495 since that's the best that any real-world system supports now.
4496 But they are picosecond-resolution at the Lisp level, as that's
4497 easy, and leaves room for future OS improvements.
4498
4499 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4500 (LIBES): Use it.
4501
4502 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4503 Don't get current time unless it's needed.
4504
4505 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4506 now provides it if it's absent.
4507 (start_atimer): Port to higher-res time stamps.
4508 Check for time stamp overflow. Don't get current time more
4509 often than is needed.
4510
4511 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4512 Include systime.h, not time.h.
4513 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4514
4515 * dired.c: Include stat-time.h.
4516 (Ffile-attributes): File times now have higher resolution.
4517
4518 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4519 (struct image): Timestamp now has higher resolution.
4520
4521 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4522 has at least microseconds now. All uses removed.
4523 (update_frame, update_single_window, update_window, update_frame_1)
4524 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 4525 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
4526
4527 * editfns.c (time_overflow): Now extern.
4528 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4529 (float-time, Fformat_time_string, Fcurrent_time_string)
4530 (Fcurrent_time_zone): Accept and generate higher-resolution
4531 time stamps.
4532 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4533 (decode_time_components, lisp_seconds_argument): New functions.
4534 (make_time): Now static.
4535 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4536 Report an error if the time is invalid, rather than having the caller
4537 do that.
4538
4539 * fileio.c: Include <stat-time.h>
4540 (Fcopy_file): Copy higher-resolution time stamps.
4541 Prefer to set the time stamp via a file descriptor if that works.
4542 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4543 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4544 (Fvisited_file_modtime, Fset_visited_file_modtime):
4545 Support higher-resolution time stamps.
4546
4547 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4548
4549 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4550
4551 * image.c (prepare_image_for_display, clear_image_cache)
4552 (lookup_image): Port to higer-resolution time stamps.
4553
4554 * keyboard.c (start_polling, bind_polling_period):
4555 Check for time stamp overflow.
4556 (read_char, kbd_buffer_get_event, timer_start_idle)
4557 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4558 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4559 Port to higher-resolution time stamps. Do not assume time_t is signed.
4560 (decode_timer): New function. Timers are now vectors of length 9,
4561 not 8, to accommodate the picosecond component.
4562 (timer_check_2): Use it.
4563
4564 * nsterm.m (select_timeout, timeval_subtract): Remove.
4565 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4566 as they're a bit more accurate and handle overflow better.
4567 (ns_select): Change prototype to be compatible with pselect.
4568 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4569 * nsterm.h (ns_select): Adjust prototype.
4570
4571 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4572 us-resolution time stamps.
4573 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4574
4575 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4576
4577 * lisp.h (time_overflow): New decl.
4578 (wait_reading_process_output): First arg is now intmax_t, not int,
4579 to accommodate larger waits.
4580
4581 * process.h (struct Lisp_Process.read_output_delay):
4582 Now counts nanoseconds, not microseconds.
4583 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4584 EMACS_HAS_USECS.
4585 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4586 (wait_reading_process_output):
4587 Port to ns-resolution time stamps.
4588 (Faccept_process_output, wait_reading_process_output):
4589 Check for time stamp overflow. Do not assume time_t is signed.
4590 (select_wrapper): Remove; we now use pselect.
4591 (Fprocess_attributes): Now generates ns-resolution time stamps.
4592
4593 * sysdep.c: Include utimens.h. Don't include utime.h
4594 or worry about struct utimbuf; gnulib does that for us now.
4595 (gettimeofday): Remove; gnulib provides a substitute.
4596 (make_timeval): New function.
4597 (set_file_times): Now sets ns-resolution time stamps.
4598 New arg FD; all uses changed.
4599 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4600 (system_process_attributes):
4601 Now returns ns-resolution time stamp. All uses changed.
4602 Check for time stamp overflow.
4603
4604 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4605 provides a substitute now.
4606
4607 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4608 since it guarantees struct timespec.
4609 (EMACS_TIME): Now struct timespec, so that we can support
4610 ns-resolution time stamps.
4611 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4612 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4613 (EMACS_USECS): Remove.
4614 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4615 so multiply the arg by 1000 before storing it.
4616 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4617 New macros.
4618 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4619 Port to ns-resolution time stamps.
4620 (EMACS_TIME_NEG_P): Remove; replaced by....
4621 (EMACS_TIME_SIGN): New macro.
4622 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4623 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4624 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4625 (make_timeval, make_lisp_time, decode_time_components): New decls.
4626 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4627 that it mishandled time_t overflow. You can't compare by subtracting!
4628 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4629 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4630
4631 * term.c: Include <sys/time.h>.
4632 (timeval_to_Time): New function, for proper overflow wraparound.
4633 (term_mouse_position, term_mouse_click): Use it.
4634
4635 * undo.c (record_first_change): Support higher-resolution time stamps
4636 in the undo buffer.
4637 (Fprimitive_undo): Use them when restoring time stamps.
4638
4639 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4640 (w32_get_internal_run_time):
4641 Port to higher-resolution Emacs time stamps.
4642 (ltime): Now accepts single 64-bit integer, as that's more convenient
4643 for callers.
4644
4645 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4646
4647 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4648 for compatibility with pselect. Support ns-resolution time stamps.
4649
4650 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4651
4652 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4653 Check for time stamp overflow, and support ns-resolution time stamps.
4654
4655 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4656 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4657 (timeval_subtract): Remove; no longer needed.
4658 (XTflash, XTring_bell, x_wait_for_event):
4659 Port to ns-resolution time stamps. Don't assume time_t is signed.
4660
b6a92dfe
CY
46612012-06-22 Chong Yidong <cyd@gnu.org>
4662
4663 * xdisp.c (x_consider_frame_title): Revert last change.
4664
d251c37c
EZ
46652012-06-22 Eli Zaretskii <eliz@gnu.org>
4666
4667 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4668 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4669 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4670 staticidx goes up to 1597 out of 1600 = 0x640.)
4671
f10deafb
PE
46722012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4673
4674 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4675 Otherwise, the umask might be mistakenly 0 while handling input signals.
4676
ec6de1e2
SM
46772012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4678
4679 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4680
28be1ada
DA
46812012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4682
4683 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4684 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4685 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4686 access to `contents' member of Lisp_Vector objects with AREF and ASET
4687 where appropriate.
4688
c6bf3022
CY
46892012-06-19 Chong Yidong <cyd@gnu.org>
4690
4691 * frame.c (delete_frame): When selecting a frame on a different
4692 text terminal, do not alter the terminal's top-frame.
4693
4694 * xdisp.c (format_mode_line_unwind_data): Record the target
4695 frame's selected window and its terminal's top-frame.
4696 (unwind_format_mode_line): Restore them.
4697 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4698 Callers changed.
4699 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4700 since tty frames can be explicitly named.
4701 (prepare_menu_bars): Likewise.
4702
4703 * term.c (Ftty_top_frame): New function.
4704
defd4196
PE
47052012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4706
4707 Port byte-code-meter to modern targets.
4708 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4709 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 4710 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
4711 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4712 (METER_1, METER_2): Simplify.
4713
1053a871
SM
47142012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4715
4716 * data.c (Fdefalias): Return `symbol' (bug#11686).
4717
b7e8d081
MR
47182012-06-18 Martin Rudalics <rudalics@gmx.at>
4719
4720 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
4721 gets killed during executing of this function (Bug#11665).
4722 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
4723 (Vkill_buffer_query_functions): In doc-string say that functions
4724 run by this hook should not change the current buffer.
4725
7ea2b339
PE
47262012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4727
4728 Fix recently-introduced process.c problems found by static checking.
4729 * process.c (write_queue_push, write_queue_pop, send_process):
4730 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4731 (write_queue_pop): Fix pointer signedness problem.
4732 (send_process): Remove unused local.
4733
96a313a1
CY
47342012-06-17 Chong Yidong <cyd@gnu.org>
4735
4736 * xdisp.c (redisplay_internal): No need to redisplay terminal
4737 frames that are not on top.
4738
20ca2e94
TN
47392012-06-17 Troels Nielsen <bn.troels@gmail.com>
4740
4741 * process.c (make_process): Initialize write_queue.
4742 (write_queue_push, write_queue_pop): New functions.
4743 (send_process): Use them to maintain correct ordering of process
4744 writes (Bug#10815).
4745
9a900ca9
PE
47462012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4747
310fbfa8
PE
4748 * lisp.h (eassert): Assume C89 or later.
4749 This removes the need for CHECK.
4750 (CHECK): Remove. Its comments about always evaluating its
4751 argument were confusing, as 'eassert' typically does not evaluate
4752 its argument.
4753
27bb1ca4
PE
4754 * coding.c (produce_chars): Use ptrdiff_t, not int.
4755
9a900ca9
PE
4756 * xterm.c (x_draw_underwave): Check for integer overflow.
4757 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4758
41b7f8bc 47592012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
4760
4761 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4762 referenced (Bug#11583).
4763
9b0e3eba
AA
47642012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4765
4766 Implement wave-style variant of underlining.
4767 * dispextern.h (face_underline_type): New enum.
4768 (face): Add field for underline type.
4769 * nsterm.m (ns_draw_underwave): New function.
4770 (ns_draw_text_decoration): Use it.
4771 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4772 New functions.
4773 (x_draw_glyph_string): Use them.
4774 * xfaces.c (Qline, Qwave): New Lisp objects.
4775 (check_lface_attrs, merge_face_ref)
1053a871
SM
4776 (Finternal_set_lisp_face_attribute, realize_x_face):
4777 Handle wave-style underline face attributes.
9b0e3eba
AA
4778 * xterm.c (x_draw_underwave): New function.
4779 (x_draw_glyph_string): Use it.
4780
0fb52f11
JB
47812012-06-16 Juanma Barranquero <lekktu@gmail.com>
4782
4783 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4784 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4785 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4786 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4787 ($(BLD)/w32select.$(O)): Update dependencies.
4788
e5560ff7
AS
47892012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4790
4791 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4792 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4793 * character.c (_fetch_multibyte_char_p): Remove.
4794 * alloc.c: Include "character.h" before "buffer.h".
4795 * bidi.c: Likewise.
4796 * buffer.c: Likewise.
4797 * bytecode.c: Likewise.
4798 * callint.c: Likewise.
4799 * callproc.c: Likewise.
4800 * casefiddle.c: Likewise.
4801 * casetab.c: Likewise.
4802 * category.c: Likewise.
4803 * cmds.c: Likewise.
4804 * coding.c: Likewise.
4805 * composite.c: Likewise.
4806 * dired.c: Likewise.
4807 * dispnew.c: Likewise.
4808 * doc.c: Likewise.
4809 * dosfns.c: Likewise.
4810 * editfns.c: Likewise.
4811 * emacs.c: Likewise.
4812 * fileio.c: Likewise.
4813 * filelock.c: Likewise.
4814 * font.c: Likewise.
4815 * fontset.c: Likewise.
4816 * fringe.c: Likewise.
4817 * indent.c: Likewise.
4818 * insdel.c: Likewise.
4819 * intervals.c: Likewise.
4820 * keyboard.c: Likewise.
4821 * keymap.c: Likewise.
4822 * lread.c: Likewise.
4823 * macros.c: Likewise.
4824 * marker.c: Likewise.
4825 * minibuf.c: Likewise.
4826 * nsfns.m: Likewise.
4827 * nsmenu.m: Likewise.
4828 * print.c: Likewise.
4829 * process.c: Likewise.
4830 * regex.c: Likewise.
4831 * region-cache.c: Likewise.
4832 * search.c: Likewise.
4833 * syntax.c: Likewise.
4834 * term.c: Likewise.
4835 * textprop.c: Likewise.
4836 * undo.c: Likewise.
4837 * unexsol.c: Likewise.
4838 * w16select.c: Likewise.
4839 * w32fns.c: Likewise.
4840 * w32menu.c: Likewise.
4841 * window.c: Likewise.
4842 * xdisp.c: Likewise.
4843 * xfns.c: Likewise.
4844 * xmenu.c: Likewise.
4845 * xml.c: Likewise.
4846 * xselect.c: Likewise.
4847
2f07e6af
EZ
48482012-06-16 Eli Zaretskii <eliz@gnu.org>
4849
1053a871
SM
4850 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4851 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 4852 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
4853 row.
4854 (handle_face_prop): Use chunk-relative overlay string index when
4855 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
4856 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4857 the rightmost. (Bug#11720)
2f07e6af 4858
29b83cec
AS
48592012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4860
4861 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4862 (CATEGORY_MEMBER): Enforce 1/0 value.
4863 * category.c (_temp_category_set): Remove.
4864
4c5501e9
EZ
48652012-06-16 Eli Zaretskii <eliz@gnu.org>
4866
4867 * window.c (Fdelete_other_windows_internal)
4868 (Fdelete_window_internal): Don't access frame's mouse highlight
4869 info of the initial frame. (Bug#11677)
4870
2b570124
PE
48712012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4872
e93864f9
PE
4873 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4874 Assume USE_2_TAGS_FOR_INTS.
4875 (xreload): Adjust $tagmask width to match recent lisp.h change.
4876
2b570124
PE
4877 Simplify lisp.h in minor ways that should not affect code.
4878 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4879 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4880 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4881 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4882 (INTTYPEBITS): New macro, for clarity.
4883 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
4884 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4885 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
4886 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4887 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4888
81755f69
JB
48892012-06-13 Juanma Barranquero <lekktu@gmail.com>
4890
4891 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4892
16192a57
GM
48932012-06-13 Glenn Morris <rgm@gnu.org>
4894
4895 * s/bsd-common.h (BSD4_3):
4896 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4897
646b5f55
AS
48982012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4899
4900 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4901 instead of union.
4902 (XLI, XIL): Define.
1053a871
SM
4903 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4904 Use them.
4905 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 4906 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 4907 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
4908 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4909 * frame.c (delete_frame): Remove outdated comment.
4910 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4911 USE_LISP_UNION_TYPE.
4912 (Fw32_unregister_hot_key): Likewise.
4913 (Fw32_toggle_lock_key): Likewise.
4914 * w32menu.c (add_menu_item): Likewise.
4915 (w32_menu_display_help): Use XIL instead of checking
4916 USE_LISP_UNION_TYPE.
4917 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4918 (init_heap): Likewise.
4919 * w32term.c (w32_read_socket): Update comment.
4920
1d3823c9
GM
49212012-06-13 Glenn Morris <rgm@gnu.org>
4922
c62ff706
GM
4923 * s/usg5-4-common.h, src/s/unixware.h:
4924 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4925
1d3823c9
GM
4926 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4927
bfe3e0a2
PE
49282012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4929
4930 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4931 * alloc.c (make_number) [!defined make_number]:
4932 Remove, as lisp.h always defines this now.
4933 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4934 (roundup_size): Verify that it is a power of 2.
4935 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4936 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4937 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4938 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4939 USE_LSB_TAG now is always defined to be either 0 or 1.
4940 All uses changed.
4941 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4942 code works fine either way, and efficiency is not a concern here,
4943 as the union type is for debugging, not for production.
4944 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4945 Use an inline function on all platforms when using the union type,
4946 since this is simpler and 'static inline' can be used portably
4947 within Emacs now.
4948 (LISP_INITIALLY_ZERO): New macro.
4949 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4950 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4951
45fa9c0f
GM
49522012-06-12 Glenn Morris <rgm@gnu.org>
4953
b4492cba
GM
4954 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4955
4956 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 4957
45fa9c0f
GM
4958 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4959 Move BROKEN_SIGIO to configure.
4960
4961 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4962 Move NO_TERMIO to configure.
4963
0e25d334
CY
49642012-06-12 Chong Yidong <cyd@gnu.org>
4965
4966 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4967 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4968 MagickExportImagePixels is undefined.
4969
43682bb6
PE
49702012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4971
4972 * image.c (imagemagick_load_image): Remove unused label.
4973
a9be7d2b
GM
49742012-06-11 Glenn Morris <rgm@gnu.org>
4975
4976 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4977 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4978 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4979 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4980
3017f87f
SM
49812012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4982
4983 * alloc.c (make_byte_code): New function.
4984 (Fmake_byte_code): Use it. Don't purify here.
4985 * lread.c (read1): Use it as well to avoid extra allocation.
4986
1b9b4cf4
CY
49872012-06-11 Chong Yidong <cyd@gnu.org>
4988
4989 * image.c (imagemagick_load_image): Implement transparency.
4990
95988fcf
AS
49912012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4992
4993 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4994 account for preceding backslashes. (Bug#11663)
4995
cd4eb164
CY
49962012-06-09 Chong Yidong <cyd@gnu.org>
4997
4998 * term.c: Support italics in capable terminals (Bug#9652).
4999 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5000 (turn_on_face): Output using TS_enter_italic_mode if available.
5001 Don't handle unused blinking and alt-charset cases.
5002 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5003 and tty_alt_charset_p cases.
5004 (tty_capable_p, init_tty): Support italics.
5005
5006 * termchar.h (struct tty_display_info): Add field for italics.
5007 Remove unused blink field.
5008
5009 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5010 Handle slant.
5011
5012 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5013 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5014 tty_alt_charset_p. Add tty_italic_p.
5015
ff88beb8
MA
50162012-06-09 Michael Albinus <michael.albinus@gmx.de>
5017
5018 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5019 dbus_type_is_basic if available.
5020 (xd_extract_signed, xd_extract_unsigned): Rename from
5021 extract_signed and extract_unsigned, respectively. Adapt callers.
5022
44286096
CY
50232012-06-09 Chong Yidong <cyd@gnu.org>
5024
1682701f
CY
5025 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5026
44286096
CY
5027 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5028 case (Bug#9752).
5029
d86feb17
PE
50302012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * xdisp.c (vmessage): Treat frame message as multibyte.
5033 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5034 would generate the diagnostic "Making \302\247 buffer-local while
5035 let-bound!".
5036
d5c20fe8
EZ
50372012-06-08 Eli Zaretskii <eliz@gnu.org>
5038
5039 * dispnew.c (showing_window_margins_p): Undo last change, which
5040 was done due to an inadvertent commit.
5041 (adjust_frame_glyphs_for_frame_redisplay): Do call
5042 showing_window_margins_p.
5043
513749ee
SM
50442012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5045
5046 * eval.c (Fmake_var_non_special): New primitive.
5047 (syms_of_eval): Defsubr it.
5048 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5049
d4a8f5c1
JB
50502012-06-08 Juanma Barranquero <lekktu@gmail.com>
5051
5052 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5053 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5054
8bbbc977
EZ
50552012-06-08 Eli Zaretskii <eliz@gnu.org>
5056
5057 * alloc.c (allocate_vectorlike): Fix last change.
5058
f3372c87
DA
50592012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5060
5061 Block-based vector allocation of small vectors.
5062 * lisp.h (struct vectorlike_header): New field `nbytes',
5063 adjust comment accordingly.
5064 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5065 to denote vector blocks. Adjust users (live_vector_p,
5066 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5067 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5068 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5069 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5070 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5071 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5072 (roundup_size): New constant.
5073 (struct vector_block): New data type.
5074 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 5075 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
5076 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5077 (sweep_vectors): New functions.
5078 (allocate_vectorlike): Return `zero_vector' as the only vector of
5079 0 items. Allocate new vector from block if vector size is less than
5080 or equal to VBLOCK_BYTES_MAX.
5081 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5082 (init_alloc_once): Add call to init_vectors.
5083
4f18a4ed
SM
50842012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5085
5086 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5087
86f158bc
PE
50882012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5089
5090 * doprnt.c (doprnt): Truncate multibyte char correctly.
5091 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5092 would mishandle a string argument "Xc" if X was a multibyte
5093 character of length 2: it would truncate after X's first byte
5094 rather than including all of X.
5095
c5cfcbe0
CY
50962012-06-06 Chong Yidong <cyd@gnu.org>
5097
5098 * buffer.c (word_wrap): Doc fix.
5099
c05cf390
PE
51002012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5101
5102 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5103
0c3461de
GM
51042012-06-03 Glenn Morris <rgm@gnu.org>
5105
5106 * xdisp.c (tool-bar-style): Doc fix.
5107
c71232db
UM
51082012-06-03 Ulrich Müller <ulm@gentoo.org>
5109
5110 * Makefile.in (PAXCTL): Define.
5111 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5112 binary via PaX flags if the paxctl utility is available.
5113 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5114 Restore PaX flags to their default. (Bug#11398)
5115
383f7350
CY
51162012-06-03 Chong Yidong <cyd@gnu.org>
5117
5118 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5119 buffer (Bug#11226).
5120
5f2c76c6
CY
51212012-06-03 Chong Yidong <cyd@gnu.org>
5122
5123 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5124 (note_mode_line_or_margin_highlight): If there is no help echo,
5125 use mode-line-default-help-echo. Handle the case where the mouse
5126 position is past the end of the mode line string.
5127
5128 * buffer.c (buffer_local_value_1): New function, split from
5129 Fbuffer_local_value; can return Qunbound.
5130 (Fbuffer_local_value): Use it.
5131 (Vmode_line_format): Docstring tweaks.
5132
773d47f6
PE
51332012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5134
5135 * sysdep.c (system_process_attributes): Improve comment.
5136
f2d6a3df
SM
51372012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5138
5139 * keyboard.c: Export real-this-command to Elisp.
5140 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5141 and DEFVAR it. Update all users.
5142
63810350
PE
51432012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5144
7bd5c1f4
PE
5145 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5146
63810350
PE
5147 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5148 Convert pctcpu and pctmem to Lisp float properly.
5149 Let the compiler fold better, as 100.0/0x8000 is exact.
5150
a2821611
AS
51512012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5152
5153 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5154 cons_block.
5155
5fceba1d
PE
51562012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5157
5158 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5159
c98ff5dd
DA
51602012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5161
5162 For a 'struct window', replace some Lisp_Object fields to
5163 bitfields where appropriate, remove unused fields.
5164 * window.h (struct window): Remove unused 'last_mark_x' and
5165 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5166 change it's type from Lisp_Object to bitfield.
5167 Change type of 'force_start', 'optional_new_start',
5168 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5169 fields from Lisp_Object to bitfield. Adjust users accordingly.
5170
ca34e0be
PE
51712012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5172
5173 Pacify gcc -Wdouble-precision when using Xaw.
5174 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5175 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5176 Use 'float' consistently, rather than 'float' in most places
5177 and 'double' in a couple of places.
5178
efc00ab1 51792012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
5180
5181 * xdisp.c (handle_stop): Detect whether we have overlay strings
5182 loaded by testing it->current.overlay_string_index to be
5183 non-negative, instead of checking whether n_overlay_strings is
5184 positive. (Bug#11587)
5185
efc00ab1 51862012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
5187
5188 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5189
5190 * doc.c (Fsubstitute_command_keys): Doc fix.
5191
efc00ab1 51922012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
5193
5194 * search.c (search_buffer): Remove calls to
5195 r_alloc_inhibit_buffer_relocation, as it is now called by
5196 maybe_unify_char, which was the cause of relocation of buffer text
5197 in bug#11519.
5198
efc00ab1 51992012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
5200
5201 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5202 for the duration of call to load_charset, to avoid problems with
5203 callers of maybe_unify_char that access buffer text through C
5204 pointers.
5205
5206 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5207 decrement the inhibition flag, instead of just setting or
5208 resetting it.
5209
ba93a187
PE
52102012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5211
5212 Remove obsolete '#define static' cruft.
5213 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5214 This #undef was "temporary" in 2000; it is no longer needed
5215 now that '#define static' has gone away.
5216 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5217 (gray_bitmap_bits): Remove; no longer needed.
5218 All uses replaced with definiens.
5219 * xterm.c: Include "bitmaps/gray.xbm".
5220
9e4bf381
PE
52212012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 Clean up __executable_start, monstartup when --enable-profiling.
5224 The following changes affect the code only when profiling.
5225 * dispnew.c (__executable_start): Rename from safe_bcopy.
5226 Define only on platforms that need it.
5227 * emacs.c: Include <sys/gmon.h> when profiling.
5228 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5229 (__executable_start): Remove decl, since lisp.h does it now.
5230 (safe_bcopy): Remove decl; no longer has that name.
5231 (main): Coalesce #if into single bit of code, for simplicity.
5232 Cast pointers to uintptr_t, since standard libraries want integers
5233 and not pointers.
5234 * lisp.h (__executable_start): New decl.
5235
32d72c2f
GM
52362012-05-31 Glenn Morris <rgm@gnu.org>
5237
5238 * image.c (Fimagemagick_types): Doc fix.
5239
baac5bc7
JM
52402012-05-30 Jim Meyering <meyering@redhat.com>
5241
5242 * callproc.c (Fcall_process_region): Include directory component
5243 in mkstemp error message (Bug#11586).
5244
72cb32cf
PE
52452012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5246
5247 * alloc.c, lisp.h (make_pure_vector): Now static.
5248
61b108cc
SM
52492012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5250
5251 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5252 Move to byte-run.el.
5253 (Fautoload): Do the hash-doc more carefully.
5254 * data.c (Fdefalias): Purify definition, except for keymaps.
5255 (Qdefun): Move from eval.c.
5256 * lisp.h (Qdefun): Remove.
5257 * lread.c (read1): Tiny simplification.
5258
471fe23d
TN
52592012-05-29 Troels Nielsen <bn.troels@gmail.com>
5260
934f3f58 5261 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
5262 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5263 Bug#9642, but explicitly check that the buffer the overlay would
5264 be moved to is live and rearrange lines to make sure that errors
5265 will not put the overlay in an inconsistent state.
5266 (Fdelete_overlay): Cosmetics.
5267
85d0efd1
EZ
52682012-05-28 Eli Zaretskii <eliz@gnu.org>
5269
5270 * w32term.c (my_bring_window_to_top): New function.
5271 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
5272 could be different from the original one.
5273 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
5274 (Bug#11513)
5275
5276 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5277 by calling BringWindowToTop.
5278
5279 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5280 (WM_EMACS_END): Increase by one.
5281
da92a98c
PE
52822012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5283
5284 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5285 This avoids undefined behavior that might cause the eassert
5286 to not catch an out-of-range value.
5287
74d1f848
JB
52882012-05-28 Juanma Barranquero <lekktu@gmail.com>
5289
5290 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5291 Update dependencies.
5292
9e1a06fc
EZ
52932012-05-27 Eli Zaretskii <eliz@gnu.org>
5294
5295 * bidi.c (bidi_mirror_char): Fix last change.
5296
f3dd7312
AS
52972012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5298
5299 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5300 when referring to sectname field in printf format.
5301
81899c91
PE
53022012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5303
57b81a9f
PE
5304 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5305 Only r_alloc_inhibit_buffer_relocation needed to be added;
5306 the others were already declared.
5307
81899c91
PE
5308 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5309 before checking whether it's out of range. Put the check inside
5310 eassert. See
5311 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5312
33017faf 53132012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
5314
5315 * callproc.c (Fcall_process): Restore a line that was accidentally
5316 commented out in the 2011-02-13 change (bug#11547).
5317
33017faf 53182012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
5319
5320 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5321 defined on ralloc.c.
5322
5323 * buffer.c [REL_ALLOC]: Remove prototypes of
5324 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5325 they are now on lisp.h.
5326
5327 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5328
5329 * search.c (search_buffer): Use it to inhibit relocation of buffer
5330 text while re_search_2 is doing its job, because re_search_2 is
5331 passed C pointers to buffer text. (Bug#11519)
5332
23415acf
EZ
5333 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5334 Update value to 24.
5335
44e27368
EZ
5336 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5337 state after an additional call to move_it_in_display_line_to, keep
5338 the values of it->max_ascent and it->max_descent found for the
5339 entire line.
5340 (pos_visible_p): Revert the comparison against bottom_y to what it
5341 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5342 (Bug#11464)
5343
c1892f11
PE
53442012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5345
5346 Fix coding-related core dumps with gcc -ftrapv.
5347 The code was computing A - B, where A and B are pointers, and B is
5348 random garbage. This can lead to core dumps on platforms that
5349 have special pointer registers, and it also leads to core dumps on
5350 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5351 A - B only when B is initialized properly.
5352 * coding.c (coding_set_source, coding_set_destination): Return void.
5353 (coding_change_source, coding_change_destinations): New functions,
5354 with the old behaviors of coding_set_source and coding_set_destination.
5355 All callers that need an offset changed to use these new functions.
5356
eb7afdad
GM
53572012-05-26 Glenn Morris <rgm@gnu.org>
5358
5359 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5360
f12fdf02
EZ
53612012-05-26 Eli Zaretskii <eliz@gnu.org>
5362
53a63be6 5363 Extend mouse support on W32 text-mode console.
61b108cc
SM
5364 * xdisp.c (draw_row_with_mouse_face):
5365 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 5366
eb3f6f01 5367 * w32console.c: Include window.h.
61b108cc
SM
5368 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5369 New functions.
eb3f6f01
EZ
5370 (initialize_w32_display): Initialize mouse-highlight data.
5371
53a63be6
EZ
5372 * w32inevt.c: Include termchar.h and window.h.
5373 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5374 moves, call note_mouse_highlight. If help_echo changed, call
5375 gen_help_event to produce help-echo message in the echo area.
5376 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5377 highlight info.
5378
4cfd81f6
PE
53792012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5380
5381 * lread.c (read1): Simplify slightly to avoid an overflow warning
5382 with GCC 4.7.0 on x86-64.
5383
4446092a
EZ
53842012-05-26 Eli Zaretskii <eliz@gnu.org>
5385
5386 * bidi.c (bidi_mirror_char): Revert last change: an int is
5387 definitely wide enough here.
5388
42b2a986 53892012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 5390
42b2a986 5391 Fix integer width and related bugs (Bug#9874).
eb106a49 5392 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
5393 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5394 (string_bytes, check_sblock, allocate_string_data):
5395 (compact_small_strings, Fmake_bool_vector, make_string)
5396 (make_unibyte_string, make_multibyte_string)
5397 (make_string_from_bytes, make_specified_string)
5398 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5399 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5400 (mark_vectorlike):
5401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5402 (allocate_pseudovector):
5403 Use int, not EMACS_INT, where int is wide enough.
5404 (inhibit_garbage_collection, Fgarbage_collect):
5405 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5406 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5407 int might not be wide enough.
5408 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5409 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5410 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5411 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5412 (bidi_level_of_next_char, bidi_move_to_visually_next):
5413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5414 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5415 (Fkill_buffer, Fset_buffer_major_mode)
5416 (advance_to_char_boundary, Fbuffer_swap_text)
5417 (Fset_buffer_multibyte, overlays_at, overlays_in)
5418 (overlay_touches_p, struct sortvec, record_overlay_string)
5419 (overlay_strings, recenter_overlay_lists)
5420 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5421 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5422 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5423 (Foverlay_recenter, last_overlay_modification_hooks_used)
5424 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
5426 (validate_region): Omit unnecessary test for b <= e,
5427 since that's guaranteed by the previous test.
d311d28c
PE
5428 (adjust_overlays_for_delete): Avoid pos + length overflow.
5429 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5430 (report_overlay_modification):
5431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5432 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5433 Omit pointer cast, which isn't needed anyway, and doesn't work
5434 after the EMACS_INT -> ptrdiff_t change.
02481186 5435 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
5436 * buffer.h: Adjust decls to match defn changes elsewhere.
5437 (struct buffer_text, struct buffer):
5438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5439 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
5440 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5441 not int, to avoid needless 32-bit limit on 64-bit hosts.
5442 (exec_byte_code): Use tighter memory-full test, one that checks
5443 for alloca overflow. Don't compute the address of the object just
5444 before an array, as that's not portable. Use EMACS_INT, not
5445 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
5446 * callint.c (Fcall_interactively):
5447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5448 * callproc.c (call_process_kill, Fcall_process):
5449 Don't assume pid_t fits into an Emacs fixnum.
5450 (call_process_cleanup, Fcall_process, child_setup):
5451 Don't assume pid_t fits into int.
5452 (call_process_cleanup, Fcall_process, delete_temp_file)
5453 (Fcall_process_region):
5454 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5455 (Fcall_process): Simplify handling of volatile integers.
5456 Use int, not EMACS_INT, where int will do.
5457 * casefiddle.c (casify_object, casify_region, operate_on_word)
5458 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5460 (casify_object): Avoid integer overflow when overallocating buffer.
5461 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 5462 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
5463 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5464 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5465 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5466 integers are now checked earlier. All uses replaced with XINT.
5467 (ccl_driver):
5468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5469 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
5470 (ccl_driver, Fregister_code_conversion_map):
5471 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
5472 (resolve_symbol_ccl_program): Check that vector header is in range.
5473 Always copy the vector, so that we can check its contents reliably
5474 now rather than having to recheck each instruction as it's being
5475 executed. Check that vector words fit in 'int'.
5476 (ccl_get_compiled_code, Fregister_ccl_program)
5477 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5478 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5479 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5480 contents are in range.
5481 (Fccl_execute_on_string): Check that status is in range.
5482 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5483 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5484 Accept and return EMACS_INT, not int, because callers can pass values
5485 out of 'int' range.
5486 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5487 (multibyte_chars_in_text, parse_str_as_multibyte)
5488 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5489 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5490 (string_escape_byte8, Fget_byte):
5491 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 5492 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
5493 avoid mishandling large integers.
5494 * character.h: Adjust decls to match defn changes elsewhere.
5495 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5496 (Ffind_charset_region):
5497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5498 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5499 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 5500 Don't assume fixnum fits in int.
d311d28c
PE
5501 (load_charset_map_from_vector, Fmap_charset_chars):
5502 Remove now-unnecessary CHECK_NATNUMs.
5503 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
5504 Don't rely on undefined behavior with signed left shift overflow.
5505 Don't assume unsigned int fits into fixnum, or that fixnum fits
5506 into unsigned int. Don't require max_code to be a valid fixnum;
5507 that's not true for gb10830 4-byte on a 32-bit host. Allow
5508 invalid_code to be a cons, for the same reason. Require code_offset
5509 to be a character. Avoid int overflow if max_char is close
5510 to INT_MAX.
5511 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5512 this is intended anyway and avoids some undefined behavior.
5513 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5514 INDEX_TO_CODE_POINT, as that's what it expects.
5515 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
5516 * charset.h (DECODE_CHAR): Return int, not unsigned;
5517 this is what was intended anyway, and it avoids undefined behavior.
5518 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5519 integer-overflow issues.
5520 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5521 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5522 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
5523 * chartab.c (Fmake_char_table, Fset_char_table_range)
5524 (uniprop_get_decoder, uniprop_get_encoder):
5525 Don't assume fixnum fits in int.
5526 * cmds.c (move_point): New function, that does the gist of
5527 Fforward_char and Fbackward_char, but does so while checking
5528 for integer overflow more accurately.
c96e5d6a 5529 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
5530 (Fforward_line, Fend_of_line, internal_self_insert)
5531 (internal_self_insert):
5532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5533 Fix a FIXME, by checking for integer overflow when calculating
5534 target_clm and actual_clm.
5535 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 5536 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
5537 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5538 (coding_alloc_by_making_gap, alloc_destination)
5539 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5540 (encode_coding_utf_16, detect_coding_emacs_mule)
5541 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5542 (detect_coding_iso_2022, decode_coding_iso_2022)
5543 (encode_invocation_designation, encode_designation_at_bol)
5544 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5545 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5546 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5547 (encode_coding_ccl, encode_coding_raw_text)
5548 (detect_coding_charset, decode_coding_charset)
5549 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5550 (produce_composition, produce_charset, produce_annotation)
5551 (decode_coding, handle_composition_annotation)
5552 (handle_charset_annotation, consume_chars, decode_coding_gap)
5553 (decode_coding_object, encode_coding_object, detect_coding_system)
5554 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5555 (code_convert_region, code_convert_string)
8f50130c
PE
5556 (Fdefine_coding_system_internal)
5557 (coding_set_source, coding_set_destination):
d311d28c
PE
5558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5559 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5560 (Fdefine_coding_system_internal):
5561 Don't assume fixnums fit in int.
5562 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 5563 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
5564 (Funencodable_char_position, Fcheck_coding_systems_region)
5565 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 5566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 5567 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 5568 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 5569 Don't access memory outside of the args array.
d311d28c 5570 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
5571 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5572 result of ENCODE_CHAR.
d311d28c
PE
5573 * coding.h: Adjust decls to match defn changes elsewhere.
5574 (struct coding_system):
5575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5576 * composite.c (get_composition_id, find_composition)
5577 (run_composition_function, update_compositions)
5578 (compose_text, composition_gstring_put_cache)
5579 (composition_gstring_p, composition_gstring_width)
5580 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5581 (composition_compute_stop_pos, composition_reseat_it)
5582 (composition_update_it, struct position_record)
5583 (find_automatic_composition, composition_adjust_point)
5584 (Fcomposition_get_gstring, Ffind_composition_internal):
5585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5586 (update_compositions):
5587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5588 * composite.h: Adjust decls to match defn changes elsewhere.
5589 (struct composition):
5590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5591 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5592 Do not attempt to compute the address of the object just before a
5593 buffer; this is not portable.
5594 (Faref, Faset):
5595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5596 (Faset): Use int, not EMACS_INT, where int is wide enough.
5597 (Fstring_to_number): Don't assume fixnums fit in int.
5598 (Frem): Don't assume arg is nonnegative.
5599 * dbusbind.c (xd_append_arg): Check for integers out of range.
5600 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 5601 (extract_signed, extract_unsigned): New functions.
243e0530
PE
5602 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5603 (xd_get_connection_references): Return ptrdiff_t, not int.
5604 All uses changed.
5605 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5606 (xd_read_message_1):
5607 Use int, not unsigned, where the dbus API uses int.
5608 (Fdbus_message_internal): Don't overflow mtype.
5609 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
5610 * dired.c (directory_files_internal, file_name_completion, scmp)
5611 (file_name_completion_stat):
5612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5613 (file_name_completion): Don't overflow matchcount.
5614 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5615 * dispextern.h: Adjust decls to match defn changes elsewhere.
5616 (struct text_pos, struct glyph, struct bidi_saved_info)
5617 (struct bidi_string_data, struct bidi_it, struct composition_it)
5618 (struct it):
5619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5620 (struct display_pos, struct composition_it, struct it):
5621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5622 * dispnew.c (increment_matrix_positions)
5623 (increment_row_positions, mode_line_string)
5624 (marginal_area_string):
5625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 5626 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
5627 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5628 (duration_to_sec_usec): New function, to check for overflow better.
5629 (Fsleep_for, sit_for): Use it.
5630 * doc.c (get_doc_string, store_function_docstring):
5631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5632 (get_doc_string, Fsnarf_documentation):
5633 Use int, not EMACS_INT, where int is wide enough.
5634 (get_doc_string):
5635 Use SAFE_ALLOCA, not alloca.
5636 Check for overflow when converting EMACS_INT to off_t.
5637 * doprnt.c (doprnt):
5638 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5639 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5640 Don't assume uid_t fits into fixnum.
5641 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5642 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5643 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5644 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5645 (general_insert_function)
5646 (Finsert_char, make_buffer_string, make_buffer_string_both)
5647 (update_buffer_properties, Fbuffer_substring)
5648 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5649 (Fsubst_char_in_region, check_translation)
5650 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5651 (transpose_markers, Ftranspose_regions):
5652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5653 (clip_to_bounds): Move to lisp.h as an inline function).
5654 (Fconstrain_to_field): Don't assume integers are nonnegative.
5655 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5656 (Fsubst_char_in_region, Fsave_restriction):
5657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5658 (Femacs_pid): Don't assume pid_t fits into fixnum.
5659 (lo_time): Use int, not EMACS_INT, when int suffices.
5660 (lisp_time_argument): Check for usec out of range.
5661 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
5662 (Fuser_login_name, Fuser_full_name): Signal an error
5663 if a uid argument is out of range, rather than relying on
5664 undefined behavior.
c8d5c857
PE
5665 (Fformat_time_string): Remove now-unnecessary check.
5666 lisp_time_argument checks for out-of-range usec now.
243e0530 5667 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
5668 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5669 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5670 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5671 (init_cmdargs, Fdump_emacs):
5672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5673 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5674 the bottom (typically) 32 bits of the fixnum.
5675 * eval.c (specpdl_size, call_debugger):
5676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5677 (when_entered_debugger, Fbacktrace_debug):
5678 Don't assume fixnum can fit in int.
5679 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5680 the object just before a buffer; this is not portable.
5681 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5682 (grow_specpdl, unbind_to):
5683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5684 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5685 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 5686 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
5687 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5688 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5690 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5691 (a_write, e_write):
5692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5693 (Fcopy_file, non_regular_nbytes, read_non_regular)
5694 (Finsert_file_contents):
5695 Use int, not EMACS_INT, where int is wide enough.
5696 (READ_BUF_SIZE): Verify that it fits in int.
5697 (Finsert_file_contents): Check that counts are in proper range,
5698 rather than assuming fixnums fit into ptrdiff_t etc.
5699 Don't assume fixnums fit into int.
125b3835 5700 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
5701 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5702 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
5703 (string_char_to_byte, string_byte_to_char)
5704 (string_make_multibyte, string_to_multibyte)
5705 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5706 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5707 (substring_both, Fdelete, internal_equal, Ffillarray)
5708 (Fclear_string, mapcar1)
5709 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5710 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5711 (larger_vector, make_hash_table, maybe_resize_hash_table)
5712 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5713 (Fmaphash, secure_hash):
5714 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5715 (concat): Check for string index and length overflow.
5716 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5717 (Frequire):
5718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5719 (larger_vector): New API (vec, incr_min, size_max) replaces old
5720 one (vec, new_size, init). This catches size overflow.
5721 INIT was removed because it was always Qnil.
5722 All callers changed.
5723 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5724 the upper bound on a hash table index size.
5725 (make_hash_table, maybe_resize_hash_table): Use it.
5726 (secure_hash): Computer start_byte and end_byte only after
5727 they're known to be in ptrdiff_t range.
5728 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5729 (Ffont_get_glyphs, Ffont_at):
5730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5731 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5732 (Flist_fonts, Fopen_font):
5733 Don't assume fixnum can fit in int.
5734 (check_gstring): Don't assume index can fit in int.
5735 (font_match_p): Check that fixnum is a character, not a nonnegative
5736 fixnum, since the later code needs to stuff it into an int.
5737 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5738 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5739 conversion overflow issues.
5740 (Fopen_font): Check for integer out of range.
5741 (Ffont_get_glyphs): Don't assume index can fit in int.
5742 * font.h: Adjust decls to match defn changes elsewhere.
5743 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5744 integer overflow.
5745 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5746 printmax_t, where ptrdiff_t is wide enough.
5747 (Finternal_char_font):
5748 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5749 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5750 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5751 (Fset_frame_position, x_set_frame_parameters)
5752 (x_set_line_spacing, x_set_border_width)
5753 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5754 Check that fixnums are in proper range for system types.
5755 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5757 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5758 Use SAFE_ALLOCA_LISP, not alloca.
5759 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5760 intptr_t is wide enough.
5761 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5762 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5763 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5764 Check for fixnum out of range.
5765 * ftfont.c (ftfont_list): Don't assume index fits in int.
5766 Check that fixnums are in proper range for system types.
5767 (ftfont_shape_by_flt):
5768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
5769 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5771 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5772 Check that fixnums are in proper range for system types.
5773 * gnutls.h: Adjust decls to match defn changes elsewhere.
5774 * gtkutil.c (xg_dialog_run):
5775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5776 (update_frame_tool_bar):
5777 Check that fixnums are in proper range for system types.
5778 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 5779 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
5780 * indent.c (last_known_column, last_known_column_point):
5781 (current_column_bol_cache):
5782 (skip_invisible, current_column, check_display_width):
5783 (check_display_width, scan_for_column, current_column_1)
5784 (Findent_to, Fcurrent_indentation, position_indentation)
5785 (indented_beyond_p, Fmove_to_column, compute_motion):
5786 (Fcompute_motion, Fvertical_motion):
5787 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5788 (last_known_column_modified): Use EMACS_INT, not int.
5789 (check_display_width):
5790 (Fcompute_motion):
5791 Check that fixnums and floats are in proper range for system types.
5792 (compute_motion): Don't assume index or fixnum fits in int.
5793 (compute_motion, Fcompute_motion):
5794 Use int, not EMACS_INT, when it is wide enough.
5795 (vmotion): Omit local var start_hpos that is always 0; that way
5796 we don't need to worry about overflow in expressions involving it.
5797 * indent.h: Adjust decls to match defn changes elsewhere.
5798 (struct position):
5799 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5800 Use int, not EMACS_INT, where int is wide enough.
5801 Remove unused members ovstring_chars_done and tab_offset;
5802 all uses removed.
5803 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5804 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5805 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5806 (make_gap, copy_text, insert, insert_and_inherit)
5807 (insert_before_markers, insert_before_markers_and_inherit)
5808 (insert_1, count_combining_before, count_combining_after)
5809 (insert_1_both, insert_from_string)
5810 (insert_from_string_before_markers, insert_from_string_1)
5811 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5812 (adjust_after_replace, adjust_after_insert, replace_range)
5813 (replace_range_2, del_range, del_range_1, del_range_byte)
5814 (del_range_both, del_range_2, modify_region)
5815 (prepare_to_modify_buffer, signal_before_change)
5816 (signal_after_change, Fcombine_after_change_execute):
5817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5818 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5819 (balance_an_interval, split_interval_right, split_interval_left)
5820 (find_interval, next_interval, update_interval)
5821 (adjust_intervals_for_insertion, delete_node, delete_interval)
5822 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5823 (static_offset_intervals, offset_intervals)
5824 (merge_interval_right, merge_interval_left, make_new_interval)
5825 (graft_intervals_into_buffer, temp_set_point_both)
5826 (temp_set_point, set_point, adjust_for_invis_intang)
5827 (set_point_both, move_if_not_intangible, get_property_and_range)
5828 (get_local_map, copy_intervals, copy_intervals_to_string)
5829 (compare_string_intervals, set_intervals_multibyte_1):
5830 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5831 * intervals.h: Adjust decls to match defn changes elsewhere.
5832 (struct interval):
5833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5834 * keyboard.c (this_command_key_count, this_single_command_key_start)
5835 (before_command_key_count, before_command_echo_length, echo_now)
5836 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5837 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5838 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5839 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5841 (last_non_minibuf_size, last_point_position, echo_truncate)
5842 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5843 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5844 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5845 (stuff_buffered_input):
5846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5847 (last_auto_save, command_loop_1, read_char):
5848 Use EMACS_INT, not int, to avoid integer overflow.
5849 (record_char): Avoid overflow in total_keys computation.
5850 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5851 * keyboard.h: Adjust decls to match defn changes elsewhere.
5852 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5853 (Fkey_description, Fdescribe_vector, Flookup_key):
5854 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5855 (click_position): New function, to check that positions are in range.
5856 (Fcurrent_active_maps):
5857 (describe_command):
5858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5859 (Faccessible_keymaps, Fkey_description):
5860 (preferred_sequence_p):
5861 Don't assume fixnum can fit into int.
5862 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5863 Check for integer overflow in size calculations.
5864 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5865 avoid mishandling large integers.
5866 * lisp.h: Adjust decls to match defn changes elsewhere.
5867 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5868 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5869 (struct Lisp_Marker):
5870 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5871 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
5872 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5873 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5874 All callers changed.
5875 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5876 Assume the arg has valid form, since it always does.
5877 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5878 unsigned integer system type.
5879 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5880 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5881 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5882 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5883 (duration_to_sec_usec): New decl.
5884 * lread.c (read_from_string_index, read_from_string_index_byte)
5885 (read_from_string_limit, readchar, unreadchar, openp)
5886 (read_internal_start, read1, oblookup):
5887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5888 (Fload, readevalloop, Feval_buffer, Feval_region):
5889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5890 (openp): Check for out-of-range argument to 'access'.
5891 (read1): Use int, not EMACS_INT, where int is wide enough.
5892 Don't assume fixnum fits into int.
6efdadfd 5893 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
5894 (read_filtered_event): Use duration_to_sec_usec
5895 to do proper overflow checking on durations.
d311d28c
PE
5896 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5897 in size calculation.
5898 (Fexecute_kbd_macro):
5899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5900 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5901 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5902 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5903 (set_marker_both, set_marker_restricted_both, marker_position)
5904 (marker_byte_position, Fbuffer_has_markers_at):
5905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5906 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 5907 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
5908 It now merely ensures that the menu is large enough, without
5909 necessarily growing it, as this avoids some integer overflow issues.
5910 All callers changed.
5911 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5913 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5914 Use SAFE_ALLOCA_LISP, not alloca.
5915 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5916 to EMACS_INT. Check that fixnums are in proper range for system types.
5917 * minibuf.c (minibuf_prompt_width, string_to_object)
5918 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5919 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5920 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5921 (get_minibuffer, read_minibuf_unwind):
5922 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5923 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5924 this simplifies overflow checking. All callers changed.
5925 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5926 (Ftest_completion):
5927 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5928 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5929 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5930 Check that fixnums are in proper range for system types.
5931 (Fx_create_frame, Fx_show_tip):
5932 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5933 * nsfont.m (ns_findfonts, nsfont_list_family):
5934 Don't assume fixnum fits in long.
5935 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5936 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5937 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5938 wide enough.
17fdb222 5939 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
5940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5941 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5942 (PRINTDECLARE, PRINTPREPARE):
5943 (strout, print_string):
5944 (print, print_preprocess, print_check_string_charset_prop)
5945 (print_object):
5946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5947 (PRINTDECLARE):
5948 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5949 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5950 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 5951 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 5952 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
5953 (print_error_message): Use SAFE_ALLOCA, not alloca.
5954 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
5955 (print_depth, new_backquote_output, print_number_index):
5956 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
5957 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5958 (Fset_process_window_size, Fformat_network_address)
5959 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 5960 (sigchld_handler):
d311d28c 5961 Check that fixnums are in proper range for system types.
d44287d4 5962 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
5963 Check for process-ids out of pid_t range rather than relying on
5964 undefined behavior.
e4d81efc 5965 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
5966 (Fformat_network_address, read_process_output, send_process)
5967 (Fprocess_send_region, status_notify):
5968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5969 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5970 (wait_reading_process_output, read_process_output, exec_sentinel):
5971 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5972 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5973 (Faccept_process_output): Use duration_to_sec_usec to do proper
5974 overflow checking on durations.
dde14581
PE
5975 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5976 Don't assume pid_t fits in int.
02481186
PE
5977 * process.h (struct Lisp_Process): Members tick and update_tick
5978 are now of type EMACS_INT, not int.
b62b53e8
PE
5979 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5980 configured --with-wide-int.
d311d28c
PE
5981 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5982 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5983 * search.c (looking_at_1, string_match_1):
5984 (fast_string_match, fast_c_string_match_ignore_case)
5985 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5986 (scan_newline, find_before_next_newline, search_command)
5987 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5988 (set_search_regs, wordify):
5989 (Freplace_match):
5990 (Fmatch_data):
5991 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5992 (string_match_1, search_buffer, set_search_regs):
5993 (Fmatch_data):
5994 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5995 (wordify): Check for overflow in size calculation.
5996 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5997 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5998 Check that fixnums are in proper range for system types.
5999 * sound.c (struct sound_device)
6000 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6002 (Fplay_sound_internal):
6003 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 6004 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
6005 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6006 (Fparse_partial_sexp):
6007 Don't assume fixnums can fit in int.
6008 (struct lisp_parse_state, find_start_pos, find_start_value)
6009 (find_start_value_byte, find_start_begv)
6010 (update_syntax_table, char_quoted, dec_bytepos)
6011 (find_defun_start, prev_char_comend_first, back_comment):
6012 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6013 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6014 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6015 (Finternal_describe_syntax_value): Check that match_lisp is a
6016 character, not an integer, since the code stuffs it into int.
6017 (scan_words, scan_sexps_forward):
6018 Check that fixnums are in proper range for system types.
6019 (Fforward_word):
6020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6021 (scan_sexps_forward):
6022 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6023 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6024 * syntax.h: Adjust decls to match defn changes elsewhere.
6025 (struct gl_state_s):
6026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
6027 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6028 MOST_POSITIVE_FIXNUM.
d311d28c
PE
6029 * sysdep.c (wait_for_termination_1, wait_for_termination)
6030 (interruptible_wait_for_termination, mkdir):
6031 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6032 (emacs_read, emacs_write):
6033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
6034 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6035 and double all fit in int.
d311d28c
PE
6036 * term.c (set_tty_color_mode):
6037 Check that fixnums are in proper range for system types.
6038 * termhooks.h (struct input_event):
6039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6040 * textprop.c (validate_interval_range, interval_of)
6041 (Fadd_text_properties, set_text_properties_1)
6042 (Fremove_text_properties, Fremove_list_of_text_properties)
6043 (Ftext_property_any, Ftext_property_not_all)
6044 (copy_text_properties, text_property_list, extend_property_ranges)
6045 (verify_interval_modification):
6046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6047 (Fnext_single_char_property_change)
6048 (Fprevious_single_char_property_change):
6049 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
6050 (copy_text_properties):
6051 Check for integer overflow in index calculation.
d311d28c
PE
6052 * undo.c (last_boundary_position, record_point, record_insert)
6053 (record_delete, record_marker_adjustment, record_change)
6054 (record_property_change):
6055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6056 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6058 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6059 (Fx_hide_tip, Fx_file_dialog):
6060 * w32menu.c (set_frame_menubar):
6061 Use ptrdiff_t, not int, for consistency with rest of code.
6062 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6063 (select_window, Fdelete_other_windows_internal)
6064 (window_scroll_pixel_based, window_scroll_line_based)
6065 (Frecenter, Fset_window_configuration):
6066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6067 (Fset_window_hscroll, run_window_configuration_change_hook)
6068 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 6069 (Fscroll_other_window, Frecenter):
d311d28c
PE
6070 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6071 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6072 Don't assume fixnum fits in int.
6073 (Fset_window_scroll_bars):
6074 Check that fixnums are in proper range for system types.
6075 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6076 (string_pos, c_string_pos, number_of_chars, init_iterator)
6077 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6078 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6079 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
6080 (face_before_or_after_it_pos, handle_invisible_prop)
6081 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
6082 (display_prop_intangible_p, string_buffer_position_lim)
6083 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6084 (get_overlay_strings_1, get_overlay_strings)
6085 (iterate_out_of_display_property, forward_to_next_line_start)
6086 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6087 (get_next_display_element, set_iterator_to_next)
6088 (get_visually_first_element, compute_stop_pos_backwards)
6089 (handle_stop_backwards, next_element_from_buffer)
6090 (move_it_in_display_line_to, move_it_in_display_line)
6091 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6092 (add_to_log, message_dolog, message_log_check_duplicate)
6093 (message2, message2_nolog, message3, message3_nolog
6094 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6095 (current_message_1, truncate_echo_area, truncate_message_1)
6096 (set_message, set_message_1, store_mode_line_noprop)
6097 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6098 (text_outside_line_unchanged_p, check_point_in_composition)
6099 (reconsider_clip_changes)
6100 (redisplay_internal, set_cursor_from_row, try_scrolling)
6101 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6102 (redisplay_window, find_last_unchanged_at_beg_row)
6103 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6104 (trailing_whitespace_p, find_row_edges, display_line)
6105 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6106 (display_mode_element, store_mode_line_string)
6107 (pint2str, pint2hrstr, decode_mode_spec)
6108 (display_count_lines, display_string, draw_glyphs)
6109 (x_produce_glyphs, x_insert_glyphs)
6110 (rows_from_pos_range, mouse_face_from_buffer_pos)
6111 (fast_find_string_pos, mouse_face_from_string_pos)
6112 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6114 (safe_call, init_from_display_pos, handle_fontified_prop)
6115 (handle_single_display_spec, load_overlay_strings)
6116 (with_echo_area_buffer, setup_echo_area_for_printing)
6117 (display_echo_area, echo_area_display)
6118 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6119 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
6120 (redisplay_window, dump_glyph_row, display_mode_line)
6121 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 6122 (handle_display_spec, display_prop_string_p):
d311d28c
PE
6123 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6124 (handle_single_display_spec, build_desired_tool_bar_string)
6125 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6126 (get_specified_cursor_type):
6127 Check that fixnums are in proper range for system types.
6128 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6129 (Flookup_image_map):
6130 Don't assume fixnums fit in int.
6131 (compare_overlay_entries):
6132 Avoid mishandling comparisons due to subtraction overflow.
6133 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6134 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6135 (handle_tool_bar_click):
6136 Use int, not unsigned, since we prefer signed and the signedness
6137 doesn't matter here.
6138 (get_next_display_element, next_element_from_display_vector):
6139 Use int, not EMACS_INT, when int is wide enough.
6140 (start_hourglass): Use duration_to_sec_usec to do proper
6141 overflow checking on durations.
6142 * xfaces.c (Fbitmap_spec_p):
6143 Check that fixnums are in proper range for system types.
6144 (compare_fonts_by_sort_order):
6145 Avoid mishandling comparisons due to subtraction overflow.
6146 (Fx_family_fonts, realize_basic_faces):
6147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6148 (Fx_family_fonts):
6149 Don't assume fixnum fits in int.
6150 Use SAFE_ALLOCA_LISP, not alloca.
6151 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6152 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6153 (face_at_buffer_position, face_for_overlay_string)
6154 (face_at_string_position):
6155 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6156 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6157 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6158 (Fx_show_tip):
6159 Check that fixnums are in proper range for system types.
6160 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6161 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6162 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6163 (Fx_change_window_property): Don't assume fixnums fit in int.
6164 * xfont.c (xfont_chars_supported):
6165 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6166 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6167 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6168 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6169 * xml.c (parse_region):
6170 * xrdb.c (magic_file_p):
6171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6172 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6173 (x_get_local_selection, x_reply_selection_request)
6174 (x_handle_selection_request, wait_for_property_change):
6175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6176 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6177 short is wide enough.
6178 (x_send_client_event): Don't assume fixnum fits in int.
6179 * xterm.c (x_x_to_emacs_modifiers):
6180 Don't assume EMACS_INT overflows nicely into int.
6181 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6182 may come from Lisp.
6183 (handle_one_xevent): NATNUMP can eval its arg twice.
6184 (x_connection_closed):
6185 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6186 * xterm.h: Adjust decls to match defn changes elsewhere.
6187 (struct scroll_bar): Use struct vectorlike_header
6188 rather than rolling our own approximation.
6189 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6190
c6574eb5
GM
61912012-05-25 Glenn Morris <rgm@gnu.org>
6192
6193 * lisp.mk (lisp): Update for more files being compiled now.
6194
e8d32c7e
SM
61952012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6196
48def666
SM
6197 * lread.c: Remove `read_pure' which makes no difference.
6198 (read_pure): Remove var.
6199 (unreadpure): Remove function.
6200 (readevalloop): Don't call read_list with -1 flag.
6201 (read1, read_vector): Don't test read_pure any more.
6202 (read_list): Simplify.
6203
e8d32c7e
SM
6204 * fileio.c, character.h: Minor style tweaks.
6205
4b2addb7
DA
62062012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6207
6208 * window.h (clip_changed): Remove useless declaration.
6209
584461b2
JB
62102012-05-22 Juanma Barranquero <lekktu@gmail.com>
6211
6212 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6213 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6214
34374650
PE
62152012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6216
6217 Remove src/m/*.
6218 This directory predates autoconf and is no longer needed nowadays.
6219 Move its few remaining bits of functionality to where they're needed.
6220 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6221 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6222 * m/template.h: Remove.
6223 * Makefile.in (M_FILE): Remove. All uses removed.
6224 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6225 * lisp.h (USE_LSB_TAG):
6226 * mem-limits.h (EXCEEDS_LISP_PTR):
6227 Use VAL_MAX, not VALBITS, in #if.
6228 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6229 (EMACS_UINT): Define unconditionally now.
6230 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6231 (BITS_PER_EMACS_INT): New constants, replacing
6232 what used to be in config.h, but not useful in #if.
6233 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6234 define them any more.
6235 (VAL_MAX): New macro.
6236 (VALMASK): Use it.
6237 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6238 BITS_PER_EMACS_INT, in #if.
6239 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6240 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6241 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6242 * s/ms-w32.h (DATA_START):
6243 Move here from removed file m/intel386.h.
6244 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6245 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6246
261cb4bb
PE
62472012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6248
6249 Assume C89 or later.
6250 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6251 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6252 (xrealloc):
6253 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6254 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6255 * textprop.c, tparam.c (NULL): Remove.
6256 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6257 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6258 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6259 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6260 * xterm.c (input_signal_count): Assume volatile works.
6261
ff23cd9f
KB
62622012-05-21 Ken Brown <kbrown@cornell.edu>
6263
6264 * xgselect.c (xg_select): Fix first argument in call to 'select'
6265 (bug#11508).
6266
1b170bc6
KB
62672012-05-20 Ken Brown <kbrown@cornell.edu>
6268
6269 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 6270 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 6271
b2f4d39f
KB
62722012-05-19 Ken Brown <kbrown@cornell.edu>
6273
6274 * xfns.c (x_in_use): Remove `static' qualifier.
6275 * xterm.h (x_in_use): Declare.
6276 * xgselect.c: Include xterm.h.
6277 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6278 and `display_arg' (bug#9754).
6279
003fdae2
PE
62802012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6281
9232a6d9
PE
6282 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6283
003fdae2
PE
6284 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6285 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6286
784b56e2
EZ
62872012-05-18 Eli Zaretskii <eliz@gnu.org>
6288
6289 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6290
6291 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 6292 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
6293
6294 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6295 reference to image_cache->refcount.
6296 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6297
a0a79cde
JL
62982012-05-17 Juri Linkov <juri@jurta.org>
6299
6300 * search.c (Fword_search_regexp, Fword_search_backward)
6301 (Fword_search_forward, Fword_search_backward_lax)
6302 (Fword_search_forward_lax): Move functions to isearch.el
6303 (bug#10145, bug#11381).
6304
b0572523
PE
63052012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6306
6307 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6308
9660f5fc
SM
63092012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6310
6311 * lread.c (init_obarray): Declare Qt and Qnil as special.
6312
4374de83
GM
63132012-05-14 Glenn Morris <rgm@gnu.org>
6314
6315 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 6316 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 6317
dc44c39a
PE
63182012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6319
078c97cb
PE
6320 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6321
dc44c39a
PE
6322 * unexaix.c: Port to more-recent AIX compilers.
6323 (report_error, report_error_1, make_hdr, copy_sym)
6324 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6325 Make arguments const char *, not char *, to avoid violations of C
6326 standard and to fix some AIX warnings reported by Gilles Pion.
6327
e18afed7 63282012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
6329
6330 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6331 already have overlays loaded.
6332 (handle_single_display_spec): Before returning without displaying
6333 fringe bitmap, synchronize the bidi iterator with the main display
6334 iterator, by calling iterate_out_of_display_property.
6335 (iterate_out_of_display_property): Detect buffer iteration by
6336 testing that it->string is a Lisp string.
6337 (get_next_display_element): When the current object is exhausted,
6338 and there's something on it->stack, call set_iterator_to_next to
6339 proceed with what's on the stack, instead of returning zero.
6340 (set_iterator_to_next): If called at the end of a Lisp string,
6341 proceed to consider_string_end without incrementing string
6342 position. Don't increment display vector index past the end of
6343 the display vector. (Bug#11417)
c8fb9dc6
EZ
6344 (pos_visible_p): Don't report a position visible when move_it_to
6345 stopped at the last line of window, which happens to be scanned
6346 backwards by the bidi iteration. (Bug#11464)
ac268e67 6347
e18afed7 63482012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
6349
6350 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6351 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
6352 are on a TTY, and thus unable to display on the fringes.
6353 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
6354 so we need to signal to the caller that this is a "replacing"
6355 display spec. This fixes display when the spec is invalid or we
6356 are on a TTY.
6357
e18afed7 63582012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
6359
6360 * unexaix.c (make_hdr): Fix typo in prototype.
6361 This bug broke the build on AIX. Problem reported by Gilles Pion.
6362
9d0a235a
MA
63632012-05-14 Michael Albinus <michael.albinus@gmx.de>
6364
6365 * keyboard.c (kbd_buffer_get_event): Read special events also in
6366 batch mode. (Bug#11415)
6367
9e6b06ed
GM
63682012-05-12 Glenn Morris <rgm@gnu.org>
6369
6370 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6371
c1a1d7a3
EZ
63722012-05-12 Eli Zaretskii <eliz@gnu.org>
6373
6374 * lisp.mk (lisp): Add newcomment.elc.
6375
3fe7cdc8
GM
63762012-05-12 Glenn Morris <rgm@gnu.org>
6377
6378 * Makefile.in (MKDIR_P): New, set by configure.
6379 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6380
53f7d2c0
PE
63812012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6382
6383 Remove unused function hourglass_started.
6384 * dispextern.h (hourglass_started):
6385 * w32fns.c (hourglass_started):
6386 * xdisp.c (hourglass_started): Remove.
6387
75aafb17
JB
63882012-05-10 Juanma Barranquero <lekktu@gmail.com>
6389
6390 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6391 Update dependencies.
6392
12959e8e
PE
63932012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6394
97107e2e
PE
6395 * xgselect.c (xg_select): Put maxfds+1 into a var.
6396 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6397
12959e8e
PE
6398 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6399
836d29b3
DA
64002012-05-10 Dave Abrahams <dave@boostpro.com>
6401
6402 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6403 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6404
5cb67954
MA
64052012-05-09 Michael Albinus <michael.albinus@gmx.de>
6406
6407 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6408 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6409 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6410 Initialize xd_registered_buses.
6411
3478ec45
PE
64122012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6413
b263a6b0
PE
6414 Untag more efficiently if USE_LSB_TAG.
6415 This is based on a proposal by YAMAMOTO Mitsuharu in
6416 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6417 For an admittedly artificial (nth 8000 longlist) benchmark on
6418 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6419 Emacs's overall text size by 1%.
6420 * lisp.h (XUNTAG): New macro.
6421 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6422 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6423 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6424 * eval.c (Fautoload):
6425 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6426 * frame.h (XFRAME): Use XUNTAG.
6427
3478ec45
PE
6428 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6429 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6430 Remove unportable assumptions about print widths of types like
6431 dbus_uint32_t.
6432 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6433 intptr_t when converting between pointer and integer, to avoid GCC
6434 warnings about wrong width.
6435
666b903b 64362012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
6437
6438 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6439 stack for each reader_thread, instead of defaulting to 8MB
6440 determined by the linker. This avoids failures in creating
6441 subprocesses on Windows 7, see the discussion in this thread:
6442 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6443
b120cc17
JC
64442012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6445
6446 Fix up display of the *Minibuf-0* buffer in the mini window.
6447 * keyboard.c (read_char): Don't clear the echo area if there's no
6448 message to clear.
6449 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 6450 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 6451
9a4b36f8
MA
64522012-05-07 Michael Albinus <michael.albinus@gmx.de>
6453
6454 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6455 batch mode.
6456
e5f9458f
CY
64572012-05-06 Chong Yidong <cyd@gnu.org>
6458
6459 * lisp.mk (lisp): Update.
6460
eceeb5fc 64612012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
6462
6463 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6464
71873e2b
SM
64652012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6466
6467 * data.c (PUT_ERROR): New macro.
6468 (syms_of_data): Use it. Add new error type `user-error'.
6469 * undo.c (user_error): New function.
6470 (Fprimitive_undo): Use it.
6471 * print.c (print_error_message): Adjust print style for `user-error'.
6472 * keyboard.c (user_error): New function.
6473 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6474
ab0fa4e4
PE
64752012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6476
6477 Do not limit current-time-string to years 1000..9999.
6478 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6479 (Fcurrent_time_string): Support any year that is supported by the
6480 underlying localtime representation. Don't use asctime, as it
6481 has undefined behavior for years outside the range -999..9999.
6482
7ed806a7
PE
64832012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6484
6485 Fix race conditions involving setenv, gmtime, localtime, asctime.
6486 Without this fix, interrupts could mess up code that uses these
6487 nonreentrant functions, since setting TZ invalidates existing
6488 tm_zone or tzname values, and since most of these functions return
6489 pointers to static storage.
6490 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6491 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6492 Grow the critical sections to include not just invoking
6493 localtime/gmtime, but also accessing these functions' results
6494 including their tm_zone values if any, and any related TZ setting.
6495 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
6496 so that the struct tm is saved in the critical section.
6497 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
6498 motivated by the fact that memory allocation needs to be outside
6499 the critical section.
6500
0c16dfed
DA
65012012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6502
6503 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6504 with RESET_INTERVAL.
6505
6506 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6507 Remove duplicated buffer name initialization.
6508
3f83ace8
JM
65092012-05-02 Jim Meyering <jim@meyering.net>
6510
6511 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6512
c7b8541e
JM
6513 * xfns.c (x_window): Use xstrdup (Bug#11375).
6514
90207a15 65152012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
6516
6517 * xdisp.c (pos_visible_p): If already at a newline from the
6518 display string before the 'while' loop, don't walk back the glyphs
6519 from it3.glyph_row. Solves assertion violation when the display
6520 string begins with a newline (egg.el). (Bug#11367)
6521
b593d6a9
AH
65222012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6523
6524 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6525 Move to simple.el.
6526
4737362e
GM
65272012-05-01 Glenn Morris <rgm@gnu.org>
6528
99cf43f9
GM
6529 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6530 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6531 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6532 All were removed before 23.1.
6533
9311dcff
GM
6534 * dispnew.c: Remove HAVE_LIBNCURSES test;
6535 it is always true on relevant platforms.
6536
4d5c6349
GM
6537 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6538 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6539
4737362e
GM
6540 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6541
74dd3a6b
AS
65422012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6543
6544 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6545 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6546 Remove.
6547
13c379ee
PE
65482012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 Do not avoid creating empty evaporating overlays (Bug#9642).
6551 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6552 That is, do not delete an evaporating overlay if it becomes
6553 empty after its bounds are adjusted to fit within its buffer.
6554 This fix caused other problems, and I'm reverting it until we get
6555 to the bottom of them.
6556
a8e7d6d7 65572012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
6558
6559 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6560
a8e7d6d7 65612012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
6562
6563 * xdisp.c (pos_visible_p): If the window start position is beyond
6564 ZV, start the display from buffer beginning. Prevents assertion
6565 violation in init_iterator when the minibuffer window is scrolled
6566 via the scroll bar.
6567
6568 * window.c (window_scroll_pixel_based): Likewise.
6569
a8e7d6d7 65702012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
6571
6572 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6573
a8e7d6d7 65742012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
6575
6576 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6577 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6578
a8e7d6d7 65792012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 6580
b593d6a9
AH
6581 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6582 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 6583
1c6900d9
EZ
65842012-04-26 Eli Zaretskii <eliz@gnu.org>
6585
4c3fa1d9
EZ
6586 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6587 display element, check also the underlying string or buffer
6588 character. (Bug#11341)
6589
1c6900d9
EZ
6590 * w32menu.c: Include w32heap.h.
6591 (add_menu_item): If the call to AppendMenuW (via
6592 unicode_append_menu) fails, disable Unicode menus only if we are
6593 running on Windows 9X/Me.
6594
42bf8205
AS
65952012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6596
6597 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6598 (xgetint): Add missing shift for LSB tags.
6599
b1bac16e
MR
66002012-04-24 Martin Rudalics <rudalics@gmx.at>
6601
6602 * keyboard.c (read_char): Don't wipe echo area for select window
6603 events: These might get delayed via `mouse-autoselect-window'
6604 (Bug#11304).
6605
d69621cc
JB
66062012-04-24 Juanma Barranquero <lekktu@gmail.com>
6607
6608 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6609 manipulation of :loaded-from data.
6610
02fd101b
JB
66112012-04-23 Juanma Barranquero <lekktu@gmail.com>
6612
6613 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6614 now a cons (bug#11311).
6615
888bec30
PE
66162012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6617
89a438bd
PE
6618 Do not create empty overlays with the evaporate property (Bug#9642).
6619 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6620 if it becomes empty after its bounds are adjusted to fit within
6621 its buffer. Without this fix, in a nonempty buffer (let ((o
6622 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6623 yields an empty overlay that has the evaporate property, which is
6624 not supposed to happen.
6625
1068fe4d
PE
6626 Fix minor GTK3 problems found by static checking.
6627 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6628 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6629 (struct _EmacsFixedClass, emacs_fixed_get_type):
6630 Move decls here from emacsgtkfixed.h, since they needn't be public.
6631 (emacs_fixed_get_type): Now static.
6632 (emacs_fixed_class_init): Omit unused local.
6633 (emacs_fixed_child_type): Remove; unused.
6634 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6635 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6636 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6637 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6638 (EMACS_FIXED_GET_CLASS): Remove; unused.
6639 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6640
888bec30
PE
6641 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6642 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6643
de85e130
PE
66442012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6645
d0baac98 6646 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 6647 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
6648 (__malloc_size_t, __malloc_ptrdiff_t):
6649 Remove. All uses removed, replaced by the definiens if needed,
6650 since we can assume C89 or better now.
6651 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6652 (protect_malloc_state, align, get_contiguous_space)
6653 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6654 (malloc_atfork_handler_child, malloc_enable_thread)
6655 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6656 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6657 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6658 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6659 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6660 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6661 Define using prototypes, not old style.
6662 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6663 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6664 (align): Don't assume that signed integer overflow wraps around.
6665 Omit unused local var.
6666 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6667 (_free_internal_nolock, memalign, mallochook, reallochook):
6668 Omit no-longer-needed casts.
6669 (valloc): Use getpagesize, not __getpagesize.
6670 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6671 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6672
de85e130
PE
6673 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6674
dcbf5805
MA
66752012-04-22 Michael Albinus <michael.albinus@gmx.de>
6676
6677 Move functions from C to Lisp. Make non-blocking method calls
6678 the default. Implement further D-Bus standard interfaces.
6679
6680 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6681 (QCdbus_request_name_allow_replacement)
6682 (QCdbus_request_name_replace_existing)
6683 (QCdbus_request_name_do_not_queue)
6684 (QCdbus_request_name_reply_primary_owner)
6685 (QCdbus_request_name_reply_in_queue)
6686 (QCdbus_request_name_reply_exists)
6687 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6688 (QCdbus_registered_serial, QCdbus_registered_method)
6689 (QCdbus_registered_signal): New Lisp objects.
6690 (XD_DEBUG_MESSAGE): Use sizeof.
6691 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6692 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6693 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6694 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6695 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6696 (xd_signature, xd_append_arg): Allow float for integer types.
6697 (xd_get_connection_references): New function.
b593d6a9
AH
6698 (xd_get_connection_address): Rename from xd_initialize.
6699 Return cached address.
dcbf5805
MA
6700 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6701 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6702 level.
6703 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 6704 Return number of refcounts.
dcbf5805
MA
6705 (Fdbus_get_unique_name): Make stronger parameter check.
6706 (Fdbus_message_internal): New defun.
6707 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6708 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6709 (Fdbus_send_signal, Fdbus_register_service)
6710 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6711 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6712 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6713 (Vdbus_compiled_version, Vdbus_runtime_version)
6714 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6715 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6716 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
6717 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6718 Adapt docstring.
dcbf5805 6719
52828e02
PE
67202012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6721
da05bc4c
PE
6722 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6723 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6724 Do not assume ptrdiff_t is the same width as 'int'.
6725
52828e02
PE
6726 * alloc.c: Handle unusual debugging option combinations.
6727 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6728 since the two debugging options are incompatible.
6729 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6730 is defined.
6731 (mem_init, mem_insert, mem_insert_fixup):
6732 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6733 (NEED_MEM_INSERT): Remove; no longer needed.
6734
f01769f9
LL
67352012-04-22 Leo Liu <sdl.web@gmail.com>
6736
6737 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6738
5790543d
PE
67392012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6740
6741 * sysdep.c [__FreeBSD__]: Minor cleanups.
6742 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6743 Use Emacs indenting style more consistently. Avoid some casts.
6744 Use 'double' consistently rather than mixing 'float' and 'double'.
6745
b91b7e4d
EW
67462012-04-21 Eduard Wiebe <usenet@pusto.de>
6747
b593d6a9
AH
6748 * sysdep.c (list_system_processes, system_process_attributes):
6749 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 6750
6114eb15
AS
67512012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6752
6753 * lisp.mk (lisp): Update.
6754
2f38dff7
PE
67552012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6756
6757 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6758 It is never used otherwise.
6759
4ae29f89
SM
67602012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6761
6762 * print.c (print_preprocess): Only check print_depth if print-circle
6763 is nil.
6764 (print_object): Check for cycles even when print-circle is nil and
6765 print-gensym is t, but only check print_depth if print-circle is nil.
6766
f30d612a
CY
67672012-04-20 Chong Yidong <cyd@gnu.org>
6768
6769 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6770 set the status to "failed" and ensure that sentinel is run.
6771
c07a4c0b 67722012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
6773
6774 * process.c (Fset_process_inherit_coding_system_flag)
6775 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 6776 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 6777
c07a4c0b 67782012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
6779
6780 * xdisp.c (string_buffer_position_lim): Limit starting position to
6781 BEGV.
6782 (set_cursor_from_row): If called for a mode-line or header-line
6783 row, return zero immediately.
6784 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
6785 farther than the first row after the header line, if any.
6786 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
6787 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6788
c07a4c0b 67892012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6790
4ae29f89
SM
6791 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6792 (bug#11238).
ad3a2b41 6793
c07a4c0b 67942012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 67952012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
6796
6797 configure: new option --enable-gcc-warnings (Bug#11207)
6798 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6799 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6800 (ALL_CFLAGS): Use new macros rather than old.
6801 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6802 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6803 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6804 -Wunused-result, -Wunused-variable. This should go away once
6805 the Emacs and Gnulib regex code is merged.
6806 (xmalloc, xrealloc): Now static.
6807
aba027e8
PE
68082012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6809
6810 * dired.c (Fsystem_groups): Remove unused local.
6811
e5a36063
GM
68122012-04-17 Glenn Morris <rgm@gnu.org>
6813
6814 * dired.c (Fsystem_users): Doc fix.
6815
316411f0
DA
68162012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6817
6818 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6819 (syms_of_dired): Add them.
6820
9426aba4
PE
68212012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6822
b62a57be
PE
6823 Fix minor alloc.c problems found by static checking.
6824 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6825 New extern decls, to avoid calling undeclared functions.
6826 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6827 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6828 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6829 (NEED_MEM_INSERT): New macro.
6830 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 6831 Remove one incorrect comment and fix another.
b62a57be 6832
3539f31f
PE
6833 Fix minor ralloc.c problems found by static checking.
6834 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6835 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6836 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6837 (r_alloc_sbrk): Now static.
6838
a041960a
PE
6839 Improve ralloc.c interface checking.
6840 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6841 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6842 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6843 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6844 [REL_ALLOC]: ... to here, to check interface.
6845 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6846 Remove decls. This fixes an "It stinks!".
6847
9426aba4
PE
6848 * alloc.c (which_symbols): Fix alignment issue / type clash.
6849
d55c12ed
AS
68502012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6851
6852 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6853 (struct Lisp_Misc_Any): Likewise.
6854 (struct Lisp_Free): Likewise.
6855 * alloc.c (union aligned_Lisp_Symbol): Define.
6856 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6857 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6858 (union aligned_Lisp_Misc): Define.
6859 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6860 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 6861 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 6862
b948ce8b
PE
68632012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6864
6865 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6866 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6867 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6868 * s/netbsd.h, s/sol2-6.h:
6869 Remove definition of GC_MARK_STACK, since the default now works.
6870 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6871 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6872 no longer the default.
6873 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6874
35dc09a1 68752012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6876
35dc09a1
GM
6877 * lread.c (lisp_file_lexically_bound_p):
6878 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 6879
35dc09a1
GM
68802012-04-14 Eli Zaretskii <eliz@gnu.org>
6881
6882 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6883 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6884
68852012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6886
6887 * nsterm.m (constrainFrameRect): Always constrain when there is only
6888 one screen (Bug#10962).
6889
bcd86815
KB
68902012-04-13 Ken Brown <kbrown@cornell.edu>
6891
6892 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6893
c25df26e
RT
68942012-04-13 Reuben Thomas <rrt@sc3d.org>
6895
6896 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6897
0fc59f1e
DC
68982012-04-11 Daniel Colascione <dancol@dancol.org>
6899
6900 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6901 against is gone. It's better to use vfork now so that when Cygwin
6902 gains a new, working vfork, we use it automatically (bug#10398).
6903
de8c03dc
SM
69042012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6905
6906 * window.c (save_window_save): Obey window-point-insertion-type.
6907
2f097256
GM
69082012-04-11 Glenn Morris <rgm@gnu.org>
6909
6910 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6911
453b951e
SM
69122012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6913
6914 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6915
75f1671a 69162012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
6917
6918 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6919 (force_quit_count): New var.
6920 (handle_interrupt): Use it.
6921
2a8ce227
JB
69222012-04-10 Juanma Barranquero <lekktu@gmail.com>
6923
6924 * w32.c (w32_delayed_load): Record the full path of the library
6925 being loaded (bug#10424).
6926
935396c0
GM
69272012-04-09 Glenn Morris <rgm@gnu.org>
6928
05920a43
GM
6929 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6930 not just in the obarray, before snarfing them. (Bug#11036)
6931
935396c0
GM
6932 * Makefile.in ($(leimdir)/leim-list.el):
6933 Pass EMACS rather than BUILT_EMACS.
6934
a18ecafa
TZ
69352012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6936
6937 * process.c (make_process):
6938 * process.h: Add integer `gnutls_handshakes_tried' member to
6939 process struct.
6940
6bbef4e5
JC
6941 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6942 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
6943
6944 * gnutls.c (gnutls_log_function2i): Convenience log function.
6945 (emacs_gnutls_read): Use new log functions,
6946 `gnutls_handshakes_tried' process member, and
6947 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6948 attempts per process (connection).
6949
b4d3bc10
CY
69502012-04-09 Chong Yidong <cyd@gnu.org>
6951
6952 * eval.c (Fuser_variable_p, user_variable_p_eh)
6953 (lisp_indirect_variable): Functions deleted.
6954 (Fdefvar): Caller changed.
6955
6956 * callint.c (Finteractive, Fcall_interactively):
6957 * minibuf.c (Fread_variable): Callers changed.
6958
70f4d973
EZ
69592012-04-09 Eli Zaretskii <eliz@gnu.org>
6960
6961 * xdisp.c (set_cursor_from_row): If the display string appears in
6962 the buffer at position that is closer to point than the position
6963 after the display string, display the cursor on the first glyph of
6964 the display string. Fixes cursor display when a 'display' text
6965 property immediately follows invisible text. (Bug#11094)
6966
cb3c2e3e
PE
69672012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6968
6969 composite.c: use 'double' consistently
6970 * composite.c (get_composition_id): Use 'double' consistently
6971 instead of converting 'float' to 'double' and vice versa; this is
6972 easier to understand and avoids a GCC warning.
6973
fd06db5d
GM
69742012-04-09 Glenn Morris <rgm@gnu.org>
6975
50fe702a
GM
6976 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6977 preparation for dumping it with emacs. (Bug#4789)
6978 (leimdir): New variable.
6979 ($(leimdir)/leim-list.el): New rule.
6980 (emacs$(EXEEXT)): Depend on leim-list.el.
6981
fd06db5d
GM
6982 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6983 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6984 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6985
55c131ee
AS
69862012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6987
6988 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6989 proper alignment.
6990
9209588f
JB
69912012-04-07 Juanma Barranquero <lekktu@gmail.com>
6992
6993 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6994 Remove unused local variable.
6995
e3fb2efb
PE
69962012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6997
6998 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6999 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7000 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7001 objects, as mark_maybe_pointer will catch them otherwise.
7002 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7003 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7004
b5385551
PE
70052012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7006
7007 Fix typo that broke non-Windows builds.
7008 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7009
9078ead6
EZ
70102012-04-07 Eli Zaretskii <eliz@gnu.org>
7011
7012 Support building on MS-Windows with libxml2.
7013
7014 * makefile.w32-in (OBJ2): Add xml.$(O).
7015 (GLOBAL_SOURCES): Add xml.c.
7016 ($(BLD)/xml.$(O)): New dependency list.
7017
7018 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7019 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7020 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7021 [!WINDOWSNT]: New macros.
7022 (init_libxml2_functions, libxml2_loaded_p): New functions.
7023 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7024 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7025 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7026 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7027 linked in).
6bbef4e5
JC
7028 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7029 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
7030 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7031
7032 * emacs.c: Don't include libxml/parser.h.
7033 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7034 xmlCleanupParser directly.
7035
7036 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7037
3811fdf3
EZ
70382012-04-07 Eli Zaretskii <eliz@gnu.org>
7039
7040 * indent.c (Fvertical_motion): If there is a display string at
7041 point, use it.vpos to compute how many lines to backtrack after
7042 move_it_to point. (Bug#11133)
7043
2f8e16b2
EZ
70442012-04-06 Eli Zaretskii <eliz@gnu.org>
7045
7046 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7047 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7048 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7049 macros related to unification of CJK characters. For the details,
7050 see the discussion following the message here:
7051 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7052
3d439cd1
CY
70532012-04-04 Chong Yidong <cyd@gnu.org>
7054
7055 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7056
8bc53d00
EZ
70572012-04-01 Eli Zaretskii <eliz@gnu.org>
7058
7059 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7060 instead of alloca. (Bug#11138)
7061
3b0512a3
AS
70622012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7063
7064 * w32menu.c (is_simple_dialog): Properly check lisp types.
7065 (Bug#11141)
7066
8427ddd2
EZ
70672012-03-31 Eli Zaretskii <eliz@gnu.org>
7068
979022ef
EZ
7069 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7070 position we get to after a call to move_it_to fails the
7071 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7072 only if we wind up in a string from display property. (Bug#11063)
7073
a6b1c7cc
EZ
7074 * window.c (Fdelete_other_windows_internal): Invalidate the row
7075 and column information about mouse highlight, so that redisplay
7076 restores it after reallocating the glyph matrices. (Bug#7464)
7077
8427ddd2
EZ
7078 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7079 string comes from a `display' text property, use the buffer
7080 position of that property as if we actually saw that position in
7081 the row's glyphs.
697ba24b
EZ
7082 (move_it_by_lines): Remove the assertion that
7083 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7084 violated when there's a before-string at the beginning of a line.
7085 (Bug#11063)
8427ddd2 7086
65a0a738
EZ
70872012-03-30 Eli Zaretskii <eliz@gnu.org>
7088
7089 * xdisp.c (append_space_for_newline): If the default face was
7090 remapped, use the remapped face for the appended newline.
7091 (extend_face_to_end_of_line): Use the remapped default face for
7092 extending the face to the end of the line.
7093 (display_line): Call extend_face_to_end_of_line when the default
7094 face was remapped. (Bug#11068)
7095
581355cc
EZ
70962012-03-29 Eli Zaretskii <eliz@gnu.org>
7097
7098 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7099
e8fc049f
SM
71002012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7101
7102 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7103
4fb9a543
GM
71042012-03-27 Glenn Morris <rgm@gnu.org>
7105
7106 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7107 Doc fixes.
7108
679910f1
KH
71092012-03-26 Kenichi Handa <handa@m17n.org>
7110
7111 * dispextern.h (struct glyph): Fix previous change. Change the
7112 bit length of glyphless.ch to 25 (Bug#11082).
7113
90d49b7f
CY
71142012-03-26 Chong Yidong <cyd@gnu.org>
7115
7116 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7117 (command_loop_1): Use it; inhibit selection update for
7118 handle-select-window too (Bug#8996).
7119
f514f6f0
FP
71202012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7121
e8fc049f 7122 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 7123
bf43fa51
KH
71242012-03-25 Kenichi Handa <handa@m17n.org>
7125
7126 * dispextern.h (struct glyph): Change the bit length of
7127 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7128
8a0c01dd
EZ
71292012-03-24 Eli Zaretskii <eliz@gnu.org>
7130
7131 * s/ms-w32.h (tzname): Include time.h before redirecting to
7132 _tzname. Fixes the MSVC build. (Bug#9960)
7133
7d1c3a76
AS
71342012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7135
8ed79523
AS
7136 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7137 characters.
7138
7d1c3a76
AS
7139 * xterm.c (XTread_socket): Only modify handling_signal if
7140 !SYNC_INPUT. (Bug#11080)
7141
e99a9b8b
EZ
71422012-03-23 Eli Zaretskii <eliz@gnu.org>
7143
7144 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7145 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7146 when fetching a multibyte character consumes more bytes than
7147 CHAR_BYTES returns, due to unification of CJK characters in
7148 string_char. (Bug#11073)
7149
5063c0e1
TN
71502012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7151
7152 * process.c (wait_reading_process_output): Handle pty disconnect
7153 by refraining from sending oneself a SIGCHLD (bug#10933).
7154
9f851fbd
CY
71552012-03-22 Chong Yidong <cyd@gnu.org>
7156
7157 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7158
5063c0e1 7159 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
7160 Mark string as coming from a prefix property.
7161 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7162 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7163
fb5b8aca
CY
71642012-03-21 Chong Yidong <cyd@gnu.org>
7165
7166 * xfaces.c (Vface_remapping_alist): Doc fix.
7167
62356a1b
EZ
71682012-03-20 Eli Zaretskii <eliz@gnu.org>
7169
7170 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
7171 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7172 Doc fixes.
62356a1b 7173
025de85b
CY
71742012-03-20 Chong Yidong <cyd@gnu.org>
7175
7176 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7177 to reflect default non-nil value of redisplay-dont-pause.
7178
4827f94e
KH
71792012-03-19 Kenichi Handa <handa@m17n.org>
7180
7181 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7182 it fit in a valid range (Bug#11003).
7183
e50a24a2
EZ
71842012-03-18 Eli Zaretskii <eliz@gnu.org>
7185
7186 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7187 that is not from display property, accept the row as a "cursor
7188 row" if one of the string's character has a non-nil `cursor'
7189 property. Fixes cursor positioning when there are newlines in
7190 overlay strings, e.g. in icomplete.el. (Bug#11035)
7191
9af5ed87
PE
71922012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7195
d1f55f16
CY
71962012-03-12 Chong Yidong <cyd@gnu.org>
7197
7198 * eval.c (inhibit_lisp_code): Rename from
7199 inhibit_window_configuration_change_hook; move from window.c.
7200
7201 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7202 * window.c (run_window_configuration_change_hook)
7203 (syms_of_window): Callers changed.
7204
66c5eebd
CY
72052012-03-11 Chong Yidong <cyd@gnu.org>
7206
413df973
CY
7207 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7208
66c5eebd
CY
7209 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7210
1de11f56
CY
72112012-03-10 Chong Yidong <cyd@gnu.org>
7212
7213 * frame.c (other_visible_frames): Don't assume the selected frame
7214 is visible (Bug#10955).
7215
cae07000
SM
72162012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7217
7218 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7219
89c94350
JD
72202012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7221
7222 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7223 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7224 zero (Bug#10954).
7225
999dd333
GM
72262012-03-03 Glenn Morris <rgm@gnu.org>
7227
01a6dcc8 7228 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 7229
de0100f2
EZ
72302012-03-02 Eli Zaretskii <eliz@gnu.org>
7231
7232 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7233 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
7234 (redisplay_window, next_element_from_string): Fix typos in
7235 comments.
3e441275
EZ
7236 (redisplay_window): Pass to move_it_vertically the margin in
7237 pixels, not in screen lines.
de0100f2 7238
96a72ee9
GM
72392012-03-02 Glenn Morris <rgm@gnu.org>
7240
7241 * buffer.c (buffer-list-update-hook): Doc fix.
7242
312508d7
EZ
72432012-02-29 Eli Zaretskii <eliz@gnu.org>
7244
7245 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7246 push_it before setting up the iterator for the first overlay
7247 string, even if we have an empty string loaded.
7248 (next_overlay_string): If there's an empty string on the iterator
7249 stack, pop the stack. (Bug#10903)
7250
27f3c637
PE
72512012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7252
7253 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7254 Suggested by Stefan Monnier in
7255 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7256 * alloc.c (widen_to_Lisp_Object): New static function.
7257 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7258 and widening them to Lisp_Objects. This would work even if
7259 USE_LSB_TAG is defined and wide integers are used, which might
7260 happen in a future version of Emacs.
7261
3c9dfce6
CY
72622012-02-25 Chong Yidong <cyd@gnu.org>
7263
fa74b241
CY
7264 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7265 Doc fix.
7266
3c9dfce6
CY
7267 * xselect.c (Fx_selection_exists_p): Doc fix.
7268 (x_clipboard_manager_save_all): Print an informative message
7269 before saving to clipboard manager.
7270
9486df08
CY
72712012-02-24 Chong Yidong <cyd@gnu.org>
7272
7273 * keyboard.c (process_special_events): Handle all X selection
7274 requests in kbd_buffer, not just the next one (Bug#8869).
7275
f01d3321
CY
72762012-02-23 Chong Yidong <cyd@gnu.org>
7277
7278 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7279 call when setting menu-bar-lines and tool-bar-lines parameters.
7280 (unwind_create_frame_1): New helper function.
7281
7282 * window.c (inhibit_window_configuration_change_hook): New var.
7283 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 7284 (syms_of_window): Initialize it.
f01d3321 7285
86b847b6
CY
72862012-02-22 Chong Yidong <cyd@gnu.org>
7287
7288 * xterm.c (x_draw_image_relief): Add missing type check for
7289 Vtool_bar_button_margin (Bug#10743).
7290
a59225b1
CY
72912012-02-21 Chong Yidong <cyd@gnu.org>
7292
7293 * fileio.c (Vfile_name_handler_alist): Doc fix.
7294
7295 * buffer.c (Fget_file_buffer): Protect against invalid file
7296 handler return value.
7297
310f5bd4
PE
72982012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7299
cb3a28cc
PE
7300 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7301 when computing $valmask.
7302
310f5bd4
PE
7303 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7304 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7305 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7306 It's useless in that case, and it can cause problems on hosts
7307 that allocate halves of EMACS_INT values separately.
7308 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7309 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7310 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7311 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7312 it avoids undefined behavior on hosts where shifting right by more
7313 than the word width has undefined behavior.
7314
2375c96a
CY
73152012-02-19 Chong Yidong <cyd@gnu.org>
7316
7317 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7318 (Funhandled_file_name_directory, Ffile_name_as_directory)
7319 (Fdirectory_file_name, Fexpand_file_name)
7320 (Fsubstitute_in_file_name): Protect against invalid file handler
7321 return values (Bug#10845).
7322
3eb49e71
EZ
73232012-02-18 Eli Zaretskii <eliz@gnu.org>
7324
7325 * .gdbinit (pitx): Fix incorrect references to fields of the
7326 iterator stack.
7327
7b926f3f
CY
73282012-02-17 Chong Yidong <cyd@gnu.org>
7329
7330 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7331
11273115
PE
73322012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7333
7334 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7335 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7336
c3a70e2b
CY
73372012-02-15 Chong Yidong <cyd@gnu.org>
7338
7339 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7340 marked as special. Also, starting docstrings with * is obsolete.
7341
0ca43699
AS
73422012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7343
7344 * gnutls.c (emacs_gnutls_write): Fix last change.
7345
2e8f3c56
LI
73462012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7347
7348 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7349 send_process.
7350
af70074f
SM
73512012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7352
7353 * keymap.c (Fsingle_key_description): Handle char ranges.
7354
95986d52
CY
73552012-02-12 Chong Yidong <cyd@gnu.org>
7356
afd83bd1
CY
7357 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7358 as that creates a dangerous corner case.
7359
95986d52
CY
7360 * window.c (Fdelete_window_internal): Invalidate the mouse
7361 highlight (Bug#9904).
7362
bd7da63e
GM
73632012-02-12 Glenn Morris <rgm@gnu.org>
7364
7365 * xselect.c (Fx_own_selection_internal)
7366 (Fx_get_selection_internal, Fx_disown_selection_internal)
7367 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7368 * nsselect.m (Fx_own_selection_internal)
7369 (Fx_disown_selection_internal, Fx_selection_exists_p)
7370 (Fx_selection_owner_p, Fx_get_selection_internal):
7371 Sync docs and argument specs with the xselect.c versions.
7372
77abcbc2
LI
73732012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7374
7375 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7376
90b671e2
EZ
73772012-02-11 Eli Zaretskii <eliz@gnu.org>
7378
1c0ca0b7
EZ
7379 * w32select.c (Fx_selection_exists_p): Sync doc string and
7380 argument list with xselect.c. (Bug#10783)
7381
7382 * w16select.c (Fx_selection_exists_p): Sync doc string and
7383 argument list with xselect.c. (Bug#10783)
90b671e2 7384
49241268
GM
73852012-02-10 Glenn Morris <rgm@gnu.org>
7386
7387 * fns.c (Fsecure_hash): Doc fix.
7388
f998bbe7 73892012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
7390
7391 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7392
0992bd9c
CY
73932012-02-07 Chong Yidong <cyd@gnu.org>
7394
7395 * buffer.c (Fbuffer_local_variables)
7396 (buffer_lisp_local_variables): Handle unbound vars correctly;
7397 don't let Qunbound leak into Lisp.
7398
af008560
GM
73992012-02-07 Glenn Morris <rgm@gnu.org>
7400
dd605cc4
GM
7401 * image.c (Fimagemagick_types): Doc fix.
7402
af008560
GM
7403 * image.c (imagemagick-render-type): Change it from a lisp object
7404 to an integer. Move the doc here from the lisp manual.
7405 Treat all values not equal to 0 the same.
7406
1449fa1d
CY
74072012-02-06 Chong Yidong <cyd@gnu.org>
7408
7409 * doc.c (store_function_docstring): Avoid applying docstring of
7410 alias to base function (Bug#2603).
7411
3723ec07
AS
74122012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7413
7414 * .gdbinit (pp1, pv1): Remove redundant defines.
7415 (pr): Use pp.
7416
79c1cc1e
CY
74172012-02-04 Chong Yidong <cyd@gnu.org>
7418
7419 * nsterm.m: Declare a global (Bug#10694).
7420
d7f29f8e
EZ
74212012-02-04 Eli Zaretskii <eliz@gnu.org>
7422
cae07000
SM
7423 * w32.c (get_emacs_configuration_options):
7424 Include --enable-checking, if specified, in the return value.
d7f29f8e 7425
3b95a6f9
MR
74262012-02-04 Martin Rudalics <rudalics@gmx.at>
7427
7428 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7429 after rounding frame sizes. (Bug#9723)
7430
d6fa96a6
EZ
74312012-02-04 Eli Zaretskii <eliz@gnu.org>
7432
7433 * keyboard.c (adjust_point_for_property): Don't position point
7434 before BEGV. (Bug#10696)
7435
df0b2940
PE
74362012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7437
7438 Handle overflow when computing char display width (Bug#9496).
7439 * character.c (char_width): Return EMACS_INT, not int.
7440 (char_width, c_string_width): Check for overflow when
7441 computing the width; this is possible now that individual
7442 characters can have unbounded width. Problem introduced
7443 by merge from Emacs 23 on 2012-01-19.
7444
6bee44d6
MA
74452012-02-02 Michael Albinus <michael.albinus@gmx.de>
7446
7447 * dbusbind.c (Fdbus_register_method): Mention the return value
7448 :ignore in the docstring.
7449
44f92739
GM
74502012-02-02 Glenn Morris <rgm@gnu.org>
7451
1b9f60cc
GM
7452 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7453
44f92739
GM
7454 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7455 Unconditionally set to t. (Bug#10673)
7456 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7457 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7458 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7459
c5d3843c
KH
74602012-02-02 Kenichi Handa <handa@m17n.org>
7461
7462 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7463 0, do not call append_composite_glyph.
7464
159462d4 74652012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
7466
7467 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7468 NULL (Bug#6988).
7469 (x_produce_glyphs): If the component of a composition is a null
7470 string, set it->pixel_width to 1 to avoid zero-width glyph.
7471
78cef877
EZ
74722012-02-01 Eli Zaretskii <eliz@gnu.org>
7473
7474 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7475 first 2 arguments are identical. This makes inserting large
7476 output from a subprocess an order of magnitude faster on
7477 MS-Windows, where all sbrk'ed memory is always contiguous.
7478
97897668
GM
74792012-01-31 Glenn Morris <rgm@gnu.org>
7480
7481 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 7482 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
7483 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7484
31fd3586
GM
74852012-01-29 Glenn Morris <rgm@gnu.org>
7486
7487 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7488
0e24a8b2
CY
74892012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7490
7491 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7492
cc0adcb0
CY
74932012-01-28 Chong Yidong <cyd@gnu.org>
7494
7495 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7496
acc28cb9
CY
74972012-01-26 Chong Yidong <cyd@gnu.org>
7498
9c69cfb7
CY
7499 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7500
acc28cb9
CY
7501 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7502 repeat counts (Bug#10507).
7503
48da7392
GM
75042012-01-26 Glenn Morris <rgm@gnu.org>
7505
7506 * lread.c (syms_of_lread): Doc fix.
7507
14af5f7f
CY
75082012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7509
7510 * coding.c (encode_designation_at_bol): Change return value to
7511 EMACS_INT.
7512
0b21c100
CY
75132012-01-25 Chong Yidong <cyd@gnu.org>
7514
7515 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7516
3c2907f7
CY
75172012-01-21 Chong Yidong <cyd@gnu.org>
7518
7519 * floatfns.c (Fcopysign): Make the second argument non-optional,
7520 since nil is not allowed anyway.
7521
959ad23f
AS
75222012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7523
7524 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7525 (send_process): Likewise.
7526
34a02f46
MR
75272012-01-19 Martin Rudalics <rudalics@gmx.at>
7528
7529 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
7530 (Vwindow_persistent_parameters): Do not use Qstate.
7531 Rewrite doc-strings.
34a02f46 7532
1259009a 75332012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
7534
7535 * character.c (char_width): New function.
70d4fdf6
GM
7536 (Fchar_width, c_string_width, lisp_string_width):
7537 Use char_width (Bug#9496).
25ed9e61 7538
6a6ee00d
MR
75392012-01-16 Martin Rudalics <rudalics@gmx.at>
7540
7541 * window.c (Vwindow_persistent_parameters): New variable.
7542 (Fset_window_configuration, save_window_save): Handle persistent
7543 window parameters.
7544
c85efaf7
EZ
75452012-01-14 Eli Zaretskii <eliz@gnu.org>
7546
7547 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7548 thrashing the stack of the thread. (Bug#9087)
7549
5944709e
PE
75502012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7551
7552 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7553
e71f5d99
EZ
75542012-01-11 Eli Zaretskii <eliz@gnu.org>
7555
7556 * xdisp.c (rows_from_pos_range): Handle the case where the
7557 highlight ends on a newline. (Bug#10464)
7558 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7559 he end column for display of highlight that ends on a newline
7560 before a R2L line.
7561
ce316182
GM
75622012-01-11 Glenn Morris <rgm@gnu.org>
7563
7564 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7565 from load-path also when installation-directory is nil. (Bug#10208)
7566
5b43da69
GM
75672012-01-10 Glenn Morris <rgm@gnu.org>
7568
74cc8ff9
GM
7569 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7570
7d8d6e4e
GM
7571 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7572 Update template values to be closer to their typical values these days.
5b43da69 7573
a0db8d43
EZ
75742012-01-09 Eli Zaretskii <eliz@gnu.org>
7575
7576 * xdisp.c (rows_from_pos_range): Accept additional argument
7577 DISP_STRING, and accept any glyph in a row whose object is that
7578 string as eligible for mouse highlight. Fixes mouse highlight of
7579 display strings from overlays. (Bug#10464)
7580
9a0115ab 75812012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 7582
b9110d6a 7583 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
7584 * fileio.c (auto_saving_dir_umask): New static var.
7585 (Fmake_directory_internal): Use it.
7586 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7587 creating the directory. The old code temporarily assigns
7588 too-generous permissions to the directory.
7589 (do_auto_save_eh): Clear it.
b9110d6a 7590 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
7591 that the var is always cleared.
7592
6c1bd3f3
EZ
75932012-01-07 Eli Zaretskii <eliz@gnu.org>
7594
7595 * search.c (scan_buffer): Pass character positions to
7596 know_region_cache, not byte positions. (Bug#6540)
7597
069d2b50
L
75982012-01-07 LynX <_LynX@bk.ru> (tiny change)
7599
7600 * w32.c (sys_rename): Report EXDEV when rename of a directory
7601 fails because the target is on another logical disk. (Bug#10284)
7602
75bf0d33
DB
76032012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7604
7605 * xterm.c (x_embed_request_focus): New function.
7606
7607 * xterm.h: Add prototype.
7608
7609 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7610
1c6e5a32
GM
76112012-01-05 Glenn Morris <rgm@gnu.org>
7612
7613 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7614
651e947e
EZ
76152012-01-01 Eli Zaretskii <eliz@gnu.org>
7616
7617 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7618 Load gnutls_transport_set_lowat only if GnuTLS version is below
7619 2.11.1.
7620 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7621 GnuTLS versions below 2.11.1.
7622
3778cdd8
AL
76232011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7624
7625 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7626 to the doc string advising against its use for altering the way
7627 windows are scrolled.
7628
0e5317f7
KH
76292011-12-28 Kenichi Handa <handa@m17n.org>
7630
7631 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7632 coding-system ASCII compatible only when it does not produce BOM
7633 on encoding (Bug#10383).
7634
93d5ca1f
JD
76352011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7636
7637 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7638 can scroll.
7639 (create_and_show_popup_menu): Always use menu_position_func for
7640 Gtk3 (Bug#10361).
7641
ca22b785
AS
76422011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7643
7644 * callint.c (Fcall_interactively): Don't truncate prompt string.
7645
d048e1e6
EZ
76462011-12-23 Eli Zaretskii <eliz@gnu.org>
7647
7648 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7649 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 7650 resumed from there (after widening). (Bug#10360)
d048e1e6 7651
5ccaba1f
JD
76522011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7653
7654 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7655
204ee57f
JD
76562011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7657
b81d40f0
JB
7658 * nsterm.m (x_free_frame_resources):
7659 Release f->output_data.ns->miniimage.
204ee57f
JD
7660 (ns_index_color): Fix indentation. Do not retain
7661 color_table->colors[i].
7662
7663 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7664 before returning.
7665
7666 * nsfns.m (x_set_background_color): Assign return value from
7667 ns_index_color to face-background instead of NSColor*.
7668 (ns_implicitly_set_icon_type): Fix indentation.
7669 Change assignment in for loop to comparison.
7670
7671 * emacs.c (ns_pool): New variable.
7672 (main): Assign ns_pool.
7673 (Fkill_emacs): Call ns_release_autorelease_pool.
7674
7675 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7676 autorelease fdesc, release fdAttrs and tdict.
7677 (ns_get_covering_families): Release charset.
7678 (ns_findfonts): Release NSFontDescriptor created with new.
7679 (ns_uni_to_glyphs): Fix indentation.
7680 (setString): Release attrStr before assigning new value.
7681
c803b2b7
JD
76822011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7683
678f4426
JD
7684 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7685 and NS_IMPL_COCOA.
7686 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7687 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7688
cd394be1 76892011-12-18 David Reitter <reitter@cmu.edu>
678f4426 7690
5fecd5fc
JD
7691 * nsterm.m (ns_term_init): Subscribe for notifications
7692 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7693 to method trackingNotification in EmacsMenu.
7694
7695 * nsmenu.m (trackingMenu): New variable.
3771cb17 7696 (trackingNotification): New method (from Aquamacs).
5fecd5fc 7697 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 7698 from Aquamacs (Bug#7030).
678f4426
JD
7699
77002011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 7701
c803b2b7
JD
7702 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7703 (symbol_to_nsstring): Fix indentation.
7704 (ns_symbol_to_pb): New function.
cae07000
SM
7705 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7706 (Fns_rotate_cut_buffers_internal): Remove.
7707 (Fns_store_selection_internal): Rename from
c803b2b7
JD
7708 Fns_store_cut_buffer_internal.
7709 (ns_get_foreign_selection, Fx_own_selection_internal)
7710 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
7711 (Fns_get_selection_internal, Fns_store_selection_internal):
7712 Use ns_symbol_to_pb and check if return value is nil.
7713 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7714 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
7715 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7716 renamed to Sns_store_selection_internal.
7717 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7718 and remove this function.
7719 (ns_handle_selection_clear): Remove, never used.
7720 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7721 here.
7722
e1b01a3a
KB
77232011-12-17 Ken Brown <kbrown@cornell.edu>
7724
7725 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7726 GID is unknown (Bug#10257).
7727
2adb6e85
PE
77282011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7729
7730 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7731 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7732 which caused a build failure on GNU/Linux IA-64. This problem was
7733 introduced by my 2011-10-07 patch.
7734
d1d7b339
JL
77352011-12-15 Juri Linkov <juri@jurta.org>
7736
7737 * image.c (imagemagick_error): New function. (Bug#10112)
7738 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7739 Use `imagemagick_error' where ImageMagick functions return
7740 `MagickFalse'.
7741 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7742 proper order.
7743
100d5755
KH
77442011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7745
7746 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7747 fill background (Bug#8992).
7748
454592a6
MR
77492011-12-13 Martin Rudalics <rudalics@gmx.at>
7750
7751 * window.c (Vwindow_combination_resize)
7752 (Vwindow_combination_limit): Use t instead of non-nil in
7753 doc-strings.
61d4b438
MR
7754 (Vrecenter_redisplay): Add first sentence of doc-string on
7755 separate line.
53524d93 7756 (Frecenter): Fix doc-string typo.
454592a6 7757
3633e3aa
KH
77582011-12-11 Kenichi Handa <handa@m17n.org>
7759
7760 * coding.c (Funencodable_char_position): Pay attention to the
7761 buffer text relocation (Bug#9389).
7762
7b9d523a 77632011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 7764
7b9d523a
JD
7765 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7766 gtk_init (Bug#10100).
7767
b73189c6
EZ
77682011-12-10 Eli Zaretskii <eliz@gnu.org>
7769
7770 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7771 IT->string is nil. (Bug#10263)
7772
f7dfe5d6
JD
77732011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7774
83faebb4
JD
7775 * nsterm.h (x_free_frame_resources): Declare.
7776
f7dfe5d6
JD
7777 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7778 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7779
7780 * nsterm.h (ns_get_defaults_value): Declare.
7781
7782 * nsterm.m (ns_default): Call ns_get_defaults_value.
7783
7cd4e72c
EZ
77842011-12-09 Eli Zaretskii <eliz@gnu.org>
7785
7786 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7787 (Bug#10170)
7788
b34d7317
YM
77892011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7790
7791 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7792 that where the value of an _OBJC_* symbol points to is in the .bss
7793 section (Bug#10240).
7794
76470ad1
KH
77952011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7796
7797 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 7798 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 7799
745fff94
KH
78002011-12-08 Kenichi Handa <handa@m17n.org>
7801
7802 * ftfont.c (get_adstyle_property): Fix previous change
7803 (Bug#10233).
7804
6e44397c
JB
78052011-12-07 Juanma Barranquero <lekktu@gmail.com>
7806
7807 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7808 dirs from the default value of EMACSLOADPATH (bug#10208).
7809
7efa6272
GM
78102011-12-07 Glenn Morris <rgm@gnu.org>
7811
7812 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7813 installation and source directories as well. (Bug#10208)
7814
f6fc4d87
CY
78152011-12-06 Chong Yidong <cyd@gnu.org>
7816
7817 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7818
2bf26180
GM
78192011-12-06 Glenn Morris <rgm@gnu.org>
7820
7821 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7822 as an error, not just -1. (Bug#10217)
7823
3a6ad4f0
CY
78242011-12-05 Chong Yidong <cyd@gnu.org>
7825
7826 * keyboard.c (process_special_events): New function.
7827 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7828
75a3b399
PE
78292011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7830
7831 * coding.c (encode_designation_at_bol): Don't use uninitialized
7832 local variable (Bug#9318).
7833
c3c9e25e
KH
78342011-12-05 Kenichi Handa <handa@m17n.org>
7835
7836 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7837 return Qnil (Bug#8046, Bug#10193).
7838
5eb05ea3
KH
78392011-12-05 Kenichi Handa <handa@m17n.org>
7840
7841 * coding.c (encode_designation_at_bol): New args charbuf_end and
7842 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
7843 (coding_set_source): Return how many bytes coding->source was
7844 relocated.
7845 (coding_set_destination): Return how many bytes
7846 coding->destination was relocated.
7847 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 7848 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
7849
78502011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7851
7852 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7853 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7854 macro (Bug#9318).
7855
78562011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7857
7858 The following changes are to fix Bug#9318.
7859
a79703f5 7860 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
7861 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7862 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 7863 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 7864
7dbda6df
JB
78652011-12-05 Juanma Barranquero <lekktu@gmail.com>
7866
7867 * lisp.h (process_quit_flag): Fix external declaration.
7868
6d5eb5b0
SM
78692011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7870
7871 Don't macro-inline non-performance-critical code.
7872 * eval.c (process_quit_flag): New function.
7873 * lisp.h (QUIT): Use it.
7874
a0c3fad0
JD
78752011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7876
7877 * nsfns.m (get_geometry_from_preferences): New function.
7878 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7879
6c07aac2
AS
78802011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7881
7882 * emacs.c (Qkill_emacs): Define.
7883 (syms_of_emacs): Initialize it.
7884 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7885 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
7886 (quit_throw_to_read_char): Add parameter `from_signal'.
7887 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
7888 * lisp.h (QUIT): Call Fkill_emacs if requested.
7889
c052ead4
JD
78902011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7891
7892 * widget.c (update_wm_hints): Return if wmshell is null.
7893 (widget_update_wm_size_hints): New function.
7894
7895 * widget.h (widget_update_wm_size_hints): Declare.
7896
7897 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7898 widget_update_wm_size_hints (Bug#10104).
7899
9e49252b
EZ
79002011-12-03 Eli Zaretskii <eliz@gnu.org>
7901
7902 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7903 before a newline, prepare the bidi iterator for consuming the
7904 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 7905 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 7906
02b16839
JL
79072011-12-02 Juri Linkov <juri@jurta.org>
7908
7909 * search.c (Fword_search_regexp): New Lisp function created from
7910 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7911 (Fword_search_backward, Fword_search_forward)
7912 (Fword_search_backward_lax, Fword_search_forward_lax):
7913 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7914 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7915
0068070e
SM
79162011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7917
7918 * fileio.c (Finsert_file_contents): Move after-change-function call
7919 to before the "handled:" label, since all "goto handled" appear in
7920 cases where the *-change-functions have already been properly called
7921 (bug#10117).
7922
3360a3fc
AS
79232011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7924
7925 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7926 waiting for input. (Bug#10169)
7927
73d6c093
EZ
79282011-11-30 Eli Zaretskii <eliz@gnu.org>
7929
7930 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7931 verifies glyph row's hash code--we have just reallocated the
7932 glyphs, so their contents can be complete garbage. (Bug#10164)
7933
febe6bea
JB
79342011-11-30 Juanma Barranquero <lekktu@gmail.com>
7935
7936 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7937
801a4313
EZ
79382011-11-30 Eli Zaretskii <eliz@gnu.org>
7939
7940 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7941 attributes are tested _before_ calling verify_row_hash, to protect
7942 against GCC re-ordering of the tests. (Bug#10164)
7943
2b56b87e
JD
79442011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7945
7946 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7947
7948 * xterm.c (handle_one_xevent): Only set async_visible and friends
7949 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 7950 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
7951 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7952
dbf31225
PE
79532011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7954
7955 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7956 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7957 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7958 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7959 All uses changed to use GCPRO1 etc.
7960 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7961 Revert to old implementation (i.e., before 2011-03-11).
7962
1305621b
YM
79632011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7964
7965 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7966 of scroll runs so as to avoid assigning disabled bogus rows and
7967 unnecessary graphics copy operations.
7968
8c9afb46
EZ
79692011-11-27 Eli Zaretskii <eliz@gnu.org>
7970
7971 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7972 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7973 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7974 (malloc, free, realloc, calloc): Redirect to e_* only when
7975 compiling Emacs.
7976
7977 * lisp.h (GCTYPEBITS): Move before first use.
7978 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7979 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7980 this macro definition.
7981
7982 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7983 _MSC_VER.
7984
54e9e3bf
JD
79852011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7986
6d5eb5b0
SM
7987 * gtkutil.c (xg_create_frame_widgets):
7988 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
7989 present with Gtk+ 2.0.
7990
83aca1cb
PE
79912011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7992
7993 * fileio.c (Finsert_file_contents): Undo previous change; see
7994 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7995
5b76caa4
PE
79962011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7997
7998 Rename locals to avoid shadowing.
7999 * fileio.c (Finsert_file_contents):
8000 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8001 * process.c (wait_reading_process_output):
8002 Rename inner 'proc' to 'p' to avoid shadowing.
8003 Indent for consistency with usual Emacs style.
8004
8c535114
EZ
80052011-11-25 Eli Zaretskii <eliz@gnu.org>
8006
8007 * xdisp.c (redisplay_window): If cursor row is not fully visible
8008 after recentering, and scroll-conservatively is set to a large
8009 number, scroll window by a few more lines to make the cursor fully
8010 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
8011 (start_display): Don't move to the next line if the display should
8012 start at a newline that is part of a display vector or an overlay
8013 string. (Bug#10119)
8c535114 8014
fa4fdb5c
JL
80152011-11-24 Juri Linkov <juri@jurta.org>
8016
8017 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8018 after the `MagickPingImage' call. (Bug#10112)
8019
90ec88df
CY
80202011-11-23 Chong Yidong <cyd@gnu.org>
8021
8022 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8023
56e2e794
MR
80242011-11-23 Martin Rudalics <rudalics@gmx.at>
8025
8026 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8027 making another buffer current. (Bug#10114)
8028
b6e64c41
GM
80292011-11-23 Glenn Morris <rgm@gnu.org>
8030
8031 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8032
6b21de18
CY
80332011-11-23 Chong Yidong <cyd@gnu.org>
8034
8035 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8036 using it (Bug#5984).
8037
b12cd789
EZ
80382011-11-22 Eli Zaretskii <eliz@gnu.org>
8039
8040 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8041 and header-lines, as they don't have one computed for them.
8042 (Bug#10098)
8043
8044 * .gdbinit (prow): Make displayed values more self-explaining.
8045 Add row's hash code.
8046
261b6fd4
LMI
80472011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8048
8049 * process.c (wait_reading_process_output): Fix asynchrounous
8050 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 8051 (wait_reading_process_output): Add comment and URL.
261b6fd4 8052
e7cfd277
JD
80532011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8054
8055 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8056
a9b9b7f5
CY
80572011-11-21 Chong Yidong <cyd@gnu.org>
8058
8059 * window.c (Fnext_window, Fprevious_window): Doc fix.
8060
b0d15b4f
SM
80612011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8062
8063 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8064
fe7a3057
JB
80652011-11-20 Juanma Barranquero <lekktu@gmail.com>
8066
8067 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8068
d2999b1a
MR
80692011-11-20 Martin Rudalics <rudalics@gmx.at>
8070
8071 * window.c (Fset_window_combination_limit): Rename argument
8072 STATUS to LIMIT.
8073 (Vwindow_combination_limit): Remove "status" from doc-string.
8074
d5ff9cd0
AS
80752011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8076
8077 * m/ibms390.h: Remove.
8078 * m/ibms390x.h: Don't include "ibms390.h".
8079
a5bb9bd3
SM
80802011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8081
8082 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8083 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8084
cd1181db
JB
80852011-11-20 Juanma Barranquero <lekktu@gmail.com>
8086
8087 * casetab.c (Fset_case_table):
8088 * charset.c (Fcharset_after): Fix typos.
8089
615a3b8d 80902011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 8091
17e845af
PE
8092 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8093 Otherwise, valgrind does not work on some platforms.
8094 Problem reported by Andreas Schwab in
6a0bf43d
PE
8095 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8096 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8097 is set, removing the need for VIRT_ADDRESS_VARIES.
8098 (PURE_P): Use a more-efficient implementation that needs just one
8099 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8100 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8101 to 4 (xorl, subq, cmpq, setbe).
8102 * alloc.c (pure): Always extern now, since that's the
8103 VIRT_ADDR_VARIES behavior.
8104 (PURE_POINTER_P): Use a single comparison, not two, for
8105 consistency with the new puresize.h.
8106 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8107 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8108 Remove VIRT_ADDR_VARIES no longer needed.
8109
f8fe6f96
EZ
81102011-11-19 Eli Zaretskii <eliz@gnu.org>
8111
8112 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8113 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8114 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8115 behave as if the cursor position were at the window margin.
8116
8117 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8118 and the cursor position is out of bounds, behave as if the cursor
8119 position were at the window margin. (Bug#10075)
8120
df05a53c
CY
81212011-11-18 Chong Yidong <cyd@gnu.org>
8122
8123 * window.c (Fwindow_combination_limit): Make first argument
8124 non-optional, since it is meaningless for live windows like the
8125 selected window.
61ccba97 8126
2071918e
DA
81272011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8128
8129 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8130
b50a28de
SM
81312011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8132
8133 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8134 (graft_intervals_into_buffer): Simplify.
8135
015137db
EZ
81362011-11-18 Eli Zaretskii <eliz@gnu.org>
8137
8138 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8139 hash values of the two rows.
8140 (copy_row_except_pointers): Preserve the used[] arrays and the
8141 hash values of the two rows. (Bug#10035)
68c95424 8142 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
8143
8144 * xdisp.c (row_hash): New function, body extracted from
8145 compute_line_metrics.
8146 (compute_line_metrics): Call row_hash, instead of computing the
8147 hash code inline.
8148
8149 * dispnew.c (verify_row_hash): Call row_hash for computing the
8150 hash code of a row, instead of duplicating code from xdisp.c.
8151
8152 * dispextern.h (row_hash): Add prototype.
8153
a2addb04
TH
81542011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8155
8156 * frame.c (delete_frame): Don't delete the terminal when the last
8157 X frame is closed if emacs is built with GTK toolkit.
8158
df85d315
JB
81592011-11-17 Juanma Barranquero <lekktu@gmail.com>
8160
8161 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8162
a0c2d0ae
MR
81632011-11-17 Martin Rudalics <rudalics@gmx.at>
8164
8165 * window.c (Vwindow_splits): Rename to
8166 Vwindow_combination_resize. Suggested by Juri Linkov.
8167 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8168 of Vwindow_splits.
8169
58179cce
JB
81702011-11-16 Juanma Barranquero <lekktu@gmail.com>
8171
7877f373
JB
8172 * nsfns.m (Fns_font_name):
8173 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 8174
b6f67890
MR
81752011-11-16 Martin Rudalics <rudalics@gmx.at>
8176
8177 * window.h (window): Rename slot "nest" to "combination_limit".
8178 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8179 (Fset_window_nest): Rename to Fset_window_combination_limit.
8180 (Vwindow_nest): Rename to Vwindow_combination_limit.
8181 (recombine_windows, make_parent_window, make_window)
8182 (Fsplit_window_internal, saved_window)
8183 (Fset_window_configuration, save_window_save): Rename all
8184 occurrences of window_nest to window_combination_limit.
8185
c7015153
JB
81862011-11-15 Juanma Barranquero <lekktu@gmail.com>
8187
8188 * image.c (imagemagick_load_image): Fix typo.
8189
322ad6ec
EZ
81902011-11-14 Eli Zaretskii <eliz@gnu.org>
8191
8192 * xdisp.c (display_line): Move the call to
8193 highlight_trailing_whitespace before the call to
8194 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
8195 faces of all the glyphs to compute ROW's hash value.
8196 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 8197
f067b8ec
JB
81982011-11-14 Juanma Barranquero <lekktu@gmail.com>
8199
8200 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8201 just return (bug#10044).
8202
1e5b2111
EZ
82032011-11-12 Eli Zaretskii <eliz@gnu.org>
8204
7ef3cbd5
EZ
8205 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8206 with user-defined heap size. Bump the default size of the temacs
8207 heap to 27MB, to avoid memory warning when running temacs.
8208 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8209
1e5b2111
EZ
8210 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8211 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
8212 (verify_row_hash) [XASSERTS]: New function.
8213 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8214 that the hash value of glyph rows is correct.
1e5b2111 8215
89d61221
MR
82162011-11-12 Martin Rudalics <rudalics@gmx.at>
8217
8218 * window.h (window): Remove splits slot.
8219 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8220 (Fdelete_other_windows_internal, make_parent_window)
8221 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8222 (Fset_window_configuration, save_window_save): Don't deal with
8223 split status of windows.
8224 (saved_window): Remove splits slot.
8225 (Vwindow_splits): Rewrite doc-string.
8226
97f18cc8
JD
82272011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8228
8229 * xfns.c (unwind_create_frame):
8230 * nsfns.m (unwind_create_frame):
8231 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8232 Vframe_list (Bug#9999).
8233
22a648b4
DA
82342011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8235
0b381c7e 8236 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 8237
659afede
KH
82382011-11-11 Kenichi Handa <handa@m17n.org>
8239
8240 * callproc.c (Fcall_process): Set the member dst_multibyte of
8241 process_coding.
8242
9ac0394b
KH
82432011-11-11 Johan Bockgård <bojohan@gnu.org>
8244
8245 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8246 avoid a crash (bug#9496).
8247
2fbdc249
CY
82482011-11-09 Chong Yidong <cyd@gnu.org>
8249
8250 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8251 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8252
ac6b1f81
PE
82532011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8254
8255 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8256
09db192c
PE
82572011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8258
8259 Avoid some portability problems by eschewing 'extern inline' functions.
8260 The trivial performance wins aren't worth the portability hassles; see
8261 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8262 et seq.
8263 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8264 (window_box_width, window_box_left, window_box_left_offset)
8265 (window_box_right, window_box_right_offset): Undo previous change,
8266 by removing the "extern"s.
8267 * intervals.c (adjust_intervals_for_insertion)
8268 (adjust_intervals_for_deletion): Undo previous change,
8269 making these static again.
8270 (offset_intervals, temp_set_point_both, temp_set_point)
8271 (copy_intervals_to_string): No longer inline.
8272 * xdisp.c (window_text_bottom_y, window_box_width)
8273 (window_box_height, window_box_left_offset)
8274 (window_box_right_offset, window_box_left, window_box_right)
8275 (window_box): No longer inline.
8276
105216ed
CY
82772011-11-08 Chong Yidong <cyd@gnu.org>
8278
8279 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
8280 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8281 Signal an error if not a live window.
105216ed
CY
8282 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8283 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8284
ae9e237f
JB
82852011-11-07 Juanma Barranquero <lekktu@gmail.com>
8286
8287 * lisp.h (syms_of_abbrev): Remove declaration.
8288 Reported by CHENG Gao <chenggao@royau.me>.
8289
c7aa8333
EZ
82902011-11-07 Eli Zaretskii <eliz@gnu.org>
8291
8292 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8293 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8294 of temacs in GUI mode.
8295
be7f5545
MR
82962011-11-07 Martin Rudalics <rudalics@gmx.at>
8297
8298 * window.h: Declare delete_all_child_windows instead of
8299 delete_all_subwindows.
8300 * window.c (Fwindow_nest, Fset_window_nest)
8301 (Fset_window_new_total, Fset_window_new_normal)
8302 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8303 (delete_all_subwindows): Rename to delete_all_child_windows.
8304 (Fdelete_other_windows_internal, Fset_window_configuration):
8305 Call delete_all_child_windows instead of delete_all_subwindows.
8306 * frame.c (delete_frame): Call delete_all_child_windows instead
8307 of delete_all_subwindows.
8308
ca78dc43
PE
83092011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8310
8311 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8312 This is also needed for porting to any host where GC_MARK_STACK is
8313 not GC_MAKE_GCPROS_NOOPS.
8314 (which_symbols): Use it.
8315
a0241d01
KH
83162011-11-07 Kenichi Handa <handa@m17n.org>
8317
8318 * coding.c (coding_set_destination): Check coding->src_pos only
8319 when coding->src_object is a buffer (bug#9910).
8320
8321 * process.c (send_process): Set the member src_multibyte of coding
8322 to 0 (bug#9911) when sending a unibyte text.
8323
8324 * callproc.c (Fcall_process): Set the member src_multibyte of
8325 process_coding to 0 (bug#9912).
8326
a64bfdfa 83272011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
8328
8329 * xmenu.c (cleanup_widget_value_tree): New function.
8330 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8331 calling free_menubar_widget_value_tree directly (Bug#9830).
8332
cb41b32a
PE
83332011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8334
8335 Fix some portability problems with 'inline'.
8336 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8337 (window_box_width, window_box_left, window_box_left_offset)
8338 (window_box_right, window_box_right_offset): Declare extern.
8339 Otherwise, these inline functions do not conform to C99 and
8340 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8341 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8342 * intervals.c (adjust_intervals_for_insertion)
8343 (adjust_intervals_for_deletion): Now extern, because otherwise the
8344 extern inline functions 'offset_intervals' couldn't refer to it.
8345 (static_offset_intervals): Remove.
8346 (offset_intervals): Rewrite using the old contents of
8347 static_offset_intervals. The old version didn't conform to C99
8348 because an extern inline function contained a reference to an
8349 identifier with static linkage.
8350
b7041366
AS
83512011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8352
8353 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8354 GC.
8355
88a37c4d
EZ
83562011-11-06 Eli Zaretskii <eliz@gnu.org>
8357
8358 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8359 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8360 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8361 return Qleft_to_right.
8362
49745b39
CY
83632011-11-06 Chong Yidong <cyd@gnu.org>
8364
8365 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8366 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8367 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8368 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8369 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8370 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8371 (Fwindow_vscroll): Doc fix.
8372 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8373 argument, since it makes no sense to pass a live window and for
8374 consistency with window-child.
8375
1f05cd82
CS
83762011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8377
8378 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8379 support MSVC.
8380
22610910
JR
83812011-11-05 Jason Rumney <jasonr@gnu.org>
8382
8383 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8384 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8385 fonts (Bug#6029).
8386 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8387 bitwise arithmetic preventing use of unicode-sip and non-truetype
8388 opentype fonts.
8389
a06776b2
EZ
83902011-11-05 Eli Zaretskii <eliz@gnu.org>
8391
3ad924ba
EZ
8392 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8393 "emacs"-only part.
8394
a06776b2
EZ
8395 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8396 initialization code to keep similarity to xfns.c after changes
8397 from 2011-11-05.
8398
c9e7db78
JD
83992011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8400
a97f8f3f
JD
8401 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8402 (unwind_create_frame): New function (Bug#9943).
8403 (Fx_create_frame): Restructure code to be more similar to the one in
8404 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8405 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8406 Move terminal->reference_count++ just before making the frame official
8407 (Bug#9943).
8408
8409 * nsterm.m (x_free_frame_resources): New function.
8410 (x_destroy_window): Move code to x_free_frame_resources.
8411
c9e7db78 8412 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
8413 (Fx_create_frame, x_create_tip_frame):
8414 Move terminal->reference_count++ just before making the frame
75f1671a 8415 official. Move initialization of image_cache_refcount and
c9e7db78
JD
8416 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8417
a6fc3b5c
EZ
84182011-11-05 Eli Zaretskii <eliz@gnu.org>
8419
8420 Support MSVC build with newer versions of Visual Studio.
8421 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8422 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8423 nt/gmake.defs.
8424
8425 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8426 which are not supported by MSVC.
8427 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8428 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8429 bitfields.
8430 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8431 types in bitfields.
8432 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8433
8434 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8435
58179cce 84362011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
8437
8438 Support MSVC build with newer versions of Visual Studio.
8439 * w32.c: Don't include w32api.h for MSVC.
8440 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8441
8442 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8443 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8444 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8445 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8446 e_* cousins.
8447 (alloca) [_MSC_VER]: Define to _alloca.
8448
8449 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8450
8451 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8452
a58c13ed
EZ
84532011-11-04 Eli Zaretskii <eliz@gnu.org>
8454
8455 * xdisp.c (note_mouse_highlight): If either of
8456 previous/next-single-property-change returns nil, treat that as
8457 the beginning or the end of the buffer. (Bug#9955)
8458
fe0b6370
JD
84592011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8460
a58c13ed 8461 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
8462 label is not null (Bug#9951).
8463 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8464 may be NULL.
8465
89bd5ee1
EZ
84662011-11-04 Eli Zaretskii <eliz@gnu.org>
8467
8468 * window.c (Fwindow_body_size): Mention in the doc string that the
8469 return value is in frame's canonical units. (Bug#9949)
8470
84c3edb9
EZ
84712011-11-03 Eli Zaretskii <eliz@gnu.org>
8472
4e2fb5c7
EZ
8473 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8474
84c3edb9 8475 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 8476 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 8477 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 8478
bc17a887
EZ
84792011-11-01 Eli Zaretskii <eliz@gnu.org>
8480
8481 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8482 Don't stop backward scan on the continuation glyph, even though
8483 its CHARPOS is positive.
6d5eb5b0
SM
8484 (mouse_face_from_buffer_pos, note_mouse_highlight):
8485 Rename cover_string to disp_string.
bc17a887 8486
4ee88440
MR
84872011-11-01 Martin Rudalics <rudalics@gmx.at>
8488
8489 * window.c (temp_output_buffer_show): Don't use
8490 Vtemp_buffer_show_specifiers.
8491 (Vtemp_buffer_show_specifiers): Remove unused variable.
8492
c2ff3c02
EZ
84932011-10-30 Eli Zaretskii <eliz@gnu.org>
8494
8495 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8496 past the beginning of the current glyph matrix.
8497
58179cce 84982011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
8499
8500 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8501 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8502 HAVE_GTK3 (Bug#9869).
b77a6a7f 8503
3b574623
JD
8504 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8505 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8506
b77a6a7f
JD
8507 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8508
8509 * xterm.c: Declare x_handle_net_wm_state to return int.
8510 (handle_one_xevent): Check if we are iconified but don't have
8511 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8512 (get_current_wm_state): Return non-zero if not hidden,
8513 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8514 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8515 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8516 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8517
196e41e4
PE
85182011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8519
8520 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8521 so that this new function doesn't get optimized away by a
8522 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8523
021f2e1a
AS
85242011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8525
8526 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8527
8b058d44
EZ
85282011-10-29 Eli Zaretskii <eliz@gnu.org>
8529
8530 Fix the `xbytecode' command.
8531 * .gdbinit (xprintbytestr): New command.
b50a28de 8532 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
8533 (xbytecode): Print the byte-code string as well.
8534
4452fb80
EZ
85352011-10-29 Kim Storm <storm@cua.dk>
8536
8b058d44
EZ
8537 * alloc.c (which_symbols): New function.
8538
21b72067
AS
85392011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8540
8541 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8542 line. (Bug#9903)
8543
83ed7b5c
GM
85442011-10-29 Glenn Morris <rgm@gnu.org>
8545
8546 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8547 Not clear what it was for, and it causes various bugs. (Bug#9839)
8548
5a7a728b
EZ
85492011-10-28 Eli Zaretskii <eliz@gnu.org>
8550
8551 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8552 possible random value that matches one of those tested as
8553 condition to clear the mouse face.
8554
d3d0842f
CY
85552011-10-28 Chong Yidong <cyd@gnu.org>
8556
8557 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8558
31b39d13
DN
85592011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8560
8561 * window.c (make_window): Initialize phys_cursor_on_p.
8562
9aba6043
SM
85632011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8564
8565 * lisp.h (struct Lisp_Symbol): Update comments.
8566
c20992f4
JB
85672011-10-28 Juanma Barranquero <lekktu@gmail.com>
8568
8569 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8570
db4f02f2
EZ
85712011-10-28 Eli Zaretskii <eliz@gnu.org>
8572
8573 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8574 <oslsachem@gmail.com> for helping to debug this.
8575
8576 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8577 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8578 (g_b_init_get_glyph_outline_w): New static variables.
8579 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8580 (GetGlyphOutlineW_Proc): New typedefs.
8581 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
8582 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8583 New functions.
8584 (w32font_open_internal, compute_metrics):
8585 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
8586 instead of calling the "wide" APIs directly.
8587
8588 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8589
8590 * w32.h (syms_of_w32font): Add prototype.
8591
87e68db4
JB
85922011-10-27 Juanma Barranquero <lekktu@gmail.com>
8593
8594 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8595 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8596 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8597 (Fmove_to_window_line): Doc fix.
8598
435c1d67
CY
85992011-10-27 Chong Yidong <cyd@gnu.org>
8600
8601 * process.c (make_process): Set gnutls_state to NULL.
8602
8603 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8604 non-NULL, regardless of GNUTLS_INITSTAGE.
8605 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8606 an error. Set process slots as soon as we allocate them.
8607
8608 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8609
9c6c6f49
CY
86102011-10-27 Chong Yidong <cyd@gnu.org>
8611
9aba6043
SM
8612 * gnutls.c (emacs_gnutls_deinit): New function.
8613 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
8614 (Fgnutls_deinit, Fgnutls_boot): Use it.
8615
8616 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8617 (deactivate_process): Call emacs_gnutls_deinit.
8618
657d08d3
JB
86192011-10-27 Juanma Barranquero <lekktu@gmail.com>
8620
8621 * image.c (x_create_x_image_and_pixmap):
8622 * w32.c (sys_rename, w32_delayed_load):
8623 * w32font.c (fill_in_logfont):
8624 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8625
5430d399
JB
86262011-10-26 Juanma Barranquero <lekktu@gmail.com>
8627
8628 * w32fns.c (w32_default_color_map): New function,
8629 extracted from Fw32_default_color_map.
a7ef684b 8630 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 8631
fe0055fa
PE
86322011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8633
8634 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8635
e6346438
SM
86362011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8637
8638 * keyboard.c (test_undefined): New function (bug#9751).
8639 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8640
e112cc37
ET
86412011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8642
8643 * sysdep.c (init_sys_modes): Fix the check for the controlling
8644 terminal (Bug#6649).
8645
7b5d6677
EZ
86462011-10-20 Eli Zaretskii <eliz@gnu.org>
8647
8648 * dispextern.h (struct bidi_it): New member next_en_type.
8649
8650 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8651 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8652 current character, check also for next_en_type being WEAK_EN.
8653 (bidi_resolve_weak): Don't enter the expensive loop if the current
8654 position is before next_en_pos. Record the bidi type of the first
8655 non-ET, non-BN character we find, in addition to its position.
8656 (bidi_level_of_next_char): Invalidate next_en_type when
8657 next_en_pos is over-stepped.
8658
7da0b018
PE
86592011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8660
8661 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8662 * editfns.c: Rewrite current-time-zone so that it invokes
8663 the equivalent of (format-time-string "%Z") to get the time zone name.
8664 This fixes a bug when the time zone name contains characters that
8665 need converting from the system time locale to Emacs internal format.
8666 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8667 that patch fixed format-time-string to do the conversion, but
8668 I forgot to fix current-time-zone.
8669 (format_time_string): New function, containing most of
8670 what Fformat_time_string used to contain.
8671 (Fformat_time_string): Rewrite in terms of format_time_string.
8672 This doesn't change this function's behavior.
8673 (current-time-zone): Rewrite to use format_time_string.
8674 This fixes the bug reported by Michael Schierl in
8675 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8676 Jason Rumney's 2007-06-07 change worked around this bug, but
8677 didn't fix it.
8678 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8679
8547b010
EZ
86802011-10-19 Eli Zaretskii <eliz@gnu.org>
8681
8682 * xdisp.c (start_display): If the character at POS is displayed
8683 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
8684 (try_window_reusing_current_matrix): If a line ends in a display
8685 vector or the next line starts in a display vector, continue
8686 redrawing the window even though the character position of
8687 start_row was reached.
8547b010
EZ
8688 (Bug#9771, part 2)
8689
4e948d15
CY
86902011-10-18 Chong Yidong <cyd@gnu.org>
8691
8692 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8693 with nobreak-char-display too.
8694
4787455f
EZ
86952011-10-18 Eli Zaretskii <eliz@gnu.org>
8696
8697 Fix part 3 of bug#9771.
8698 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8699 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8700 non-neutral characters if the current character is a paragraph
8701 separator (a.k.a. Newline). This avoids running the same
8702 expensive loop twice, once when we consume the preceding newline
8703 and the other time when the line actually needs to be displayed.
8704 Avoid the loop when we see neutrals on the base embedding level
8705 following a character whose directionality is the same as the
8706 paragraph's. This avoids running the expensive loop when a line
8707 ends in a long sequence of neutrals, like control characters.
8708 Add assertion against STRONG_AL type. Slightly rearrange code
8709 that determines the type of a neutral given the first non-neutral
8710 that follows it.
8711 (bidi_level_of_next_char): Set next_en_pos to zero when
8712 invalidating its info.
8713
2c91f553
EZ
87142011-10-17 Eli Zaretskii <eliz@gnu.org>
8715
8716 * xdisp.c (push_display_prop): Determine whether to record string
8717 or buffer position by IT->string, not by IT->method. Allow
8718 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
8719 (move_it_vertically_backward): Don't look for character position
8720 immediately after the newline when in a continuation line.
8721 (Bug#9771, part 1)
2c91f553 8722
c7b08b0d
MR
87232011-10-15 Martin Rudalics <rudalics@gmx.at>
8724
8725 * window.c (coordinates_in_window): Rewrite and delabelize
8726 vertical border check. (Bug#5357) (Bug#9618)
8727
6b02f655
SM
87282011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8729
8730 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8731 errors in XSetWindowBorder (bug#9310).
8732
81d40c92
DA
87332011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8734
8735 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8736 avoid crash when xmalloc overrun checking is enabled.
8737
d4172c3b
EZ
87382011-10-13 Eli Zaretskii <eliz@gnu.org>
8739
8740 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8741 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8742 cursor motion with <left> and <right> arrow keys.
8743
8744 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8745 some callers set that themselves.
8746
b00eea75
EZ
87472011-10-12 Eli Zaretskii <eliz@gnu.org>
8748
8749 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8750 display string and the previous row comes from the same string and
8751 is empty. (Bug#9739) (Bug#9738)
8752
8fe012c4
SM
87532011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8754
8755 * doc.c (get_doc_string): Encode file name (bug#9735).
8756
0074aef2
EZ
87572011-10-12 Eli Zaretskii <eliz@gnu.org>
8758
79beb178
EZ
8759 * bidi.c (bidi_level_of_next_char):
8760 * xdisp.c (get_visually_first_element): Remove old incorrect
8761 comments regarding the Unicode Line Separator character.
8762
0074aef2
EZ
8763 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8764
6e4b3fbe
DA
87652011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8766
8767 * alloc.c (Fgc_status): Do not access beyond zombies array
8768 boundary if nzombies > MAX_ZOMBIES.
8769 * alloc.c (dump_zombies): Add missing format specifier.
8770
0324f3af
PE
87712011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8772
b5525cac
PE
8773 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8774 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8775
0324f3af
PE
8776 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8777 Some packages use them to denote characters with modifiers.
8778
e9b5f888
AS
87792011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8780
8781 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8782 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8783 matching a pp-number. Rename parameter var to var1.
8784
127827c0
SM
87852011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8786
8787 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8788
c8fd3bd0
GM
87892011-10-08 Glenn Morris <rgm@gnu.org>
8790
8791 * callint.c (Fcall_interactively): Give a more explicit error for the
8792 'c' case with a non-character input. (Bug#8479)
8793
352ec8ff
EZ
87942011-10-08 Eli Zaretskii <eliz@gnu.org>
8795
03669ccb
EZ
8796 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8797 lines.
7061c986
EZ
8798 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8799 lines that are hscrolled on the left.
03669ccb 8800
352ec8ff
EZ
8801 * dispnew.c (buffer_posn_from_coords): Account for a possible
8802 presence of header-line. (Bug#4426)
8803
a66cfb1c
SM
88042011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8805
6b02f655
SM
8806 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8807 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 8808
7c5ee88e
PE
88092011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8810
8811 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8812 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8813 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8814 this makes Emacs dump core during garbage collection on rare
8815 occasions. sizeof is obviously inferior to offsetof here, so
8816 stick with offsetof.
8817 (GC_POINTER_ALIGNMENT): New macro.
8818 (mark_memory): Omit 3rd (offset) arg; caller changed.
8819 Don't assume EMACS_INT alignment is the same as pointer alignment.
8820
df1bbe5b
SM
88212011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8822
8823 * keyboard.c (read_key_sequence_remapped): New var.
8824 (read_key_sequence): Compute remapping in the right buffer.
8825 (command_loop_1): Use read_key_sequence's remapping directly.
8826
51553db6
SM
88272011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8828
32c1fffd
SM
8829 * dired.c (file_name_completion): Don't expand file name.
8830 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8831 before checking file name handler.
8832
51553db6
SM
8833 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8834 they've been requested explicitly (bug#9591).
8835
b6bd1599 88362011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
8837
8838 * keymap.c (Fsingle_key_description): Use make_specified_string
8839 instead of build_string to build string from push_key_description.
8840 (Bug#5193)
8841
f701dc2a
PE
88422011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8843
4222c55d
PE
8844 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8845 This fixes a Y2038 bug on 64-bit hosts.
8846 * buffer.c (reset_buffer):
8847 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8848 (Fclear_buffer_auto_save_failure):
8849 Use 0, not -1, to represent an unset failure time, since time_t
8850 might not be signed.
8851
f701dc2a
PE
8852 Remove dependency on glibc malloc internals.
8853 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8854 Move back here from lisp.h, but with their new implementations.
8855 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8856 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8857 * charset.c (charset_table_init): New static var.
8858 (syms_of_charset): Use it instead of xmalloc. This removes a
8859 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8860 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8861 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8862 Move back to alloc.c.
8863 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8864 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8865
9ceebf39
JD
88662011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8867
8868 * nsterm.m (windowDidResize): Call x_set_window_size only when
8869 ns_in_resize is true. Otherwise set pixelwidth/height and
8870 call change_frame_size (Bug#9628).
8871
cb993c58
PE
88722011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8873
3930c88b
PE
8874 Port --enable-checking=all to Fedora 14 x86-64.
8875 * charset.c (syms_of_charset): Also account for glibc malloc's
8876 internal overhead when calculating the initial malloc maximum.
8877
cb993c58
PE
8878 Port --enable-checking=all to Fedora 14 x86.
8879 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8880 Move to lisp.h.
8881 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8882 (overrun_check_realloc, overrun_check_free):
8883 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8884 That way, xmalloc returns a properly-aligned pointer even if
8885 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8886 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8887 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8888 into account when calculating the initial malloc maximum.
8889 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8890 Move here from alloc.c, so that charset.c can use it too.
8891 Properly align; the old code wasn't right for common 32-bit hosts
8892 when configured with --enable-checking=all.
8893 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8894 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8895
31bed486
EZ
88962011-09-29 Eli Zaretskii <eliz@gnu.org>
8897
04c70788 8898 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
8899 use EDOM.
8900
fbcaa2f3
EZ
89012011-09-28 Eli Zaretskii <eliz@gnu.org>
8902
8903 * xdisp.c (compute_display_string_end): If there's no display
8904 string at CHARPOS, return -1.
8905
8906 * bidi.c (bidi_fetch_char): When compute_display_string_end
8907 returns a negative value, treat the character as a normal
8908 character not covered by a display string. (Bug#9624)
8909
a239d4e9
JB
89102011-09-28 Juanma Barranquero <lekktu@gmail.com>
8911
8912 * lread.c (Fread_from_string): Fix typo in docstring.
8913
88652fd5
EZ
89142011-09-27 Eli Zaretskii <eliz@gnu.org>
8915
8916 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8917 newline, reseat the iterator instead of bidi-iterating there one
8918 character at a time. (Bug#9610)
32c1fffd
SM
8919 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8920 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 8921
ed497dd4
AS
89222011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8923
8924 * lread.c (readevalloop): Use correct code for NBSP.
8925 (read1): Likewise. (Bug#9608)
8926
b2bf61aa
MA
89272011-09-25 Michael Albinus <michael.albinus@gmx.de>
8928
8929 * dbusbind.c (Fdbus_register_signal): When service is not
8930 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8931
32bbb17c
GM
89322011-09-25 Glenn Morris <rgm@gnu.org>
8933
8934 * buffer.c (truncate-lines): Doc fix.
8935
94e0933e
CY
89362011-09-24 Chong Yidong <cyd@stupidchicken.com>
8937
8938 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8939 (Fset_window_next_buffers): Doc fix.
8940
cddde921
GM
89412011-09-24 Glenn Morris <rgm@gnu.org>
8942
8943 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8944
1260aef1
PE
89452011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8946
25b4bfa0
PE
8947 Fix minor problems found by static checking.
8948 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
8949 * indent.c (Fvertical_motion): Fix == vs = typo.
8950
e3cbd34b
EZ
89512011-09-24 Eli Zaretskii <eliz@gnu.org>
8952
a66cfb1c
SM
8953 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8954 Default value is now t. Doc fix.
6bf7006f 8955
e3cbd34b 8956 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 8957 logic when moving up, not only when moving down. Fix the
e3cbd34b 8958 confusing name and values of the it_overshoot_expected variable;
32c1fffd 8959 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
8960
8961 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8962 CHARPOS is covered by a display string which includes newlines.
8963 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8964 is covered by a display string with embedded newlines.
8965
a3de0cbd
MA
89662011-09-24 Michael Albinus <michael.albinus@gmx.de>
8967
8968 * dbusbind.c (Fdbus_register_signal): Add match rule to
8969 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
8970 (Fdbus_register_method, Vdbus_registered_objects_table):
8971 Fix docstring.
a3de0cbd 8972
b260039d
JM
89732011-09-24 Jim Meyering <meyering@redhat.com>
8974
32c1fffd 8975 do not ignore write error for any output size
b260039d
JM
8976 The previous change was incomplete.
8977 While it makes emacs --batch detect the vast majority of stdout
8978 write failures, errors were still ignored whenever the output size is
8979 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8980 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8981 && echo FAIL: ignored write error
8982 FAIL: ignored write error
8983 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8984 && echo FAIL: ignored write error
8985 FAIL: ignored write error
8986 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8987
8eca8a7c
AS
89882011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8989
8990 * emacs.c (Fkill_emacs): In noninteractive mode exit
8991 non-successfully if a write error occurred on stdout. (Bug#9574)
8992
3341db62
EZ
89932011-09-21 Eli Zaretskii <eliz@gnu.org>
8994
8995 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8996 the xassert test.
8997
8998 * dispextern.h (struct it): Update the comment documenting what
8999 can it->OBJECT be.
9000
8c203dbf
EZ
90012011-09-20 Eli Zaretskii <eliz@gnu.org>
9002
9003 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9004 a display string, extend search for cursor position to end of row.
9005 (find_row_edges): If the row ends in a newline from a display
9006 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9007 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
9008 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9009 non-empty line. Fixes confusing cursor motion with arrow keys at
9010 the beginning of a line that starts with whitespace.
8c203dbf 9011
a4824228
LMI
90122011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9013
9014 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9015 (bug#9493).
9016
33ed493b
CY
90172011-09-18 Chong Yidong <cyd@stupidchicken.com>
9018
9019 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9020 boolean (Bug#9154).
9021
56cd55c8
EZ
90222011-09-18 Eli Zaretskii <eliz@gnu.org>
9023
9024 * xdisp.c (display_line): Record maximum and minimum buffer
9025 positions even if no glyphs were produced (e.g., by a zero-width
9026 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9027 buffer positions that will be removed from the glyph row because
9028 they don't fit.
c02dcedf
EZ
9029 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9030 column is beyond frame width: don't subtract 1 "pixel" when
9031 computing width of the stretch.
3e62b7e0
EZ
9032 (reseat_at_next_visible_line_start): Undo the change made on
9033 2011-09-17 that saved paragraph information and restored it after
9034 the call to `reseat'. (Bug#9545)
56cd55c8 9035
5ed99d36 90362011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
9037
9038 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9039 and turn window cursor on if cleared (Bug#9415).
9040
5ed99d36 90412011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
9042
9043 * search.c (boyer_moore): Take unibyte characters from pattern
9044 literally. (Bug#9458)
9045
9bade7b2
EZ
90462011-09-18 Eli Zaretskii <eliz@gnu.org>
9047
9048 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9049
e5e9d610
PE
90502011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9051
87e4427a
PE
9052 Fix minor problem found by static checking.
9053 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9054 initialized, to pacify gcc -Wuninitialized.
9055
e5e9d610
PE
9056 * fileio.c: Report proper errno when syscall falls.
9057 (Finsert_file_contents): Save and restore errno,
9058 so that report_file_error outputs the correct diagnostic.
9059 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9060
a1674f0b
EZ
90612011-09-18 Eli Zaretskii <eliz@gnu.org>
9062
9063 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9064
fbfb6dd4
EZ
90652011-09-17 Eli Zaretskii <eliz@gnu.org>
9066
9067 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9068 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9069
bb187662
EZ
90702011-09-17 Eli Zaretskii <eliz@gnu.org>
9071
1137e8b8 9072 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 9073 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
9074
9075 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9076 (bidi_find_paragraph_start): Search back for paragraph beginning
9077 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9078 (bidi_move_to_visually_next): Only trigger paragraph-related
9079 computations when the last character is a newline or at EOB, not
9080 just any NEUTRAL_B. (Bug#9470)
9081
bb187662
EZ
9082 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9083 truncated lines if point is covered by a display string. (Bug#9524)
9084
2e621251
PE
90852011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9086
9087 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9088 (cons_to_x_long): New function.
9089 (lisp_data_to_selection_data): Use it. Correct the test for
9090 short-versus-long data; it was negated. Break out of vector
9091 loop, for efficiency, when a long datum is discovered.
9092
91a15bc6
SM
90932011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9094
9095 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9096
b41c3a35
EZ
90972011-09-16 Eli Zaretskii <eliz@gnu.org>
9098
9099 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9100 GCC PR/17406) by declaring this function with external scope.
9101
7812ba2d
PE
91022011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9105 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9106
cf7edc2a
AS
91072011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9108
9109 * editfns.c (Fformat): Correctly handle text properties on "%%".
9110
bd01620e
EZ
91112011-09-15 Eli Zaretskii <eliz@gnu.org>
9112
9113 * xterm.c (x_draw_composite_glyph_string_foreground):
9114 * w32term.c (x_draw_composite_glyph_string_foreground):
9115 * term.c (encode_terminal_code):
9116 * composite.c (composition_update_it, get_composition_id):
9117 * xdisp.c (get_next_display_element)
9118 (fill_composite_glyph_string): Add comments about special meaning
9119 of TAB characters in a composition.
9120
a02719a3
PE
91212011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
9124 This occurs when processing a multibyte format.
9125 Problem reported by Wolfgang Jenker.
a02719a3 9126
72589a3c
JB
91272011-09-15 Johan Bockgård <bojohan@gnu.org>
9128
9129 * xdisp.c (try_cursor_movement): Only check for exact match if
9130 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9131
1c14176c
PE
91322011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9133
9134 Remove unused external symbols.
9135 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9136 * xdisp.c (calc_pixel_width_or_height): Now static.
9137 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9138 * indent.c (check_display_width):
9139 * w32term.c: Fix comment to match code.
9140 * xterm.c, xterm.h (x_catching_errors): Remove.
9141
d2eea5b5
PE
91422011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9143
9144 * xselect.c: Use signed conversions more consistently (Bug#9498).
9145 (selection_data_to_lisp_data): Assume incoming selection data are
9146 signed integers, not unsigned. This is to be consistent with
9147 outgoing selection data, which was modified to use signed integers
9148 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9149 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9150 expects long, not unsigned long.
9151
46888499
EZ
91522011-09-14 Eli Zaretskii <eliz@gnu.org>
9153
9154 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9155 computation of loop end. Reported by Johan Bockgård
9156 <bojohan@gnu.org>.
9157
ef8ef9fb
CY
91582011-09-13 Chong Yidong <cyd@stupidchicken.com>
9159
9160 * frame.c (Fother_visible_frames_p): Function deleted.
9161
fa819fed
EZ
91622011-09-12 Eli Zaretskii <eliz@gnu.org>
9163
9164 * indent.c (compute_motion): Process display vector front to back
9165 rather than the other way around. (Bug#2496)
9166
2ba8e008
SM
91672011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9168
9169 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9170
20f53c69
CY
91712011-09-11 Chong Yidong <cyd@stupidchicken.com>
9172
9173 * minibuf.c (Fread_from_minibuffer): Doc fix.
9174
d562d7a4
EZ
91752011-09-11 Eli Zaretskii <eliz@gnu.org>
9176
9177 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9178 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9179
1c4d7f3d
LMI
91802011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9181
9182 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9183 value for non-existent files.
9184
b885bf36
EZ
91852011-09-11 Eli Zaretskii <eliz@gnu.org>
9186
9187 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9188 set its "size" to -1. This will set the modtime_size field of
9189 the corresponding buffer to -1, which is what
9190 verify-visited-file-modtime expects for files that do not exist.
9191 (Bug#9139)
9192
6612f0bf
PE
91932011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9194
9195 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9196 here ...
9197 * lisp.h: ... from here. push_key_description is no longer
9198 defined in keyboard.c, so its declaration should not be in
9199 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9200 logically belongs with push_key_description.
9201
dfb3f755
PE
92022011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9203
9204 * buffer.h: Include <sys/types.h> instead of <time.h>.
9205 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9206 Problem reported by Herbert J. Skuhra.
9207
3134906c
LMI
92082011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9209
9210 * xml.c (parse_region): Make the parsing work for
9211 non-comment-starting XML files again (bug#9144).
9212
8d903f4e
AS
92132011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9214
9215 * image.c (gif_load): Fix calculation of bottom and right corner.
9216 (Bug#9468)
9217
80ad64f4
EZ
92182011-09-10 Eli Zaretskii <eliz@gnu.org>
9219
9220 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9221 redisplay in small windows.
9222
208a048d
EZ
92232011-09-09 Eli Zaretskii <eliz@gnu.org>
9224
9225 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9226
9b1c252e
MR
92272011-09-08 Martin Rudalics <rudalics@gmx.at>
9228
9229 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9230 Operate on live windows only.
9231
2949f33b
JB
92322011-09-08 Juanma Barranquero <lekktu@gmail.com>
9233
9234 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9235
e08dcafd
EZ
92362011-09-07 Eli Zaretskii <eliz@gnu.org>
9237
9238 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9239 only under bidi iteration.
9240
115b96bd
JD
92412011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9242
9243 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9244
c8199d0f
PE
92452011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9246
9247 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9248 Without this fix, the command to link temacs failed due to an
9249 undefined symbol __builtin_isnan. This is because
9250 /usr/include/iso/math_c99.h #defines isnan(x) to
9251 __builtin_isnan(x), but the bundled gcc, which identifies itself
9252 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9253 a __builtin_isnan.
9254 * floatfns.c (isnan): #undef, and then #define to a clone of
9255 what's in data.c.
9256 (Fisnan): Always define, since it's always available now.
9257 (syms_of_floatfns): Always define isnan at the Lisp level.
9258
e39b275c 92592011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
9260
9261 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9262
b2db44d9 92632011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 9264
f4af5137 9265 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
9266 The previous code assumed that file offsets (off_t values) fit in
9267 EMACS_INT variables, which is not true on typical 32-bit hosts.
9268 The code messed up by falsely reporting buffer overflow in cases
9269 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9270 when "big" contains more than 2**29 bytes, even though this
9271 inserts just one byte and does not overflow the buffer.
9272 (Finsert_file_contents): Store file offsets as off_t
9273 values, not as EMACS_INT values. Check for overflow when
9274 converting between EMACS_INT and off_t. When checking for
9275 buffer overflow or for overlap, take the offsets into account.
9276 Don't use EMACS_INT for small values where int suffices.
9277 When checking for overlap, fix a typo: ZV was used where
9278 ZV_BYTE was intended.
9279 (Fwrite_region): Don't assume off_t fits into 'long'.
9280 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9281
ecfc0a49
MA
92822011-09-05 Michael Albinus <michael.albinus@gmx.de>
9283
9284 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9285
6511acf2 92862011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 9287
0999621a 9288 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
9289
9290 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 9291 (esprintf, exprintf, evxprintf): New functions.
62f19c19 9292 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 9293 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
9294 (modify_event_symbol): Do not assume that the length of
9295 name_alist_or_stem is safe to alloca and fits in int.
9296 (Fexecute_extended_command): Likewise for function name and binding.
9297 (Frecursion_depth): Wrap around reliably on integer overflow.
9298 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9299 since some callers pass EMACS_INT values.
9300 (Fsingle_key_description): Don't crash if symbol name contains more
9301 than MAX_ALLOCA bytes.
9302 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9303 (get_minibuffer): Arg is now EMACS_INT, not int.
9304 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 9305 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
9306 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9307
2be7d702
PE
9308 * dbusbind.c (signature_cat): New function.
9309 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
9310 Do not overrun buffer; instead, report string overflow.
9311
9d1df220
PE
9312 * dispnew.c (add_window_display_history): Don't overrun buffer.
9313 Truncate instead; this is OK since it's just a log.
9314
33ef5c64
PE
9315 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9316 even if the time zone offset is outlandishly large.
9317 Don't mishandle offset == INT_MIN.
9318
66c6fdd5
PE
9319 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9320 when creating daemon; the previous buffer-overflow check was incorrect.
9321
d749b01b
PE
9322 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9323 which has the guts of the old verror function.
9324
b5cd1905
PE
9325 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9326 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9327
6e1a67fb
PE
9328 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9329 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 9330 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 9331 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
9332 length of string rather than counting it via multiple sprintfs;
9333 that's simpler and more reliable.
c21721cc
PE
9334 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9335 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9336 sprintf, in case result does not fit in int.
9337
c57b67fc
PE
9338 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9339 (fontset_from_font): Print it.
9340
8a401434
PE
9341 * frame.c (tty_frame_count): Now printmax_t, not int.
9342 (make_terminal_frame, set_term_frame_name): Print it.
9343 (x_report_frame_params): In X, window IDs are unsigned long,
9344 not signed long, so print them as unsigned.
9345 (validate_x_resource_name): Check for implausibly long names,
9346 and don't assume name length fits in 'int'.
9347 (x_get_resource_string): Don't blindly alloca invocation name;
9348 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9349 not fit in int.
9350
6e1a67fb
PE
9351 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9352 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
9353 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9354
0df02bf3
PE
9355 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9356 Use esprintf, not sprintf, in case result does not fit in int.
9357
48e30793
PE
9358 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9359 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9360 it as a large positive number.
9361 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9362 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9363
a66ff6d8
PE
9364 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9365 in case result does not fit in int.
9366
aca216ff
PE
9367 * print.c (float_to_string): Detect width overflow more reliably.
9368 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9369 buffer overrun. Don't assume list length fits in 'int'. Treat
9370 print length of 0 as 0, not as infinity; to be consistent with other
9371 uses of print length in this function. Don't overflow print length
9372 index. Don't assume hash table size fits in 'long', or that
9373 vectorlike size fits in 'unsigned long'.
9374
31c286f7
PE
9375 * process.c (make_process): Use printmax_t, not int, to format
9376 process-name gensyms.
9377
55e5faa1
PE
9378 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9379
80f2e268
PE
9380 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9381 to avoid potential buffer overrun.
9382
670741ab
PE
9383 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9384 if X resource line is longer than 512 bytes.
9385
b7163a50
PE
9386 * xfns.c (x_window): Make sprintf buffer a bit bigger
9387 to avoid potential buffer overrun.
9388
ae58ff1f
PE
9389 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9390
c43c8a6a
PE
9391 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9392
3f8236f4
PE
93932011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9394
53e9fe90 9395 Integer overflow fixes for scrolling, etc.
6511acf2
PE
9396 Without these, Emacs silently mishandles large integers sometimes.
9397 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
9398 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9399
6511acf2
PE
9400 * xdisp.c (try_window_id): Check Emacs fixnum range before
9401 converting to 'int'.
806add1d 9402
6511acf2 9403 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
9404 Check that an Emacs fixnum is in range before assigning it to 'int'.
9405 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9406 values converted from Emacs fixnums.
9407 (Frecenter): Don't wrap around a line count if it is out of 'int'
9408 range; instead, treat it as an extreme value.
9409 (Fset_window_configuration, compare_window_configurations):
9410 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9411
6511acf2
PE
9412 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9413 that can exceed INT_MAX. Check that EMACS_INT value is in range
9414 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
9415 (match_limit): Don't assume that a fixnum can fit in 'int'.
9416
6511acf2 9417 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
9418 exceed INT_MAX.
9419
6511acf2 9420 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
9421 (Fvertical_motion): Don't wrap around LINES values that don't fit
9422 in 'int'. Instead, treat them as extreme values. This is good
9423 enough for windows, which can't have more than INT_MAX lines anyway.
9424
fcb901a7
LMI
94252011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9426
0f2f6b6d
LMI
9427 * Require libxml/parser.h to avoid compilation warning.
9428
fcb901a7
LMI
9429 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9430
9431 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9432 since this reportedly can destroy thread storage.
9433
6e20a0d4
CY
94342011-08-30 Chong Yidong <cyd@stupidchicken.com>
9435
9436 * syntax.c (find_defun_start): Update all cache variables if
9437 exiting early (Bug#9401).
9438
148ae00e
EZ
94392011-08-30 Eli Zaretskii <eliz@gnu.org>
9440
f6cfbd8f
EZ
9441 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9442
148ae00e
EZ
9443 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9444 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9445 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9446
9447 * term.c (tty_append_glyph): New function.
9448 (produce_stretch_glyph): Static function and its prototype deleted.
9449
a66cfb1c
SM
9450 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9451 Add prototypes.
148ae00e 9452
c4a07a4c
PE
94532011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9454
9455 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9456 when checking :margin (Bug#9390).
9457 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 9458 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
9459 so that the name doesn't mislead. All uses changed.
9460
6bc8cd65
JB
94612011-08-28 Johan Bockgård <bojohan@gnu.org>
9462
9463 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9464 set_tty_hooks.
9465
dca4927e
EZ
94662011-08-27 Eli Zaretskii <eliz@gnu.org>
9467
9468 * xdisp.c (move_it_to): Don't bail out early when reaching
9469 position beyond to_charpos, if we are scanning backwards.
9470 (move_it_vertically_backward): When DY == 0, make sure we get to
9471 the first character in the line after the newline.
9472
f2cad773
PE
94732011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9474
9475 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9476 (ccl_driver): Do not generate an out-of-range pointer.
9477 (Fccl_execute_on_string): Remove unnecessary check for
9478 integer overflow, noted by Stefan Monnier in
9479 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9480 Remove a FIXME that didn't need fixing.
9481 Simplify the newly-introduced buffer reallocation code.
9482
0cae2cdb
JB
94832011-08-27 Juanma Barranquero <lekktu@gmail.com>
9484
9485 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9486
5fc295a4 94872011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 9488
70c60eb2 9489 Integer and memory overflow issues (Bug#9196).
726e0ab1 9490
d31850da
PE
9491 * doc.c (get_doc_string): Rework so that
9492 get_doc_string_buffer_size is the actual buffer size, rather than
9493 being 1 less than the actual buffer size; this makes xpalloc more
9494 convenient.
9495
a69fbedb
PE
9496 * image.c (x_allocate_bitmap_record, cache_image):
9497 * xselect.c (Fx_register_dnd_atom):
9498 Simplify previous changes by using xpalloc.
9499
fe5c5d37
PE
9500 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9501 since either will do and ptrdiff_t is convenient with xpalloc.
9502
0065d054
PE
9503 * charset.c (charset_table_size)
9504 (struct charset_sort_data.priority): Now ptrdiff_t.
9505 (charset_compare): Don't overflow if priorities differ greatly.
9506 (Fsort_charsets): Don't assume list length fits in int.
9507 Check for size-calculation overflow when allocating sort data.
9508 (syms_of_charset): Allocate an initial charset table that is
9509 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9510
9511 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9512
9513 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9514 The actual value is always <= INT_MAX, and leaving it unsigned made
9515 overflow checking harder.
9516
9517 * dispextern.h (struct glyph_matrix.rows_allocated)
9518 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9519 with xpalloc. The values are still always <= INT_MAX.
9520
9521 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9522
9523 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9524 (SAFE_NALLOCA): New macro.
9525
9526 * region-cache.c (struct boundary.pos, find_cache_boundary)
9527 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9528 (set_cache_region, invalidate_region_cache)
9529 (revalidate_region_cache, know_region_cache, region_cache_forward)
9530 (region_cache_backward, pp_cache):
9531 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9532 so that ptrdiff_t * can be passed to xpalloc.
9533 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9534 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9535 (pp_cache): Don't assume cache_len fits in int.
9536 * region-cache.h: Adjust extern decls to match.
9537
9538 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9539 EMACS_INT, since either will do, for xpalloc.
9540
9541 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9542 (xnmalloc, xnrealloc, xpalloc): New functions.
9543
726e0ab1
PE
9544 * bidi.c (bidi_shelve_header_size): New constant.
9545 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9546 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9547
51f30bc5 9548 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
9549 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9550 (overlay_strings):
9551 Don't update size of array until after memory allocation succeeds,
9552 because xmalloc/xrealloc may not return.
0065d054
PE
9553 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9554 now that we have proper integer overflow checking.
9555 (record_overlay_string, overlay_strings): Catch overflows when
9556 calculating size of overlay_str_buf.
726e0ab1 9557
0065d054
PE
9558 * callproc.c (Fcall_process): Check for size overflow when
9559 calculating size of args2.
9560 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9561 Normally we prefer signed values, but sticking with ptrdiff_t would
9562 require adding more-complicated checks.
726e0ab1
PE
9563
9564 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9565 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9566 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 9567 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
9568
9569 * character.c (Fstring): Check for size-calculation overflow.
9570
9571 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9572 unnecessary integer overflow. Check for size overflow.
9573 (encode_coding_object): Don't update size until xmalloc succeeds.
9574
9575 * composite.c (get_composition_id): Check for overflow in glyph
9576 length calculations.
9577
9578 Integer and memory overflow fixes for display code.
9579 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9580 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9581 (scrolling_window): Check for overflow in size calculations.
9582 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9583 Don't assume glyph table len fits in int.
9584 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9585 (row_table_size): Now ptrdiff_t, not int.
9586 (scrolling_window): Avoid overflow in size calculations.
9587 Don't update size until allocation succeeds.
9588 * fns.c (concat): Check for overflow in size calculations.
9589 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9590 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9591 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9592
9593 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9594 (get_doc_string): Check for size calculation overflow.
9595 Don't update size until allocation succeeds.
9596 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9597 EMACS_INT, where ptrdiff_t will do.
9598 (Fsubstitute_command_keys): Check for string overflow.
9599
9600 * editfns.c (set_time_zone_rule): Don't assume environment length
9601 fits in int.
9602 (message_length): Now ptrdiff_t, not int.
9603 (Fmessage_box): Don't update size until allocation succeeds.
9604 Don't assume message length fits in int.
9605 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9606
0065d054
PE
9607 * emacs.c (main): Do not reallocate argv, since there is a null at
9608 the end that can be overwritten, and this way there's no need to
9609 worry about size-calculation overflow.
9610 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
9611
9612 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9613 alloc succeeds.
9614 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9615
9616 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9617 (x_set_scroll_bar_width, x_figure_window_size):
9618 Check for integer overflow.
9619 (x_set_alpha): Do not assume XINT fits in int.
9620
9621 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9622 This is for the members text_lines, text_cols, total_lines, total_cols,
9623 where the system imposes an 'int' limit.
9624
9625 * fringe.c (Fdefine_fringe_bitmap):
9626 Don't update size until alloc works.
9627
9628 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9629 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9630
9631 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9632 Check for size-calculation overflow.
9633 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9634 do, as we prefer signed integers.
9635 (id_to_widget.max_size, id_to_widget.used)
9636 (xg_store_widget_in_map, xg_remove_widget_from_map)
9637 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9638 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9639 Use and return ptrdiff_t, not int.
9640 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9641 * gtkutil.h: Change prototypes to match the above.
9642
9643 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9644 are duplicate now that they've been promoted to lisp.h.
9645 (x_allocate_bitmap_record, x_alloc_image_color)
9646 (make_image_cache, cache_image, xpm_load):
9647 Don't update size until alloc is done.
9648 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9649 (x_detect_edges):
3256efce 9650 Check for size calculation overflow.
726e0ab1
PE
9651 (ct_colors_allocated_max): New constant.
9652 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9653 overflow.
3256efce 9654
726e0ab1
PE
9655 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9656 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9657 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9658 Use ptrdiff_t, not int, to count maps.
9659 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
9660 calculations. Don't update size until allocation succeeds.
9661 Redo calculations to avoid overflow.
726e0ab1
PE
9662 * keyboard.h: Change prototypes to match the above.
9663
9664 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9665 to count maps.
9666 (current_minor_maps): Check for size calculation overflow.
9667 * keymap.h: Change prototypes to match the above.
9668
9669 * lread.c (read1, init_obarray): Don't update size until alloc done.
9670
9671 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9672 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9673
726e0ab1
PE
9674 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9675 Now ptrdiff_t, not int.
9676 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9677 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9678
9679 * process.c (Fnetwork_interface_list): Check for overflow
9680 in size calculation.
9681
9682 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9683
9684 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9685 overflow. Don't bother calling xmalloc when xrealloc will do.
9686
9687 * search.c (Freplace_match): Check for size calculation overflow.
9688 (Fset_match_data): Don't assume list lengths fit in 'int'.
9689
9690 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9691 for command line length. Do not attempt to address one before the
9692 beginning of an array, as that's not portable.
9693
9694 * term.c (max_frame_lines): Remove; unused.
9695 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9696 not int.
9697 (encode_terminal_code, calculate_costs): Check for size
9698 calculation overflow.
9699 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9700 table lengths and related sizes. Don't update size until alloc
9701 done. Redo calculations to avoid overflow.
9702 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9703
9704 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9705 subtracting pointers.
9706 (gobble_line): Check for overflow more carefully. Don't update size
9707 until alloc done.
9708
9709 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9710 Don't update size until alloc done.
9711 Redo size calculations to avoid overflow.
9712 Check for size calculation overflow.
0065d054 9713 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
9714
9715 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9716 Use ptrdiff_t, not int, for sizes.
9717 (store_mode_line_noprop_char): Don't update size until alloc done.
9718
0065d054
PE
9719 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9720 Use ptrdiff_t, not int, for sizes.
9721 (Finternal_make_lisp_face, cache_face):
9722 Check for size calculation overflow.
9723 (cache_face): Treat size calculation overflows as if they were
9724 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
9725
9726 * xfns.c (x_encode_text, x_set_name_internal)
9727 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9728 sizes, since they can exceed INT_MAX in size. Check for size
9729 calculation overflow.
9730
0065d054
PE
9731 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9732 (xg_select): Check for size calculation overflow.
726e0ab1
PE
9733 Don't update size until alloc done.
9734
0065d054 9735 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 9736 as sprintf is limited to int lengths.
1d526e2f 9737
252c5ee1
PE
9738 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9739 (X_LONG_MIN): New macros.
864d7ce7
PE
9740 Use them to make the following changes clearer.
9741 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9742 This change doesn't affect the value now, but it may help remind
9743 future maintainers not to raise the value too much later.
9744 (SELECTION_QUANTUM): Remove, replacing with ...
9745 (selection_quantum): ... new function, which avoids overflow.
9746 All uses changed.
9747 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9748 assumption that selection length fits in 'int'.
9749 (x_reply_selection_request, x_handle_selection_request)
9750 (x_get_window_property, receive_incremental_selection)
9751 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9752 (lisp_data_to_selection_data, clean_local_selection_data):
9753 Use ptrdiff_t, not int, to record length of selection.
9754 (x_reply_selection_request, x_get_window_property)
9755 (receive_incremental_selection, x_property_data_to_lisp):
9756 Redo calculations to avoid overflow.
9757 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 9758 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
9759 something.
9760 (x_get_window_property, receive_incremental_selection)
9761 (lisp_data_to_selection_data, x_property_data_to_lisp):
9762 Check for size-calculation overflow.
9763 (x_get_window_property, receive_incremental_selection)
9764 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9765 Don't store size until memory allocation succeeds.
9766 (x_get_window_property): Plug memory leak on memory exhaustion.
9767 Don't double-block input; malloc is safe here. Don't assume 2**34
9768 - 4 fits in unsigned long. Add an xassert to check
9769 XGetWindowProperty overflow. Be more careful about overflow
9770 calculations, and distinguish size from memory overflow better.
9771 (receive_incremental_selection): When tracing, don't assume
9772 unsigned int is less than INT_MAX.
9773 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9774 harmful) conversions of unsigned short to int.
9775 (lisp_data_to_selection_data): Don't assume that integers
9776 in the range -65535 through -1 fit in an X unsigned short.
9777 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9778 result parameters unless successful. Rely on cons_to_unsigned
9779 to report problems with elements; the old code wasn't right anyway.
9780 (x_check_property_data): Check for int overflow; we cannot use
9781 a wider type due to X limits.
9782 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9783
726e0ab1 9784 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 9785
0065d054
PE
9786 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9787 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
9788 (x_color_cells): Don't store size until memory allocation succeeds.
9789 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 9790 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
9791 (x_term_init): Don't assume length fits in int (sprintf is limited
9792 to int size).
bc18e09d 9793
ebfa62c0
PE
9794 Use ptrdiff_t for composition IDs.
9795 * character.c (lisp_string_width):
9796 * composite.c (composition_table_size, n_compositions)
9797 (get_composition_id, composition_gstring_from_id):
9798 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9799 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9800 * window.c (Frecenter):
9801 Use ptrdiff_t, not int, for composition IDs.
9802 * composite.c (get_composition_id): Check for integer overflow.
9803 * composite.h: Adjust prototypes to match the above changes.
9804
d3411f89
PE
9805 Use ptrdiff_t for hash table indexes.
9806 * category.c (hash_get_category_set):
9807 * ccl.c (ccl_driver):
9808 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9809 * coding.c (coding_system_charset_list, detect_coding_system):
9810 * coding.h (struct coding_system.id):
9811 * composite.c (get_composition_id, gstring_lookup_cache):
9812 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9813 * image.c (xpm_get_color_table_h):
9814 * lisp.h (hash_lookup, hash_put):
9815 * minibuf.c (Ftest_completion):
9816 Use ptrdiff_t for hash table indexes, not int (which is too
9817 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9818 32-bit --with-wide-int hosts).
9819
e097a6fa
PE
9820 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9821 Add a FIXME comment about memory leaks.
9822 (syms_of_charset): Don't assume xmalloc returns.
9823
5637687f
PE
9824 Don't assume that stated character widths fit in int.
9825 * character.c (Fchar_width, c_string_width, lisp_string_width):
9826 * character.h (CHAR_WIDTH):
9827 * indent.c (MULTIBYTE_BYTES_WIDTH):
9828 Use sanitize_char_width to avoid undefined and/or bad behavior
9829 with outlandish widths.
a66cfb1c 9830 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
9831 now that we have two such functions. All uses changed.
9832 (sanitize_char_width): New inline function.
9833
a2271ba2
PE
9834 Don't assume that tab-width fits in int.
9835 * character.h (sanitize_width): New inline function.
9836 (SANE_TAB_WIDTH): New macro.
9837 (ASCII_CHAR_WIDTH): Use it.
9838 * indent.c (sane_tab_width): Remove. All uses replaced by
9839 SANE_TAB_WIDTH (current_buffer).
9840 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9841
18c52557
PE
9842 * fileio.c: Integer overflow issues with file modes.
9843 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9844
caeeedc1
PE
9845 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9846 Remove unreachable code.
9847 (read_hex, load_charset_map_from_file): Check for integer overflow.
9848
6df6ae42 9849 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
9850 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9851 (x_send_scroll_bar_event): Likewise. Check that the size does not
9852 exceed limits imposed by XClientMessageEvent, as well as the usual
9853 ptrdiff_t and size_t limits.
9854
b13995db
PE
9855 * keyboard.c: Overflow, signedness and related fixes.
9856 (make_lispy_movement): Use same integer type in forward decl
9857 that is used in the definition.
9858 (read_key_sequence, keyremap_step):
9859 Change bufsize argument back to int, undoing my 2011-03-30 change.
9860 We prefer signed types, and int is wide enough here.
9861 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9862 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9863 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9864 length, not size_t. Use ptrdiff_t for index, not int.
9865 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9866 possibility of integer overflow.
9867
13464394
PE
9868 Overflow, signedness and related fixes for images.
9869
9870 * dispextern.h (struct it.stack[0].u.image.image_id)
9871 (struct_it.image_id, struct image.id, struct image_cache.size)
9872 (struct image_cache.used, struct image_cache.ref_count):
9873 * gtkutil.c (update_frame_tool_bar):
9874 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9875 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9876 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9877 * nsmenu.m (update_frame_tool_bar):
9878 * xdisp.c (calc_pixel_width_or_height):
9879 * xfns.c (image_cache_refcount):
9880 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9881 on typical 64-bit hosts.
9882
9883 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9884 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9885 Omit unnecessary casts to int.
9886 (parse_image_spec): Check that integers fall into 'int' range
9887 when the callers expect that.
9888 (image_ascent): Redo ascent calculation to avoid int overflow.
9889 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9890 (lookup_image): Remove unnecessary tests.
9891 (xbm_image_p): Locals are now of int, not EMACS_INT,
9892 since parse_image_check makes sure they fit into int.
9893 (png_load, gif_load, svg_load_image):
9894 Prefer int to unsigned where either will do.
9895 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
9896 old tiff_error_handler and tiff_warning_handler.
9897 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
9898 stack buffer overflows. It uses only the features of vsnprintf
9899 that are common to both POSIX and native Microsoft.
9900 (tiff_error_handler, tiff_warning_handler): Use it.
9901 (tiff_load, gif_load, imagemagick_load_image):
9902 Don't assume :index value fits in 'int'.
9903 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9904 (imagemagick_load_image): Check that crop parameters fit into
9905 the integer types that MagickCropImage accepts. Don't assume
9906 Vimagemagick_render_type has a nonnegative value. Don't assume
9907 size_t fits in 'long'.
9908 (gs_load): Use printmax_t to print the widest integers possible.
9909 Check for integer overflow when computing image height and width.
9910
c11821d4
EZ
99112011-08-26 Eli Zaretskii <eliz@gnu.org>
9912
9913 * xdisp.c (redisplay_window): Don't force window start if point
9914 will be invisible in the resulting window. (Bug#9324)
9915
0c95fcf7
EZ
99162011-08-25 Eli Zaretskii <eliz@gnu.org>
9917
9918 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9919 the display spec is of the form `(space ...)'.
9920 (handle_display_spec): Return the value returned by
9921 handle_single_display_spec, not just 1 or zero.
9922 (handle_single_display_spec): If the display spec is of the form
9923 `(space ...)', and specifies display in the text area, return 2
9924 rather than 1.
fee65a97 9925 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
9926 accurately, and prefer exact match for point under bidi.
9927 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
9928
9929 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9930 into disp_prop; all users changed.
9931
9932 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9933 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9934 for the text covered by the display property.
9935
e4ed06f1
CY
99362011-08-25 Chong Yidong <cyd@stupidchicken.com>
9937
9938 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9939 Change return value to nil.
9940 (Frecord_buffer): Delete unused function.
9941
f67cdd7f
EZ
99422011-08-24 Eli Zaretskii <eliz@gnu.org>
9943
5980d4c6
EZ
9944 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9945 buffers, return left-to-right.
8610fe8b
EZ
9946 (set_cursor_from_row): Consider candidate row a win if its glyph
9947 represents a newline and point is on that newline. Fixes cursor
9948 positioning on the newline at EOL of R2L text within L2R
9949 paragraph, and vice versa.
9950 (try_cursor_movement): Check continued rows, in addition to
9951 continuation rows. Fixes unwarranted scroll when point enters a
9952 continued line of R2L text within an L2R paragraph, or vice versa.
9953 (cursor_row_p): Consider the case of point being equal to
9954 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9955 from the end of a short line to the beginning of a continued line
9956 of R2L text within L2R paragraph.
9957 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9958 composed characters.
5980d4c6 9959
f67cdd7f
EZ
9960 * bidi.c (bidi_check_type): Use xassert.
9961 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9962 members.
9963
bca633fb
EZ
99642011-08-23 Eli Zaretskii <eliz@gnu.org>
9965
9966 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9967 a character.
9968
4a5885a7
CY
99692011-08-23 Chong Yidong <cyd@stupidchicken.com>
9970
9971 * nsfont.m (ns_otf_to_script): Fix typo.
9972
0902a04e
KH
99732011-08-22 Kenichi Handa <handa@m17n.org>
9974
9975 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9976 extra slot even if the purpose is char-code-property-table.
9977
1a2e6670
EZ
99782011-08-23 Eli Zaretskii <eliz@gnu.org>
9979
8ddde651
EZ
9980 * xdisp.c (redisplay_window): When computing centering_position,
9981 account for the height of the header line. (Bug#8874)
9982
425cc014
EZ
9983 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9984 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9985 candidate is selected by the mouse, and that candidate has a
9986 composed character under the mouse.
9987
1a2e6670
EZ
9988 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9989 coordinates reported by pos-visible-in-window-p for a composed
9990 character in column zero.
9991
8b76d6f8
SM
99922011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9993
9994 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9995
dac347dd
EZ
99962011-08-22 Eli Zaretskii <eliz@gnu.org>
9997
9998 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9999 consider it a hit if to_charpos is anywhere in the range of the
10000 composed buffer positions.
10001
e013fb34
CY
100022011-08-22 Chong Yidong <cyd@stupidchicken.com>
10003
10004 * image.c (gif_load): Don't assume that each subimage has the same
10005 dimensions as the base image. Handle disposal method that is
10006 "undefined" by the gif spec (Bug#9335).
10007
bd1ba3e8
CY
100082011-08-20 Chong Yidong <cyd@stupidchicken.com>
10009
10010 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 10011 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 10012
54a1215b
EZ
100132011-08-19 Eli Zaretskii <eliz@gnu.org>
10014
823564e5
EZ
10015 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10016 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10017 from an Org mode buffer to a Speedbar frame.
10018
54a1215b
EZ
10019 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10020 a composition, take its buffer position from IT->cmp_it.charpos.
10021 Fixes cursor positioning at the beginning of a line that begins
10022 with a composed character.
10023
9778ebcc
EZ
100242011-08-18 Eli Zaretskii <eliz@gnu.org>
10025
0be6ee06
EZ
10026 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10027 character bidirectional type, use STRONG_L instead. Fixes crashes
10028 in a buffer produced by `describe-categories'.
10029
9778ebcc
EZ
10030 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10031 members before the level stack, so they would be saved and
10032 restored when copying iterator state. Fixes incorrect reordering
10033 around TABs covered by display properties.
10034
156bffbe
AS
100352011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10036
6b02f655 10037 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 10038
72ad093b
CY
100392011-08-17 Chong Yidong <cyd@stupidchicken.com>
10040
10041 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
10042 (internal_condition_case_2, internal_condition_case_n):
10043 Remove unnecessary aborts (Bug#9081).
72ad093b 10044
35774242
EZ
100452011-08-17 Eli Zaretskii <eliz@gnu.org>
10046
10047 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10048 has no `load' handler, try opening the file locally. (Bug#9311)
10049
db76dd85
KB
100502011-08-16 Ken Brown <kbrown@cornell.edu>
10051
10052 * gmalloc.c: Expand comment.
10053
b215eee5
EZ
100542011-08-16 Eli Zaretskii <eliz@gnu.org>
10055
10056 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10057 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10058
a4579d33
KB
100592011-08-16 Ken Brown <kbrown@cornell.edu>
10060
10061 Fix memory allocation problems in Cygwin build (Bug#9273).
10062
10063 * unexcw.c ( __malloc_initialized): Declare external variable.
10064 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10065
8b76d6f8
SM
10066 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10067 New variables.
a4579d33
KB
10068 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10069 dumped emacs.
10070 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10071 in the static heap.
10072 [CYGWIN] (special_realloc): New function.
10073 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10074 requests to realloc storage in the static heap.
10075
3ebec551
PE
100762011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10077
10078 * bidi.c (bidi_initialize): Remove unused local.
10079
9fd8be00
EZ
100802011-08-15 Eli Zaretskii <eliz@gnu.org>
10081
6b02f655
SM
10082 * bidimirror.h:
10083 * biditype.h: Remove file.
10084 * makefile.w32-in ($(BLD)/bidi.$(O)):
10085 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
10086
10087 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10088
10089 * chartab.c: Improve commentary for the uniprop_table API.
10090
32413314
EZ
10091 * bidi.c (bidi_paragraph_init): Support zero value of
10092 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
10093 (bidi_initialize): Use uniprop_table instead of including
10094 biditype.h and bidimirror.h.
32413314 10095
9fd8be00
EZ
10096 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10097 coordinates of the iterator when restoring from ppos_it.
10098 (Bug#9296)
10099
5cf2b69b
KH
101002011-08-14 Kenichi Handa <handa@m17n.org>
10101
10102 * process.c (create_process): Call setup_process_coding_systems
72ad093b 10103 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 10104
daf17d00
EZ
101052011-08-14 Eli Zaretskii <eliz@gnu.org>
10106
10107 * xdisp.c (move_it_in_display_line_to): Don't invoke
10108 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10109 ppos_it. Fixes vertical cursor motion when line beginning is
10110 covered by an image. (Bug#9296)
10111
08e3161a
JD
101122011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10113
10114 * nsterm.h (ns_run_ascript): Declare.
10115 (NSAPP_DATA2_RUNASSCRIPT): Define.
10116
10117 * nsfns.m (as_script, as_result, as_status): New static variables.
10118 (ns_run_ascript): New function.
5e617bc2 10119 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
10120 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10121 the event loop. Get status from as_status (Bug#7276).
10122
10123 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10124 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10125 the event loop (Bug#7276).
10126
a3720aa2
AS
101272011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10128
10129 * gnutls.c (QCgnutls_bootprop_priority)
10130 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10131 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10132 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10133 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10134 (QCgnutls_bootprop_verify_hostname_error)
10135 (QCgnutls_bootprop_callbacks_verify): Rename from
10136 Qgnutls_bootprop_..., all uses changed.
10137
10138 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10139 uses changed.
10140
0a0d27fb
PE
101412011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10142
19d5c50c
PE
10143 * xfaces.c (Qframe_set_background_mode): Now static.
10144 * dispextern.h (Qframe_set_background_mode): Remove decl.
10145
0a0d27fb
PE
10146 * process.c (Fnetwork_interface_info): Declare local only if needed.
10147
377538cb
JD
101482011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10149
10150 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10151 (Fnetwork_interface_list): Allocate in increments of bytes instead
10152 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10153 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10154 sockaddr.
10155 (struct ifflag_def): notrailers is smart on OSX.
10156 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10157 Get hardware address with getifaddrs if available.
10158
08fff70c
EZ
101592011-08-12 Eli Zaretskii <eliz@gnu.org>
10160
10161 * xdisp.c (iterate_out_of_display_property): xassert that
10162 IT->position is set to within IT->object's boundaries. Break from
10163 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
10164 when IT->position is set up wrongly due to some bug.
10165 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
10166 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10167 entry. Force push_it to save on the stack the current
10168 buffer/string position, to be restored by pop_it. Fix flags in
10169 the iterator structure wrt the object coming from a display
10170 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10171 properties. (Bug#9284)
10172
7be1c708 101732011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 10174
7be1c708
CY
10175 * fontset.c (fontset_get_font_group): Add proper type checks.
10176 (Bug#9172)
aac0c6e3 10177
7be1c708 101782011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 10179
7be1c708
CY
10180 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10181 and LC_VERSION_MIN_MACOSX.
10182 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10183 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 10184
97bb72a6
EZ
101852011-08-08 Eli Zaretskii <eliz@gnu.org>
10186
10187 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
10188 no-display-properties-and-no-overlays under bidi display.
10189 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 10190 properties and overlays.
97bb72a6 10191
d5617611
CY
101922011-08-08 Chong Yidong <cyd@stupidchicken.com>
10193
37e11a63
CY
10194 * editfns.c (Fset_time_zone_rule): Document relationship with the
10195 setenv function.
10196
d5617611
CY
10197 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10198 the font entity extracted from the cache (Bug#8109).
10199
58872834
CY
102002011-08-07 Chong Yidong <cyd@stupidchicken.com>
10201
10202 * composite.c (autocmp_chars): Don't reset point. That is done by
10203 restore_point_unwind (Bug#5984).
10204
75bfc667
JL
102052011-08-07 Juri Linkov <juri@jurta.org>
10206
10207 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10208 to show the arg `TIME' instead of `TIMEVAL'.
10209
d1410150
EZ
102102011-08-06 Eli Zaretskii <eliz@gnu.org>
10211
10212 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10213 display property strides EOL and includes a newline, as in
10214 longlines-mode. (Bug#9254)
75b771e4
EZ
10215 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10216 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
10217
10218 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10219 is non-zero, even if the data buffer is NULL. Fixes a crash in
10220 vertical-motion with longlines-mode. (Bug#9254)
10221
35928349
EZ
102222011-08-05 Eli Zaretskii <eliz@gnu.org>
10223
ec7cc85b
EZ
10224 * bidi.c <bidi_cache_total_alloc>: Now static.
10225 (bidi_initialize): Initialize bidi_cache_total_alloc.
10226
8b76d6f8 10227 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
10228 cache. (Bug#9221)
10229
10230 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10231 amount allocated this far in `bidi_cache_total_alloc'.
10232 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10233 non-zero, only free the data buffer without restoring the cache
10234 contents. All callers changed.
10235
10236 * dispextern.h (bidi_unshelve_cache): Update prototype.
10237
10238 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10239 (move_it_in_display_line, move_it_to)
10240 (move_it_vertically_backward, move_it_by_lines): Replace the call
10241 to xfree to an equivalent call to bidi_unshelve_cache.
10242 (move_it_in_display_line_to): Fix logic of returning
412b6358 10243 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 10244
e2e2423b
EZ
102452011-08-05 Eli Zaretskii <eliz@gnu.org>
10246
10247 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10248 came from a string character with a `cursor' property. (Bug#9229)
10249
ae9e757a
JD
102502011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10251
10252 * Makefile.in (LIB_PTHREAD): New variable.
10253 (LIBES): Add LIB_PTHREAD (Bug#9216).
10254
10255 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10256 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10257
213bd7f2
AS
102582011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10259
6b02f655 10260 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 10261
99aaf75f
JD
102622011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10263
10264 * xterm.c (x_find_topmost_parent): New function.
10265 (x_set_frame_alpha): Find topmost parent window with
10266 x_find_topmost_parent and set the property there also (bug#9181).
10267 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10268
c74e9d86
PE
102692011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10270
10271 * callproc.c (Fcall_process): Avoid vfork clobbering
10272 the local vars buffer, coding_systems, current_dir.
10273
640c8776
SM
102742011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10275
10276 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10277
f26d0e4c
PE
102782011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10279
8a10d76c
PE
10280 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10281 so that it is not optimized away.
10282
f26d0e4c
PE
10283 * xdisp.c (compute_display_string_pos): Remove unused local.
10284
55439c61
EZ
102852011-08-02 Eli Zaretskii <eliz@gnu.org>
10286
10287 Fix slow cursor motion and scrolling in large buffers with
10288 selective display, like Org Mode buffers. (Bug#9218)
10289
10290 * dispextern.h (struct bidi_it): New member disp_prop_p.
10291
10292 * xdisp.c: Remove one-slot cache of display string positions.
10293 (compute_display_string_pos): Accept an additional argument
5e617bc2 10294 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
10295 for a display string or property. If found, set DISP_PROP_P
10296 non-zero.
10297
10298 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
10299 DISP_PROP_P, and pass it to compute_display_string_pos.
10300 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
10301 non-zero. All callers of bidi_fetch_char changed.
10302
fb33fa43
SM
103032011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10304
10305 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10306
b099e063
DM
103072010-12-03 Don March <don@ohspite.net>
10308
10309 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10310 last character M-[char] is translated to ESC [char] (bug#7541).
10311
5cc7f7af
KH
103122011-08-02 Kenichi Handa <handa@m17n.org>
10313
d0fffa3f 10314 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
10315
10316 * chartab.c (uniprop_table): Make it non-static.
10317
525d5e6e
EZ
103182011-08-01 Eli Zaretskii <eliz@gnu.org>
10319
10320 * xdisp.c (forward_to_next_line_start): Accept additional argument
10321 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10322 on the newline.
10323 (reseat_at_next_visible_line_start): Use the bidi iterator state
10324 returned by forward_to_next_line_start to restore the state of
10325 it->bidi_it after backing up to previous newline. (Bug#9212)
10326
31011111
AS
103272011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10328
10329 * regex.c (re_comp): Protoize.
10330 (re_exec): Fix return type.
10331 (regexec): Fix type of `ret'. (Bug#9203)
10332
476371c4
PE
103332011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10334
e5d76069
PE
10335 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10336 This is needed if max-image-size is a floating-point number.
10337
9a79b20c
AS
103382011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10339
10340 * print.c (print_object): Print empty symbol as ##.
10341
10342 * lread.c (read1): Read ## as empty symbol.
10343
d8c2fa78
AA
103442011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10345
10346 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10347 setting frame foreground color (Bug#9175).
10348 (x_set_background_color): Likewise.
10349
ffe57a7a
AA
10350 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10351 contents (Bug#9176).
10352 (EmacsTooltip -init): Remove bezels and add shadows to
10353 tooltip windows.
10354
bf3492a5
AA
10355 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10356 or scroll bar (Bug#8470).
10357
d55e9c53
AA
10358 * nsfont.m (nsfont_open): Remove assignment to voffset and
10359 unnecessary vars hshink, expand, hd, full_height, min_height.
10360 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10361
10362 * nsterm.h (nsfont_info): Remove voffset field.
10363
d8c2fa78 103642011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
10365
10366 Implement strike-through and overline on NextStep (Bug#8863).
10367
10368 * nsfont.m (nsfont_open): Use underline position provided by font,
10369 instead of hard-coded value of 2.
10370 (nsfont_draw): Call ns_draw_text_decoration instead.
10371
10372 * nsterm.h: Add declaration for ns_draw_text_decoration.
10373
10374 * nsterm.m (ns_draw_text_decoration): New function for drawing
10375 underline, overline, and strike-through.
10376 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10377 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 10378 accommodate underlining, etc.
4843aac3 10379
4cc60b9b
EZ
103802011-07-28 Eli Zaretskii <eliz@gnu.org>
10381
bc7ece87
EZ
10382 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10383 default.
4cc60b9b 10384
476371c4
PE
103852011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10386
66606eea
PE
10387 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10388 Without this fix, if a signal arrives just after memory fills up,
10389 'malloc' might be invoked reentrantly.
10390
476371c4
PE
10391 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10392 In other words, assume that every image size is allowed, on non-X
10393 hosts. This assumption is probably wrong, but it lets Emacs compile.
10394
f3fcc40d
AS
103952011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10396
10397 * regex.c (re_iswctype): Convert return values to boolean.
10398
350c992f
EZ
103992011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10400
10401 * xdisp.c (compute_display_string_pos): Don't use cached display
10402 string position if the buffer had its restriction changed.
10403 (Bug#9184)
10404
5266b4bb
PE
104052011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10406
10407 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10408
2573a837 104092011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 10410
41f55ccd 10411 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 10412
39e378da
PE
10413 * bidi.c: Integer size and overflow fixes.
10414 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10415 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10416 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10417 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10418 (bidi_find_other_level_edge):
10419 Use ptrdiff_t instead of EMACS_INT where either will do.
10420 This works better on 32-bit hosts configured --with-wide-int.
10421 (bidi_cache_ensure_space): Check for size-calculation overflow.
10422 Use % rather than repeated addition, for better worst-case speed.
10423 Don't set bidi_cache_size until after xrealloc returns, because it
10424 might not return.
10425 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
10426 (bidi_cache_ensure_space): Also check that the bidi cache size
10427 does not exceed that of the largest Lisp string or buffer. See Eli
10428 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 10429
5e927815
PE
10430 * alloc.c (__malloc_size_t): Remove.
10431 All uses replaced by size_t. See Andreas Schwab's note
10432 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10433
ca4aa935
PE
10434 * image.c: Improve checking for integer overflow.
10435 (check_image_size): Assume that f is nonnull, since
10436 it is always nonnull in practice. This is one less thing to
10437 worry about when checking for integer overflow later.
10438 (x_check_image_size): New function, which checks for integer
10439 overflow issues inside X.
10440 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10441 This removes the need for a memory_full check.
10442 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10443 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10444 (xbm_read_bitmap_data): Change locals back to 'int', since
10445 their values must fit in 'int'.
10446 (xpm_load_image, png_load, tiff_load):
10447 Invoke x_create_x_image_and_pixmap earlier,
10448 to avoid much needless work if the image is too large.
10449 (tiff_load): Treat overly large images as if
10450 x_create_x_image_and_pixmap failed, not as malloc failures.
10451 (gs_load): Use x_check_image_size.
10452
5f8f9cc2
PE
10453 * gtkutil.c: Omit integer casts.
10454 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10455 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10456
5adf60bc
PE
10457 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10458
c8907a93
PE
10459 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10460 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10461 would wrongly return t on a 64-bit host.
10462
e3c25c68
PE
10463 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10464 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10465 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10466 and therefore cause GCC to emit a bogus diagnostic in some cases.
10467
3f791afe
PE
10468 * image.c: Integer signedness and overflow and related fixes.
10469 This is not an exhaustive set of fixes, but it's time to
10470 record what I've got.
10471 (lookup_pixel_color, check_image_size): Remove redundant decls.
10472 (check_image_size): Don't assume that arbitrary EMACS_INT values
10473 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10474 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10475 (tiff_load, imagemagick_load_image):
10476 Check for overflow in size calculations.
10477 (x_create_x_image_and_pixmap): Remove unnecessary test for
10478 xmalloc returning NULL; that can't happen.
10479 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10480 (xpm_color_bucket): Use better integer hashing function.
10481 (xpm_cache_color): Don't possibly over-allocate memory.
10482 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10483 (gif_memory_source):
10484 Use ptrdiff_t, not int or size_t, to record sizes.
10485 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10486 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10487 either works, as we prefer signed integers.
10488 (tiff_read_from_memory, tiff_write_from_memory):
10489 Return tsize_t, not size_t, since that's what the TIFF API wants.
10490 (tiff_read_from_memory): Don't fail simply because the read would
10491 go past EOF; instead, return a short read.
10492 (tiff_load): Omit no-longer-needed casts.
10493 (Fimagemagick_types): Don't assume size fits into 'int'.
10494
3cc5a532
PE
10495 Improve hashing quality when configured --with-wide-int.
10496 * fns.c (hash_string): New function, taken from sxhash_string.
10497 Do not discard information about ASCII character case; this
10498 discarding is no longer needed.
10499 (sxhash-string): Use it. Change sig to match it. Caller changed.
10500 * lisp.h: Declare it.
10501 * lread.c (hash_string): Remove, since we now use fns.c's version.
10502 The fns.c version returns a wider integer if --with-wide-int is
10503 specified, so this should help the quality of the hashing a bit.
10504
b312a492
PE
10505 * emacs.c: Integer overflow minor fix.
10506 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10507 Define only if GNU_LINUX.
10508 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10509
dfd153ae
PE
10510 * dispnew.c: Integer signedness and overflow fixes.
10511 Remove unnecessary forward decls, that were a maintenance hassle.
10512 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10513 All uses changed.
10514 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10515 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10516 (prepare_desired_row, line_draw_cost):
10517 Use int, not unsigned, where either works.
10518 (save_current_matrix, restore_current_matrix):
10519 Use ptrdiff_t, not size_t, where either works.
10520 (init_display): Check for overflow more accurately, and without
10521 relying on undefined behavior.
10522
a81d11a3
PE
10523 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10524 Remove, replacing with the new symbols in lisp.h. All uses changed.
10525 * fileio.c (make_temp_name):
10526 * filelock.c (lock_file_1, lock_file):
10527 * xdisp.c (message_dolog):
10528 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10529 Use pMd etc. instead.
10530 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10531 replacing the pWIDE etc. symbols removed from editfns.c.
10532
3300e6fd
PE
10533 * keyboard.h (num_input_events): Now uintmax_t.
10534 This is (very slightly) less likely to mess up due to wraparound.
10535 All uses changed.
10536
fd05c7e9
PE
10537 * buffer.c: Integer signedness fixes.
10538 (alloc_buffer_text, enlarge_buffer_text):
10539 Use ptrdiff_t rather than size_t when either will do, as we prefer
10540 signed integers.
10541
903fe15d
PE
10542 * alloc.c: Integer signedness and overflow fixes.
10543 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10544 (__malloc_size_t): Default to size_t, not to int.
10545 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10546 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10547 Prefer ptrdiff_t to size_t when either would do, as we prefer
10548 signed integers.
10549 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10550 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10551 Now const. Initialize with values that are in range even if char
10552 is signed.
10553 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10554 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10555 These functions do the right thing with sizes > 2**32.
10556 (check_depth): Now ptrdiff_t, not int.
10557 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10558 Adjust to new way of storing sizes. Check for size overflow bugs
10559 in rest of code.
10560 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10561 slightly wrong anyway, as it missed one instance of
10562 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10563 (refill_memory_reserve): Omit needless cast to size_t.
10564 (mark_object_loop_halt): Mark as externally visible.
10565
ac82cc6a
PE
10566 * xselect.c: Integer signedness and overflow fixes.
10567 (Fx_register_dnd_atom, x_handle_dnd_message):
10568 Use ptrdiff_t, not size_t, since we prefer signed.
10569 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10570 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10571 x_dnd_atoms_size and x_dnd_atoms_length.
10572
c2d1e36d
PE
10573 * doprnt.c: Prefer signed to unsigned when either works.
10574 * eval.c (verror):
10575 * doprnt.c (doprnt):
10576 * lisp.h (doprnt):
10577 * xdisp.c (vmessage):
10578 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10579 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10580 prefer signed arithmetic to avoid comparison confusion.
10581 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10582 but is a bit tricky.
10583
0e926e56
PE
10584 Assume freestanding C89 headers, string.h, stdlib.h.
10585 * data.c, doprnt.c, floatfns.c, print.c:
10586 Include float.h unconditionally.
10587 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10588 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10589 * regex.c: Likewise for stddef.h, string.h.
10590 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10591 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10592 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10593 (STDC_HEADERS): Remove obsolete defines.
10594 * sysdep.c: Include limits.h unconditionally.
10595
9cfdb3ec
PE
10596 Assume support for memcmp, memcpy, memmove, memset.
10597 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10598 * regex.c (memcmp, memcpy):
10599 Remove; we assume C89 now.
10600
10601 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10602 (__malloc_safe_bcopy): Remove; no longer needed.
10603
cf950e6b 10604 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
10605 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10606 well either way, and we prefer signed to unsigned.
10607
dbf38e02
LMI
106082011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10609
10610 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10611 closes the connection while we're reading (bug#9182).
10612
d6f0886c 106132011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 10614
d6f0886c
JD
10615 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10616 are specified (Bug#9168).
24e0f6b1 10617
2eb1f9e6
PE
106182011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10619
10620 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10621 Found by GCC static checking and --with-wide-int on a 32-bit host.
10622
22381272 106232011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
10624
10625 * xdisp.c (compute_display_string_pos): Fix logic of caching
10626 previous display string position. Initialize cached_prev_pos to
10627 -1. Fixes slow-down at the beginning of a buffer.
10628
f25e39b4
EZ
106292011-07-24 Eli Zaretskii <eliz@gnu.org>
10630
10631 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10632 for attrs[LFACE_FONTSET_INDEX].
10633
04c4b52e
PE
106342011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 * xml.c (parse_region): Remove unused local
10637 that was recently introduced.
10638
c1734fbd
EZ
106392011-07-23 Eli Zaretskii <eliz@gnu.org>
10640
be18c5a5
EZ
10641 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10642 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10643
c1734fbd
EZ
10644 * xdisp.c (move_it_in_display_line_to): Record the best matching
10645 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
10646 exit if none of the characters scanned was an exact match.
10647 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
10648 when exact match is impossible due to invisible text, and the
10649 lines are truncated.
10650
a258d627
JD
106512011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10652
10653 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10654 for OSX >= 10.7.
10655
b6d5a689
EZ
106562011-07-22 Eli Zaretskii <eliz@gnu.org>
10657
0f74f785
EZ
10658 Fix a significant slow-down of cursor motion with C-n, C-p,
10659 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10660 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 10661 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
10662 (next_element_from_buffer): Call compute_stop_pos_backwards to
10663 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
10664 base_level_stop.
10665 (reseat): Don't look for prev_stop, as that could mean a very long
10666 run.
10667 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10668 <cached_disp_overlay_modiff>: Cache for last found display string
10669 position.
551918c1 10670 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
10671 about the same buffer in the same area of character positions, and
10672 the buffer wasn't changed since the time the display string
10673 position was cached.
551918c1 10674
b2d0c91a
EZ
106752011-07-22 Eli Zaretskii <eliz@gnu.org>
10676
10677 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10678 is an integer, which is important for empty lines. (Bug#9149)
10679
043604ee
CY
106802011-07-22 Chong Yidong <cyd@stupidchicken.com>
10681
10682 * frame.c (Fmodify_frame_parameters): In tty case, update the
10683 default face if necessary (Bug#4238).
10684
da4adb04
CY
106852011-07-21 Chong Yidong <cyd@stupidchicken.com>
10686
10687 * editfns.c (Fstring_to_char): No need to explain what a character
10688 is in the docstring (Bug#6576).
10689
9abd0532
LMI
106902011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10691
10692 * xml.c (parse_region): Make sure we always return a tree.
10693
36881d16
HK
106942011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10695
10696 * xml.c (parse_region): If a document contains only comments,
10697 return that, too.
10698
1e98674d
LMI
106992011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10700
10701 * xml.c (make_dom): Return comments, too.
10702
590bd467
PE
107032011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10704
10705 Port to OpenBSD.
10706 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10707 and the surrounding thread.
10708 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10709 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10710 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10711 timer goes off.
10712 * s/openbsd.h (BROKEN_SIGIO): Define.
10713 * unexelf.c (unexec) [__OpenBSD__]:
10714 Don't update the .mdebug section of the Alpha COFF symbol table.
10715
f41628b2
LMI
107162011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10717
10718 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10719 (bug#8460).
10720
b59b67c5
PE
107212011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10722
15e3a074
PE
10723 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10724 This fixes some race conditions on the permissions of any newly
10725 created file.
10726
41bed37d
PE
10727 * alloc.c (valid_pointer_p): Use pipe, not open.
10728 This fixes some permissions issues when debugging.
10729
b59b67c5
PE
10730 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10731 If fchown fails to set both uid and gid, try to set just gid,
10732 as that is sometimes allowed. Adjust the file's mode to eliminate
10733 setuid or setgid bits that are inappropriate if fchown fails.
10734
925a6be7
SM
107352011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10736
10737 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10738 to compare Lisp_Objects.
10739 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10740 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10741 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10742
52968808
AS
107432011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10744
0a6a104b
AS
10745 * lread.c (read_integer): Unread even EOF character.
10746 (read1): Likewise. Properly record start position of symbol.
10747
52968808
AS
10748 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10749 symbol character follows.
10750
9e381cdd
PE
107512011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10752
10753 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10754 This works around a problem with the previous change to Fcopy_file.
10755 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10756 and without this change, GCC might complain about discarding
10757 fchown's return value.
10758
b5641435
JB
107592011-07-16 Juanma Barranquero <lekktu@gmail.com>
10760
10761 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10762
a8031457
PE
107632011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10764
10765 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10766
dd889327
LMI
107672011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10768
750c33f7
LMI
10769 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10770 it's used from the C level.
10771
dd889327
LMI
10772 * process.c: Use the same condition for POLL_FOR_INPUT in both
10773 keyboard.c and process.c (bug#1858).
10774
87e86684
LM
107752011-07-09 Lawrence Mitchell <wence@gmx.li>
10776
10777 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10778 (Fgnutls_boot): Use it.
10779
64348f40
AS
107802011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10781
10782 * doc.c (Fsubstitute_command_keys): Revert last change.
10783
1d698799
LMI
107842011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10785
f863868c
LMI
10786 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10787 quotes the next character, and doesn't affect other longer
10788 sequences (bug#8935).
10789
1d698799
LMI
10790 * lread.c (syms_of_lread): Clarify that is isn't only
10791 `eval-buffer' and `eval-defun' that's affected by
10792 `lexical-binding' (bug#8460).
10793
aa4b6df6
EZ
107942011-07-15 Eli Zaretskii <eliz@gnu.org>
10795
10796 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 10797 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 10798
5d856da6
PE
107992011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10800
ad6042bb
PE
10801 Fix minor problems found by static checking.
10802 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10803 (elsz): Now a signed constant, not a size_t var. We prefer signed
10804 types to unsigned, to avoid integer comparison confusion. Without
10805 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10806 "cannot optimize loop, the loop counter may overflow", a symptom
10807 of the confusion.
f00bbb22 10808 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
10809 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10810
6468f31c
LMI
108112011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10812
49080b10
LMI
10813 * search.c (Fre_search_backward): Mention `case-fold-search' in
10814 all the re_search_* functions (bug#8138).
10815
6468f31c
LMI
10816 * keyboard.c (Fopen_dribble_file): Document when the file is
10817 closed (bug#8056).
10818
c965adc5
EZ
108192011-07-14 Eli Zaretskii <eliz@gnu.org>
10820
df9733bf
EZ
10821 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10822 bidi_cache_idx.
10823
0bb23927
EZ
10824 Support bidi reordering of display and overlay strings.
10825 * xdisp.c (compute_display_string_pos)
10826 (compute_display_string_end): Accept additional argument STRING.
10827 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10828 (reseat_to_string): Initialize bidi_it->string.s and
10829 bidi_it->string.schars.
10830 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
10831 NULL (avoids a crash in bidi_paragraph_init).
10832 Initialize itb.string.lstring.
0bb23927
EZ
10833 (init_iterator): Call bidi_init_it only of a valid
10834 buffer position was specified. Initialize paragraph_embedding to
10835 L2R.
10836 (reseat_to_string): Initialize the bidi iterator.
10837 (display_string): If we need to ignore text properties of
10838 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10839 original value of -1 will not work with bidi.)
10840 (compute_display_string_pos): First arg is now struct
10841 `text_pos *'; all callers changed. Support display properties on
10842 Lisp strings.
10843 (compute_display_string_end): Support display properties on Lisp
10844 strings.
10845 (init_iterator, reseat_1, reseat_to_string): Initialize the
10846 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10847 when iterating on a string not from display properties).
640c8776
SM
10848 (compute_display_string_pos, compute_display_string_end):
10849 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
10850 arrow keys.
10851 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
10852 base_level_stop; instead, set base_level_stop to BEGV.
10853 Fixes crashes in vertical-motion.
0bb23927
EZ
10854 (next_element_from_buffer): Improve commentary for when
10855 the iterator is before prev_stop.
10856 (init_iterator): Initialize bidi_p from the default value of
10857 bidi-display-reordering, not from buffer-local value. Use the
10858 buffer-local value only if initializing for buffer iteration.
10859 (handle_invisible_prop): Support invisible properties on strings
10860 that are being bidi-reordered.
10861 (set_iterator_to_next): Support bidi reordering of C strings and
10862 Lisp strings.
10863 (next_element_from_string): Support bidi reordering of Lisp
10864 strings.
10865 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
10866 (display_string): Support display of R2L glyph rows.
10867 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
10868 (init_iterator): Don't initialize it->bidi_p for strings
10869 here.
10870 (reseat_to_string): Initialize it->bidi_p for strings here.
10871 (next_element_from_string, next_element_from_c_string)
10872 (next_element_from_buffer): Add xassert's for correspondence
10873 between IT's object being iterated and it->bidi_it.string
10874 structure.
10875 (face_before_or_after_it_pos): Support bidi iteration.
10876 (next_element_from_c_string): Handle the case of the first string
10877 character that is not the first one in the visual order.
10878 (get_visually_first_element): New function, refactored from common
10879 parts of next_element_from_buffer, next_element_from_string, and
10880 next_element_from_c_string.
10881 (tool_bar_lines_needed, redisplay_tool_bar)
10882 (display_menu_bar): Force left-to-right direction. Add a FIXME
10883 comment for making that be controlled by a user option.
10884 (push_it, pop_it): Save and restore the state of the
10885 bidi iterator. Save and restore the bidi_p flag.
10886 (pop_it): Iterate out of display property for string iteration as
10887 well.
10888 (iterate_out_of_display_property): Support iteration over strings.
10889 (handle_single_display_spec): Set up it->bidi_it for iteration
10890 over a display string, and call bidi_init_it.
10891 (handle_single_display_spec, next_overlay_string)
10892 (get_overlay_strings_1, push_display_prop): Set up the bidi
10893 iterator for displaying display or overlay strings.
10894 (forward_to_next_line_start): Don't use the shortcut if
10895 bidi-iterating.
10896 (back_to_previous_visible_line_start): If handle_display_prop
10897 pushed the iterator stack, restore the internal state of the bidi
10898 iterator by calling bidi_pop_it same number of times.
10899 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10900 and we are bidi-iterating, don't decrement the iterator position;
10901 instead, set the first_elt flag in the bidi iterator, to produce
10902 the same effect.
10903 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10904 (push_display_prop): xassert that we are iterating a buffer.
10905 (push_it, pop_it): Save and restore paragraph_embedding member.
10906 (handle_single_display_spec, next_overlay_string)
10907 (get_overlay_strings_1, reseat_1, reseat_to_string)
10908 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10909 correctly. Don't assume unibyte strings are not bidi-reordered.
10910 (compute_display_string_pos)
10911 (compute_display_string_end): Fix handling the case of C string.
10912 (push_it, pop_it): Save and restore from_disp_prop_p.
10913 (handle_single_display_spec, push_display_prop): Set the
10914 from_disp_prop_p flag.
10915 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10916 (pop_it): Call iterate_out_of_display_property only if we are
10917 popping after iteration over a string that came from a display
10918 property. Fix a typo in popping stretch info. Add an assertion
10919 for verifying that the iterator position is in sync with the bidi
10920 iterator.
10921 (handle_single_display_spec, get_overlay_strings_1)
10922 (push_display_prop): Fix initialization of paragraph direction for
10923 string when that of the parent object is not yet determined.
10924 (reseat_1): Call bidi_init_it to resync the bidi
10925 iterator with IT's position. (Bug#7616)
10926 (find_row_edges): If ROW->start.pos gives position
10927 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10928 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10929 Reset the from_disp_prop_p flag.
10930 (SAVE_IT, RESTORE_IT): New macros.
10931 (pos_visible_p, face_before_or_after_it_pos)
10932 (back_to_previous_visible_line_start)
10933 (move_it_in_display_line_to, move_it_in_display_line)
10934 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10935 (try_scrolling, redisplay_window, display_line): Use them when
10936 saving a temporary copy of the iterator and restoring it back.
10937 (back_to_previous_visible_line_start, reseat_1)
10938 (init_iterator): Empty the bidi cache "stack".
10939 (move_it_in_display_line_to): If iterator ended up at
10940 EOL, but we never saw any buffer positions smaller than
10941 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10942 motion in bidi-reordered lines.
10943 (move_it_in_display_line_to): Record prev_method and prev_pos
10944 immediately before the call to set_iterator_to_next. Fixes cursor
10945 motion in bidi-reordered lines with stretch glyphs and strings
10946 displayed in margins. (Bug#8133) (Bug#8867)
10947 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10948 TO_CHARPOS.
640c8776
SM
10949 (pos_visible_p): Support positions in bidi-reordered lines.
10950 Save and restore bidi cache.
0bb23927
EZ
10951
10952 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10953 (bidi_paragraph_info): Delete unused struct.
10954 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10955 (bidi_cache_start): New variable.
10956 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10957 to zero.
10958 (bidi_cache_fetch_state, bidi_cache_search)
10959 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10960 (bidi_cache_find, bidi_peek_at_next_level)
10961 (bidi_level_of_next_char, bidi_find_other_level_edge)
10962 (bidi_move_to_visually_next): Compare cache index with
10963 bidi_cache_start rather than with zero.
10964 (bidi_fetch_char): Accept new argument STRING; all callers
10965 changed. Support iteration over a string. Support strings with
10966 display properties. Support unibyte strings. Fix the type of
10967 `len' according to what STRING_CHAR_AND_LENGTH expects.
10968 (bidi_paragraph_init, bidi_resolve_explicit_1)
10969 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
10970 (bidi_level_of_next_char, bidi_move_to_visually_next):
10971 Support iteration over a string.
0bb23927
EZ
10972 (bidi_set_sor_type, bidi_resolve_explicit_1)
10973 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10974 can now be zero (for strings); special values 0 and -1 were
10975 changed to -1 and -2, respectively.
10976 (bidi_char_at_pos): New function.
10977 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10978 Call it instead of FETCH_MULTIBYTE_CHAR.
10979 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10980 initialized to valid values.
10981 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10982 values.
10983 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10984 the test for valid cached positions. Fix the logic for looking up
10985 the sentinel state in the cache. GCPRO the Lisp string we are
10986 iterating.
10987 (bidi_push_it, bidi_pop_it): New functions.
10988 (bidi_initialize): Initialize the bidi cache start stack pointer.
10989 (bidi_cache_ensure_space): New function, refactored from part of
10990 bidi_cache_iterator_state. Don't assume the required size is just
10991 one BIDI_CACHE_CHUNK away.
10992 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10993 (bidi_count_bytes, bidi_char_at_pos): New functions.
10994 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10995 always valid if bidi_cache_idx is valid.
10996 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10997 is valid if it's going to be used.
10998 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10999 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
11000 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11001 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
11002 (bidi_find_other_level_edge, bidi_cache_start_stack):
11003 All variables related to cache indices are now EMACS_INT.
c965adc5 11004
0bb23927
EZ
11005 * dispextern.h (struct bidi_string_data): New structure.
11006 (struct bidi_it): New member `string'. Make flag members be 1-bit
11007 fields, and put them last in the struct.
640c8776
SM
11008 (compute_display_string_pos, compute_display_string_end):
11009 Update prototypes.
0bb23927
EZ
11010 (bidi_push_it, bidi_pop_it): Add prototypes.
11011 (struct iterator_stack_entry): New members bidi_p,
11012 paragraph_embedding, and from_disp_prop_p.
11013 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
11014 (bidi_shelve_cache, bidi_unshelve_cache):
11015 Declare prototypes.
0bb23927
EZ
11016
11017 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11018 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11019 and vector-like objects.
11020
11021 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11022 cache around display iteration.
11023
11024 * window.c (Fwindow_end, window_scroll_pixel_based)
11025 (displayed_window_lines, Frecenter): Save and restore the bidi
11026 cache around display iteration.
11027
3bbd2265
LMI
110282011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11029
11030 * editfns.c (Fdelete_region): Clarify the use of the named
11031 parameters (bug#6788).
11032
adc47434
MR
110332011-07-14 Martin Rudalics <rudalics@gmx.at>
11034
11035 * indent.c (Fvertical_motion): Set and restore w->pointm when
11036 saving and restoring the window's buffer (Bug#9006).
11037
837c31f8
LMI
110382011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11039
11040 * editfns.c (Fstring_to_char): Clarify just what is returned
11041 (bug#6576). Text by Eli Zaretskii.
11042
ac389d0c
JB
110432011-07-13 Juanma Barranquero <lekktu@gmail.com>
11044
11045 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11046
0be0ce47
EZ
110472011-07-13 Eli Zaretskii <eliz@gnu.org>
11048
11049 * buffer.c (mmap_find): Fix a typo.
11050
cd18e7e3
JB
110512011-07-13 Johan Bockgård <bojohan@gnu.org>
11052
11053 Fix execution of x selection hooks.
11054 * xselect.c (Qx_lost_selection_functions)
11055 (Qx_sent_selection_functions): New vars.
11056 (syms_of_xselect): DEFSYM them.
11057 (x_handle_selection_request): Pass Qx_sent_selection_functions
11058 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11059 (x_handle_selection_clear,x_clear_frame_selections):
11060 Pass Qx_lost_selection_functions rather than
11061 Vx_lost_selection_functions to Frun_hook_with_args.
11062
47ea7f44
PE
110632011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11064
ac389d0c 11065 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
11066 The old code sometimes used this field without initializing it.
11067
47ea7f44
PE
11068 * alloc.c (gc_sweep): Don't read past end of array.
11069 In theory, the old code could also have corrupted Emacs internals,
11070 though it'd be very unlikely.
11071
bc985c87
AS
110722011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11073
11074 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 11075 argument. (Bug#4026)
bc985c87 11076
0cf34688
LMI
110772011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11078
b3dadd76
LMI
11079 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11080 key" (bug#4257).
11081
0cf34688
LMI
11082 * window.c (Fset_window_start): Doc fix (bug#4199).
11083 (Fset_window_hscroll): Ditto.
11084
270768cd
PE
110852011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11086
077e3dda 11087 Fix minor new problems caught by GCC 4.6.1.
270768cd 11088 * term.c (init_tty): Remove unused local.
490011a6 11089 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 11090 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 11091 not used otherwise.
270768cd 11092
b1f58454
CY
110932011-07-12 Chong Yidong <cyd@stupidchicken.com>
11094
11095 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11096
22b9578d
LMI
110972011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11098
6e70ab07
LMI
11099 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11100 are the mini-buffer and the echo area (bug#3320).
11101
22b9578d
LMI
11102 * term.c (init_tty): Remove support for supdup, c10 and perq
11103 terminals, which are no longer supported (bug#1482).
11104
8974cc9f
JB
111052011-07-10 Johan Bockgård <bojohan@gnu.org>
11106
11107 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11108
a560d974
JD
111092011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11110
11111 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11112 for non-popups (Bug#3642).
11113
1dae0f0a
AS
111142011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11115
268c2c36 11116 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 11117 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
11118 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11119 * cm.c (losecursor): Likewise.
1dae0f0a
AS
11120 * data.c (fmod): Likewise.
11121 * dispnew.c (swap_glyphs_in_rows): Likewise.
11122 * emacs.c (memory_warning_signal): Likewise.
11123 * floatfns.c (float_error): Likewise.
11124 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11125 (otf_open, font_otf_capability, generate_otf_features)
11126 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11127 Likewise.
11128 * image.c (pbm_read_file): Likewise.
11129 * indent.c (string_display_width): Likewise.
11130 * intervals.c (check_for_interval, search_for_interval)
11131 (inc_interval_count, count_intervals, root_interval)
11132 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11133 * lread.c (defalias): Likewise.
268c2c36 11134 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
11135 * regex.c (set_image_of_range_1, set_image_of_range)
11136 (regex_grow_registers): Likewise.
11137 * sysdep.c (strerror): Likewise.
11138 * termcap.c (valid_filename_p, tprint, main): Likewise.
11139 * tparam.c (main): Likewise.
11140 * unexhp9k800.c (run_time_remap, save_data_space)
11141 (update_file_ptrs, read_header, write_header, calculate_checksum)
11142 (copy_file, copy_rest, display_header): Likewise.
11143 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11144 Likewise.
11145 * xdisp.c (check_it): Likewise.
11146 * xfaces.c (register_color, unregister_color, unregister_colors):
11147 Likewise.
11148 * xfns.c (print_fontset_result): Likewise.
11149 * xrdb.c (member, fatal, main): Likewise.
11150
99033785
PE
111512011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11152
11153 Fix minor problems found by static checking (Bug#9031).
11154 * chartab.c (char_table_set_range, map_sub_char_table):
11155 Remove unused locals.
11156 (uniprop_table): Now static.
11157 * composite.c (_work_char): Remove unused static var.
11158
9cb2ac56
JB
111592011-07-09 Juanma Barranquero <lekktu@gmail.com>
11160
11161 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11162
f25661f0
JD
111632011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11164
11165 * gtkutil.c (qttip_cb): Remove code without function.
11166
8278c4fe
EZ
111672011-07-09 Eli Zaretskii <eliz@gnu.org>
11168
11169 * w32.c (pthread_sigmask): New stub.
11170
1692ae2d 111712011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 11172
8a6ebd58 11173 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
11174 sigprocmask is portable only for single-threaded applications, and
11175 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
11176 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11177 (LIBES): Use it.
11178 * callproc.c (Fcall_process):
11179 * process.c (create_process):
11180 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11181 Use pthread_sigmask, not sigprocmask.
123403e4 11182
1b854618
JD
111832011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11184
11185 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11186 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11187 wrong (Bug#8591).
11188
3fe4b549
JD
111892011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11190
0ce7e563
JD
11191 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11192 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11193 (xg_hide_tooltip): Fix comment.
11194
3fe4b549
JD
11195 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11196 in registerServicesMenuSendTypes.
11197 (validRequestorForSendType): Don't check ns_return_types.
11198
11199 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11200 ns_return_type.
11201
5df75e47
JR
112022011-07-08 Jason Rumney <jasonr@gnu.org>
11203
22610910
JR
11204 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11205 SH_SHOW for hidden windows (Bug#5482).
11206
5df75e47
JR
11207 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11208 frame struct members of non-existent frames (Bug#6284).
11209
699c10bd
JD
112102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11211
4393663b
JD
11212 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11213 variable firstTime not needed on OSX >= 10.6.
11214 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11215 >= 10.5. Use setKnobProportion, setDoubleValue.
11216
11217 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11218 (MAC_OS_X_VERSION_10_5): Define if not defined.
11219 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11220 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11221 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11222
11223 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 11224 cString and lossyCString on OSX >= 10.4.
4393663b 11225
58179cce 11226 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
11227 sizeToFit on OSX >= 10.2.
11228
11229 * nsimage.m (allocInitFromFile): Don't use deprecated method
11230 bestRepresentationForDevice on OSX >= 10.6.
11231
11232 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11233 to avoid warning.
11234
11235 * emacs.c: Declare unexec_init_emacs_zone.
11236
a63e0781
JD
11237 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11238
699c10bd
JD
11239 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11240
11241 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11242 on svcsMenu (Bug#8842).
11243
11244 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11245 ns_return_types.
11246 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11247
11248 * nsterm.m (QUTF8_STRING): Declare.
11249 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11250 (validRequestorForSendType): Return type is (id).
11251 Change indexOfObjectIdenticalTo to indexOfObject.
11252 Check if we have local selection before returning self (Bug#8842).
11253 (writeSelectionToPasteboard): Put local selection into paste board
11254 if we have a local selection (Bug#8842).
11255 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11256
11257 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11258 (ns_get_local_selection): Declare.
11259
54e10184
LMI
112602011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11261
9888ff71
LMI
11262 * keymap.c (describe_map_tree): Don't insert a double newline at
11263 the end of the buffer (bug#1169) and return whether we inserted
11264 something.
11265
54e10184
LMI
11266 * callint.c (Fcall_interactively): Change "reading args" to
11267 "providing args" to try to clarify what it does (bug#1010).
11268
15fa4783
KH
112692011-07-07 Kenichi Handa <handa@m17n.org>
11270
11271 * composite.c (composition_compute_stop_pos): Ignore a static
11272 composition starting before CHARPOS (Bug#8915).
11273
11274 * xdisp.c (handle_composition_prop): Likewise.
11275
a8815b00
EZ
112762011-07-07 Eli Zaretskii <eliz@gnu.org>
11277
11278 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11279 (Bug#9015)
11280
ef7b981d 112812011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
11282
11283 * character.h (unicode_category_t): New enum type.
11284
11285 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11286 (Qchar_code_property_table): New variable.
11287 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11288 (UNIPROP_COMPRESSED_FORM_P): New macros.
11289 (char_table_ascii): Uncompress the compressed values.
11290 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11291 Uncompress the compressed values.
ac389d0c 11292 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
11293 (char_table_ref_and_range): Uncompress the compressed values.
11294 (sub_char_table_set): New arg is_uniprop. Callers changed.
11295 Uncompress the compressed values.
11296 (sub_char_table_set_range): Args changed. Callers changed.
11297 (char_table_set_range): Adjuted for the above change.
11298 (map_sub_char_table): Delete args default_val and parent. Add arg
11299 top. Give decoded values to a Lisp function.
640c8776 11300 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
11301 values to a Lisp function. Gcpro more variables.
11302 (uniprop_table_uncompress)
11303 (uniprop_decode_value_run_length): New functions.
11304 (uniprop_decoder, uniprop_decoder_count): New variables.
11305 (uniprop_get_decoder, uniprop_encode_value_character)
11306 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11307 New functions.
11308 (uniprop_encoder, uniprop_encoder_count): New variables.
11309 (uniprop_get_encoder, uniprop_table)
11310 (Funicode_property_table_internal, Fget_unicode_property_internal)
11311 (Fput_unicode_property_internal): New functions.
11312 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11313 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 11314 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
11315 char-code-property-alist.
11316
640c8776 11317 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
11318 Vunicode_category_table.
11319
640c8776 11320 * font.c (font_range): Adjust for the change of
c805dec0
KH
11321 Vunicode_category_table.
11322
76b397fb
DN
113232011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11324
11325 * m/iris4d.h: Remove file, move contents ...
11326 * s/irix6-5.h: ... here.
11327
22b4128e
PE
113282011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11329
11330 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
11331 * alloc.c (mark_buffer):
11332 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11333 (clone_per_buffer_values): Don't assume that
22b4128e
PE
11334 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11335 This isn't true in general, and it's particularly not true
11336 if Emacs is configured with --with-wide-int.
11337 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11338 New macros, used in the buffer.c change.
11339
869795d6
JD
113402011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11341
11342 * xsettings.c: Use both GConf and GSettings if both are available.
11343 (store_config_changed_event): Add comment.
11344 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11345 (store_tool_bar_style_changed): New functions.
5e617bc2 11346 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
11347 (struct xsettings): Move font inside HAVE_XFT.
11348 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 11349 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 11350 Move inside HAVE_XFT.
640c8776 11351 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
11352 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11353 also.
11354 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 11355 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 11356 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
11357 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11358 (parse_settings): Move check for font inside HAVE_XFT.
11359 (read_settings, apply_xft_settings): Add comment.
11360 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11361 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11362 call store_font_name_changed.
11363 (xft_settings_event): Add comment.
11364 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11365 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11366 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11367 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11368 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
11369 (xsettings_get_system_font, xsettings_get_system_normal_font):
11370 Add comment.
869795d6 11371
d8ed26bd
PE
113722011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11373
11374 Random fixes. E.g., (random) never returned negative values.
11375 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11376 subseconds part to the entropy, as that's a bit more random.
11377 Prefer signed to unsigned, since the signedness doesn't matter and
11378 in general we prefer signed. When given a limit, use a
11379 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11380 latter isn't right if USE_2_TAGS_FOR_INTS.
11381 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11382 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11383
cabf1cac
SM
113842011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11385
11386 * textprop.c (text_property_stickiness):
11387 Obey Vtext_property_default_nonsticky.
11388 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11389 * w32fns.c (syms_of_w32fns):
11390 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11391
6e9b2be9
PE
113922011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11393
11394 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11395 This is more efficient than Ffile_directory_p and avoids a minor race.
11396
90186c68
LMI
113972011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11398
7c301272
LMI
11399 * buffer.c (Foverlay_put): Say what the return value is
11400 (bug#7835).
11401
c4f2d8d4
LMI
11402 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11403 is a directory before asking whether to use the file name
11404 (bug#7564).
ad637907
LMI
11405 (barf_or_query_if_file_exists): Make the "File is a directory"
11406 error be more correct.
c4f2d8d4 11407
90186c68
LMI
11408 * fns.c (Frequire): Remove the mention of the .gz files, since
11409 that's installation-specific, but keep the mention of
11410 `get-load-suffixes'.
11411
da64016e
PE
114122011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11413
11414 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11415 Report string overflow if the output is too long.
11416
7d47b580
JB
114172011-07-04 Juanma Barranquero <lekktu@gmail.com>
11418
a555cb87
JB
11419 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11420 (syms_of_gnutls): Remove duplicate DEFSYM for
11421 Qgnutls_bootprop_verify_hostname_error, an error for
11422 Qgnutls_bootprop_verify_error (which is no longer used).
11423
7d47b580
JB
11424 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11425 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11426 Also (re)move comments that are misplaced or no longer relevant.
11427
1e49bfab
LMI
114282011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11429
11430 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11431
1485f4c0
CY
114322011-07-03 Chong Yidong <cyd@stupidchicken.com>
11433
11434 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11435 and background color parameters if they have been changed.
11436
a9ab721e
LMI
114372011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11438
11439 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11440
cf7cff57
PE
114412011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11442
2e13213d
PE
11443 * xsettings.c (SYSTEM_FONT): Define only when used.
11444 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11445
cf7cff57
PE
11446 * keymap.c (access_keymap_1): Now static.
11447
7a8e04f7
CY
114482011-07-02 Chong Yidong <cyd@stupidchicken.com>
11449
11450 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11451 leave any prefix arg for the up event (Bug#1586).
11452
61352f62
LMI
114532011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11454
69bb1ef7
LMI
11455 * lread.c (syms_of_lread): Mention single symbols defined by
11456 `defvar' or `defconst' (bug#7154).
11457
61352f62 11458 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 11459 (Frequire): Mention get-load-suffixes.
61352f62 11460
28545e04
MR
114612011-07-02 Martin Rudalics <rudalics@gmx.at>
11462
11463 * window.h (window): Remove clone_number slot.
11464 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11465 Remove.
11466 (make_parent_window, make_window, saved_window)
11467 (Fset_window_configuration, save_window_save): Don't deal with
11468 clone numbers.
11469 * buffer.c (Qclone_number): Remove declaration.
11470 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11471
3349e122
SM
114722011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11473
11474 Add multiple inheritance to keymaps.
11475 * keymap.c (Fmake_composed_keymap): New function.
11476 (Fset_keymap_parent): Simplify.
11477 (fix_submap_inheritance): Remove.
11478 (access_keymap_1): New function extracted from access_keymap to handle
11479 embedded parents and handle lists of maps.
11480 (access_keymap): Use it.
11481 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11482 (Fcopy_keymap): Handle embedded parents.
11483 (Fcommand_remapping, define_as_prefix): Simplify.
11484 (Fkey_binding): Simplify.
11485 (syms_of_keymap): Move minibuffer-local-completion-map,
11486 minibuffer-local-filename-completion-map,
11487 minibuffer-local-must-match-map, and
11488 minibuffer-local-filename-must-match-map to Elisp.
11489 (syms_of_keymap): Defsubr make-composed-keymap.
11490 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11491 (parse_menu_item): Trivial simplification.
11492
3279eb87
GM
114932011-07-01 Glenn Morris <rgm@gnu.org>
11494
11495 * Makefile.in (SETTINGS_LIBS): Fix typo.
11496
39cb9e56 114972011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
11498
11499 * coding.c (Fencode_coding_string): Record the last coding system
11500 used, as the function doc string says (bug#8738).
11501
0949d2b6
JD
115022011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11503
11504 * xsettings.c (store_monospaced_changed): Take new font as arg and
11505 check for change against current_mono_font.
11506 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11507 (emacs_settings_constructor, emacs_settings_get_property)
11508 (emacs_settings_set_property, emacs_settings_class_init)
11509 (emacs_settings_init, gsettings_obj): Remove.
11510 (something_changedCB): New function for HAVE_GSETTINGS.
11511 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11512 with value as argument.
11513 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11514 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 11515 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
11516 "changed".
11517
11518 * xgselect.c: Add defined (HAVE_GSETTINGS).
11519 (xgselect_initialize): Ditto.
11520
11521 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11522 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11523 xg_select.
11524
bbc6b304
PE
115252011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11526
11527 * eval.c (struct backtrace): Simplify and port the data structure.
11528 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11529 signed bit field, as this assumption is not portable and it makes
11530 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11531 "char debug_on_exit : 1" as this is not portable either; instead,
11532 use the portable "unsigned int debug_on_exit : 1". Remove unused
11533 member evalargs. Remove obsolete comments about cc bombing out.
11534
9851bfc5
JD
115352011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11536
51bb811f 11537 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
11538 Let HAVE_GSETTINGS override HAVE_GCONF.
11539 (store_monospaced_changed): New function.
11540 (EMACS_SETTINGS): A new type derived from GObject to handle
11541 GSettings notifications.
11542 (emacs_settings_constructor, emacs_settings_get_property)
11543 (emacs_settings_set_property, emacs_settings_class_init):
11544 New functions.
11545 (gsettings_client, gsettings_obj): New variables.
11546 (GSETTINGS_SCHEMA): New define.
11547 (something_changedCB): Call store_monospaced_changed.
11548 (init_gsettings): New function.
11549 (xsettings_initialize): Call init_gsettings.
11550 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11551 to NULL.
11552
640c8776 11553 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
11554 GCONF_CFLAGS/LIBS.
11555
5386012d
MR
115562011-06-29 Martin Rudalics <rudalics@gmx.at>
11557
11558 * window.c (resize_root_window, grow_mini_window)
11559 (shrink_mini_window): Rename Qresize_root_window to
11560 Qwindow_resize_root_window and Qresize_root_window_vertically to
11561 Qwindow_resize_root_window_vertically.
11562
f13e0b08
PE
115632011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11564
11565 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11566
94515237
JB
115672011-06-27 Juanma Barranquero <lekktu@gmail.com>
11568
11569 * makefile.w32-in: Redesign dependencies so they reflect more
11570 clearly which files are directly included by each source file,
11571 and not through other includes.
11572
e43b6e43
MR
115732011-06-27 Martin Rudalics <rudalics@gmx.at>
11574
11575 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11576 (sort_overlays, overlay_strings): When an overlay's clone number
11577 matches the window's clone number process the overlay even if
11578 the overlay's window property doesn't match the current window.
11579
d68443dc
MR
11580 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11581 (Fwindow_hchild): Rename to Fwindow_left_child.
11582 (Fwindow_next): Rename to Fwindow_next_sibling.
11583 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
11584 (resize_window_check): Rename to window_resize_check.
11585 (resize_window_apply): Rename to window_resize_apply.
11586 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11587 (Fdelete_other_windows_internal, resize_frame_windows)
11588 (Fsplit_window_internal, Fdelete_window_internal)
11589 (grow_mini_window, shrink_mini_window)
11590 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 11591
c7e73be5
JD
115922011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11593
11594 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11595 (emacs_fixed_set_min_size): Remove.
11596 (emacs_fixed_new): Take frame as argument.
11597
11598 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11599 (_EmacsFixedPrivate): Remove minwidth/height.
11600 Add struct frame *f.
11601 (emacs_fixed_init): Initialize priv->f.
11602 (get_parent_class, emacs_fixed_set_min_size): Remove.
11603 (emacs_fixed_new): Set priv->f to argument.
11604 (emacs_fixed_get_preferred_width)
11605 (emacs_fixed_get_preferred_height): Use min_width/height from
11606 frames size_hint to set minimum and natural (Bug#8919).
11607 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11608 and use min_width/height from frames size_hint to set
11609 min_width/height (Bug#8919).
11610
11611 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
11612 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11613 Fix indentation.
c7e73be5 11614
cf99dcf8
EZ
116152011-06-26 Eli Zaretskii <eliz@gnu.org>
11616
11617 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11618 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11619 called at ZV.
11620
029529ac
CY
116212011-06-26 Chong Yidong <cyd@stupidchicken.com>
11622
11623 * process.c (wait_reading_process_output): Bypass select if
11624 waiting for a cell while ignoring keyboard input, and input is
11625 pending. Suggested by Jan Djärv (Bug#8869).
11626
7a7ef429
PE
116272011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11628
11629 Use gnulib's dup2 module instead of rolling our own.
11630 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11631
11fdef7d 116322011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
11633
11634 * dispnew.c (scrolling_window): Before scrolling, turn off a
11635 mouse-highlight in the window being scrolled.
11636
cd3520a4
JB
116372011-06-24 Juanma Barranquero <lekktu@gmail.com>
11638
11639 Move DEFSYM to lisp.h and use everywhere.
11640
11641 * character.h (DEFSYM): Move declaration...
11642 * lisp.h (DEFSYM): ...here.
11643
11644 * gnutls.c:
11645 * minibuf.c:
11646 * w32menu.c:
11647 * w32proc.c:
11648 * w32select.c: Don't include character.h.
11649
11650 * alloc.c (syms_of_alloc):
11651 * buffer.c (syms_of_buffer):
11652 * bytecode.c (syms_of_bytecode):
11653 * callint.c (syms_of_callint):
11654 * casefiddle.c (syms_of_casefiddle):
11655 * casetab.c (init_casetab_once):
11656 * category.c (init_category_once, syms_of_category):
11657 * ccl.c (syms_of_ccl):
11658 * cmds.c (syms_of_cmds):
11659 * composite.c (syms_of_composite):
11660 * dbusbind.c (syms_of_dbusbind):
11661 * dired.c (syms_of_dired):
11662 * dispnew.c (syms_of_display):
11663 * doc.c (syms_of_doc):
11664 * editfns.c (syms_of_editfns):
11665 * emacs.c (syms_of_emacs):
11666 * eval.c (syms_of_eval):
11667 * fileio.c (syms_of_fileio):
11668 * fns.c (syms_of_fns):
11669 * frame.c (syms_of_frame):
11670 * fringe.c (syms_of_fringe):
11671 * insdel.c (syms_of_insdel):
11672 * keymap.c (syms_of_keymap):
11673 * lread.c (init_obarray, syms_of_lread):
11674 * macros.c (syms_of_macros):
11675 * msdos.c (syms_of_msdos):
11676 * print.c (syms_of_print):
11677 * process.c (syms_of_process):
11678 * search.c (syms_of_search):
11679 * sound.c (syms_of_sound):
11680 * syntax.c (init_syntax_once, syms_of_syntax):
11681 * terminal.c (syms_of_terminal):
11682 * textprop.c (syms_of_textprop):
11683 * undo.c (syms_of_undo):
11684 * w32.c (globals_of_w32):
11685 * window.c (syms_of_window):
11686 * xdisp.c (syms_of_xdisp):
11687 * xfaces.c (syms_of_xfaces):
11688 * xfns.c (syms_of_xfns):
11689 * xmenu.c (syms_of_xmenu):
11690 * xsettings.c (syms_of_xsettings):
11691 * xterm.c (syms_of_xterm): Use DEFSYM.
11692
4228cf16
TZ
116932011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11694
cd3520a4 11695 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 11696
7fcccf1e
PE
116972011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11698
7efb4e0e
PE
11699 Integer and buffer overflow fixes (Bug#8873).
11700
ff5844ad
PE
11701 * print.c (printchar, strout): Check for string overflow.
11702 (PRINTPREPARE, printchar, strout):
11703 Don't set size unless allocation succeeds.
11704
90532f02
PE
11705 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11706 for sizes. Check for string overflow more accurately.
11707 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11708
6d84508d
PE
11709 * macros.c: Integer and buffer overflow fixes.
11710 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11711 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11712 Use ptrdiff_t, not int, for sizes.
11713 Don't increment bufsize until after realloc succeeds.
11714 Check for size-calculation overflow.
11715 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11716
437b2cb4
PE
11717 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11718
8b9ac8b4
PE
11719 * lread.c: Integer overflow fixes.
11720 (read_integer): Radix is now EMACS_INT, not int,
11721 to improve quality of diagnostics for out-of-range radices.
11722 Calculate buffer size correctly for out-of-range radices.
11723 (read1): Check for integer overflow in radices, and in
11724 read-circle numbers.
82cb60d3
PE
11725 (read_escape): Avoid int overflow.
11726 (Fload, openp, read_buffer_size, read1)
11727 (substitute_object_recurse, read_vector, read_list, map_obarray):
11728 Use ptrdiff_t, not int, for sizes.
11729 (read1): Use EMACS_INT, not int, for sizes.
20270765 11730 Check for size overflow.
8b9ac8b4 11731
7fcccf1e
PE
11732 * image.c (cache_image): Check for size arithmetic overflow.
11733
bfbbd7e7
PE
11734 * lread.c: Integer overflow issues.
11735 (saved_doc_string_size, saved_doc_string_length)
11736 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11737 Now ptrdiff_t, not int.
11738 (read1): Don't assume doc string length fits in int. Check for
11739 out-of-range doc string lengths.
11740 (read_list): Don't assume file position fits in int.
39019e54 11741 (read_escape): Check for hex character overflow.
bfbbd7e7 11742
4e323265
LL
117432011-06-22 Leo Liu <sdl.web@gmail.com>
11744
11745 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11746 Move to minibuffer.el.
11747
85fece3e
PE
117482011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11749
20b84ce9 11750 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
11751 The following patches are for when GLYPH_DEBUG && !XASSERT.
11752 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11753 * dispnew.c (flush_stdout):
11754 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11755 Mark as externally visible.
11756 * dispnew.c (check_window_matrix_pointers): Now static.
11757 * dispnew.c (window_to_frame_vpos):
11758 * xfns.c (unwind_create_frame):
11759 * xterm.c (x_check_font): Remove unused local.
11760 * scroll.c (CHECK_BOUNDS):
11761 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11762 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11763 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11764 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11765 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11766 Now static.
11767 (debug_method_add): Use va_list and vsprintf rather than relying
11768 on undefined behavior with wrong number of arguments.
11769 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11770 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11771 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11772 since we're not interested in debugging glyphs with old libraries.
11773 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11774 GCC 4.6.0's static checking.
11775
0766b489
PE
117762011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11777
31fd4b32
PE
11778 Integer overflow and signedness fixes (Bug#8873).
11779 A few related buffer overrun fixes, too.
11780
b79e8648
PE
11781 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11782
0766b489
PE
11783 * dispextern.h (struct face.stipple):
11784 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11785 (x_bitmap_mask, x_allocate_bitmap_record)
11786 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11787 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11788 (x_create_bitmap_from_xpm_data):
11789 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11790 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11791 (.bitmaps_last):
11792 * xfaces.c (load_pixmap):
11793 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11794 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11795 (.bitmaps_last, struct x_output.icon_bitmap):
11796 Use ptrdiff_t, not int, for bitmap indexes.
11797 (x_allocate_bitmap_record): Check for size overflow.
11798 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11799
b081724f
PE
11800 Use ptrdiff_t, not int, for overlay counts.
11801 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11802 * editfns.c (overlays_around, get_pos_property):
11803 * textprop.c (get_char_property_and_overlay):
11804 * xdisp.c (next_overlay_change, note_mouse_highlight):
11805 * xfaces.c (face_at_buffer_position):
21514da7
PE
11806 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11807 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11808 (Fnext_overlay_change, Fprevious_overlay_change)
11809 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 11810 Use ptrdiff_t, not int, for sizes.
21514da7 11811 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 11812
3de73e5e
PE
11813 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11814
2606c57b
PE
11815 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11816 (x_session_initialize): Do not assume string length fits in int.
11817
aaafe47a
PE
11818 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11819 This is unlikely, but can occur if DPI is outlandish.
11820
2674ddc8 11821 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
11822 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11823
28154962
PE
11824 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11825 * xrdb.c (magic_file_p, search_magic_path):
11826 Omit last arg SUFFIX; it was always 0. All callers changed.
11827 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11828
7de51af5
PE
11829 * xfont.c (xfont_match): Avoid need for strlen.
11830
25ed6cc3
PE
11831 * xfns.c: Don't assume strlen fits in int.
11832 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11833
4eab31dd
PE
11834 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11835 not unsigned long, as we prefer signed integers. All callers changed.
11836 Detect integer overflow in repeat count.
11837 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 11838 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 11839
171e2a58
PE
11840 * termcap.c: Don't assume sizes fit in int and never overflow.
11841 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11842 (gobble_line): Check for size-calculation overflow.
11843
ad39faca 11844 * minibuf.c (Fread_buffer):
6e5bb2dc 11845 * lread.c (intern, intern_c_string):
74ca2eb3
PE
11846 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11847 Don't assume string length fits in int.
11848
52c61c22 11849 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
11850 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11851
b5b8c9e5
PE
11852 * font.c: Don't assume string length fits in int.
11853 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11854 Use ptrdiff_t, not int.
ccd6111c
PE
11855 (font_intern_prop): Don't assume string length fits in int.
11856 Don't assume integer property fits in fixnum.
11857 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 11858
882f0d81 11859 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 11860 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
11861 Reformulate so as not to need the command string.
11862 Invoke gzip -cd rather than gunzip, as it's more portable.
11863 (lock_info_type, lock_file_1, lock_file):
11864 Don't assume pid_t and time_t fit in unsigned long.
11865 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11866 (current_lock_owner): Prefer signed type for sizes.
11867 Use memcpy, not strncpy, where memcpy is what is really wanted.
11868 Don't assume (via atoi) that time_t and pid_t fit in int.
11869 Check for time_t and/or pid_t out of range, e.g., via a network share.
11870 Don't alloca where an auto var works fine.
11871
93f4cf88
PE
11872 * fileio.c: Fix some integer overflow issues.
11873 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11874 Don't assume string length fits in int.
11875 (directory_file_name): Don't assume string length fits in long.
11876 (make_temp_name): Don't assume pid fits in int, or that its print
11877 length is less than 20.
11878
f3e92b69
PE
11879 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11880
1bfdaf10
PE
11881 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11882
35016e9a
PE
11883 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11884
3d1e65a1
PE
11885 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11886 We prefer signed integers, even for size calculations.
11887
0b963a93
PE
11888 * emacs.c: Don't assume string length fits in 'int'.
11889 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11890 (main): Don't invoke strlen when not needed.
11891
573f4b54
PE
11892 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11893 (XD_DEBUG_MESSAGE): Don't waste a byte.
11894
989f33ba
PE
11895 * callproc.c (getenv_internal_1, getenv_internal)
11896 (Fgetenv_internal):
965d34eb
PE
11897 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11898
e4d29b33
PE
11899 * lread.c (invalid_syntax): Omit length argument.
11900 All uses changed. This doesn't fix a bug, but it simplifies the
11901 code away from its former Hollerith-constant appearance, and it's
11902 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 11903 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 11904
eb49b136
PE
11905 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11906 This didn't break anything, but it didn't help either.
11907 It's confusing to put a bogus integer in a place where the actual
11908 value does not matter.
9f62aeb1 11909 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 11910 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 11911
15375a22
PE
11912 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11913 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11914 implementation.
b61cc01c
PE
11915 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11916 We prefer signed types, and the value cannot exceed the EMACS_INT
11917 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
11918 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11919 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11920 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 11921
53b2623d
PE
11922 * indent.c (sane_tab_width): New function.
11923 (current_column, scan_for_column, Findent_to, position_indentation)
11924 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 11925 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 11926
51cab52b 11927 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 11928
f2ed8a70
PE
11929 * lisp.h (lint_assume): New macro.
11930 * composite.c (composition_gstring_put_cache):
11931 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11932
abe80cc6
PE
11933 * editfns.c, insdel.c:
11934 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 11935
b02c740e
PE
11936 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11937
ebc96716
PE
11938 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11939
b4e50fa0 11940 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 11941 Use much-faster test for byte-length change.
311d5d7c 11942 Don't assume string byte-length fits in 'int'.
a4cf38e4 11943 Check that character arg fits in 'int'.
85461888 11944 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 11945
c0c1ee9f
PE
11946 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11947
a498d7f4
PE
11948 * fns.c (concat): Catch string overflow earlier.
11949 Do not rely on integer wraparound.
11950
51cab52b
PE
11951 * dispextern.h (struct it.overlay_strings_charpos)
11952 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
11953 * xdisp.c (forward_to_next_line_start)
11954 (back_to_previous_visible_line_start)
11955 (reseat_at_next_visible_line_start, next_element_from_buffer):
11956 Don't arbitrarily truncate the value of 'selective' to int.
11957
76031fad
PE
11958 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11959
5eb55db9
PE
11960 * composite.c: Don't truncate sizes to 'int'.
11961 (composition_gstring_p, composition_reseat_it)
11962 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
11963 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11964 not EMACS_UINT, for indexes.
5eb55db9 11965
0703a717
PE
11966 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11967
d6202519
PE
11968 * buffer.c: Include <verify.h>.
11969 (struct sortvec.priority, struct sortstr.priority):
8961a454 11970 Now EMACS_INT, not int.
c20998a7 11971 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
11972 (struct sortstr.size, record_overlay_string)
11973 (struct sortstrlist.size, struct sortlist.used):
11974 Don't truncate size to int.
11975 (record_overlay_string): Check for size-calculation overflow.
d6202519 11976 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 11977
d5a19415
JM
119782011-06-22 Jim Meyering <meyering@redhat.com>
11979
029529ac 11980 Don't leak an XBM-image-sized buffer
d5a19415
JM
11981 * image.c (xbm_load): Free the image buffer after using it.
11982
a9041e6c
PE
119832011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11984
11985 Port to Sun C.
11986 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11987 that Sun C diagnosed.
11988 * fns.c (secure_hash): Fix pointer signedness issue.
11989 * intervals.c (static_offset_intervals): New function.
11990 (offset_intervals): Use it.
11991
7f3f739f
LL
119922011-06-21 Leo Liu <sdl.web@gmail.com>
11993
11994 * deps.mk (fns.o):
11995 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11996 sha512.h.
11997
11998 * fns.c (secure_hash): Rename from crypto_hash_function and change
11999 the first arg to accept symbols.
5b66d427 12000 (Fsecure_hash): New primitive.
7f3f739f
LL
12001 (syms_of_fns): New symbols.
12002
76147d94
DD
120032011-06-20 Deniz Dogan <deniz@dogan.se>
12004
12005 * process.c (Fset_process_buffer): Clarify return value in
12006 docstring.
12007
7d7d0045
CY
120082011-06-18 Chong Yidong <cyd@stupidchicken.com>
12009
12010 * dispnew.c (add_window_display_history): Use BVAR.
12011
12012 * xdisp.c (debug_method_add): Use BVAR.
12013 (check_window_end, dump_glyph_matrix, dump_glyph)
12014 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12015
12016 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12017 Likewise.
12018
12019 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12020 check till after the cache is created in init_frame_faces.
12021
ff2bc410
SM
120222011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12023
12024 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12025
28177add
PE
120262011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12027
dd3482fe
PE
12028 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12029 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12030 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12031
393d71f3 12032 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
12033 * fileio.c (Finsert_file_contents):
12034 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12035 Remove the old (too-loose) buffer overflow checks.
12036 They weren't needed, since make_gap checks for buffer overflow.
12037 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12038 The old code merely checked for Emacs fixnum overflow, and relied
12039 on undefined (wraparound) behavior. The new code avoids undefined
12040 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12041
2e6813b0 12042 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
12043 Tune. Don't use wider integers than needed. Don't use alloca.
12044 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 12045
599a9e4f
PE
12046 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12047
99561444
PE
12048 * insdel.c, lisp.h (buffer_overflow): New function.
12049 (insert_from_buffer_1, replace_range, replace_range_2):
12050 * insdel.c (make_gap_larger):
12051 * editfns.c (Finsert_char):
12052 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12053
28177add
PE
12054 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12055
e69dafad
PE
120562011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12057
4baa020d 12058 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 12059
b1c46f02
PE
12060 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12061 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12062
e69dafad
PE
12063 * fileio.c: Don't assume EMACS_INT fits in off_t.
12064 (emacs_lseek): New static function.
12065 (Finsert_file_contents, Fwrite_region): Use it.
12066 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12067
566684ea
PE
12068 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12069
e6966cd6
PE
12070 * fns.c: Don't overflow int when computing a list length.
12071 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12072 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12073 truncation on 64-bit hosts. Check for QUIT every
12074 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12075 faster and is responsive enough.
12076 (Flength): Report an error instead of overflowing an integer.
12077 (Fsafe_length): Return a float if the value is not representable
12078 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 12079 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 12080 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 12081
dd0b0efb
PE
12082 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12083 (header_size, word_size): New constants.
12084 (allocate_vectorlike): Don't check size overflow here.
12085 (allocate_vector): Check it here instead, since this is the only
12086 caller of allocate_vectorlike that could cause overflow.
12087 Check that the new vector's length is representable as a fixnum.
12088
86fe5cfe
PE
12089 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12090 The previous code was bogus. For example, next_almost_prime (32)
12091 returned 39, which is undesirable as it is a multiple of 3; and
12092 next_almost_prime (24) returned 25, which is a multiple of 5 so
12093 why was the code bothering to check for multiples of 7?
12094
80e88859
PE
12095 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12096
4a2f0ad6
PE
12097 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12098
f66c7cf8
PE
12099 Variadic C functions now count arguments with ptrdiff_t.
12100 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12101 Back then I didn't know that the Emacs coding style prefers signed int.
12102 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
12103 were being counted with int, which may truncate counts on 64-bit
12104 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
12105 * lisp.h (struct Lisp_Subr.function.aMANY)
12106 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12107 Arg counts are now ptrdiff_t, not size_t.
12108 All variadic functions and their callers changed accordingly.
12109 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12110 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12111 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12112 * callint.c (Fcall_interactively): Check arg count for overflow,
12113 to avoid potential buffer overrun. Use signed char, not 'int',
12114 for 'varies' array, so that we needn't bother to check its size
12115 calculation for overflow.
12116 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12117 * eval.c (apply_lambda):
12118 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12119 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12120 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12121
a1759b76
PE
12122 * callint.c (Fcall_interactively): Don't use index var as event count.
12123
d96be9fc
PE
12124 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12125 * mem-limits.h (SIZE): Remove; no longer used.
12126
a690a978 12127 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 12128
578c21e6
PE
12129 Remove unnecessary casts.
12130 * xterm.c (x_term_init):
12131 * xfns.c (x_set_border_pixel):
12132 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12133 These aren't needed now that we assume ANSI C.
12134
96f53c6c
PE
12135 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12136 It's more likely to cause problems (due to unsigned overflow)
12137 than to cure them.
12138
83c77d31
PE
12139 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12140
ee2079f1
PE
12141 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12142
6da65536
PE
12143 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12144
7147c4a4
PE
12145 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12146
193e32d9
PE
12147 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12148
e5533da6
PE
12149 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12150
9910e595
PE
12151 GLYPH_CODE_FACE returns EMACS_INT, not int.
12152 * dispextern.h (merge_faces):
12153 * xfaces.c (merge_faces):
01103c44
PE
12154 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12155 Don't assume EMACS_INT fits in int.
9910e595 12156
2638320e
PE
12157 * character.h (CHAR_VALID_P): Remove unused parameter.
12158 * fontset.c, lisp.h, xdisp.c: All uses changed.
12159
045eb8d9
PE
12160 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12161
c1f134b5
PE
12162 * fns.c (concat): Minor tuning based on overflow analysis.
12163 This doesn't fix any bugs. Use int to hold character, instead
12164 of constantly refetching from Emacs object. Use XFASTINT, not
12165 XINT, for value known to be a character. Don't bother comparing
12166 a single byte to 0400, as it's always less.
12167
395fcb93 12168 * floatfns.c (Fexpt):
327eeec8
PE
12169 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12170
abbd3d23
PE
12171 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12172 for characters.
12173
684a03ef
PE
12174 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12175
0fed43f3
PE
12176 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12177 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12178 incorrectly succeed when S was a string, because 4294967386 was
12179 truncated before it was used.
12180
8fd02eb7
PE
12181 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12182 Otherwise, an out-of-range integer could cause undefined behavior
12183 on a 64-bit host.
12184
f8c86b69
PE
12185 * composite.c: Use int, not EMACS_INT, for characters.
12186 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12187 EMACS_INT, for values that are known to be in character range.
12188 This doesn't fix any bugs but is the usual style inside Emacs and
12189 may generate better code on 32-bit machines.
12190
34206dd2
PE
12191 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12192 This is for reasons similar to the recent CHAR_STRING fix.
12193 * charset.c (Fencode_char): Check that character arg is actually
12194 a character. Pass an int to ENCODE_CHAR.
12195 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12196 wider than 'int', as a compile-time check to prevent future regressions
12197 in this area.
12198
c5958d4c 12199 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
12200
12201 Make sure a 64-bit char is never passed to CHAR_STRING.
12202 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12203 by silently ignoring the top 32 bits, allowing some values
12204 that were far too large to be valid characters.
12205 * character.h: Include <verify.h>.
12206 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12207 arguments are no wider than unsigned, as a compile-time check
12208 to prevent future regressions in this area.
12209 * data.c (Faset):
01103c44 12210 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
12211 (Fsubst_char_in_region):
12212 * fns.c (concat):
12213 * xdisp.c (decode_mode_spec_coding):
12214 Adjust to CHAR_STRING's new requirement.
12215 * editfns.c (Finsert_char, Fsubst_char_in_region):
12216 * fns.c (concat): Check that character args are actually
12217 characters. Without this test, these functions did the wrong
12218 thing with wildly out-of-range values on 64-bit hosts.
12219
d37ca623
PE
12220 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12221 These casts should not be needed on 32-bit hosts, either.
12222 * keyboard.c (read_char):
12223 * lread.c (Fload): Remove casts to unsigned.
12224
ea204efb
PE
12225 * lisp.h (UNSIGNED_CMP): New macro.
12226 This fixes comparison bugs on 64-bit hosts.
12227 (ASCII_CHAR_P): Use it.
12228 * casefiddle.c (casify_object):
01103c44 12229 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
12230 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12231 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12232 * dispextern.h (FACE_FROM_ID):
12233 * keyboard.c (read_char): Use UNSIGNED_CMP.
12234
41cb286c
PE
12235 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12236 not to EMACS_INT, to avoid GCC warning.
12237
4a1b9832
PE
12238 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12239
55daad71
PE
12240 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12241 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12242 isn't needed on 32-bit machines.
8f95c75c 12243
01103c44
PE
12244 * buffer.c (Fgenerate_new_buffer_name):
12245 Use EMACS_INT for count, not int.
0ceccced 12246 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
12247
12248 * data.c (Qcompiled_function): Now static.
12249
c6f072e7
PE
12250 * window.c (window_body_lines): Now static.
12251
20ce5912
PE
12252 * image.c (gif_load): Rename local to avoid shadowing.
12253
9c4c5f81
PE
12254 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12255 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12256 * alloc.c (make_save_value): Integer argument is now of type
12257 ptrdiff_t, not int.
12258 (mark_object): Use ptrdiff_t, not int.
12259 * lisp.h (pD): New macro.
12260 * print.c (print_object): Use it.
12261
c0c5c8ae
PE
12262 * alloc.c: Use EMACS_INT, not int, to count objects.
12263 (total_conses, total_markers, total_symbols, total_vector_size)
12264 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
12265 (total_free_floats, total_floats, total_free_intervals)
12266 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
12267 Now EMACS_INT, not int. All uses changed.
12268 (Fgarbage_collect): Compute overall total using a double, so that
12269 integer overflow is less likely to be a problem. Check for overflow
12270 when converting back to an integer.
5a25e253
PE
12271 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12272 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12273 These were 'int' variables that could overflow on 64-bit hosts;
12274 they were never used, so remove them instead of repairing them.
211a0b2a 12275 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
12276 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12277 Previously, this ceilinged at INT_MAX, but that doesn't work on
12278 64-bit machines.
e46bb31a 12279 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 12280
c78baabf 12281 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 12282 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
12283 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12284 when a (possibly-narrower) signed value would do just as well.
12285 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 12286
c9d624c6
PE
12287 * alloc.c: Catch some string size overflows that we were missing.
12288 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12289 for convenience in STRING_BYTES_MAX.
12290 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12291 The definition here is exact; the one in lisp.h was approximate.
12292 (allocate_string_data): Check for string overflow. This catches
12293 some instances we weren't catching before. Also, it catches
12294 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12295 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12296 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 12297
c9d624c6
PE
12298 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12299 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 12300 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 12301
353032ce
PE
12302 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12303
2bccce07
PE
12304 * alloc.c (Fmake_string): Check for out-of-range init.
12305
0ac30604
SM
123062011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12307
12308 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12309
c195f2de
JD
123102011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12311
12312 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12313 xg_get_default_scrollbar_width.
12314
12315 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12316 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12317 (style_changed_cb): Call update_theme_scrollbar_width and call
12318 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12319 all frames (Bug#8505).
12320 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12321 Call gtk_window_set_resizable if HAVE_GTK3.
12322 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12323 and height if HAVE_GTK3 (Bug#8505).
12324 (scroll_bar_width_for_theme): New variable.
12325 (update_theme_scrollbar_width): New function.
12326 (xg_get_default_scrollbar_width): Move code to
12327 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12328 (xg_initialize): Call update_theme_scrollbar_width.
12329
12330 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12331
12332 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12333
e10ac9f1
MR
123342011-06-12 Martin Rudalics <rudalics@gmx.at>
12335
12336 * frame.c (make_frame): Call other_buffer_safely instead of
12337 other_buffer.
12338
12339 * window.c (temp_output_buffer_show): Call display_buffer with
12340 second argument Vtemp_buffer_show_specifiers and reset latter
12341 immediately after the call.
12342 (Vtemp_buffer_show_specifiers): New variable.
12343 (auto_window_vscroll_p, next_screen_context_lines)
12344 (Vscroll_preserve_screen_position): Remove leading asterisks from
12345 doc-strings.
12346
2d3c217e 123472011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 12348
7b7f97e8 12349 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
12350 * buffer.c (Qclone_number): Remove for now, as it's unused.
12351 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12352 (record_buffer): Remove unused local.
12353 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12354 (set_frame_buffer_list): Remove; unused.
12355 * frame.h (other_visible_frames): Remove decl.
12356 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12357 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12358 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12359 if HAVE_GPM.
12360 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12361 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12362 Define only if HAVE_GPM.
12363 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12364 (update_hints_inhibit): Remove; never set. All uses removed.
12365 * widgetprv.h (emacsFrameClassRec): Remove decl.
12366 * window.c (delete_deletable_window): Now returns void, since it
12367 wasn't returning anything.
12368 (compare_window_configurations): Remove unused locals.
12369 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12370 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
12371 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12372 the same widths as pointers. This follows up on the 2011-05-06 patch.
12373 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12374 * xterm.h: Likewise.
12375 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12376
1384b89e
JB
123772011-06-12 Juanma Barranquero <lekktu@gmail.com>
12378
12379 * makefile.w32-in: Update dependencies.
12380 (LISP_H): Add lib/intprops.h.
12381
1100a63c
CY
123822011-06-11 Chong Yidong <cyd@stupidchicken.com>
12383
12384 * image.c (gif_load): Add animation frame delay to the metadata.
12385 (syms_of_image): Use DEFSYM. New symbol `delay'.
12386
6198ccd0
MR
123872011-06-11 Martin Rudalics <rudalics@gmx.at>
12388
12389 * window.c (delete_deletable_window): Re-add.
12390 (Fset_window_configuration): Rewrite to handle dead buffers and
12391 consequently deletable windows.
12392 (window_tree, Fwindow_tree): Remove. Supply functionality in
12393 window.el.
12394 (compare_window_configurations): Simplify code.
12395
b6e3633c
AS
123962011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12397
1ab0dee5
AS
12398 * image.c (imagemagick_load_image): Fix type mismatch.
12399 (Fimagemagick_types): Likewise.
12400
b6e3633c
AS
12401 * window.h (replace_buffer_in_windows): Declare.
12402
9397e56f
MR
124032011-06-11 Martin Rudalics <rudalics@gmx.at>
12404
12405 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12406 Qclone_number. Remove external declaration of Qdelete_window.
12407 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12408 code.
640c8776
SM
12409 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12410 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
12411 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12412 buffer list implementation.
12413 (other_buffer_safely): New function.
12414 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12415 calls to replace_buffer_in_windows and
12416 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12417 if allowed.
12418 (record_buffer): Inhibit quitting and rewrite using quittable
12419 functions. Run Qbuffer_list_update_hook if allowed.
12420 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
12421 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12422 Move switch-to-buffer to window.el.
9397e56f
MR
12423 (bury-buffer): Move to window.el.
12424 (Vbuffer_list_update_hook): New variable.
12425
12426 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12427 section.
12428
12429 * window.h (resize_frame_windows): Move up in code.
12430 (Fwindow_frame): Remove EXFUN.
12431 (replace_buffer_in_all_windows): Remove prototype.
12432 (replace_buffer_in_windows_safely): Add prototype.
12433
12434 * window.c: Declare Qdelete_window static again. Move down
12435 declaration of select_count.
12436 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12437 (Fother_window): Move to window.el.
12438 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12439 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12440 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12441 window.el.
12442 (replace_buffer_in_windows): Implement by calling
12443 Qreplace_buffer_in_windows.
12444 (replace_buffer_in_all_windows): Remove with some functionality
12445 moved into replace_buffer_in_windows_safely.
12446 (replace_buffer_in_windows_safely): New function.
12447 (select_window_norecord, select_frame_norecord): Move in front
12448 of run_window_configuration_change_hook. Remove now obsolete
12449 declarations.
640c8776
SM
12450 (Fset_window_buffer): Rewrite doc-string.
12451 Call Qrecord_window_buffer.
9397e56f
MR
12452 (keys_of_window): Move binding for other-window to window.el.
12453
b50691aa
CY
124542011-06-11 Chong Yidong <cyd@stupidchicken.com>
12455
12456 * dispextern.h (struct image): Replace data member, whose int_val
12457 and ptr_val fields were not used by anything, with a single
12458 lisp_val object.
12459
12460 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12461 (gif_clear_image, gif_load, imagemagick_load_image)
12462 (gs_clear_image, gs_load): Callers changed.
12463
3f754b86
PE
124642011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12465
cca69397
PE
12466 * buffer.h: Include <time.h>, for time_t.
12467 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12468
109e28d0
PE
12469 Fix minor problems found by static checking.
12470
60737f02
PE
12471 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12472
4b66faf3
PE
12473 Make identifiers static if they are not used in other modules.
12474 * data.c (Qcompiled_function, Qframe, Qvector):
12475 * image.c (QimageMagick, Qsvg):
12476 * minibuf.c (Qmetadata):
12477 * window.c (resize_window_check, resize_root_window): Now static.
12478 * window.h (resize_window_check, resize_root_window): Remove decls.
12479
109e28d0
PE
12480 * window.c (window_deletion_count, delete_deletable_window):
12481 Remove; unused.
46a4ce9e
PE
12482 (window_body_lines): Now static.
12483 (Fdelete_other_windows_internal): Mark vars as initialized.
12484 Make sure 'resize_failed' is initialized.
12485 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12486 (resize_window_apply): Remove unused local.
12487 * window.h (delete_deletable_window): Remove decl.
12488
109e28d0 12489 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
12490 (imagemagick_load_image): Fix pointer signedness problem by changing
12491 last arg from unsigned char * to char *. All uses changed.
12492 Also, fix a local for similar reasons.
12493 Remove unused locals. Remove locals to avoid shadowing.
12494 (fn_rsvg_handle_free): Remove; unused.
12495 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 12496 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 12497
3f754b86
PE
12498 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12499
2547adb1
CY
125002011-06-10 Chong Yidong <cyd@stupidchicken.com>
12501
12502 * image.c (gif_load): Fix omitted cast error introduced by
12503 2011-06-06 change.
12504
2c8e37d4
MR
125052011-06-10 Martin Rudalics <rudalics@gmx.at>
12506
12507 * window.h (resize_proportionally, orig_total_lines)
12508 (orig_top_line): Remove from window structure.
12509 (set_window_height, set_window_width, change_window_heights)
12510 (Fdelete_window): Remove prototypes.
12511 (resize_frame_windows): Remove duplicate declaration.
12512
440a42e3
EZ
125132011-06-10 Eli Zaretskii <eliz@gnu.org>
12514
12515 * window.h (resize_frame_windows, resize_window_check)
12516 (delete_deletable_window, resize_root_window)
12517 (resize_frame_windows): Declare prototypes.
12518
12519 * window.c (resize_window_apply): Make definition be "static" to
12520 match the prototype.
12521
562dd5e9
MR
125222011-06-10 Martin Rudalics <rudalics@gmx.at>
12523
12524 * window.c: Remove declarations of Qwindow_size_fixed,
12525 window_min_size_1, window_min_size_2, window_min_size,
12526 size_window, window_fixed_size_p, enlarge_window, delete_window.
12527 Remove static from declaration of Qdelete_window, it's
12528 temporarily needed by Fbury_buffer.
12529 (replace_window): Don't assign orig_top_line and
12530 orig_total_lines.
12531 (Fdelete_window, delete_window): Remove. Window deletion is
12532 handled by window.el.
640c8776
SM
12533 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12534 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
12535 (Fdelete_other_windows): Remove. Deleting other windows is
12536 handled by window.el.
12537 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12538 handled in window.el.
12539 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12540 Window minimum sizes are handled in window.el.
12541 (shrink_windows, size_window, set_window_height)
12542 (set_window_width, change_window_heights, window_height)
12543 (window_width, CURBEG, CURSIZE, enlarge_window)
12544 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12545 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12546 handled in window.el.
12547 (make_dummy_parent): Rename to make_parent_window and give it a
12548 second argument horflag.
12549 (make_window): Don't set resize_proportionally any more.
12550 (Fsplit_window): Remove. Windows are split in window.el.
12551 (save_restore_action, save_restore_orig_size)
12552 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12553 Resize mini windows in window.el.
12554 (grow_mini_window, shrink_mini_window): Implement by calling
12555 Qresize_root_window_vertically, resize_window_check and
12556 resize_window_apply.
640c8776
SM
12557 (saved_window, Fset_window_configuration, save_window_save):
12558 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
12559 resize_proportionally.
12560 (window_min_height, window_min_width): Move to window.el.
12561 (keys_of_window): Move bindings for delete-other-windows,
12562 split-window, delete-window and enlarge-window to window.el.
12563
12564 * buffer.c: Temporarily extern Qdelete_window.
12565 (Fbury_buffer): Temporarily call Qdelete_window instead of
12566 Fdelete_window (Fbury_buffer will move to window.el soon).
12567
12568 * frame.c (set_menu_bar_lines_1): Remove code handling
12569 orig_top_line and orig_total_lines.
12570
12571 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12572 set_window_height but set heights directly.
12573 (change_frame_size_1): Use resize_frame_windows.
12574
12575 * xdisp.c (init_xdisp): Don't use set_window_height but set
12576 heights directly.
12577
640c8776
SM
12578 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12579 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
12580 run_window_configuration_change_hook.
12581
12582 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12583 instead of change_window_heights and run
12584 run_window_configuration_change_hook.
12585
1a13852e
MR
125862011-06-09 Martin Rudalics <rudalics@gmx.at>
12587
12588 * window.c (replace_window): Rename second argument REPLACEMENT to
12589 NEW. New third argument SETFLAG. Rewrite.
12590 (delete_window, make_dummy_parent): Call replace_window with
12591 third argument 1.
12592 (window_list_1): Move down in code.
12593 (run_window_configuration_change_hook): Move set_buffer part
12594 before select_frame_norecord part in order to unwind correctly.
12595 Rename count1 to count.
12596 (recombine_windows, delete_deletable_window, resize_root_window)
12597 (Fdelete_other_windows_internal)
12598 (Frun_window_configuration_change_hook, make_parent_window)
12599 (resize_window_check, resize_window_apply, Fresize_window_apply)
12600 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
12601 (Fdelete_window_internal, Fresize_mini_window_internal):
12602 New functions.
1a13852e
MR
12603 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12604
f3d1777e
MR
126052011-06-08 Martin Rudalics <rudalics@gmx.at>
12606
496e208e
MR
12607 * window.h (window): Add some new members to window structure -
12608 normal_lines, normal_cols, new_total, new_normal, clone_number,
12609 splits, nest, prev_buffers, next_buffers.
12610 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 12611 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 12612
f3d1777e
MR
12613 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12614 Remove.
496e208e
MR
12615 (make_dummy_parent): Set new members of windows structure.
12616 (make_window): Move down in code. Handle new members of window
12617 structure.
12618 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12619 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12620 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12621 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
12622 (Fset_window_next_buffers, Fset_window_clone_number):
12623 New functions.
496e208e
MR
12624 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12625 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12626 Doc-string fixes.
12627 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12628 Argument WINDOW can be now internal window too.
12629 (Fwindow_use_time): Move up in code.
12630 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12631 Rewrite doc-string.
12632 (Fset_window_configuration, saved_window)
12633 (Fcurrent_window_configuration, save_window_save): Handle new
12634 members of window structure.
b9e809c2
MR
12635 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12636 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12637 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12638 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12639 Qget_mru_window, Qresize_root_window,
12640 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12641 Qauto_buffer_name; staticpro them.
f3d1777e 12642
abde8f8c
MR
126432011-06-07 Martin Rudalics <rudalics@gmx.at>
12644
12645 * window.c (Fwindow_total_size, Fwindow_left_column)
12646 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12647 (Fwindow_list_1): New functions.
12648 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
12649 (Fwindow_width, Fscroll_left, Fscroll_right):
12650 Use window_body_cols instead of window_box_text_cols.
12651 (delete_window, Fset_window_configuration):
12652 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
12653 (delete_all_subwindows): Take a window as argument and not a
12654 structure. Rewrite.
190b47e6
MR
12655 (window_loop): Remove handling of GET_LRU_WINDOW and
12656 GET_LARGEST_WINDOW.
12657 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
12658
12659 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
12660 window_box_text_cols. delete_all_subwindows now takes a
12661 Lisp_Object as argument.
abde8f8c 12662
640c8776
SM
12663 * indent.c (compute_motion, Fcompute_motion):
12664 Use window_body_cols instead of window_box_text_cols.
abde8f8c 12665
fa8a67e6
MR
12666 * frame.c (delete_frame): Call delete_all_subwindows with root
12667 window as argument.
12668
a54e3482
DC
126692011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12670
12671 * fns.c (Fputhash): Document return value.
12672
60002bf5
CY
126732011-06-06 Chong Yidong <cyd@stupidchicken.com>
12674
12675 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12676
0c671da6 126772011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 12678
b862a52a 12679 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 12680
be44ca6c
PE
12681 Check for overflow when converting integer to cons and back.
12682 * charset.c (Fdefine_charset_internal, Fdecode_char):
12683 Use cons_to_unsigned to catch overflow.
12684 (Fencode_char): Use INTEGER_TO_CONS.
12685 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12686 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12687 * data.c (long_to_cons, cons_to_long): Remove.
12688 (cons_to_unsigned, cons_to_signed): New functions.
12689 These signal an error for invalid or out-of-range values.
12690 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12691 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12692 * font.c (Ffont_variation_glyphs):
12693 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12694 * lisp.h: Include <intprops.h>.
12695 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12696 (cons_to_signed, cons_to_unsigned): New decls.
12697 (long_to_cons, cons_to_long): Remove decls.
12698 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12699 (Fprimitive_undo): Use CONS_TO_INTEGER.
12700 * xfns.c (Fx_window_property): Likewise.
12701 * xselect.c: Include <limits.h>.
12702 (x_own_selection, selection_data_to_lisp_data):
12703 Use INTEGER_TO_CONS.
12704 (x_handle_selection_request, x_handle_selection_clear)
12705 (x_get_foreign_selection, Fx_disown_selection_internal)
12706 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12707 (lisp_data_to_selection_data): Use cons_to_unsigned.
12708 (x_fill_property_data): Use cons_to_signed.
12709 Report values out of range.
12710
d1f3d2af
PE
12711 Check for buffer and string overflow more precisely.
12712 * buffer.h (BUF_BYTES_MAX): New macro.
12713 * lisp.h (STRING_BYTES_MAX): New macro.
12714 * alloc.c (Fmake_string):
12715 * character.c (string_escape_byte8):
12716 * coding.c (coding_alloc_by_realloc):
12717 * doprnt.c (doprnt):
12718 * editfns.c (Fformat):
12719 * eval.c (verror):
12720 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12721 since they may not be the same number.
12722 * editfns.c (Finsert_char):
12723 * fileio.c (Finsert_file_contents):
12724 Likewise for BUF_BYTES_MAX.
12725
dd52fcea
PE
12726 * image.c: Use ptrdiff_t, not int, for sizes.
12727 (slurp_file): Switch from int to ptrdiff_t.
12728 All uses changed.
12729 (slurp_file): Check that file size fits in both size_t (for
12730 malloc) and ptrdiff_t (for sanity and safety).
12731
7f9bbdbb
PE
12732 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12733 if b->modtime has its maximal value.
12734
dfe18f82
PE
12735 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12736
84acfcf0
PE
12737 Don't assume time_t can fit into int.
12738 * buffer.h (struct buffer.modtime): Now time_t, not int.
12739 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12740 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12741
ccd9a01a
PE
12742 Minor fixes for signed vs unsigned integers.
12743 * character.h (MAYBE_UNIFY_CHAR):
12744 * charset.c (maybe_unify_char):
12745 * keyboard.c (read_char, reorder_modifiers):
12746 XINT -> XFASTINT, since the integer must be nonnegative.
12747 * ftfont.c (ftfont_spec_pattern):
12748 * keymap.c (access_keymap, silly_event_symbol_error):
12749 XUINT -> XFASTINT, since the integer must be nonnegative.
12750 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12751 since it makes no difference and we prefer signed.
12752 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12753 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12754 nonnegative.
12755
d6d100dd
SM
127562011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12757
12758 * window.h (Fwindow_frame): Declare.
12759
2b6148e4
PE
127602011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12761
12762 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12763 (SPARE_MEMORY): Always define.
12764 (LARGE_REQUEST): Remove.
12765 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12766
f230ecc9
MR
127672011-06-06 Martin Rudalics <rudalics@gmx.at>
12768
727e958e
MR
12769 * lisp.h: Move EXFUNS for Fframe_root_window,
12770 Fframe_first_window and Fset_frame_selected_window to window.h.
12771
12772 * window.h: Move EXFUNS for Fframe_root_window,
12773 Fframe_first_window and Fset_frame_selected_window here from
12774 lisp.h.
12775
12776 * frame.c (Fwindow_frame, Fframe_first_window)
12777 (Fframe_root_window, Fframe_selected_window)
12778 (Fset_frame_selected_window): Move to window.c.
12779 (Factive_minibuffer_window): Move to minibuf.c.
12780 (Fother_visible_frames_p): New function.
12781
12782 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12783
f230ecc9
MR
12784 * window.c (decode_window, decode_any_window): Move up in code.
12785 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12786 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
12787 (Fwindow_buffer): Move up and rewrite doc-string.
12788 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12789 (Fwindow_prev): New functions.
727e958e
MR
12790 (Fwindow_frame): Move here from frame.c. Accept any window as
12791 argument.
12792 (Fframe_root_window, Fframe_first_window)
12793 (Fframe_selected_window): Move here from frame.c. Accept frame
12794 or arbitrary window as argument. Update doc-strings.
12795 (Fminibuffer_window): Move up in code.
12796 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
12797 (Fset_frame_selected_window): Move here from frame.c.
12798 Marginal rewrite.
727e958e
MR
12799 (Fselected_window, select_window, Fselect_window): Move up in
12800 code. Minor doc-string fixes.
f230ecc9 12801
4d09bcf6
PE
128022011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12803
12804 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12805 Do not assume that spare memory exists; that assumption is valid
12806 only if SYSTEM_MALLOC.
12807 (LARGE_REQUEST): New macro, so that the issue of large requests
12808 is separated from the issue of spare memory.
12809
810928a2
AS
128102011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12811
172418ad
AS
12812 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12813 format. (Bug#8806)
12814
43f862f7
AS
12815 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12816
810928a2
AS
12817 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12818 before statements.
12819
a059fe24
JD
128202011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12821
12822 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12823
12824 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12825
12826 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12827 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12828
989bf368
JB
128292011-06-05 Juanma Barranquero <lekktu@gmail.com>
12830
12831 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12832
4b80f674
CY
128332011-06-04 Chong Yidong <cyd@stupidchicken.com>
12834
12835 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12836 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
12837 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12838 New error handlers.
4b80f674
CY
12839 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12840 Obey Vx_select_enable_clipboard_manager. Catch errors in
12841 x_clipboard_manager_save (Bug#8779).
12842 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 12843 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 12844
99a33b77 128452011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
12846
12847 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12848
99a33b77 128492011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
12850
12851 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12852 in the current matrix if keep_current_p is non-zero.
12853
8264569d
EZ
128542011-06-04 Eli Zaretskii <eliz@gnu.org>
12855
12856 * bidi.c (bidi_level_of_next_char): Fix last change.
12857
57f97249
EZ
128582011-06-03 Eli Zaretskii <eliz@gnu.org>
12859
fec2107c 12860 Support bidi reordering of text covered by display properties.
57f97249 12861
fec2107c
EZ
12862 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12863 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12864 (bidi_cache_search, bidi_cache_iterator_state)
12865 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
12866 (bidi_level_of_next_char, bidi_move_to_visually_next):
12867 Support character positions inside a run of characters covered by a
fec2107c
EZ
12868 display string.
12869 (bidi_paragraph_init, bidi_resolve_explicit_1)
12870 (bidi_level_of_next_char): Call bidi_fetch_char and
12871 bidi_fetch_char_advance instead of FETCH_CHAR and
12872 FETCH_CHAR_ADVANCE.
12873 (bidi_init_it): Initialize new members.
12874 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12875 definitions.
12876 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12877 instead of using explicit *_CHAR codes.
d6d100dd
SM
12878 (bidi_resolve_explicit, bidi_resolve_weak):
12879 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
12880 bidirectional text is supported only in multibyte buffers.
12881 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12882 it to initialize the frame_window_p member of struct bidi_it.
12883 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12884 (bidi_resolve_explicit, bidi_resolve_weak)
12885 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12886 bidi_it->nchars is non-positive.
12887 (bidi_level_of_next_char): Don't try to lookup the cache for the
12888 next/previous character if nothing is cached there yet, or if we
12889 were just reseat()'ed to a new position.
c40e2fb2 12890
0e14fe90
EZ
12891 * xdisp.c (set_cursor_from_row): Set start and stop points
12892 according to the row's direction when priming the loop that looks
12893 for the glyph on which to display cursor.
12894 (single_display_spec_intangible_p): Function deleted.
12895 (display_prop_intangible_p): Reimplement to call
12896 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
12897 Accept 3 additional arguments needed by handle_display_spec.
12898 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
12899 values: lists, `(when COND...)' forms, etc.
12900 (single_display_spec_string_p): Support property values that are
12901 lists with the argument STRING its top-level element.
12902 (display_prop_string_p): Fix the condition for processing a
12903 property that is a list to be consistent with handle_display_spec.
fec2107c 12904 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
12905 last portion of handle_display_prop.
12906 (compute_display_string_pos): Accept additional argument
12907 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12908 value of a `display' property is a "replacing spec".
12909 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12910 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12911 the display property, but just return a value indicating whether
12912 the display property will replace the characters it covers.
12913 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12914 frame_window_p members of struct bidi_it.
d6d100dd
SM
12915 (compute_display_string_pos, compute_display_string_end):
12916 New functions.
fec2107c
EZ
12917 (push_it): Accept second argument POSITION, where pop_it should
12918 jump to continue iteration.
12919 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 12920
fec2107c
EZ
12921 * keyboard.c (adjust_point_for_property): Adjust the call to
12922 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
12923
12924 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
12925 (bidi_init_it): Update prototypes.
12926 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
12927 (compute_display_string_pos, compute_display_string_end):
12928 Declare prototypes.
fec2107c
EZ
12929 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12930 EMACS_INT.
fc6f18ce 12931
40087514 129322011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 12933
57f53182
PE
12934 Malloc failure behavior now depends on size of allocation.
12935 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12936 * lisp.h: Change signatures accordingly.
12937 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12938 All callers changed. (Bug#8762)
12939
12940 * gnutls.c: Use Emacs's memory allocators.
12941 Without this change, the gnutls library would invoke malloc etc.
12942 directly, which causes problems on non-SYNC_INPUT hosts, and which
12943 runs afoul of improving memory_full behavior. (Bug#8761)
12944 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12945 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12946 xfree instead of the default malloc, realloc, free.
12947 (Fgnutls_boot): No need to check for memory allocation failure,
12948 since xmalloc does that for us.
12949
ac32cd99 12950 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
12951 * category.c (hash_get_category_set):
12952 * ccl.c (ccl_driver):
12953 * charset.c (Fdefine_charset_internal):
12954 * charset.h (struct charset.hash_index):
12955 * composite.c (get_composition_id, gstring_lookup_cache)
12956 (composition_gstring_put_cache):
12957 * composite.h (struct composition.hash_index):
12958 * dispextern.h (struct image.hash):
12959 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12960 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12961 (hashfn_equal, hashfn_user_defined, make_hash_table)
12962 (maybe_resize_hash_table, hash_lookup, hash_put)
12963 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12964 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12965 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12966 * image.c (make_image, search_image_cache, lookup_image)
12967 (xpm_put_color_table_h):
12968 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 12969 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 12970 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 12971 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
12972 * alloc.c (allocate_vectorlike):
12973 Check for overflow in vector size calculations.
12974 * ccl.c (ccl_driver):
12975 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
12976 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12977 need to be updated by these changes.
40087514
PE
12978 * fns.c (make_hash_table, maybe_resize_hash_table):
12979 Check for integer overflow with large hash tables.
0de4bb68
PE
12980 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12981 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12982 (SXHASH_REDUCE): New macro.
12983 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12984 Use it instead of discarding useful hash info with large hash values.
12985 (sxhash_float): New function.
12986 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12987 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
12988 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12989 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
12990 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12991 Adjust signatures to match updated version of code.
12992 (consing_since_gc): Now EMACS_INT, since a single hash table can
12993 use more than INT_MAX bytes.
12994
698d32e2
DN
129952011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12996
12997 Make it possible to build with GCC-4.6+ -O2 -flto.
12998
12999 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13000
fd6fa53f
SM
130012011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13002
13003 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13004 Call minibuffer-inactive-mode.
13005
864db017
JB
130062011-05-31 Juanma Barranquero <lekktu@gmail.com>
13007
13008 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13009 Update dependencies.
13010
2ad0baf4
DN
130112011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13012
13013 * data.c (init_data): Remove code for UTS, this system is not
13014 supported anymore.
13015
4fcc2638
DN
130162011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13017
13018 Don't force ./temacs to start in terminal mode.
13019
13020 * frame.c (make_initial_frame): Initialize faces in all cases, not
13021 only when CANNOT_DUMP is defined.
13022 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13023
c56e0fd5
DN
130242011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13025
13026 * dispnew.c (add_window_display_history): Use const for the string
13027 pointer. Remove declaration, not needed.
13028
333d54da 130292011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 13030
55d4c1b2 13031 Use 'inline', not 'INLINE'.
333d54da 13032 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
13033 * alloc.c, fontset.c (INLINE): Remove.
13034 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13035 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13036 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13037 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13038 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13039
738db178
DN
130402011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13041
13042 Make it possible to run ./temacs.
13043
13044 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13045 syms_of_callproc does the same thing. Remove test for
13046 "initialized", do it in the caller.
13047 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13048
620c53a6
SM
130492011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13050
13051 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13052 (read_minibuf): Use get_minibuffer.
13053 (syms_of_minibuf): Use DEFSYM.
13054 (Qmetadata): New var.
13055 * data.c (Qbuffer): Don't make it static.
13056 (syms_of_data): Use DEFSYM.
13057
e003a292
PE
130582011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13059
13060 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13061 (CCL_CODE_MIN): New macro.
13062
ed008a6d
PE
130632011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13064
3687c2ef
PE
13065 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13066
ed008a6d
PE
13067 * eval.c (Qdebug): Now static.
13068 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13069 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13070 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13071
d66c4c7c
CY
130722011-05-29 Chong Yidong <cyd@stupidchicken.com>
13073
13074 * image.c: Various fixes to ImageMagick code comments.
13075 (Fimagemagick_types): Doc fix.
13076
5fbc2025
PE
130772011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13078
0196f88a
PE
13079 Minor fixes prompted by GCC 4.6.0 warnings.
13080
13081 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13082
5fbc2025
PE
13083 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13084 (x_clipboard_manager_save_all): Move extern decl to ...
13085 * xterm.h: ... here, so that it can be checked for consistency.
13086
1dd3c2d9
CY
130872011-05-29 Chong Yidong <cyd@stupidchicken.com>
13088
13089 * xselect.c (x_clipboard_manager_save_frame)
13090 (x_clipboard_manager_save_all): New functions.
13091 (Fx_clipboard_manager_save): Lisp function deleted.
13092
13093 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13094 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13095
13096 * xterm.h: Update prototype.
13097
5ba6571d
WX
130982011-05-28 William Xu <william.xwl@gmail.com>
13099
13100 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13101 exiting (Bug#8239).
13102
3eaff834
JM
131032011-05-28 Jim Meyering <meyering@redhat.com>
13104
e1900994 13105 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
13106 * fns.c (to_uchar): Define.
13107 (crypto_hash_function): Use it to convert some newly-signed
13108 variables to unsigned, to avoid sign-extension bugs. For example,
13109 without this change, (md5 "truc") would evaluate to
13110 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13111 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 13112 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 13113
0f6990a7
PE
131142011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13115
13116 Integer overflow fixes.
c8a9ca5a 13117
08686060
PE
13118 * dbusbind.c: Serial number integer overflow fixes.
13119 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
13120 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13121 to hold a serial number that is too large for a fixnum.
13122 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13123 Check for serial numbers out of range. Decode any serial number
59568bf0 13124 that was so large that it became a float. (Bug#8722)
08686060 13125
2d1fc3c7
PE
13126 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13127 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13128 Use XFASTINT rather than XUINT when numbers are nonnegative.
13129 (xd_append_arg, Fdbus_method_return_internal):
13130 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13131 arguments, check that Lisp number is nonnegative, rather than
59568bf0 13132 silently wrapping negative numbers around. (Bug#8722)
30217ff0 13133 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 13134 (Bug#8722)
2d1fc3c7 13135
c8a9ca5a
PE
13136 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13137
519e1d69
PE
13138 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13139
6df6ae42 13140 ccl: Add integer overflow checks.
30569699
PE
13141 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13142 (IN_INT_RANGE): New macros.
13143 (ccl_driver): Use them to check for integer overflow when
13144 decoding a CCL program. Many of the new checks are whether XINT (x)
13145 fits in int; it doesn't always, on 64-bit hosts. The new version
13146 doesn't catch all possible integer overflows, but it's an
847044ea 13147 improvement. (Bug#8719)
30569699 13148
c11285dc
PE
13149 * alloc.c (make_event_array): Use XINT, not XUINT.
13150 There's no need for unsigned here.
13151
fdccd48e
PE
13152 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13153 This follows up to the 2011-05-06 change that substituted uintptr_t
13154 for EMACS_INT. This case wasn't caught back then.
13155
37910ab2
PE
13156 Rework Fformat to avoid integer overflow issues.
13157 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13158 now (part of C89). Include <verify.h>.
13159 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13160 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13161 (Fformat): Avoid the prepass trying to compute sizes; it was only
13162 approximate and thus did not catch overflow reliably. Instead, walk
13163 through the format just once, formatting and computing sizes as we go,
13164 checking for integer overflow at every step, and allocating a larger
13165 buffer as needed. Keep track separately whether the format is
13166 multibyte. Keep only the most-recently calculated precision, rather
13167 than them all. Record whether each argument has been converted to
13168 string. Use EMACS_INT, not int, for byte and char and arg counts.
13169 Support field widths and precisions larger than INT_MAX. Avoid
13170 sprintf's undefined behavior with conversion specifications such as %#d
13171 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13172 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13173 formatting out-of-range floating point numbers with int
9173deec 13174 formats. (Bug#8668)
37910ab2 13175
2e6578fb
PE
13176 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13177
0ae6bdee
PE
13178 * data.c: Avoid integer truncation in expressions involving floats.
13179 * data.c: Include <intprops.h>.
13180 (arith_driver): When there's an integer overflow in an expression
13181 involving floating point, convert the integers to floating point
13182 so that the resulting value does not suffer from catastrophic
13183 integer truncation. For example, on a 64-bit host (* 4
13184 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13185 Do not rely on undefined behavior after integer overflow.
13186
de883a70
PE
13187 merge count_size_as_multibyte, parse_str_to_multibyte
13188 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 13189 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
13190 Check for integer overflow.
13191 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13192 since it's now a duplicate of the other. This is more of
13193 a character than a buffer op, so better that it's in character.c.
13194 * fns.c, print.c: Adjust to above changes.
13195
2ff916cb
PE
131962011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13197
13198 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13199
f1b54466
PE
132002011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13201
fb1ac845
PE
13202 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13203 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13204 (x_clipboard_manager_save): Now static.
13205 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13206
f1b54466
PE
13207 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13208 (crypto_hash_function): Now static.
13209 Fix pointer signedness problems. Avoid unnecessary initializations.
13210
a9f737ee
CY
132112011-05-27 Chong Yidong <cyd@stupidchicken.com>
13212
13213 * termhooks.h (Vselection_alist): Make it terminal-local.
13214
13215 * terminal.c (create_terminal): Initialize it.
13216
13217 * xselect.c: Support for clipboard managers.
13218 (Vselection_alist): Move to termhooks.h as terminal-local var.
13219 (LOCAL_SELECTION): New macro.
13220 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13221 (symbol_to_x_atom): Remove gratuitous arg.
13222 (x_handle_selection_request, lisp_data_to_selection_data)
13223 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
13224 (x_own_selection, x_get_local_selection, x_convert_selection):
13225 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
13226 (some_frame_on_display): Delete unused function.
13227 (Fx_own_selection_internal, Fx_get_selection_internal)
13228 (Fx_disown_selection_internal, Fx_selection_owner_p)
13229 (Fx_selection_exists_p): New optional frame arg.
13230 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13231 (x_handle_selection_clear): Don't treat other terminals with the
13232 same keyboard specially. Use the terminal-local Vselection_alist.
13233 (x_clear_frame_selections): Use Frun_hook_with_args.
13234
13235 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13236
13237 * xterm.h: Add support for those atoms.
13238
e067f0c1
CY
132392011-05-26 Chong Yidong <cyd@stupidchicken.com>
13240
13241 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13242 (converted_selections, conversion_fail_tag): New global variables.
13243 (x_selection_request_lisp_error): Free the above.
13244 (x_get_local_selection): Remove unnecessary code.
13245 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
13246 of converted selections stored in converted_selections.
13247 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
13248 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13249 (x_convert_selection): New function.
13250 (x_handle_selection_event): Simplify.
13251 (x_get_foreign_selection): Don't ignore incoming requests while
13252 waiting for an answer; this will fail when we implement
13253 SAVE_TARGETS, and seems unnecessary anyway.
13254 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13255 (Vx_sent_selection_functions): Doc fix.
13256
0f4aebc0
LL
132572011-05-26 Leo Liu <sdl.web@gmail.com>
13258
13259 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13260
e61124cd
YM
132612011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13262
13263 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13264
13265 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13266 for fringe update if it has periodic bitmap.
ac389d0c 13267 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
13268 and fringe_bitmap_periodic_p.
13269
13270 * fringe.c (get_fringe_bitmap_data): New function.
13271 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13272 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13273 row. Mark glyph row for fringe update if periodicity changed.
13274
13275 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13276 for fringe update unless it has periodic bitmap.
13277
f16d9837
KH
132782011-05-25 Kenichi Handa <handa@m17n.org>
13279
13280 * xdisp.c (get_next_display_element): Set correct it->face_id for
13281 a static composition.
13282
e1b90ef6
LL
132832011-05-24 Leo Liu <sdl.web@gmail.com>
13284
13285 * deps.mk (fns.o):
13286 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13287
13288 * fns.c (crypto_hash_function, Fsha1): New function.
13289 (Fmd5): Use crypto_hash_function.
13290 (syms_of_fns): Add Ssha1.
13291
7400048f
PE
132922011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13293
13294 * gnutls.c: Remove unused macros.
13295 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13296 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13297 Remove macros that are defined and never used.
13298 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13299
abb71cf4
CY
133002011-05-22 Chong Yidong <cyd@stupidchicken.com>
13301
13302 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13303 (Fx_get_selection_internal): Minor cleanup.
13304 (Fx_own_selection_internal): Rename arguments for consistency with
13305 select.el.
13306
6307db39
PE
133072011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13308
13309 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13310
f3d4e0a4
CY
133112011-05-22 Chong Yidong <cyd@stupidchicken.com>
13312
13313 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13314
4d8ade89
YM
133152011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13316
13317 * dispnew.c (scrolling_window): Don't exclude the case that the
13318 last enabled row in the desired matrix touches the bottom boundary.
13319
32078c8d
GM
133202011-05-21 Glenn Morris <rgm@gnu.org>
13321
13322 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
13323 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13324 and add some more files.
32078c8d 13325
7285dc67
EZ
133262011-05-20 Eli Zaretskii <eliz@gnu.org>
13327
13328 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13329 report_file_error introduced by the change from 2011-05-07.
13330
89d1bd22
PE
133312011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13332
13333 * systime.h (Time): Define only if emacs is defined.
13334 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13335 where the include path doesn't have X11/X.h by default. See
13336 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13337
cd394be1 133382011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
13339
13340 * composite.c (find_automatic_composition): Fix previous change.
13341
b9704ad9
GM
133422011-05-20 Glenn Morris <rgm@gnu.org>
13343
13344 * lisp.mk: New file, split from Makefile.in.
13345 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13346 (shortlisp): Remove.
13347 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13348
4a720484
GM
133492011-05-19 Glenn Morris <rgm@gnu.org>
13350
13351 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13352 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13353 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13354 (lisp): Set the order to that of loadup.el.
13355 (shortlisp): Make it a copy of $lisp.
13356 (SOME_MACHINE_LISP): Remove.
13357 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13358 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13359
a28d4396
KH
133602011-05-18 Kenichi Handa <handa@m17n.org>
13361
13362 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13363 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13364 (find_automatic_composition): Mostly rewrite for efficiency.
13365
a2b1fa8e
JB
133662011-05-18 Juanma Barranquero <lekktu@gmail.com>
13367
13368 * makefile.w32-in: Update dependencies.
13369
8e1f5610
CS
133702011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13371
13372 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 13373 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 13374
7025ee00 133752011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 13376
cdfa6eab
PE
13377 Fix some integer overflow issues, such as string length overflow.
13378
06d6db33
PE
13379 * insdel.c (count_size_as_multibyte): Check for string overflow.
13380
2b4560a8
PE
13381 * character.c (lisp_string_width): Check for string overflow.
13382 Use EMACS_INT, not int, for string indexes and lengths; in
13383 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13384 the resulting string length overflows an EMACS_INT; instead,
13385 report a string overflow if no precision given. When checking for
13386 precision exhaustion, use a check that cannot possibly have
13387 integer overflow. (Bug#8675)
13388 * character.h (lisp_string_width): Adjust to new signature.
13389
cb93f9be
PE
13390 * alloc.c (string_overflow): New function.
13391 (Fmake_string): Use it. This doesn't change behavior, but saves
13392 a few bytes and will simplify future changes.
13393 * character.c (string_escape_byte8): Likewise.
13394 * lisp.h (string_overflow): New decl.
13395
1a1f3366
PE
13396 Fixups, following up to the user-interface timestamp change.
13397 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13398 for UI timestamps, instead of unsigned long.
9fbd6841
PE
13399 * msdos.c (mouse_get_pos): Likewise.
13400 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
13401 * w32gui.h (Time): Define by including "systime.h" rather than by
13402 declaring it ourselves. (Bug#8664)
13403
d4e3e4d3
PE
13404 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13405 * image.c (clear_image_cache): Likewise.
13406
f6a24d19
PE
13407 * term.c (term_mouse_position): Don't assume time_t wraparound.
13408
08dc5ae6
PE
13409 Be more systematic about user-interface timestamps.
13410 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
13411 and sometimes 'EMACS_UINT', to represent these timestamps.
13412 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
13413 This makes the code easier to follow, and makes it easier to catch
13414 integer overflow bugs such as Bug#8664.
13415 * frame.c (Fmouse_position, Fmouse_pixel_position):
13416 Use Time, not unsigned long, for user-interface timestamps.
13417 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13418 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13419 * keyboard.h (last_event_timestamp): Likewise.
13420 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13421 * menu.h (xmenu_show): Likewise.
13422 * term.c (term_mouse_position): Likewise.
13423 * termhooks.h (struct input_event.timestamp): Likewise.
13424 (struct terminal.mouse_position_hook): Likewise.
13425 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13426 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13427 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13428 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13429 what it was before.
13430 * menu.h, termhooks.h: Include "systime.h", for Time.
13431
8e55734a
PE
13432 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13433 Don't assume that the difference between two unsigned long values
13434 can fit into an integer. At this point, we know button_down_time
13435 <= event->timestamp, so the difference must be nonnegative, so
13436 there's no need to cast the result if double-click-time is
13437 nonnegative, as it should be; check that it's nonnegative, just in
13438 case. This bug is triggered when events are more than 2**31 ms
86db42d2 13439 apart (about 25 days). (Bug#8664)
8e55734a 13440
841f1b75 13441 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 13442 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 13443
3e26f69c
PE
13444 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13445 that always fit in int. Use a sentinel instead of a counter, to
13446 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
13447 * frame.h (struct frame): Use int for menu_bar_items_used
13448 instead of EMACS_INT, since it always fits in int.
3e26f69c 13449
5cc152c0
PE
13450 * menu.c (grow_menu_items): Check for int overflow.
13451
d89eb65e
PE
13452 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13453
5235bd3e
PE
13454 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13455 Before, the code was not consistent. These values cannot exceed
13456 2**31 - 1 so there's no need to make them unsigned.
13457 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13458 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13459 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13460 as modifiers.
13461 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13462
bc827e23
PE
13463 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13464 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13465 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13466 presumably because the widths might not match.
13467
78eb494e
PE
13468 * window.c (size_window): Avoid needless test at loop start.
13469
04f2d78b
CB
134702011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13471
13472 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13473
d2fc7e3d 134742011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
13475
13476 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13477
d2fc7e3d 134782011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
13479
13480 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13481 `width' to `bar_area_x' and `bar_area_width', respectively.
13482 (x_scroll_run): Take account of fringe background extension.
13483
04f2d78b
CB
13484 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13485 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
13486 `bar_area_width', respectively.
13487 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13488 background extension.
13489
79b70037
GM
134902011-05-10 Jim Meyering <meyering@redhat.com>
13491
13492 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13493
2f142cc5
JB
134942011-05-10 Juanma Barranquero <lekktu@gmail.com>
13495
13496 * image.c (Finit_image_library): Return t for built-in image types,
13497 like pbm and xbm. (Bug#8640)
13498
57679c86
AS
134992011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13500
13501 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13502
888c9e86
EZ
135032011-05-07 Eli Zaretskii <eliz@gnu.org>
13504
b0512a1d
EZ
13505 * w32console.c (Fset_screen_color): Doc fix.
13506 (Fget_screen_color): New function.
13507 (syms_of_ntterm): Defsubr it.
13508
7285dc67
EZ
13509 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13510 unlink the temporary file if Fcall_process didn't create it in the
13511 first place.
13512 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13513 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
13514 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13515 cue to call_process_cleanup not to close that handle.
13516
4d3fcc8e
BK
135172011-05-07 Ben Key <bkey76@gmail.com>
13518
13519 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13520 one of two shell specific rules, either bootstrap-temacs-CMD or
13521 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13522 to the previous implementation of the bootstrap-temacs rule.
13523 The bootstrap-temacs-CMD rule is similar to the previous
13524 implementation of the bootstrap-temacs rule except that it
13525 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13526 variable.
13527
13528 These changes, along with some changes to nt/configure.bat,
13529 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13530 earlier fix to add support for --cflags and --ldflags options
13531 that include quotes so that it works whether make uses cmd or
13532 sh as the shell.
13533
b4289b64
MA
135342011-05-06 Michael Albinus <michael.albinus@gmx.de>
13535
13536 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13537 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13538 is a constant.
13539 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13540 a string. Handle both cases.
13541 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13542 (Fdbus_register_method): Use Qinvalid_function.
13543
af4c0e28
JB
135442011-05-06 Juanma Barranquero <lekktu@gmail.com>
13545
13546 * makefile.w32-in: Update dependencies.
13547 (LISP_H): Add inttypes.h and stdin.h.
13548 (PROCESS_H): Add unistd.h.
13549
c51453d9
EZ
135502011-05-06 Eli Zaretskii <eliz@gnu.org>
13551
13552 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13553 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13554
8ff0ac3c 135552011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 13556
4c4b566b
PE
13557 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13558
aab2b9b5
PE
13559 * term.c (vfatal): Remove stray call to va_end.
13560 It's not needed and the C Standard doesn't allow it here anyway.
13561
c378da0b
PE
13562 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13563 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13564
288b08c7
PE
13565 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13566 bytes.
13567
e3601888
PE
13568 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13569
db6c0e74
PE
13570 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13571
dd5963ea
PE
13572 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13573
88c9450f
PE
13574 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13575
2f9442b8
PE
13576 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13577
c032b5f8
PE
13578 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13579 * charset.c (Fdefine_charset_internal): Don't initialize
13580 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 13581 32-bit int (Bug#8600).
a108c10b
PE
13582
13583 * lread.c (read_integer): Be more consistent with string-to-number.
13584 Use string_to_number to do the actual conversion; this avoids
13585 rounding errors and fixes some other screwups. Without this fix,
13586 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13587 (digit_to_number): Move earlier, for benefit of read_integer.
13588 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 13589 not a digit in any supported base. (Bug#8602)
a108c10b 13590
ad5f9eea
PE
13591 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13592
aec1708a
PE
13593 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13594 to match comment at start of function. This also removes a
13595 GCC warning about overflow in a 32+64-bit port.
13596
47be4ab5
PE
13597 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13598
371cac43
PE
13599 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13600 Reported by Stefan Monnier in
13601 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
13602 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13603 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 13604
d01a7826
PE
13605 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13606 (EMACS_UINTPTR): Likewise, with uintptr_t.
13607
7fd47d5c
PE
13608 * lisp.h: Prefer 64-bit EMACS_INT if available.
13609 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13610 on 32-bit hosts that have 64-bit int, so that they can access
13611 large files.
122b0c86
PE
13612 However, temporarily disable this change unless the temporary
13613 symbol WIDE_EMACS_INT is defined.
7fd47d5c 13614
8727937b
PE
13615 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13616
8ac068ac
PE
13617 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13618 This removes an assumption that EMACS_INT and long are the same
13619 width as pointers. The assumption is true for Emacs porting targets
13620 now, but we want to make other targets possible.
13621 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13622 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13623 In the rest of the code, change types of integers that hold casted
13624 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13625 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13626 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13627 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13628 No need to cast type when ORing.
13629 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13630 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13631 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13632 assume EMACS_INT is the same width as char *.
13633 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13634 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13635 Remove no-longer-needed casts.
13636 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13637 (xg_tool_bar_help_callback, xg_make_tool_item):
13638 Use EMACS_INTPTR to hold an integer
13639 that will be cast to void *; this can avoid a GCC warning
13640 if EMACS_INT is not the same width as void *.
13641 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13642 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13643 (current_message_1, set_message_1):
13644 Use a local to convert to proper width without a cast.
13645 * xmenu.c (dialog_selection_callback): Likewise.
13646
ede49d71
PE
13647 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13648 Also, don't assume VALBITS / RAND_BITS is less than 5,
13649 and don't rely on undefined behavior when shifting a 1 left into
13650 the sign bit.
13651 * lisp.h (get_random): Change signature to match.
13652
2f30ecd0
PE
13653 * lread.c (hash_string): Use size_t, not int, for hash computation.
13654 Normally we prefer signed values; but hashing is special, because
13655 it's better to use unsigned division on hash table sizes so that
13656 the remainder is nonnegative. Also, size_t is the natural width
13657 for hashing into memory. The previous code used 'int', which doesn't
13658 retain enough info to hash well into very large tables.
13659 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13660
2a866e7b
PE
13661 * dbusbind.c: Don't possibly lose pointer info when converting.
13662 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13663 Use XPNTR rather than XHASH, so that the high-order bits of
13664 the pointer aren't lost when converting through void *.
13665
51639eac
PE
13666 * eval.c (Fautoload): Don't double-shift a pointer.
13667
92394119
PE
13668 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13669
dbdb9a7c
JB
136702011-05-06 Juanma Barranquero <lekktu@gmail.com>
13671
13672 * gnutls.c (DEF_GNUTLS_FN):
13673 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13674
db7a0b4f
AS
136752011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13676
13677 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13678 marker. (Bug#8610)
13679
cd394be1 136802011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
13681
13682 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13683 New version that can reserve upto 2GB of heap space.
13684
f7ff1b0f 136852011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
13686
13687 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13688
639c109b
TZ
136892011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13690
13691 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13692 `gnutls_certificate_set_x509_key_file'.
13693
d2127135
JB
136942011-05-05 Juanma Barranquero <lekktu@gmail.com>
13695
13696 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13697 Update dependencies.
13698
e968f4f3
JB
136992011-05-04 Juanma Barranquero <lekktu@gmail.com>
13700
13701 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13702 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13703 Remove unused parameter `fildes'.
13704 * process.c (read_process_output, send_process): Don't pass it.
13705
84d358f0
JB
137062011-05-04 Juanma Barranquero <lekktu@gmail.com>
13707
13708 Fix previous change: the library cache is defined in w32.c.
13709 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13710 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13711
0898ca10
JB
137122011-05-04 Juanma Barranquero <lekktu@gmail.com>
13713
13714 Implement dynamic loading of GnuTLS on Windows.
13715
13716 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13717 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13718 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13719 Declare.
13720
13721 * gnutls.c (Qgnutls_dll): Define.
13722 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13723 (gnutls_*): Declare function pointers.
13724 (init_gnutls_functions): New function to initialize function pointers.
13725 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13726 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13727 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13728 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13729 (emacs_gnutls_write, emacs_gnutls_read)
13730 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13731 (Fgnutls_available_p): New function.
13732 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13733 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13734 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13735
13736 * image.c: Include w32.h.
13737 (Vimage_type_cache): Delete.
13738 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13739 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13740 (w32_delayed_load): Move to w32.c.
13741
13742 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13743
13744 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13745 (w32_delayed_load): Move from image.c. When loading a library, record
13746 its filename in the :loaded-from property of the library id.
13747 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13748 Initialize and staticpro them.
13749 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13750
13751 * process.c: Include lisp.h before w32.h, not after.
13752 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13753 instead of gnutls_record_check_pending.
13754
13755 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13756
ff4de4aa
TZ
137572011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13758
13759 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13760 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13761 as passed in.
13762
abe95abb
JD
137632011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13764
13765 * xterm.c (x_set_frame_alpha): Do not set property on anything
13766 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13767
e16e55d4
JB
137682011-05-02 Juanma Barranquero <lekktu@gmail.com>
13769
13770 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13771
bafcf6a5
JB
137722011-05-02 Juanma Barranquero <lekktu@gmail.com>
13773
13774 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13775 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13776 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13777 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13778 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13779 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13780 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13781 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13782 (Qgnutls_bootprop_callbacks_verify): Make static.
13783
e7a6747f
AS
137842011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13785
19ed11ba
AS
13786 * callproc.c: Indentation fixup.
13787
e7a6747f 13788 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
13789 (wait_for_termination, interruptible_wait_for_termination):
13790 Move after wait_for_termination_1.
e7a6747f 13791
1ef14cb4
LMI
137922011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13793
13794 * sysdep.c (interruptible_wait_for_termination): New function
13795 which is like wait_for_termination, but allows keyboard
13796 interruptions.
13797
13798 * callproc.c (Fcall_process): Add (:file "file") as an option for
13799 the STDOUT buffer.
13800 (Fcall_process_region): Ditto.
13801
330d880c
EZ
138022011-04-30 Eli Zaretskii <eliz@gnu.org>
13803
8db90b73
EZ
13804 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13805 rather than `XVECTOR (FOO)->size'.
13806
330d880c
EZ
13807 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13808 inttypes.h, as a gnulib replacement is used if it not available in
13809 system headers.
13810
15cbd324
EZ
138112011-04-21 Eli Zaretskii <eliz@gnu.org>
13812
13813 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13814 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13815 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13816
13817 * coding.c (coding_alloc_by_realloc): Error out if destination
13818 will grow beyond MOST_POSITIVE_FIXNUM.
13819 (decode_coding_emacs_mule): Abort if there isn't enough place in
13820 charbuf for the composition carryover bytes. Reserve an extra
13821 space for up to 2 characters produced in a loop.
13822 (decode_coding_iso_2022): Abort if there isn't enough place in
13823 charbuf for the composition carryover bytes.
13824
138252011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 13826
ae940cca
EZ
13827 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13828 aborting when %lld or %lll format is passed.
13829 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13830 %llo or %llx format is passed. (Bug#8545)
13831
03ab8921
EZ
13832 * window.c (window_scroll_line_based): Use a marker instead of
13833 simple variables to record original value of point. (Bug#7952)
13834
afda1437
EZ
13835 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13836 produced by %s or %c overflows available buffer space. (Bug#8545)
13837
f76dee0c
PE
138382011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13839
13840 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 13841 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 13842
fdc5744d
JB
138432011-04-28 Juanma Barranquero <lekktu@gmail.com>
13844
13845 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13846
638f053a
JB
138472011-04-28 Juanma Barranquero <lekktu@gmail.com>
13848
13849 * keyboard.c (Qdelayed_warnings_hook): Define.
13850 (command_loop_1): Run `delayed-warnings-hook'
13851 if Vdelayed_warnings_list is non-nil.
13852 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13853 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13854
d178f871
EZ
138552011-04-28 Eli Zaretskii <eliz@gnu.org>
13856
13857 * doprnt.c (doprnt): Don't return value smaller than the buffer
13858 size if the message was truncated. (Bug#8545).
13859
b124fd93
JB
138602011-04-28 Juanma Barranquero <lekktu@gmail.com>
13861
13862 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13863 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13864
e810457d
PE
138652011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13866
13867 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13868
ea51cceb
JB
138692011-04-27 Juanma Barranquero <lekktu@gmail.com>
13870
13871 * makefile.w32-in: Update dependencies.
13872
94dcfacf
EZ
138732011-04-27 Eli Zaretskii <eliz@gnu.org>
13874
13875 Improve `doprnt' and its usage. (Bug#8545)
13876 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13877 `format_end'. Remove support for %l as a conversion specifier.
13878 Don't use xrealloc. Improve diagnostics when the %l size modifier
13879 is used. Update the commentary.
13880
13881 * eval.c (verror): Simplify calculation of size_t.
13882
13883 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13884 messages.
13885
f61f41d7
PE
138862011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13887
13888 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13889 change.
13890
96fb4434
PE
138912011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13892
13893 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13894 This makes this file independent of the recent pseudovector change.
13895
671875da 138962011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 13897
69e9b5a3
PE
13898 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13899
b5f869a7 13900 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 13901 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 13902 Remove unused local.
c8926152 13903 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 13904
841a1577 13905 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
13906 GCC 4.6.0 optimizes based on type-based alias analysis.
13907 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
13908 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13909 != &v->size, and therefore "v->size = 1; b->size = 2; return
13910 v->size;" must therefore return 1. This assumption is incorrect
13911 for Emacs, since it type-puns struct Lisp_Vector * with many other
13912 types. To fix this problem, this patch adds a new type struct
f904488f 13913 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
13914 and pseudovectors, and helps optimizing compilers not get fooled
13915 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13916 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
13917 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13918 the size member.
eab3844f
PE
13919 (XSETPVECTYPE): Rewrite in terms of new macro.
13920 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13921 This is a bit clearer, and further avoids the possibility of
13922 undesirable aliasing.
13923 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 13924 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
13925 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13926 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
13927 (ASIZE): Now uses header.size rather than size.
13928 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
13929 to avoid the hassle of writing XVECTOR (foo)->header.size.
13930 (struct vectorlike_header): New type.
eab3844f
PE
13931 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13932 object, to help avoid aliasing.
13933 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13934 (SUBRP): Likewise, since Lisp_Subr is a special case.
13935 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13936 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13937 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 13938 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
13939 changed to be "header.size" and "header.next".
13940 * buffer.h (struct buffer): Likewise.
13941 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13942 * frame.h (struct frame): Likewise.
13943 * process.h (struct Lisp_Process): Likewise.
13944 * termhooks.h (struct terminal): Likewise.
13945 * window.c (struct save_window_data, struct saved_window): Likewise.
13946 * window.h (struct window): Likewise.
13947 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13948 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13949 * buffer.c (init_buffer_once): Likewise.
13950 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13951 special case.
13952 * process.c (Fformat_network_address): Use local var for size,
13953 for brevity.
13954
0df1eac5
PE
13955 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13956
847ab9d1 13957 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
13958 * data.c (atof): Remove decl; no longer used or needed.
13959 (digit_to_number): Move to lread.c.
13960 (Fstring_to_number): Use new string_to_number function, to be
13961 consistent with how the Lisp reader treats infinities and NaNs.
13962 Do not assume that floating-point numbers represent EMACS_INT
13963 without losing information; this is not true on most 64-bit hosts.
13964 Avoid double-rounding errors, by insisting on integers when
13965 parsing non-base-10 numbers, as the documentation specifies.
13966 * lisp.h (string_to_number): New decl, replacing ...
13967 (isfloat_string): Remove.
bc0a5c13 13968 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 13969 (read1): Do not accept +. and -. as integers; this
452f4150
PE
13970 appears to have been a coding error. Similarly, do not accept
13971 strings like +-1e0 as floating point numbers. Do not report
13972 overflow for integer overflows unless the base is not 10 which
13973 means we have no simple and reliable way to continue.
13974 Break out the floating-point parsing into a new
13975 function string_to_number, so that Fstring_to_number parses
13976 floating point numbers consistently with the Lisp reader.
04f2d78b 13977 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
13978 (E_CHAR, EXP_INT): Remove, replacing with ...
13979 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13980 (string_to_number): New function, replacing isfloat_string.
13981 This function checks for valid syntax and produces the resulting
13982 Lisp float number too. Rework it so that string-to-number
bc0a5c13 13983 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
13984 so that overflow for non-base-10 numbers is reported only when
13985 there's no portable and simple way to convert to floating point.
452f4150 13986
67769ffc
PE
13987 * textprop.c (set_text_properties_1): Rewrite for clarity,
13988 and to avoid GCC warning about integer overflow.
13989
c20db43f
PE
13990 * intervals.h (struct interval): Use EMACS_INT for members
13991 where EMACS_UINT might cause problems. See
13992 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13993 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13994 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13995 All uses changed.
37aa2f85
PE
13996 (offset_intervals): Tell GCC not to worry about length overflow
13997 when negating a negative length.
c20db43f 13998
2538aa2f
PE
13999 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14000 (overrun_check_free): Likewise.
14001
f2d3008d
PE
14002 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14003 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14004 word size.
14005
ec8df744
PE
14006 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14007 (gnutls_make_error): Rename local to avoid shadowing.
14008 (gnutls_emacs_global_deinit): ifdef out; not used.
14009 (Fgnutls_boot): Use const for pointer to readonly storage.
14010 Comment out unused local. Fix pointer signedness problems.
14011
640ee02d
PE
14012 * lread.c (openp): Don't stuff size_t into an 'int'.
14013 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14014 about possible signed overflow.
14015
6048fb2a
PE
14016 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14017 (GDK_KEY_g): Don't define if already defined.
14018 (xg_prepare_tooltip): Avoid pointer signedness problem.
14019 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14020
fa3c87e1
PE
14021 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14022 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14023
2172544b
PE
14024 * xfns.c (Fx_window_property): Simplify a bit,
14025 to make a bit faster and to avoid GCC 4.6.0 warning.
14026 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14027
9b821a21
PE
14028 * fns.c (internal_equal): Don't assume size_t fits in int.
14029
3c616cfa
PE
14030 * alloc.c (compact_small_strings): Tighten assertion a little.
14031
c2982e87
PE
14032 Replace pEd with more-general pI, and fix some printf arg casts.
14033 * lisp.h (pI): New macro, generalizing old pEd macro to other
14034 conversion specifiers. For example, use "...%"pI"d..." rather
14035 than "...%"pEd"...".
14036 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 14037 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
14038 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14039 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14040 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14041 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14042 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14043 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14044 64-bit hosts.
14045 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14046 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14047 * print.c (safe_debug_print, print_object): Likewise.
14048 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14049 to int.
6f04d126
PE
14050 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14051 avoiding the 0 flag, which is not portable.
c2982e87
PE
14052 * process.c (Fmake_network_process): Use pI to avoid cast.
14053 * region-cache.c (pp_cache): Likewise.
14054 * xdisp.c (decode_mode_spec): Likewise.
14055 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14056 behavior on 64-bit hosts with printf arg.
6f04d126 14057 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
14058 (x_stop_queuing_selection_requests): Likewise.
14059 (x_get_window_property): Don't truncate byte count to an 'int'
14060 when tracing.
0b432f21 14061
5e073ec7
PE
14062 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14063 here, since it parses constructs like leading '-' and spaces,
14064 which are not wanted; and it overflows with large numbers.
14065 Instead, simply match F[0-9]+, which is what is wanted anyway.
14066
36372bf9
PE
14067 * alloc.c: Remove unportable assumptions about struct layout.
14068 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14069 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14070 (allocate_vectorlike, make_pure_vector): Use the new macros,
14071 plus offsetof, to remove unportable assumptions about struct layout.
14072 These assumptions hold on all porting targets that I know of, but
14073 they are not guaranteed, they're easy to remove, and removing them
14074 makes further changes easier.
14075
0b432f21
PE
14076 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14077 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
14078 (string_overrun_cookie): Now const. Use initializers that
14079 don't formally overflow signed char, to avoid warnings.
000098c1
PE
14080 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14081 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
14082 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14083 multiple of sizeof (EMACS_INT); it need not be, if
14084 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 14085 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 14086
895009e1
JB
140872011-04-26 Juanma Barranquero <lekktu@gmail.com>
14088
14089 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14090
6a7a1b0b
TZ
140912011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14092
14093 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 14094 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
14095 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14096
841a1577 140972011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
14098
14099 * lisp.h (Qdebug): List symbol.
895009e1 14100 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
14101 * keyboard.c (debug-on-event): New variable.
14102 (handle_user_signal): Break into debugger when debug-on-event
14103 matches the current signal symbol.
14104
f2d3ba6f
DN
141052011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14106
14107 * alloc.c (check_sblock, check_string_bytes)
14108 (check_string_free_list): Convert to standard C.
14109
42ce4c63
TZ
141102011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14111
14112 * w32.c (emacs_gnutls_push): Fix typo.
14113
825cd63c
EZ
141142011-04-25 Eli Zaretskii <eliz@gnu.org>
14115
fb11d64d
EZ
14116 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14117 "cast to pointer from integer of different size".
14118
825cd63c
EZ
14119 Improve doprnt and its use in verror. (Bug#8545)
14120 * doprnt.c (doprnt): Document the set of format control sequences
14121 supported by the function. Use SAFE_ALLOCA instead of always
14122 using `alloca'.
14123
14124 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14125 is one byte too soon. Don't use xrealloc; instead xfree and
14126 xmalloc anew.
14127
e061a11b
TZ
141282011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14129
14130 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14131 callbacks stage.
14132
14133 * gnutls.c: Renamed global_initialized to
14134 gnutls_global_initialized. Added internals for the
14135 :verify-hostname-error, :verify-error, and :verify-flags
14136 parameters of `gnutls-boot' and documented those parameters in the
14137 docstring. Start callback support.
9173deec
JB
14138 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14139 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14140 on error. Return error code.
e061a11b
TZ
14141 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14142 (emacs_gnutls_read): Likewise.
14143 (Fgnutls_boot): Return handshake error code.
14144 (emacs_gnutls_handle_error): New function.
14145 (wsaerror_to_errno): Likewise.
14146
14147 * w32.h (emacs_gnutls_pull): Add prototype.
14148 (emacs_gnutls_push): Likewise.
14149
14150 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14151 (emacs_gnutls_push): Likewise.
14152
141532011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14154
14155 * process.c (wait_reading_process_output): Check if GnuTLS
14156 buffered some data internally if no FDs are set for TLS
14157 connections.
14158
14159 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14160 (LIBS): Link to USER_LIBS.
14161 ($(BLD)/gnutls.$(0)): New target.
14162
fa6996bc
EZ
141632011-04-24 Eli Zaretskii <eliz@gnu.org>
14164
eb35682e
EZ
14165 * xdisp.c (handle_single_display_spec): Rename the
14166 display_replaced_before_p argument into display_replaced_p, to
14167 make it consistent with the commentary. Fix typos in the
14168 commentary.
14169
e2ad650c
EZ
14170 * textprop.c (syms_of_textprop): Remove dead code.
14171 (copy_text_properties): Delete obsolete commentary about an
14172 interface that was deleted long ago. Fix typos in the description
14173 of arguments.
14174
1b2de274
EZ
14175 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14176 to changes in oldXMenu/XMenu.h from 2011-04-16.
14177 <menu_help_message, prev_menu_help_message>: Constify.
14178 (IT_menu_make_room): menu->help_text is now `const char **';
14179 adjust.
14180
14181 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14182 to changes in oldXMenu/XMenu.h from 2011-04-16.
14183 (struct XMenu): Declare `help_text' `const char **'.
14184
14185 * xfaces.c <Qunspecified>: Make extern again.
14186
14187 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 14188 required by POSIX.
1b2de274 14189
762b15be
EZ
14190 * doc.c (get_doc_string): Improve the format passed to `error'.
14191
14192 * doprnt.c (doprnt): Improve commentary.
14193
14194 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14195
14196 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14197 them with etags.
14198
f1052e5d
EZ
14199 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14200 changes in globals.h immediately force recompilation.
762b15be
EZ
14201 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14202 $(CURDIR)/s/ms-w32.h.
14203 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 14204
fa6996bc
EZ
14205 * character.c (Fchar_direction): Function deleted.
14206 (syms_of_character): Don't defsubr it.
14207 <char-direction-table>: Deleted.
14208
e6c3da20
EZ
142092011-04-23 Eli Zaretskii <eliz@gnu.org>
14210
14211 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14212 * doprnt.c: Include limits.h.
14213 (SIZE_MAX): New macro.
04f2d78b
CB
14214 (doprnt): Return a size_t value. 2nd arg is now size_t.
14215 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
14216 Improve overflow protection. Support `l' modifier for integer
14217 conversions. Support %l conversion. Don't assume an EMACS_INT
14218 argument for integer conversions and for %c.
14219
14220 * lisp.h (doprnt): Restore prototype.
14221
14222 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14223 $(SRC)/character.h.
14224
14225 * Makefile.in (base_obj): Add back doprnt.o.
14226
14227 * deps.mk (doprnt.o): Add back prerequisites.
14228 (callint.o): Depend on character.h.
14229
14230 * eval.c (internal_lisp_condition_case): Include the handler
14231 representation in the error message.
14232 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14233 when breaking from the loop.
14234
14235 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14236
14237 * callint.c (Fcall_interactively): When displaying error message
14238 about invalid control letter, pass the character's codepoint, not
14239 a pointer to its multibyte form. Improve display of the character
14240 in octal and display also its hex code.
14241
14242 * character.c (char_string): Use %x to display the (unsigned)
14243 codepoint of an invalid character, to avoid displaying a bogus
14244 negative value.
14245
14246 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14247 `error', not SYMBOL_NAME itself.
14248
14249 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14250 character arguments to `error'.
14251
14252 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14253 to `error' in error message about FINAL_CHAR argument. Make sure
14254 FINAL_CHAR is a character, and use %c when it is passed as
14255 argument to `error'.
14256
4ffd0d6b 142572011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
14258
14259 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14260
14261 * w32.c: Include <time.h>.
14262 (sys_localtime): New function.
14263
4ffd0d6b 142642011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
14265
14266 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14267
4ffd0d6b 14268 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 14269
4ffd0d6b 142702011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 14271
4ffd0d6b
GM
14272 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14273 zombies (Bug#8467).
aac0c6e3 14274
04c56954
EZ
142752011-04-19 Eli Zaretskii <eliz@gnu.org>
14276
14277 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14278 gl_state.e_property when gl_state.object is Qt.
14279
14280 * insdel.c (make_gap_larger): Remove limitation of buffer size
14281 to <= INT_MAX.
14282
16a43933
CY
142832011-04-18 Chong Yidong <cyd@stupidchicken.com>
14284
14285 * xdisp.c (lookup_glyphless_char_display)
14286 (produce_glyphless_glyph): Handle cons cell entry in
14287 glyphless-char-display.
14288 (Vglyphless_char_display): Document it.
14289
14290 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14291 glyphless-char-display.
14292
4581706e
CY
142932011-04-17 Chong Yidong <cyd@stupidchicken.com>
14294
14295 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14296
14297 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14298
14299 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14300 definition for no-X builds.
14301
4887c6e2 143022011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 14303
fd35b6f9
PE
14304 Static checks with GCC 4.6.0 and non-default toolkits.
14305
5c1ccb01
PE
14306 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14307
006c5daa
PE
14308 * process.c (keyboard_bit_set): Define only if SIGIO.
14309 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14310 (send_process): Repair possible setjmp clobbering.
14311
efc736d3
PE
14312 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14313
4e2fe2e6
PE
14314 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14315
f97334a2
PE
14316 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14317
4e75f29d
PE
14318 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14319 Define only if needed.
14320
90efadd1
PE
14321 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14322 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 14323 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 14324
3c647824
PE
14325 * dispextern.h (struct redisplay_interface): Rename param
14326 to avoid shadowing.
e264f262 14327 * termhooks.h (struct terminal): Likewise.
761383f4 14328 * xterm.c (xembed_send_message): Likewise.
3c647824 14329
b58c5c4a
PE
14330 * insdel.c (make_gap_smaller): Define only if
14331 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14332
cad59032
PE
14333 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14334 it.
14335
c339dc2e
PE
14336 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14337 so that we aren't warned about unused symbols.
14338
91a3e27b
PE
14339 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14340
399c71d3 14341 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 14342
8ffc96f5
PE
14343 * xfns.c (x_real_positions): Mark locals as initialized.
14344
eef9bc79
PE
14345 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14346
098db9dd
PE
14347 * xterm.c: Fix problems found by static analysis with other toolkits.
14348 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
14349 (x_dispatch_event): Declare static if USE_GTK, and
14350 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 14351 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 14352 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
14353 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14354 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 14355
eb18f6cc
PE
14356 * xmenu.c (menu_help_callback): Pointer type fixes.
14357 Use const pointers when pointing at readonly data. Avoid pointer
14358 signedness clashes.
14359 (FALSE): Remove unused macro.
14360 (update_frame_menubar): Remove unused decl.
14361
1fe72bf8
PE
14362 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14363
60d9e1db
PE
14364 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14365 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14366 (single_menu_item): Rename local to avoid shadowing.
14367
39261c26
PE
14368 * keyboard.c (make_lispy_event): Remove unused local var.
14369
018c5e19
PE
14370 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14371 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14372
63d2b86e
PE
14373 * bitmaps: Change bitmaps from unsigned char back to the X11
14374 compatible char. Avoid the old compiler warnings about
14375 out-of-range initializers by using, for example, '\xab' rather
14376 than 0xab.
14377
aefd87e1
PE
14378 * xgselect.c (xgselect_initialize): Check vs interface
14379 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14380
bf501fb9
PE
14381 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14382
e9829fdf
PE
14383 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14384 to read-only memory.
14385
1086c095
PE
14386 * fns.c (vector): Remove; this old hack is no longer needed.
14387
2baccd04 14388 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 14389 Remove unused var.
dde42981 14390 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 14391
72391843 14392 * xrdb.c (x_load_resources): Omit unused local.
3565b346 14393
436c16df 14394 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 14395 (x_window): Rename locals to avoid shadowing.
dc5ddd85 14396 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 14397
92bb796d 14398 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 14399 (x_term_init): Remove local to avoid shadowing.
92bb796d 14400
764430a3 14401 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
14402
14403 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14404 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14405
d1dfb56c
EZ
144062011-04-16 Eli Zaretskii <eliz@gnu.org>
14407
c4354cb4
EZ
14408 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14409
d1dfb56c
EZ
14410 Fix regex.c, syntax.c and friends for buffers > 2GB.
14411 * syntax.h (struct gl_state_s): Declare character position members
14412 EMACS_INT.
14413
14414 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14415
04f2d78b
CB
14416 * textprop.c (verify_interval_modification, interval_of):
14417 Declare arguments EMACS_INT.
d1dfb56c
EZ
14418
14419 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14420 EMACS_INT.
14421
14422 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14423
14424 * indent.c (Fvertical_motion): Local variable it_start is now
14425 EMACS_INT.
14426
14427 * regex.c (re_match, re_match_2, re_match_2_internal)
14428 (bcmp_translate, regcomp, regexec, print_double_string)
14429 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14430 (re_compile_pattern, re_exec): Declare arguments and local
14431 variables `size_t' and `ssize_t' and return values `regoff_t', as
14432 appropriate.
14433 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14434 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14435 <compile_stack_type>: `size' and `avail' are now `size_t'.
14436
14437 * regex.h <regoff_t>: Use ssize_t, not int.
14438 (re_search, re_search_2, re_match, re_match_2): Arguments that
14439 specify buffer/string position and length are now ssize_t and
14440 size_t. Return type is regoff_t.
14441
613052cd
BK
144422011-04-16 Ben Key <bkey76@gmail.com>
14443
14444 * nsfont.m: Fixed bugs in ns_get_family and
14445 ns_descriptor_to_entity that were caused by using free to
14446 deallocate memory blocks that were allocated by xmalloc (via
14447 xstrdup). This caused Emacs to crash when compiled with
14448 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14449 --enable-checking=xmallocoverrun). xfree is now used to
14450 deallocate these memory blocks.
14451
4170f62f 144522011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 14453
71b41406
PE
14454 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14455
9587a89d
PE
14456 emacs_write: Accept and return EMACS_INT for sizes.
14457 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14458 et seq.
14459 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14460 Accept and return EMACS_INT.
14461 (emacs_gnutls_write): Return the number of bytes written on
14462 partial writes.
14463 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
14464 (emacs_read, emacs_write): Remove check for negative size, as the
14465 Emacs source code has been audited now.
9587a89d
PE
14466 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14467 (emacs_read, emacs_write): Use it.
273a5f82
PE
14468 * process.c (send_process): Adjust to the new signatures of
14469 emacs_write and emacs_gnutls_write. Do not attempt to store
14470 a byte offset into an 'int'; it might overflow.
9587a89d 14471 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 14472
3e047f51
PE
14473 * sound.c: Don't assume sizes fit in 'int'.
14474 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 14475 Return EMACS_INT, not int.
3e047f51 14476 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
14477 Accept EMACS_INT, not int.
14478 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
14479 record read return values.
14480
cc39a9db
BK
144812011-04-15 Ben Key <bkey76@gmail.com>
14482
c9d0ec6d
JB
14483 * keyboard.c (Qundefined): Don't declare static since it is used
14484 in nsfns.m.
14485 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14486 static since they are used in nsfont.m.
cc39a9db 14487
6c60eb9f
SM
144882011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14489
14490 * process.c (Qprocessp): Don't declare static.
14491 * lisp.h (Qprocessp): Declare again.
14492
7990b61a
JB
144932011-04-15 Juanma Barranquero <lekktu@gmail.com>
14494
14495 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14496
5d4cb038
PE
144972011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14498
8bd7b830 14499 Improve C-level modularity by making more things 'static'.
cd64ea1d 14500
e3b27b31
PE
14501 Don't publish debugger-only interfaces to other modules.
14502 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14503 (verify_bytepos, count_markers): Move decls to the only modules
14504 that need them.
14505 * region-cache.h (pp_cache): Likewise.
14506 * window.h (check_all_windows): Likewise.
14507 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14508
5d4cb038
PE
14509 * sysdep.c (croak): Now static, if
14510 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14511 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
14512
14513 * alloc.c (refill_memory_reserve): Now static if
14514 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14515 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 14516
e87b6180
PE
14517 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14518 Define only if USE_LUCID.
14519
ac64929e
PE
14520 * xrdb.c (x_customization_string, x_rm_string): Now static.
14521
6f37259d
PE
14522 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14523 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14524
1683e3ab
PE
14525 * xdisp.c (draw_row_with_mouse_face): Now static.
14526 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14527
de9c2632
PE
14528 * window.h (check_all_windows): Mark externally visible.
14529
2b96acb7
PE
14530 * window.c (window_deletion_count): Now static.
14531
14532 * undo.c: Make symbols static if they're not exported.
14533 (last_undo_buffer, last_boundary_position, pending_boundary):
14534 Now static.
14535
50436f33
PE
14536 * textprop.c (interval_insert_behind_hooks): Now static.
14537 (interval_insert_in_front_hooks): Likewise.
14538
64520e5c
PE
14539 * term.c: Make symbols static if they're not exported.
14540 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14541 (max_frame_lines, tty_set_terminal_modes):
14542 (tty_reset_terminal_modes, tty_turn_off_highlight):
14543 (get_tty_terminal): Now static.
14544 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14545 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 14546 HAVE_WINDOW_SYSTEM.
64520e5c
PE
14547 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14548 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14549
1fa53021
PE
14550 * sysdep.c: Make symbols static if they're not exported.
14551 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14552 Now static.
14553 (sigprocmask_set, full_mask): Remove; unused.
14554 (wait_debugging): Mark as visible.
14555 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14556 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14557
d4b43b22
PE
14558 * syntax.c (syntax_temp): Define only if !__GNUC__.
14559
b7c513d0
PE
14560 * sound.c (current_sound_device, current_sound): Now static.
14561
989b29ad
PE
14562 * search.c (searchbufs, searchbuf_head): Now static.
14563
13a55a78
PE
14564 * scroll.c (scroll_cost): Remove; unused.
14565 * dispextern.h (scroll_cost): Remove decl.
14566
de68a1fc
PE
14567 * region-cache.h (pp_cache): Mark as externally visible.
14568
40ccffa6
PE
14569 * process.c: Make symbols static if they're not exported.
14570 (process_tick, update_tick, create_process, chan_process):
14571 (Vprocess_alist, proc_buffered_char, datagram_access):
14572 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14573 (deactivate_process): Mark defn as static, as well as decl.
14574 * lisp.h (create_process): Remove decl.
14575 * process.h (chan_process, Vprocess_alist): Remove decls.
14576
ad64fc97
PE
14577 * print.c: Make symbols static if they're not exported.
14578 (print_depth, new_backquote_output, being_printed, print_buffer):
14579 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14580 (print_interval, print_number_index, initial_stderr_stream):
14581 Now static.
14582 * lisp.h (Fprinc): Remove decl.
14583 (debug_output_compilation_hack): Mark as externally visible.
14584
adddb265
PE
14585 * sysdep.c (croak): Move decl from here to syssignal.h.
14586 * syssignal.h (croak): Put it here, so the API can be checked when
14587 'croak' is called from dissociate_if_controlling_tty.
14588
1717ede2
PE
14589 * minibuf.c: Make symbols static if they're not exported.
14590 (minibuf_save_list, choose_minibuf_frame): Now static.
14591 * lisp.h (choose_minibuf_frame): Remove decl.
14592
fa5fb2bc
PE
14593 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14594
1e3890d1
PE
14595 * lread.c: Make symbols static if they're not exported.
14596 (read_objects, initial_obarray, oblookup_last_bucket_number):
14597 Now static.
14598 (make_symbol): Remove; unused.
14599 * lisp.h (initial_obarray, make_symbol): Remove decls.
14600
8a1414fa
PE
14601 * keyboard.c: Make symbols static if they're not exported.
14602 (single_kboard, recent_keys_index, total_keys, recent_keys):
14603 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14604 (this_single_command_key_start, echoing, last_auto_save):
14605 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14606 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14607 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14608 (Vlispy_mouse_stem, double_click_count):
14609 Now static.
14610 (force_auto_save_soon): Define only if SIGDANGER.
14611 (ignore_mouse_drag_p): Now static if
14612 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14613 (print_help): Remove; unused.
14614 (stop_character, last_timer_event): Mark as externally visible.
14615 * keyboard.h (ignore_mouse_drag_p): Declare only if
14616 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14617 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14618 * lisp.h (echoing): Remove decl.
14619 (force_auto_save_soon): Declare only if SIGDANGER.
14620 * xdisp.c (redisplay_window): Simplify code, to make it more
14621 obvious that ignore_mouse_drag_p is not accessed if !defined
14622 USE_GTK && !defined HAVE_NS.
14623
93ea6e8f
PE
14624 * intervals.c: Make symbols static if they're not exported.
14625 (merge_properties_sticky, merge_interval_right, delete_interval):
14626 Now static.
14627 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14628
77382fcc
PE
14629 * insdel.c: Make symbols static if they're not exported.
14630 However, leave prepare_to_modify_buffer alone. It's never
14631 called from outside this function, but that appears to be a bug.
14632 (combine_after_change_list, combine_after_change_buffer):
4889fc82 14633 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
14634 (adjust_after_replace_noundo): Remove; unused.
14635 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 14636 (signal_before_change): Remove decls.
77382fcc 14637
9306c32e
PE
14638 * indent.c (val_compute_motion, val_vmotion): Now static.
14639
cd44d2eb
PE
14640 * image.c: Make symbols static if they're not exported.
14641 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14642 if USE_GTK.
14643 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14644 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14645
ad9a7a06
PE
14646 * fringe.c (standard_bitmaps): Now static.
14647 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14648
81626931
PE
14649 * frame.c: Make symbols static if they're not exported.
14650 (x_report_frame_params, make_terminal_frame): Now static.
14651 (get_frame_param): Now static, unless HAVE_NS.
14652 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14653 (x_get_resource_string): Remove; not used.
14654 * frame.h (make_terminal_frame, x_report_frame_params):
14655 (x_get_resource_string); Remove decls.
14656 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14657 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14658
239f9db9
PE
14659 * font.c, fontset.c: Make symbols static if they're not exported.
14660 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14661 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14662 * font.c (font_close_object): Now static.
14663 * font.h (font_close_object): Remove.
14664 * fontset.c (FONTSET_OBJLIST): Remove.
14665 (free_realized_fontset) #if-0 the body, which does nothing.
14666 (face_suitable_for_char_p): #if-0, as it's never called.
14667 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
14668 * xfaces.c (face_at_string_position):
14669 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
14670 since 0 is always ASCII.
14671
dfcf3579
PE
14672 * fns.c (weak_hash_tables): Now static.
14673
5045092b
PE
14674 * fileio.c: Make symbols static if they're not exported.
14675 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14676 (Vwrite_region_annotation_buffers): Now static.
14677
57a96f5c
PE
14678 * eval.c: Make symbols static if they're not exported.
14679 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14680 * lisp.h (backtrace_list): Remove decl.
14681
35f08c38
PE
14682 * emacs.c: Make symbols static if they're not exported.
14683 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14684 (fatal_error_code, fatal_error_signal_hook, standard_args):
14685 Now static.
14686 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14687 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14688 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14689 * lisp.h (fatal_error_signal_hook): Remove decl.
14690 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14691
f44bd759
PE
14692 * editfns.c: Move a (normally-unused) function to its only use.
14693 * editfns.c, lisp.h (get_operating_system_release): Remove.
14694 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14695 worth the hassle of breaking this out.
14696
b532497d
PE
14697 * xterm.c: Make symbols static if they're not exported.
14698 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14699 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14700 (x_destroy_window, x_delete_display):
14701 Now static.
14702 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14703 (x_mouse_leave): Remove; unused.
14704 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14705 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14706 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14707 Remove decls.
14708 (x_mouse_leave): Declare only if WINDOWSNT.
14709 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14710 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14711 USE_X_TOOLKIT.
14712
1675728f
PE
14713 * ftxfont.c: Make symbols static if they're not exported.
14714 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14715 HAVE_FREETYPE.
14716 * font.h (ftxfont_driver): Likewise.
14717
e4cebfca
PE
14718 * xfns.c: Make symbols static if they're not exported.
14719 (x_last_font_name, x_display_info_for_name):
14720 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14721 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14722 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14723 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14724 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14725 (last_show_tip_args): Now static.
14726 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14727 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14728 (x_screen_planes): Remove; unused.
14729 * dispextern.h (x_screen_planes): Remove decl.
14730
5bf46f05
PE
14731 * dispnew.c: Make symbols static if they're not exported.
14732 * dispextern.h (redraw_garbaged_frames, scrolling):
14733 (increment_row_positions): Remove.
14734 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14735 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14736 Now static.
14737 (redraw_garbaged_frames): Remove; unused.
14738
435f4c28
PE
14739 * xfaces.c: Make symbols static if they're not exported.
14740 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14741 Remove decls.
14742 * xterm.h (defined_color): Remove decls.
14743 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14744 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14745 (menu_face_changed_default, defined_color, free_realized_face):
14746 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14747 (ascii_face_of_lisp_face): Remove; unused.
14748
8524aef3
PE
14749 * xdisp.c: Make symbols static if they're not exported.
14750 * dispextern.h (scratch_glyph_row, window_box_edges):
14751 (glyph_to_pixel_coords, set_cursor_from_row):
14752 (get_next_display_element, set_iterator_to_next):
14753 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14754 (show_mouse_face): Remove decls
14755 * frame.h (message_buf_print): Likewise.
14756 * lisp.h (pop_message, set_message, check_point_in_composition):
14757 Likewise.
14758 * xterm.h (set_vertical_scroll_bar): Likewise.
14759 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14760 (message_buf_print, scratch_glyph_row, displayed_buffer):
14761 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14762 (get_next_display_element, show_mouse_face, window_box_edges):
14763 (frame_to_window_pixel_xy, check_point_in_composition):
14764 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14765 (glyph_to_pixel_coords): Remove; unused.
14766
16390cd2
PE
14767 * dired.c (file_name_completion): Now static.
14768
14769 * dbusbind.c (xd_in_read_queued_messages): Now static.
14770
a25f4dfa
PE
14771 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14772 * data.c (circular_list_error): Remove.
14773
14a9c8df
PE
14774 * commands.h (last_point_position, last_point_position_buffer):
14775 (last_point_position_window): Remove decls.
14776 * keyboard.c: Make these variables static.
14777
04f2d78b
CB
14778 * coding.h (coding, code_convert_region, encode_coding_gap):
14779 Remove decls.
74ab6df5
PE
14780 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14781 (iso_code_class, detect_coding, code_convert_region): Now static.
14782 (encode_coding_gap): Remove; unused.
14783
38dfbee1
PE
14784 * chartab.c (chartab_chars, chartab_bits): Now static.
14785
a2cb4e63
PE
14786 * charset.h (charset_iso_8859_1): Remove decl.
14787 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14788 Now static.
14789
127198fd
PE
14790 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14791 * ccl.c (Vccl_program_table): Now static.
14792 (check_ccl_update): Remove; unused.
14793
d85b608f
PE
14794 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14795 * category.h: ... from here.
14796 * category.c (check_category_table, set_category_set): Now static.
14797
31cd66f3
PE
14798 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14799 * lisp.h: Remove these decls.
14800
c358e587
PE
14801 * buffer.c (buffer_count): Remove unused var.
14802
e78aecca
PE
14803 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14804 so that it's not optimized away.
14805 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14806 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14807 exported only to the debugger.
14808
e192d7d3 14809 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 14810 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 14811
92470028
PE
14812 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14813 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14814 was inaccessible from Lisp.
14815 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14816 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14817
244ed907
PE
14818 alloc.c: Import and export fewer symbols, and remove unused items.
14819 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14820 is defined.
14821 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14822 it's not optimized away by whole-program optimization.
14823 (message_enable_multibyte, free_misc): Remove.
14824 (catchlist, handlerlist, mark_backtrace):
14825 Declare only if BYTE_MARK_STACK.
14826 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14827 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14828 (message_enable_multibyte): Remove decl.
14829 (free_misc, interval_free_list, float_block, float_block_index):
14830 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14831 (cons_free_list, last_marked_index):
14832 Now static.
14833 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14834 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14835 (mark_backtrace): Define only if BYTE_MARK_STACK.
14836 * xdisp.c (message_enable_multibyte): Now static.
14837
61c2b50e 14838 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
14839 This makes it easier for human readers (and static analyzers)
14840 to see whether these variables are used from other modules.
14841 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14842 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14843 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14844 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14845 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14846 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14847 * xmenu.c, xselect.c:
14848 Declare Q* vars static if they are not used in other modules.
14849 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14850 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14851 Remove decls of unexported vars.
14852 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14853
95c82688
PE
14854 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14855
16a97296
PE
14856 Make Emacs functions such as Fatom 'static' by default.
14857 This makes it easier for human readers (and static analyzers)
14858 to see whether these functions can be called from other modules.
14859 DEFUN now defines a static function. To make the function external
14860 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
14861 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14862 (Finit_image_library):
16a97296
PE
14863 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14864 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14865 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14866 Remove decls, since these functions are now static.
14867 (Funintern, Fget_internal_run_time): New decls, since these functions
14868 were already external.
95c82688 14869
16a97296
PE
14870 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14871 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14872 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14873 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14874 * keyboard.c, keymap.c, lread.c:
14875 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14876 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14877 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14878 Mark functions with DEFUE instead of DEFUN,
14879 if they are used in other modules.
14880 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14881 decls for now-static functions.
14882 * buffer.h (Fdelete_overlay): Remove decl.
14883 * callproc.c (Fgetenv_internal): Mark as internal.
14884 * composite.c (Fremove_list_of_text_properties): Remove decl.
14885 (Fcomposition_get_gstring): New forward static decl.
14886 * composite.h (Fcomposite_get_gstring): Remove decl.
14887 * dired.c (Ffile_attributes): New forward static decl.
14888 * doc.c (Fdocumntation_property): New forward static decl.
14889 * eval.c (Ffetch_bytecode): New forward static decl.
14890 (Funintern): Remove extern decl; now in .h file where it belongs.
14891 * fileio.c (Fmake_symbolic_link): New forward static decl.
14892 * image.c (Finit_image_library): New forward static decl.
14893 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14894 * intervals.h (Fprevious_property_change):
14895 (Fremove_list_of_text_properties): Remove decls.
14896 * keyboard.c (Fthis_command_keys): Remove decl.
14897 (Fcommand_execute): New forward static decl.
14898 * keymap.c (Flookup_key): New forward static decl.
14899 (Fcopy_keymap): Now static.
14900 * keymap.h (Flookup_key): Remove decl.
14901 * process.c (Fget_process): New forward static decl.
14902 (Fprocess_datagram_address): Mark as internal.
14903 * syntax.c (Fsyntax_table_p): New forward static decl.
14904 (skip_chars): Remove duplicate decl.
14905 * textprop.c (Fprevious_property_change): New forward static decl.
14906 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14907 Now internal.
14908 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14909 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14910
785bbd42
PE
14911 * editfns.c (Fformat): Remove unreachable code.
14912
8b913b57
AS
149132011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14914
14915 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14916 change. (Bug#8496)
14917
a6744a35
EZ
149182011-04-13 Eli Zaretskii <eliz@gnu.org>
14919
14920 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14921 when at ZV. (Bug#8487)
14922
e7974947
AS
149232011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14924
baad03f0
AS
14925 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14926 (Bug#8437)
14927 * keyboard.c (parse_tool_bar_item): Likewise.
14928 * sound.c (sound_cleanup, alsa_close): Likewise.
14929 * termcap.c (tgetent): Likewise.
14930 * xfns.c (x_default_font_parameter): Likewise.
14931 * xsettings.c (read_and_apply_settings): Likewise.
14932
e7974947
AS
14933 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14934 (overrun_check_free): Protoize.
14935
28272684
PE
149362011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14937
14938 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14939 since callers should never pass a negative size.
14940 Change the signature to match that of plain 'read' and 'write'; see
14941 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14942 * lisp.h: Update prototypes of emacs_write and emacs_read.
14943
11997c76
EZ
149442011-04-11 Eli Zaretskii <eliz@gnu.org>
14945
14946 * xdisp.c (redisplay_window): Don't try to determine the character
14947 position of the scroll margin if the window start point w->startp
e896f03c 14948 is outside the buffer's accessible region. (Bug#8468)
11997c76 14949
8a2cbd72
EZ
149502011-04-10 Eli Zaretskii <eliz@gnu.org>
14951
14952 Fix write-region and its subroutines for buffers > 2GB.
14953 * fileio.c (a_write, e_write): Modify declaration of arguments and
14954 local variables to support buffers larger than 2GB.
14955 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14956
14957 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14958 argument, local variables, and return value.
14959
14960 * lisp.h: Update prototypes of emacs_write and emacs_read.
14961
14962 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14963
4073e537 149642011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 14965
1ebfdcb6
PE
14966 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14967
b2ded58d
PE
14968 Fix more problems found by GCC 4.6.0's static checks.
14969
7d66342c
PE
14970 * xdisp.c (vmessage): Use a better test for character truncation.
14971
bbf47d44
PE
14972 * charset.c (load_charset_map): <, not <=, for optimization,
14973 and to avoid potential problems with integer overflow.
9248994d 14974 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 14975 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 14976 * editfns.c (Fformat): Likewise.
1e69125e 14977 * syntax.c (skip_chars): Likewise.
3befa583 14978
e3019616
PE
14979 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14980 This also lets GCC 4.6.0 generate slightly better loop code.
14981
becfa255
PE
14982 * callint.c (Fcall_interactively): <, not <=, for optimization.
14983 (Fcall_interactively): Count the number of arguments produced,
14984 not the number of arguments given. This is simpler and lets GCC
14985 4.6.0 generate slightly better code.
14986
dae0cd48
PE
14987 * ftfont.c: Distingish more carefully between FcChar8 and char.
14988 The previous code passed unsigned char * to a functions like
14989 strlen and xstrcasecmp that expect char *, which does not
14990 conform to the C standard.
14991 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14992 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14993 char * when the C standard requires it.
14994
76032d70
PE
14995 * keyboard.c (read_char): Remove unused var.
14996
eb3f1cc8
PE
14997 * eval.c: Port to Windows vsnprintf (Bug#8435).
14998 Include <limits.h>.
14999 (SIZE_MAX): Define if the headers do not.
15000 (verror): Do not give up if vsnprintf returns a negative count.
15001 Instead, grow the buffer. This ports to Windows vsnprintf, which
15002 does not conform to C99. Problem reported by Eli Zaretskii.
15003 Also, simplify the allocation scheme, by avoiding the need for
15004 calling realloc, and removing the ALLOCATED variable.
15005
70476b54
PE
15006 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15007
12020a9e
PE
15008 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15009 But keep the doprint source code for now, as we might revamp it
15010 and use it again (Bug#8435).
ea6c7ae6
PE
15011 * lisp.h (doprnt): Remove.
15012 * Makefile.in (base_obj): Remove doprnt.o.
15013 * deps.mk (doprnt.o): Remove.
15014
5fdb398c
PE
15015 error: Print 32- and 64-bit integers portably (Bug#8435).
15016 Without this change, on typical 64-bit hosts error ("...%d...", N)
15017 was used to print both 32- and 64-bit integers N, which relied on
15018 undefined behavior.
61bdb816 15019 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
15020 * lisp.h (error, verror): Mark as printf-like functions.
15021 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15022 Report overflow in size calculations when allocating printf buffer.
15023 Do not truncate output string at its first null byte.
15024 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15025 Truncate the output at a character boundary, since vsnprintf does not
15026 do that.
15027 * charset.c (check_iso_charset_parameter): Convert internal
15028 character to string before calling 'error', since %c now has the
15029 printf meaning.
15030 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15031 overflow when computing char to be passed to 'error'. Do not
15032 pass Lisp_Object to 'error'; pass the integer instead.
15033 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15034 formatted with plain %d.
15035
b189fa66
PE
15036 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15037
bff87ef0
PE
15038 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15039
7e2cac20
PE
15040 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15041
ce4d90b5
PE
15042 * xterm.c (x_catch_errors): Remove duplicate declaration.
15043
266c9547
PE
15044 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15045
79c49ad2
PE
15046 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15047
368f4090
JM
150482011-04-10 Jim Meyering <meyering@redhat.com>
15049
15050 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15051 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15052 return ssize_t not "int", and use size_t as the buffer length.
15053 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15054 * gnutls.h: Update declarations.
15055 * process.c (read_process_output): Use ssize_t, to match.
15056 (send_process): Likewise.
15057
a32d4040
CY
150582011-04-09 Chong Yidong <cyd@stupidchicken.com>
15059
15060 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15061
8546720e 150622011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 15063
04f2d78b
CB
15064 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15065 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 15066
8546720e
GM
15067 * xterm.c (handle_one_xevent):
15068 * xmenu.c (create_and_show_popup_menu):
15069 * xselect.c (x_decline_selection_request)
15070 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 15071
0a2f5c1a 150722011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
15073
15074 Fix some uses of `int' instead of EMACS_INT.
15075 * search.c (string_match_1, fast_string_match)
15076 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15077 (scan_buffer, find_next_newline_no_quit)
15078 (find_before_next_newline, search_command, Freplace_match)
15079 (Fmatch_data): Make some `int' variables be EMACS_INT.
15080
15081 * xdisp.c (display_count_lines): 3rd argument and return value now
15082 EMACS_INT. All callers changed.
15083 (pint2hrstr): Last argument is now EMACS_INT.
15084
15085 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15086 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15087 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15088 (decode_coding_utf_16, decode_coding_emacs_mule)
15089 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15090 (decode_coding_ccl, decode_coding_charset)
15091 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15092 (decode_coding_iso_2022, decode_coding_emacs_mule)
15093 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15094 <char_offset, last_offset>: Declare EMACS_INT.
15095 (encode_coding_utf_8, encode_coding_utf_16)
15096 (encode_coding_emacs_mule, encode_invocation_designation)
15097 (encode_designation_at_bol, encode_coding_iso_2022)
15098 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15099 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15100 Declare EMACS_INT.
15101 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15102 (encode_invocation_designation): Last argument P_NCHARS is now
15103 EMACS_INT.
15104 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15105 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15106
15107 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15108 All users changed.
15109
15110 * ccl.c (Fccl_execute_on_string): Declare some variables
15111 EMACS_INT.
15112
8546720e 151132011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
15114
15115 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15116
4e19a977
CS
151172011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15118
15119 * process.c (Fformat_network_address): Doc fix.
15120
87302331
R
151212011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15122
ee7683eb 15123 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 15124
cbb59342
CY
151252011-04-08 Chong Yidong <cyd@stupidchicken.com>
15126
15127 * keyboard.c (read_char): Call Lisp function help-form-show,
15128 instead of using internal_with_output_to_temp_buffer.
15129 (Qhelp_form_show): New var.
e0d38eeb 15130 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
15131
15132 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15133
15134 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15135
e67a13ab
CY
151362011-04-06 Chong Yidong <cyd@stupidchicken.com>
15137
04f2d78b
CB
15138 * process.c (Flist_processes): Remove to Lisp.
15139 (list_processes_1): Delete.
e67a13ab 15140
973f782d
EZ
151412011-04-06 Eli Zaretskii <eliz@gnu.org>
15142
7c106b1e
EZ
15143 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15144
973f782d
EZ
15145 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15146
41cf7d1a 151472011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 15148
ca23cc88
PE
15149 Fix more problems found by GCC 4.6.0's static checks.
15150
f390e2d5
PE
15151 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15152
42eea0d0
PE
15153 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15154
b69769da 15155 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 15156
f9541e84
PE
15157 * xdisp.c (vmessage): Mark as a printf-like function.
15158
13841b55
PE
15159 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15160
c136c10f
PE
15161 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15162
5e2d4a30
PE
15163 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15164 printf-like functions.
15165 (tiff_load): Add casts to remove these marks before passing them
15166 to system-supplied API.
15167
583f48b9
PE
15168 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15169
b25d760e
PE
15170 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15171 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
15172 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15173 directly, rather than having caller test rule sign. This avoids
15174 some unnecessary tests.
15175 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15176 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15177 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 15178
bc7b6697 15179 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 15180 (xfont_open): Avoid unnecessary tests.
bc7b6697 15181
27ccc379
PE
15182 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15183
dcd5c89a
PE
15184 * composite.h, composite.c (composition_gstring_put_cache):
15185 Use EMACS_INT, not int, for length.
15186
b13a45c6
PE
15187 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15188 breaking out part of COMPOSITION_DECODE_RULE.
15189 (COMPOSITION_DECODE_RULE): Use it.
15190 * composite.c (get_composition_id): Remove unused local vars,
15191 by using the new macro.
15192
1e792e4d
PE
15193 * textprop.c (set_text_properties_1): Change while to do-while,
15194 since the condition is always true at first.
15195
dc6c6455 15196 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
15197 (interval_deletion_adjustment): Return unsigned value.
15198 All uses changed.
dc6c6455 15199
aba7731a
PE
15200 * process.c (list_processes_1, create_pty, read_process_output):
15201 (exec_sentinel): Remove vars that were set but not used.
afd4052b 15202 (create_pty): Remove unnecessary "volatile"s.
bc57d757 15203 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 15204 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 15205 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 15206
fdfc4bf3
PE
15207 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15208
fca8fe46 15209 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 15210 (update_syntax_table): Use unsigned instead of int.
fca8fe46 15211
06a0259a 15212 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 15213 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 15214 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 15215
e7b9e80f
PE
15216 * print.c (print_error_message): Avoid int overflow.
15217
56201685
PE
15218 * font.c (font_list_entities): Redo for clarity,
15219 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15220
78834453 15221 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 15222 (font_score): Avoid potential overflow in diff calculation.
78834453 15223
0bc0b309 15224 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 15225 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 15226
e610eaca
PE
15227 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15228
b895abce
PE
15229 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15230 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15231 can always succeed if overflow has undefined behavior.
15232
1f1d9321 15233 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 15234 (wordify): Omit three unnecessary tests.
1f1d9321 15235
c59478bc
PE
15236 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15237 All callers changed. This avoids the need for an unused var.
15238
79b73827
PE
15239 * casefiddle.c (casify_region): Remove var that is set but not used.
15240
a4db5dfe
PE
15241 * dired.c (file_name_completion): Remove var that is set but not used.
15242
43aae36e
PE
15243 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15244
2a47c44d 15245 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 15246 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 15247
a37c69bf
PE
15248 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15249 Check for integer overflow on size calculations.
15250
328ab8e7
PE
15251 * buffer.c (Fprevious_overlay_change): Remove var that is set
15252 but not used.
15253
e5a2a5cb
PE
15254 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15255 Remove vars that are set but not used.
8d84a6eb 15256 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 15257 (timer_check_2): Mark vars as initialized.
e5a2a5cb 15258
a60e5f68
PE
15259 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15260
f661cb61 15261 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 15262 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 15263
f0397f5a
PE
15264 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15265 that are set but not used.
15266
8664db06 15267 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 15268 if XCreateBitmapFromData fails (Bug#8410).
8664db06 15269
6abdaa4a
PE
15270 * xselect.c (x_get_local_selection, x_handle_property_notify):
15271 Remove vars that are set but not used.
15272
0ce7538d 15273 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 15274 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 15275
9ae848fc
PE
15276 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15277 Remove var that is set but not used.
0b918413
PE
15278 (scroll_bar_windows_size): Now size_t, not int.
15279 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15280 Check for overflow.
9ae848fc 15281
a5a62657
PE
15282 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15283 (map_tty_color) [!defined MSDOS]: Likewise.
15284
5c5cdd39
PE
15285 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15286
66ebf983
PE
15287 * coding.c: Remove vars that are set but not used.
15288 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15289 All callers changed.
15290 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15291 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15292 (decode_coding_charset): Remove vars that are set but not used.
15293
1be4d761
PE
15294 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15295 that is set but not used.
15296
47553fa8
PE
15297 * print.c (print_object): Remove var that is set but not used.
15298
1f7196bf 15299 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
15300 The gnulib version avoids calling malloc in the usual case,
15301 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15302 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15303 * filelock.c (current_lock_owner): Likewise.
15304 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15305 * sysdep.c: Include allocator.h, careadlinkat.h.
15306 (emacs_no_realloc_allocator): New static constant.
15307 (emacs_readlink): New function.
fdb61804
PE
15308 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15309 ../lib/careadlinkat.h.
d1fdcab7 15310
f84c17c7
SM
153112011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15312
15313 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15314 first non-nil return value).
15315
ef3862ad
JD
153162011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15317
15318 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15319 if not defined (Bug#8403).
15320
376a7006
JB
153212011-04-02 Juanma Barranquero <lekktu@gmail.com>
15322
15323 * xdisp.c (display_count_lines): Remove parameter `start',
15324 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15325 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15326 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15327 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15328 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15329 and thereabouts. All callers changed.
15330 (get_per_char_metric): Remove parameter `f', unused since
15331 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15332
6ca3801d
JM
153332011-04-02 Jim Meyering <meyering@redhat.com>
15334
15335 do not dereference NULL upon failed strdup
15336 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15337 (ns_get_family): Likewise.
15338
d8e2b5ba
JB
153392011-04-02 Juanma Barranquero <lekktu@gmail.com>
15340
15341 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15342
8c74fcbd
JD
153432011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15344
15345 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15346 later (Bug#8403).
15347
7200d79c
SM
153482011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15349
03408648 15350 Add lexical binding.
7200d79c 15351
03408648
SM
15352 * window.c (Ftemp_output_buffer_show): New fun.
15353 (Fsave_window_excursion):
15354 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15355
15356 * lread.c (lisp_file_lexically_bound_p): New function.
15357 (Fload): Bind Qlexical_binding.
15358 (readevalloop): Remove `evalfun' arg.
15359 Bind Qinternal_interpreter_environment.
15360 (Feval_buffer): Bind Qlexical_binding.
15361 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15362 Mark as dynamic.
15363 (syms_of_lread): Declare `lexical-binding'.
15364
15365 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15366
15367 * keyboard.c (eval_dyn): New fun.
15368 (menu_item_eval_property): Use it.
ca105506
SM
15369
15370 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 15371
03408648
SM
15372 * fns.c (concat, mapcar1): Accept byte-code-functions.
15373
15374 * eval.c (Fsetq): Handle lexical vars.
15375 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15376 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15377 (FletX, Flet): Obey lexical binding.
15378 (Fcommandp): Handle closures.
15379 (Feval): New `lexical' arg.
15380 (eval_sub): New function extracted from Feval. Use it almost
15381 everywhere where Feval was used. Look up vars in lexical env.
15382 Handle closures.
15383 (Ffunctionp): Move from subr.el.
15384 (Ffuncall): Handle closures.
15385 (apply_lambda): Remove `eval_flags'.
15386 (funcall_lambda): Handle closures and new byte-code-functions.
15387 (Fspecial_variable_p): New function.
15388 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15389 but without exporting it to Lisp.
23aba0ea 15390
23aba0ea 15391 * doc.c (Fdocumentation, store_function_docstring):
03408648 15392 * data.c (Finteractive_form): Handle closures.
23aba0ea 15393
03408648
SM
15394 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15395 interactive spec.
ba83908c 15396
04f2d78b
CB
15397 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15398 New byte-codes.
03408648
SM
15399 (exec_byte_code): New function extracted from Fbyte_code to handle new
15400 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 15401
03408648 15402 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 15403
03408648 15404 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 15405
e2abce01
JB
154062011-03-31 Juanma Barranquero <lekktu@gmail.com>
15407
15408 * xdisp.c (redisplay_internal): Fix prototype.
15409
63696a73 154102011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 15411
63696a73 15412 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
15413 (try_scrolling): Use it when setting scroll_limit.
15414 Limit scrolling to 100 screen lines.
63696a73
EZ
15415 (redisplay_window): Even when falling back on "recentering",
15416 position point in the window according to scroll-conservatively,
15417 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15418
15419 (try_scrolling): When point is above the window, allow searching
15420 as far as scroll_max, or one screenful, to compute vertical
15421 distance from PT to the scroll margin position. This prevents
15422 try_scrolling from unnecessarily failing when
15423 scroll-conservatively is set to a value slightly larger than the
15424 window height. Clean up the case of PT below the margin at bottom
15425 of window: scroll_max can no longer be INT_MAX. When aggressive
15426 scrolling is in use, don't let point enter the opposite scroll
15427 margin as result of the scroll.
15428 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
15429 threshold of 100 lines for never-recentering scrolling.
15430
e4cc2dfc
JB
154312011-03-31 Juanma Barranquero <lekktu@gmail.com>
15432
15433 * dispextern.h (move_it_by_lines):
15434 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15435 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15436 (message_log_check_duplicate): Remove parameters `prev_bol' and
15437 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15438 (redisplay_internal): Remove parameter `preserve_echo_area',
15439 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15440
15441 * indent.c (Fvertical_motion):
15442 * window.c (window_scroll_pixel_based, Frecenter):
15443 Don't pass `need_y_p' to `move_it_by_lines'.
15444
1c470562
SM
154452011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15446
44f230aa
SM
15447 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15448 steal a few bits to be more compact.
15449 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15450 Remove unneeded casts.
15451
1c470562
SM
15452 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15453
888adce9
ZK
154542011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15455
15456 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15457 binding" message (bug#7967).
15458
f838ed7b
PE
154592011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15460
77861b95
PE
15461 Fix more problems found by GCC 4.6.0's static checks.
15462
de6dbc14
PE
15463 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15464 Remove unused local var.
15465
f838ed7b
PE
15466 * editfns.c (Fmessage_box): Remove unused local var.
15467
792c7b2b
PE
15468 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15469 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15470 Omit unused local vars.
c499e557 15471 * window.c (shrink_windows): Omit unused local var.
b01a1c29 15472 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
15473 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15474 Omit unused local var.
15475
ba0165e1
PE
15476 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15477 Don't assume string length fits in int.
32ad8845 15478 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 15479 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 15480
3c59b4c9
PE
15481 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15482 instead of alloca (Bug#8344).
15483
a3eed478 15484 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 15485 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 15486
eb4d412d
PE
15487 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15488
1658b401
PE
15489 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15490 concerns.
15491
15492 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15493
15494 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 15495
9a2c6e05
PE
15496 * keyboard.c (syms_of_keyboard): Use the same style as later
15497 in this function when indexing through an array. This also
15498 works around GCC bug 48267.
15499
03d0a109
PE
15500 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15501
44f730c8
PE
15502 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15503
fe75f926
PE
15504 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15505 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15506
ffa8c828
PE
15507 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15508 This avoids undefined behavior on integer overflow, and is a bit
15509 more convenient anyway since it is compared to a size_t variable.
15510
c5101a77
PE
15511 Variadic C functions now count arguments with size_t, not int.
15512 This avoids an unnecessary limitation on 64-bit machines, which
15513 caused (substring ...) to crash on large vectors (Bug#8344).
15514 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15515 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 15516 All variadic functions and their callers changed accordingly.
c5101a77
PE
15517 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15518 * data.c (arith_driver, float_arith_driver): Likewise.
15519 * editfns.c (general_insert_function): Likewise.
15520 * eval.c (struct backtrace.nargs, interactive_p)
15521 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15522 (funcall_lambda, mark_backtrace): Likewise.
15523 * fns.c (concat): Likewise.
15524 * frame.c (x_set_frame_parameters): Likewise.
15525 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15526 0 if not found, not -1. All callers changed.
15527
dd3f25f7
PE
15528 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15529 (stack_copy_size): Now size_t, not int.
15530 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15531
461c2ab9
JB
155322011-03-28 Juanma Barranquero <lekktu@gmail.com>
15533
15534 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15535 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15536 All callers changed.
15537
15538 * lisp.h (multibyte_char_to_unibyte):
15539 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15540 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15541 * character.h (CHAR_TO_BYTE8):
15542 * cmds.c (internal_self_insert):
15543 * editfns.c (general_insert_function):
15544 * keymap.c (push_key_description):
15545 * search.c (Freplace_match):
15546 * xdisp.c (message_dolog, set_message_1): All callers changed.
15547
f6d62986
SM
155482011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15549
15550 * keyboard.c (safe_run_hook_funcall): New function.
15551 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15552 don't set the hook to nil, but remove the offending function instead.
15553 (Qcommand_hook_internal): Remove, unused.
15554 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15555 Vcommand_hook_internal.
15556
15557 * eval.c (enum run_hooks_condition): Remove.
15558 (funcall_nil, funcall_not): New functions.
15559 (run_hook_with_args): Call each function through a `funcall' argument.
15560 Remove `cond' argument, now redundant.
15561 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15562 (Frun_hook_with_args_until_failure): Adjust accordingly.
15563 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15564
1db5b1ad
JB
155652011-03-28 Juanma Barranquero <lekktu@gmail.com>
15566
15567 * dispextern.h (string_buffer_position): Remove declaration.
15568
15569 * print.c (strout): Remove parameter `multibyte', unused since
15570 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15571
15572 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15573 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15574 All callers changed.
15575
15576 * w32.c (_wsa_errlist): Use braces for struct initializers.
15577
15578 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15579 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15580 All callers changed.
15581 (string_buffer_position): Likewise. Also, make static (it's never
15582 used outside xdisp.c).
15583 (cursor_row_p): Remove parameter `w', unused since
15584 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15585 (decode_mode_spec): Remove parameter `precision', introduced during
15586 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15587 All callers changed.
15588
5ffb62aa
JD
155892011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15590
15591 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15592
461c2ab9 155932011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
15594
15595 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15596 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15597 (ns_update_auto_hide_menu_bar): New functions.
15598 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15599 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15600 ns_constrain_all_frames.
15601 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15602 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15603
5c380ffb
JD
156042011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15605
15606 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15607
9af30bdf
GM
156082011-03-27 Glenn Morris <rgm@gnu.org>
15609
15610 * syssignal.h: Replace RETSIGTYPE with void.
15611 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15612 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15613 Replace SIGTYPE with void everywhere.
15614 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15615 * s/template.h (SIGTYPE): Remove commented out definition.
15616
e2abce01
JB
156172011-03-26 Eli Zaretskii <eliz@gnu.org>
15618
15619 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15620 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15621
f868cd8a
JB
156222011-03-26 Juanma Barranquero <lekktu@gmail.com>
15623
59eb0929
JB
15624 * w32.c (read_unc_volume): Use parameter `henum', instead of
15625 global variable `wget_enum_handle'.
15626
15627 * keymap.c (describe_vector): Remove parameters `indices' and
15628 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15629 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15630
f868cd8a
JB
15631 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15632
15633 * keyboard.c (timer_check): Remove parameter `do_it_now',
15634 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15635 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15636 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15637
15638 * keyboard.c (read_char):
15639 * w32menu.c (w32_menu_display_help):
15640 * xmenu.c (show_help_event, menu_help_callback):
15641 Adjust calls to `show_help_echo'.
15642
15643 * gtkutil.c (xg_maybe_add_timer):
15644 * keyboard.c (readable_events):
15645 * process.c (wait_reading_process_output):
15646 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15647
15648 * insdel.c (adjust_markers_gap_motion):
15649 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15650 (gap_left, gap_right): Don't call it.
15651
2ecf6fdb
CY
156522011-03-25 Chong Yidong <cyd@stupidchicken.com>
15653
15654 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15655 incurred during fontification.
15656
6b1f9ba4
JB
156572011-03-25 Juanma Barranquero <lekktu@gmail.com>
15658
15659 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15660 (DEFVAR_PER_BUFFER): Don't pass it.
15661
15662 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15663 (scrolling_window): Don't pass it.
15664
0f4a96b5
JB
156652011-03-25 Juanma Barranquero <lekktu@gmail.com>
15666
15667 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15668
15669 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15670 and `suffix'.
15671 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15672 of variables specific to SELinux and computation of `encoded_absname'.
15673
15674 * image.c (XPutPixel): Remove unused variable `height'.
15675
15676 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15677
15678 * unexw32.c (get_section_info): Remove unused variable `section'.
15679
15680 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15681 (system_process_attributes): Remove unused variable `sess'.
15682 (sys_read): Remove unused variable `err'.
15683
15684 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15685 (w32_wnd_proc): Remove unused variable `isdead'.
15686 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15687 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15688 (x_create_tip_frame): Remove unused variable `tem'.
15689
15690 * w32inevt.c (w32_console_read_socket):
15691 Remove unused variable `no_events'.
15692
15693 * w32term.c (x_draw_composite_glyph_string_foreground):
15694 Remove unused variable `width'.
15695
1149507c
JB
156962011-03-24 Juanma Barranquero <lekktu@gmail.com>
15697
15698 * w32term.c (x_set_glyph_string_clipping):
15699 Don't pass uninitialized region to CombineRgn.
15700
9c88f339
JB
157012011-03-23 Juanma Barranquero <lekktu@gmail.com>
15702
15703 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15704 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15705 (Fx_close_connection): Remove unused variable `i'.
15706
15707 * w32font.c (w32font_draw): Return number of glyphs.
15708 (w32font_open_internal): Remove unused variable `i'.
15709 (w32font_driver): Add missing initializer.
15710
15711 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15712 (fill_in_menu): Remove unused variable `items_added'.
15713
15714 * w32term.c (last_mouse_press_frame): Remove static global variable.
15715 (w32_clip_to_row): Remove unused variable `f'.
15716 (x_delete_terminal): Remove unused variable `i'.
15717
15718 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15719 (NOTHING): Remove unused static global variable.
15720 (uniscribe_check_otf): Remove unused variable `table'.
15721 (uniscribe_font_driver): Add missing initializers.
15722
dee091a3
JD
157232011-03-23 Julien Danjou <julien@danjou.info>
15724
15725 * term.c (Fsuspend_tty, Fresume_tty):
15726 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15727 * window.c (temp_output_buffer_show):
15728 * insdel.c (signal_before_change):
15729 * frame.c (Fhandle_switch_frame):
15730 * fileio.c (Fdo_auto_save):
15731 * emacs.c (Fkill_emacs):
15732 * editfns.c (save_excursion_restore):
15733 * cmds.c (internal_self_insert):
15734 * callint.c (Fcall_interactively):
15735 * buffer.c (Fkill_all_local_variables):
15736 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15737 Use Frun_hooks.
0f4a96b5 15738 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 15739 unconditionally since it does the check itself.
dee091a3 15740
2c520ab5 157412011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 15742
c9c49752
PE
15743 Fix more problems found by GCC 4.5.2's static checks.
15744
8abc3f12
PE
15745 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15746 the first time through the loop, since we know p0 < p1 then.
15747 This also avoids a gcc -Wstrict-overflow warning.
15748
a2d26660
PE
15749 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15750 leading to a memory leak, possible in functions like
15751 load_charset_map_from_file that can allocate an unbounded number
b12ef411 15752 of objects (Bug#8318).
a2d26660 15753
916c72e9
PE
15754 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15755 that could (at least in theory) be that large.
15756
19ab8a18
PE
15757 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15758 This is less likely to overflow, and avoids undefined behavior if
15759 overflow does occur. All callers changed. Use strtoul to scan
15760 for the unsigned long integer.
b7cbbd6f
PE
15761 (pint2hrstr): Simplify and tune code slightly.
15762 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 15763
f0641eff
PE
15764 * scroll.c (do_scrolling): Work around GCC bug 48228.
15765 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15766
7f650bb9
PE
15767 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15768 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
15769 (validate_x_resource_name): Simplify count usage.
15770 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 15771
37dd57d1
PE
15772 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15773 fail (Bug#8306).
81e56e61 15774
699979fc 15775 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 15776
401bf9b4
PE
15777 * process.c (Fmake_network_process): Use socklen_t, not int,
15778 where POSIX says socklen_t is required in portable programs.
15779 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 15780 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
15781 (Fmake_network_process, server_accept_connection):
15782 (wait_reading_process_output, read_process_output):
15783 Likewise.
15784
b93aacde
PE
15785 * process.c: Rename or move locals to avoid shadowing.
15786 (list_processes_1, Fmake_network_process):
15787 (read_process_output_error_handler, exec_sentinel_error_handler):
15788 Rename or move locals.
4dc343ee 15789 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 15790 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 15791 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 15792 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 15793 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 15794
af8a867c 15795 Make tparam.h and terminfo.c consistent.
44f230aa
SM
15796 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15797 Include tparam.h instead, since it declares them.
af8a867c
PE
15798 * cm.h (PC): Remove extern decl; tparam.h now does this.
15799 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15800 * terminfo.c: Include tparam.h, to check interfaces.
15801 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15802 (tparam): Adjust signature to match interface in tparam.h;
15803 this removes some undefined behavior. Check that outstring and len
15804 are zero, which they always are with Emacs.
15805 * tparam.h (PC, BC, UP): New extern decls.
15806
0248044d 15807 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 15808 (xftfont_open): Rename locals to avoid shadowing.
0248044d 15809
8ff096c1 15810 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
15811 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15812 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 15813 (ftfont_list): Remove unused local.
49eaafba
PE
15814 (get_adstyle_property, ftfont_pattern_entity):
15815 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15816 Rename locals to avoid shadowing.
8ff096c1 15817
e2be39f6
PE
15818 * xfont.c (xfont_list_family): Mark var as initialized.
15819
c9735e30
PE
15820 * xml.c (make_dom): Now static.
15821
8f5201ae
PE
15822 * composite.c (composition_compute_stop_pos): Rename local to
15823 avoid shadowing.
b246f932
PE
15824 (composition_reseat_it): Remove unused locals.
15825 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 15826 (composition_update_it): Mark var as initialized.
11b61122
PE
15827 (find_automatic_composition): Mark vars as initialized,
15828 with a FIXME (Bug#8290).
8f5201ae 15829
760fbc2c
PE
15830 character.h: Rename locals to avoid shadowing.
15831 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15832 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15833 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15834 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15835 to avoid shadowing.
15836
ff08eb85
PE
15837 * textprop.c (property_change_between_p): Remove; unused.
15838
fc7bf025
PE
15839 * intervals.c (interval_start_pos): Now static.
15840
235d7abc
PE
15841 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15842
44f230aa
SM
15843 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15844 Rename locals to avoid shadowing.
3e7d6594 15845
50060332
PE
15846 * sound.c (wav_play, au_play, Fplay_sound_internal):
15847 Fix pointer signedness.
d01f234b 15848 (alsa_choose_format): Remove unused local var.
c83b8872
PE
15849 (wav_play): Initialize a variable to 0, to prevent undefined
15850 behavior (Bug#8278).
50060332 15851
c4fc4e30
PE
15852 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15853
918436ed
PE
15854 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15855
c939f91b
PE
15856 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15857 clobbering (Bug#8298).
b9c7f648
PE
15858 * sysdep.c (sys_subshell): Likewise.
15859 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 15860
6bd8c144
PE
15861 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15862 This should get cleaned up, so that child_setup has the
15863 same signature on all platforms.
15864
7710357c 15865 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 15866 (relocate_fd): Rename locals to avoid shadowing.
7710357c 15867
c59da222
CY
158682011-03-22 Chong Yidong <cyd@stupidchicken.com>
15869
15870 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15871 not to be necessary, and produces flickering.
15872
66b87493
GM
158732011-03-20 Glenn Morris <rgm@gnu.org>
15874
15875 * config.in: Remove file.
15876
45b6f6d5
JB
158772011-03-20 Juanma Barranquero <lekktu@gmail.com>
15878
15879 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15880 are now in src/globals.h.
15881 (syms_of_minibuf): Remove spurious & from previous change.
15882
cd394be1 158832011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
15884
15885 * minibuf.c (completing-read-function): New variable.
15886 (completing-read-default): Rename from completing-read.
15887 (completing-read): Call completing-read-function.
15888
b14e3e21
CY
158892011-03-19 Juanma Barranquero <lekktu@gmail.com>
15890
15891 * xfaces.c (Fx_load_color_file):
15892 Read color file from absolute filename (bug#8250).
15893
f2b726e6
JB
158942011-03-19 Juanma Barranquero <lekktu@gmail.com>
15895
15896 * makefile.w32-in: Update dependencies.
15897
09f6ff02
EZ
158982011-03-17 Eli Zaretskii <eliz@gnu.org>
15899
15900 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15901
29a6015a
PE
159022011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15903
a3a6c54e
PE
15904 Fix more problems found by GCC 4.5.2's static checks.
15905
b766f867
PE
15906 * process.c (make_serial_process_unwind, send_process_trap):
15907 (sigchld_handler): Now static.
15908
be02381c
PE
15909 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15910 That way, the code declares only the vars that it needs.
15911 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15912 * s/cygwin.h (PTY_ITERATION): Likewise.
15913 * s/darwin.h (PTY_ITERATION): Likewise.
15914 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15915
57048744
PE
15916 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15917 * process.c (allocate_pty): Don't declare stb unless it's needed.
15918
7914961c 15919 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
15920 (CONSTANTLIM): Remove; unused.
15921 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15922 Define only if needed.
7914961c 15923
b3967b18
PE
15924 * unexelf.c (unexec): Name an expression,
15925 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
15926 Use a different way to cause a compilation error if anyone uses
15927 n rather than nn, a way that does not involve shadowing.
73366a00 15928 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 15929
29a6015a
PE
15930 * deps.mk (unexalpha.o): Remove; unused.
15931
43cfc33e 15932 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 15933 * unexec.h: New file.
ce701a33
PE
15934 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15935 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15936 Depend on unexec.h.
15937 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15938 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15939 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 15940 Change as necessary to match prototype in unexec.h.
ce701a33 15941
01f44d5a
PE
15942 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15943 shadowing.
4f63c6bb 15944 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 15945
a6670b0b
PE
15946 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15947 Rename locals to avoid shadowing.
15948
cef2010d 15949 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 15950 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 15951
d4d7173a
PE
15952 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15953
f08b802a
PE
15954 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15955 warning when compiling print.c.
15956
3ddb0639
PE
15957 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15958 instead of using an uninitialized var.
5ad03b97 15959 (font_sort_entities): Mark var as initialized.
3ddb0639 15960
170a2692
PE
15961 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15962
e663c700
PE
15963 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15964 pointers to constants.
89bc529a 15965 (font_parse_fcname): Remove unused vars.
7b81e2d0 15966 (font_delete_unmatched): Now static.
ea838e10 15967 (font_get_spec): Remove; unused.
13a547c6
PE
15968 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15969 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15970 Rename or move locals to avoid shadowing.
e663c700 15971
2a80c887 15972 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 15973 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 15974
1384fa33 15975 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 15976 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 15977
8b2c52e9
PE
15978 * alloc.c (mark_backtrace): Move decl from here ...
15979 * lisp.h: ... to here, so that it can be checked.
15980
475545b5 15981 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 15982 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
15983 (lisp_indirect_variable): Name an expression,
15984 to avoid gcc -Wbad-function-cast warning.
1faed8ae 15985 (Fdefvar): Rename locals to avoid shadowing.
475545b5 15986
b1349114 15987 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 15988 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 15989 Use const pointer when appropriate.
b1349114 15990
a2928364
PE
15991 * lisp.h (get_system_name, get_operating_system_release):
15992 Move decls here, to check interfaces.
15993 * process.c (get_operating_system_release): Move decl to lisp.h.
15994 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
15995 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15996 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15997 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
15998 (Fformat_time_string, Fencode_time, Finsert_char):
15999 (Ftranslate_region_internal, Fformat):
16000 Rename or remove local vars to avoid shadowing.
9710023e 16001 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 16002
a415e694
PE
16003 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16004 avoid shadowing.
16005
8ef4622d
PE
16006 * lisp.h (eassert): Check that the argument compiles, even if
16007 ENABLE_CHECKING is not defined.
16008
946f9a5b
PE
16009 * data.c (Findirect_variable): Name an expression, to avoid
16010 gcc -Wbad-function-cast warning.
112396d6 16011 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 16012 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
16013 (Fmake_variable_buffer_local, Fmake_local_variable):
16014 Mark variables as initialized.
52746918 16015 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 16016
e5aab7e7 16017 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
16018 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16019 Rename locals to avoid shadowing.
dff45157
PE
16020 (mark_stack): Move local variables into the #ifdef region where
16021 they're used.
7bc26fdb
PE
16022 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16023 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16024 needed otherwise.
16025 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16026 (GC_STRING_CHARS): Remove; not used.
d40d4be1 16027 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 16028
e5aab7e7
PE
16029 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16030 avoids undefined behavior in theory.
16031
4da60324
PE
16032 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16033
88043301
PE
16034 Use functions, not macros, for up- and down-casing (Bug#8254).
16035 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16036 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16037 to use the following functions instead of these macros.
16038 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16039 EMACS_INT, since callers assume the returned value fits in int.
16040 (upcase1): Likewise, for UPCASE_TABLE.
16041 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 16042 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 16043 the race-condition problem in the old DOWNCASE.
88043301 16044
19ed5445
PE
16045 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16046 Rename locals to avoid shadowing.
16047 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
16048 (regex_compile, re_search_2, re_match_2_internal):
16049 Remove unused local vars.
952db0d7
PE
16050 (FREE_VAR): Rewrite so as not to use empty "else",
16051 which gcc can warn about.
da053e48 16052 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
16053 (RETALLOC_IF): Define only if needed.
16054 (WORDCHAR_P): Likewise. This one is never needed, but is used
16055 only in a comment talking about a compiler bug, so put inside
16056 the #if 0 of that comment.
16057 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16058 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16059 Remove; unused.
19ed5445 16060
1f3561e4 16061 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
16062 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16063 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 16064
ded6f8f7
PE
16065 * search.c (simple_search): Remove unused var.
16066
dbd37a95
PE
16067 * dired.c (compile_pattern): Move decl from here ...
16068 * lisp.h: ... to here, so that it can be checked.
16069 (struct re_registers): New forward decl.
16070
7e47afad
PE
16071 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16072
85f24f61
PE
16073 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16074 All uses changed.
16075 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16076 Rename locals to avoid shadowing.
5671df8f 16077 (Fvertical_motion): Mark locals as initialized.
85f24f61 16078
181aa2be 16079 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 16080 (casify_region): Mark local as initialized.
181aa2be 16081
930d429c
PE
16082 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16083
7082eac6
PE
16084 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16085 New macros, so that the caller can use some names other than
16086 gcpro1, gcpro2, etc.
16087 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16088 of the new macros.
16089 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16090 argument, for consistency with GCPRO2_VAR, etc: it is now the
16091 prefix of the variable, not the variable itself. All uses
16092 changed.
38b2c076
PE
16093 * dired.c (directory_files_internal, file_name_completion):
16094 Rename locals to avoid shadowing.
16095
15206ed9
PE
16096 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16097 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16098 dired.c's scmp function, had undefined behavior.
16099 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16100 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16101 * buffer.h: ... to here, because these macros use current_buffer,
16102 and the new implementation with inline functions needs to have
16103 current_buffer in scope now, rather than later when the macros
16104 are used.
16105 (downcase, upcase1): New static inline functions.
16106 (DOWNCASE, UPCASE1): Reimplement using these functions.
16107 This avoids undefined behavior in expressions like
16108 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16109 from race conditions in accessing the global variables
16110 case_temp1 and case_temp2.
16111 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16112 * lisp.h (case_temp1, case_temp2): Remove their decls.
16113 * character.h (ASCII_CHAR_P): Move from here ...
16114 * lisp.h: ... to here, so that the inline functions mentioned
16115 above can use them.
16116
4a6bea26
PE
16117 * dired.c (directory_files_internal_unwind): Now static.
16118
f14b7e14
PE
16119 * fileio.c (file_name_as_directory, directory_file_name):
16120 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16121 Now static.
2893f146
PE
16122 (file_name_as_directory): Use const pointers when appropriate.
16123 (Fexpand_file_name): Likewise. In particular, newdir might
16124 point at constant storage, so make it a const pointer.
fd4ead52 16125 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
16126 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16127 signedness issues.
f839df0c
PE
16128 (Fset_file_times, Finsert_file_contents, auto_save_error):
16129 Rename locals to avoid shadowing.
f14b7e14 16130
5716756e 16131 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
16132 (Ftry_completion, Fall_completions): Rename or remove locals
16133 to avoid shadowing.
5716756e 16134
b4c3046a
PE
16135 * marker.c (bytepos_to_charpos): Remove; unused.
16136
b45db522
PE
16137 * lisp.h (verify_bytepos, count_markers): New decls,
16138 so that gcc does not warn that these functions aren't declared.
16139
85876d07
PE
16140 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16141 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 16142 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 16143 (copy_text): Remove unused local var.
85876d07 16144
03d78a21 16145 * filelock.c (within_one_second): Now static.
b3dd38ab 16146 (lock_file_1): Rename local to avoid shadowing.
03d78a21 16147
5df8f01b
PE
16148 * buffer.c (fix_overlays_before): Mark locals as initialized.
16149 (fix_start_end_in_overlays): Likewise. This function should be
16150 simplified by using pointers-to-pointers, but that's a different
16151 matter.
b1d876f1 16152 (switch_to_buffer_1): Now static.
8f54f30a
PE
16153 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16154 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 16155
a70072c9 16156 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 16157 Fix pointer signedness issue.
edced198
PE
16158 (sys_subshell): Mark local as volatile if checking for lint,
16159 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 16160 (MAXPATHLEN): Define only if needed.
a70072c9 16161
a0977c44
PE
16162 * process.c (serial_open, serial_configure): Move decls from here ...
16163 * systty.h: ... to here, so that they can be checked.
16164
a884fdcc
PE
16165 * fns.c (get_random, seed_random): Move extern decls from here ...
16166 * lisp.h: ... to here, so that they can be checked.
16167
604efe86 16168 * sysdep.c (reset_io): Now static.
b8950c94 16169 (wait_for_termination_signal): Remove; unused.
604efe86 16170
38fc62d9
PE
16171 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16172 (copy_keymap_item, append_key, push_text_char_description):
16173 Now static.
1004a21a 16174 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 16175 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
16176 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16177 (describe_map_tree):
16178 Rename locals to avoid shadowing.
38fc62d9 16179
2f2650da
PE
16180 * keyboard.c: Declare functions static if they are not used elsewhere.
16181 (echo_char, echo_dash, cmd_error, top_level_2):
16182 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
16183 (read_char, kbd_buffer_get_event, make_lispy_position):
16184 (make_lispy_event, make_lispy_movement, apply_modifiers):
16185 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16186 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16187 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 16188 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 16189 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 16190
a053e86c 16191 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
16192 (mark_kboards): Move decl here ...
16193 * alloc.c (mark_kboards): ... from here.
a053e86c 16194
4752793e
PE
16195 * lisp.h (force_auto_save_soon): New decl.
16196
74f10ca7 16197 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
16198 (DEFINE_DUMMY_FUNCTION): New macro.
16199 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16200 Use it.
c03cd23f
PE
16201 (main): Add casts to avoid warnings
16202 if GCC considers string literals to be constants.
74f10ca7 16203
022e70d4
PE
16204 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16205
59d6fe83
PE
16206 * dbusbind.c: Pointer signedness fixes.
16207 (xd_signature, xd_append_arg, xd_initialize):
16208 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16209 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16210 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16211 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16212
78320123
PE
16213 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16214 if GCC considers string literals to be constants.
49cebcca 16215 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 16216
35ac2a97
SM
162172011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16218
fb103ca9
SM
16219 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16220 (print_preprocess, print_object): New macro to fix last change.
16221
35ac2a97
SM
16222 * print.c (print_preprocess): Don't forget font objects.
16223
62973b41
JB
162242011-03-16 Juanma Barranquero <lekktu@gmail.com>
16225
16226 * emacs.c (USAGE3): Doc fixes.
16227
0e48bb22
AS
162282011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16229
16230 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16231 structure.
16232
7684e57b
JB
162332011-03-14 Juanma Barranquero <lekktu@gmail.com>
16234
16235 * lisp.h (VWindow_system, Qfile_name_history):
16236 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16237 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16238 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16239
16240 * w32select.c: Don't #include "keyboard.h".
c96bbc66 16241 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
16242
16243 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16244 * w32console.c (detect_input_pending, read_input_pending)
16245 (encode_terminal_code):
16246 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16247 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16248 (w32_system_caret_y, Qfile_name_history):
16249 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16250 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16251 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16252 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16253 * w32proc.c (Qlocal, report_file_error):
16254 * w32term.c (Vwindow_system, updating_frame):
16255 * w32uniscribe.c (initialized, uniscribe_font_driver):
16256 Remove unneeded extern declarations.
16257
2aa46d6c
CY
162582011-03-14 Chong Yidong <cyd@stupidchicken.com>
16259
c96bbc66 16260 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 16261
cffc6f3b
CY
162622011-03-13 Chong Yidong <cyd@stupidchicken.com>
16263
16264 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16265 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16266 These macros can no longer be used for assignment.
16267
44f230aa
SM
16268 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16269 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
16270 (record_buffer_markers, fetch_buffer_markers): New functions for
16271 recording and fetching special buffer markers.
16272 (set_buffer_internal_1, set_buffer_temp): Use them.
16273
16274 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16275
16276 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16277
16278 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16279 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16280
16281 * xdisp.c (hscroll_window_tree):
16282 (reconsider_clip_changes): Use PT instead of BUF_PT.
16283
d251f04b
EZ
162842011-03-13 Eli Zaretskii <eliz@gnu.org>
16285
16286 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16287 $(EMACS_ROOT)/lib/intprops.h.
16288
f0c77cd1
PE
162892011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16290
3eca4629
PE
16291 Fix more problems found by GCC 4.5.2's static checks.
16292
7c86ee98
PE
16293 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16294 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
16295 (xg_free_frame_widgets): Make it clear that a local variable is
16296 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
16297 (gdk_window_get_screen): Make it clear that this macro is needed
16298 only if USE_GTK_TOOLTIP.
1e5524e7
PE
16299 (int_gtk_range_get_value): New function, which avoids a diagnostic
16300 from gcc -Wbad-function-cast.
16301 (xg_set_toolkit_scroll_bar_thumb): Use it.
16302 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16303 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
16304 (get_utf8_string, xg_get_file_with_chooser):
16305 Rename locals to avoid shadowing.
16306 (create_dialog): Move locals to avoid shadowing.
7c86ee98 16307
41729b81
PE
16308 * xgselect.c (xg_select): Remove unused var.
16309
f0c77cd1
PE
16310 * image.c (four_corners_best): Mark locals as initialized.
16311 (gif_load): Initialize transparent_p to zero (Bug#8238).
16312 Mark another local as initialized.
ec6cf4c6 16313 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 16314
ce0ad53d 16315 * image.c (clear_image_cache): Now static.
d5d5a617 16316 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 16317 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
16318 (x_edge_detection): Remove unnecessary cast that
16319 gcc -Wbad-function-cast diagnoses.
2037898d 16320 (gif_load): Fix pointer signedness.
6ae141d6
PE
16321 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16322 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 16323
33383987 163242011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 16325
d32df629
PE
16326 Improve quality of tests for time stamp overflow.
16327 For example, without this patch (encode-time 0 0 0 1 1
16328 1152921504606846976) returns the obviously-bogus value (-948597
16329 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16330 reports time overflow. See
16331 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
16332 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16333 * editfns.c: Include limits.h and intprops.h.
16334 (TIME_T_MIN, TIME_T_MAX): New macros.
16335 (time_overflow): Move earlier, to before first use.
16336 (hi_time, lo_time): New functions, for an accurate test for
16337 out-of-range times.
16338 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16339 (Fget_internal_run_time): Don't assume time_t fits in int.
16340 (make_time): Use list2 instead of Fcons twice.
16341 (Fdecode_time): More accurate test for out-of-range times.
16342 (check_tm_member): New function.
16343 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
16344 (lisp_time_argument): Don't rely on undefined left-shift and
16345 right-shift behavior when checking for time stamp overflow.
8be6f318 16346
fe31d94c
PE
16347 * editfns.c (time_overflow): New function, refactoring common code.
16348 (Fformat_time_string, Fdecode_time, Fencode_time):
16349 (Fcurrent_time_string): Use it.
16350
8be6f318
PE
16351 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16352 * dired.c (make_time): Move to ...
16353 * editfns.c (make_time): ... here.
16354 * systime.h: Note the move.
16355
09d9db2c 163562011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 16357
126bc0dc
YM
16358 * fringe.c (update_window_fringes): Remove unused variables.
16359
c47cbdfd
YM
16360 * unexmacosx.c (copy_data_segment): Also copy __got section.
16361 (Bug#8223)
16362
7ac80be9
EZ
163632011-03-12 Eli Zaretskii <eliz@gnu.org>
16364
c96bbc66 16365 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
16366 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16367 Constify `char *' arguments and their references according to
16368 prototypes in tparam.h.
16369
ecb0f94d 16370 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 16371
7ac80be9
EZ
16372 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16373 Adapt all references accordingly.
16374
16375 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16376
ef1fd07e
TT
163772011-03-11 Tom Tromey <tromey@redhat.com>
16378
16379 * buffer.c (syms_of_buffer): Remove obsolete comment.
16380
7ef4b50c
EZ
163812011-03-11 Eli Zaretskii <eliz@gnu.org>
16382
16383 * termhooks.h (encode_terminal_code): Declare prototype.
16384
16385 * msdos.c (encode_terminal_code): Don't declare prototype.
16386
16387 * term.c (encode_terminal_code): Now external again, used by
16388 w32console.c and msdos.c.
16389
44f230aa
SM
16390 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16391 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 16392
4b1ec863 163932011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 16394
1714f52b 16395 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 16396
4b1ec863
PE
16397 * fringe.c (update_window_fringes): Mark locals as initialized
16398 (Bug#8227).
16399 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 16400
524c7aa6
PE
16401 * alloc.c (mark_fringe_data): Move decl from here ...
16402 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16403 to check its interface.
16404 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16405
a5c0af81 16406 * fontset.c (free_realized_fontset): Now static.
7519b8cd 16407 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 16408 (fontset_font): Mark local as initialized.
a9a06e0b 16409 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 16410
b4716021
PE
16411 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16412
811e9bac 16413 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 16414 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
16415 (x_own_selection, Fx_disown_selection_internal): Rename locals
16416 to avoid shadowing.
16417 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 16418
7e3ab302
PE
16419 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16420 so that the caller can use some name other than gcpro1.
16421 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
16422 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16423 (Fx_backspace_delete_keys_p):
16424 Use them to avoid shadowing, and rename vars to avoid shadowing.
16425 (x_decode_color, x_set_name, x_window): Now static.
6b437900 16426 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 16427 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
16428 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16429 Remove unused locals.
7e3ab302
PE
16430 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16431 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16432 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16433 macros.
f78faa98 16434
e2b13473
PE
16435 * xterm.h (x_mouse_leave): New decl.
16436
77f23912
PE
16437 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16438 Remove unused functions.
cdf4ba58
PE
16439 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16440 (x_calc_absolute_position): Now static.
7411c686 16441 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 16442 Don't declare local "event" unless it's used.
ed7bf3a5
PE
16443 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16444 unless they are used.
38d0b34a
PE
16445 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16446 (x_fatal_error_signal): Remove; not used.
a6067996
PE
16447 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16448 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16449 (x_error_catcher, x_connection_closed, x_error_handler):
16450 (x_error_quitter, xembed_send_message, x_iconify_frame):
16451 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 16452 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 16453 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 16454
44f230aa
SM
16455 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16456 Rename or move locals to avoid shadowing.
6b463e58 16457 (tty_defined_color, merge_face_heights): Now static.
5967d051 16458 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
16459 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16460 does not deduce is never used uninitialized.
73719eba
PE
16461 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16462 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 16463
426994c3 16464 * terminal.c (store_terminal_param): Now static.
5489860b 16465
032f1620 16466 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 16467 (set_frame_menubar): Remove unused local.
d4323972 16468 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
16469 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16470 since they might point to immutable storage.
281585b0
PE
16471 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16472 since it's unused otherwise.
032f1620 16473
367c19e5 16474 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 16475 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
16476 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16477 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 16478 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
16479 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16480 does not deduce are never used uninitialized.
70739cbe 16481
07b48fa9
PE
16482 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16483
8868a238 16484 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
16485 * window.c (window_loop, size_window):
16486 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 16487
7e5cf297 16488 * window.c (display_buffer): Now static.
d6550a9f
PE
16489 (size_window): Mark variables that gcc -Wuninitialized
16490 does not deduce are never used uninitialized.
a586633d
PE
16491 * window.h (check_all_windows): New decl, to forestall
16492 gcc -Wmissing-prototypes diagnostic.
5b555da1 16493 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 16494
f6095868
PE
16495 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16496 shadowing.
16497 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
16498 Include <limits.h>.
16499 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16500 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
16501 (load_charset_map): Mark variables that gcc -Wuninitialized
16502 does not deduce are never used uninitialized.
53df7c11 16503 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 16504
f38b440c
PE
16505 * coding.c (coding_set_source, coding_set_destination):
16506 Use "else { /* comment */ }" rather than "else /* comment */;"
16507 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
16508 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16509 a block, when the outer 'i' will do.
16510 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16511 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16512 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16513 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16514 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16515 Rename locals to avoid shadowing.
16516 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
16517 * coding.c (emacs_mule_char, encode_invocation_designation):
16518 Now static, since they're not used elsewhere.
413bb2db 16519 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 16520 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
16521 (decode_coding_emacs_mule): Mark variables that gcc
16522 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
16523 (detect_coding_iso_2022): Initialize a local variable that might
16524 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 16525 this initialization is needed. (Bug#8211)
5f58e762
PE
16526 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16527 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16528 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16529 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16530 Remove unused macros.
f38b440c 16531
232b38b9 16532 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 16533 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 16534 * character.c (string_count_byte8): Likewise.
232b38b9 16535
fb90da1b
PE
16536 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16537 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16538
fb93dbc2
PE
16539 * chartab.c (copy_sub_char_table): Now static, since it's not used
16540 elsewhere.
5c156ace
PE
16541 (sub_char_table_ref_and_range, char_table_ref_and_range):
16542 Rename locals to avoid shadowing.
bbcd0949 16543 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 16544
7d3b3862 16545 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 16546 (BIDI_BOB): Remove unused macro.
7d3b3862 16547
6be7d3da
PE
16548 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16549 deduce are never used uninitialized.
c2ed9c8b 16550 * term.c (encode_terminal_code): Likewise.
6be7d3da 16551
75f8807f 16552 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 16553
50938595
PE
16554 * tparam.h: New file.
16555 * term.c, tparam.h: Include it.
16556 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16557 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16558 Move these decls to tparam.h, and make them agree with what
16559 is actually in tparam.c. The previous trick of using incompatible
16560 decls in different modules does not conform to the C standard.
16561 All callers of tparam changed to use tparam's actual API.
16562 * tparam.c (tparam1, tparam, tgoto):
16563 Use const pointers where appropriate.
16564
fbceeba2
PE
16565 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16566 * cm.h (struct cm): Likewise.
16567 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16568 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16569 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16570 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16571 (turn_on_face, init_tty): Likewise.
16572 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 16573
7f3f1250
PE
16574 * term.c (term_mouse_position): Rename local to avoid shadowing.
16575
e6ca6543
PE
16576 * alloc.c (mark_ttys): Move decl from here ...
16577 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16578
c40f8d15
AS
165792011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16580
16581 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16582
cfe0661d
JB
165832011-03-09 Juanma Barranquero <lekktu@gmail.com>
16584
16585 * search.c (compile_pattern_1): Remove argument regp, unused since
16586 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16587 (compile_pattern): Don't pass it.
16588
0afb4571
J
165892011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16590
16591 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16592 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16593 for ! HAVE_GTK3.
16594 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16595
16596 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16597
16598 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16599 gdk_window_get_screen, gdk_window_get_geometry,
16600 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16601 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16602 (xg_get_pixbuf_from_pixmap): New function.
16603 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16604 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16605 Call xg_get_pixbuf_from_pixmap instead of
16606 gdk_pixbuf_get_from_drawable.
16607 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16608 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16609 (xg_check_special_colors): Use GtkStyleContext and its functions
16610 for HAVE_GTK3.
16611 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16612 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16613 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
16614 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16615 Call gtk_widget_get_preferred_size.
0afb4571
J
16616 (xg_frame_resized): gdk_window_get_geometry only takes 5
16617 parameters.
44f230aa
SM
16618 (xg_win_to_widget, xg_event_is_for_menubar):
16619 Call gdk_x11_window_lookup_for_display.
0afb4571
J
16620 (xg_set_widget_bg): New function.
16621 (delete_cb): New function.
895009e1 16622 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 16623 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
16624 (xg_set_background_color): Call xg_set_widget_bg.
16625 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16626 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16627 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16628 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16629 if ! HAVE_GTK3.
16630 (update_frame_tool_bar): Call gtk_widget_hide.
16631 (xg_initialize): Use GDK_KEY_g.
16632
16633 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16634 if ! HAVE_GTK3
16635 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16636
16637 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16638 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16639 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16640
1c2cc4ef
JB
166412011-03-08 Juanma Barranquero <lekktu@gmail.com>
16642
16643 * w32xfns.c (select_palette): Check success of RealizePalette against
16644 GDI_ERROR, not zero.
16645
33383987 16646See ChangeLog.11 for earlier changes.
aac0c6e3
MR
16647
16648;; Local Variables:
16649;; coding: utf-8
aac0c6e3
MR
16650;; End:
16651
2f097256 16652 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
16653
16654 This file is part of GNU Emacs.
16655
16656 GNU Emacs is free software: you can redistribute it and/or modify
16657 it under the terms of the GNU General Public License as published by
16658 the Free Software Foundation, either version 3 of the License, or
16659 (at your option) any later version.
16660
16661 GNU Emacs is distributed in the hope that it will be useful,
16662 but WITHOUT ANY WARRANTY; without even the implied warranty of
16663 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16664 GNU General Public License for more details.
16665
16666 You should have received a copy of the GNU General Public License
16667 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.