Do not mark objects from deleted buffers, windows and frames.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Do not mark objects from deleted buffers, windows and frames.
4 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5 (mark_object): Likewise for windows and frames.
6
7 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
8
9 * alloc.c (valid_lisp_object_p): Treat killed buffers,
10 buffer_defaults and buffer_local_symbols as valid objects.
11 Return special value to denote them.
12
13 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
14
15 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
16 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
17 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
18 (file_name_absolute_p, Fsubstitute_in_file_name):
19 (check_executable, check_writable, Ffile_accessible_directory_p)
20 (Fset_file_selinux_context, Fdefault_file_modes)
21 (Finsert_file_contents, choose_write_coding_system)
22 (Fwrite_region, build_annotations, a_write, e_write)
23 (Fdo_auto_save):
24 * filelock.c (boot_time_initialized, get_boot_time)
25 (get_boot_time_1, lock_file_1, within_one_second):
26 * floatfns.c (in_float):
27 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
28 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
29 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
30 * lisp.h (struct Lisp_Hash_Table.cmpfn):
31 * window.c (compare_window_configurations):
32 Use bool for booleans.
33 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
34 (Fdefault_file_modes): Now mode_t, not int, for modes.
35 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
36 (internal_delete_file): Now returns void, not a (boolean) int,
37 since nobody was looking at the return value.
38 * lisp.h, window.h: Adjust to above API changes.
39
40 * xdisp.c (set_message): Simplify and reindent last change.
41
42 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
43
44 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
45
46 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
47
48 * eval.c (call_debugger): Make the function non-static so that we
49 can call it from set_message.
50
51 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
52 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
53
54 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
55
56 Give more-useful info on a fatal error (Bug#12328).
57 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
58 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
59 of doing the work ourselves.
60 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
61 do most of the work.
62 (fatal_error_backtrace): New function, taken from the guts
63 of the old fatal_error_signal, but with a new option to output
64 a backtrace.
65 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
66 info about the signal than just its number.
67 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
68 * sysdep.c: Include <execinfo.h>
69 (emacs_backtrace): New function, taken partly from the previous
70 code of the 'die' function.
71 (emacs_abort): Call fatal_error_backtrace rather than abort.
72
73 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
74
75 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
76 eager (load-time) macro-expansion.
77 * lisp.mk (lisp): Add macroexp.
78
79 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
80
81 Simplify redefinition of 'abort' (Bug#12316).
82 Do not try to redefine the 'abort' function. Instead, redo
83 the code so that it calls 'emacs_abort' rather than 'abort'.
84 This removes the need for the NO_ABORT configure-time macro
85 and makes it easier to change the abort code to do a backtrace.
86 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
87 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
88 Remove; sysdep.c's emacs_abort now takes its place.
89 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
90 'abort' changed to use 'emacs_abort'.
91 * msdos.c (dos_abort) [defined abort]: Remove; not used.
92 (abort) [!defined abort]: Rename to ...
93 (emacs_abort): ... new name.
94 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
95 the place of the old 'abort' in emacs.c.
96 * w32.c, w32fns.c (abort): Do not #undef.
97 * w32.c (emacs_abort): Rename from w32_abort.
98
99 2012-09-04 Eli Zaretskii <eliz@gnu.org>
100
101 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
102 offsets[j].dv, since the y axis of the screen coordinates points
103 down, while the y axis of the font definition coordinates points
104 up. This fixes display of Arabic diacritics such as KASRA and
105 KASRATAN. (Bug#11860)
106
107 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
108
109 Be more systematic about _setjmp vs setjmp.
110 * alloc.c (test_setjmp, mark_stack):
111 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
112 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
113 (png_load, my_error_exit, jpeg_load):
114 * process.c (send_process_trap, send_process):
115 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
116 The underscored versions are up to 30x faster on some hosts.
117 Formerly, the code used setjmp+longjmp sometimes and
118 _setjmp+_longjmp at other times, with no particular reason to
119 prefer setjmp+longjmp.
120
121 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
122
123 Fix minor problem found by static checking.
124 * buffer.c (Fdelete_all_overlays): Return nil.
125
126 2012-09-03 Martin Rudalics <rudalics@gmx.at>
127
128 * buffer.c (Fdelete_all_overlays): New function.
129
130 2012-09-03 Chong Yidong <cyd@gnu.org>
131
132 * gtkutil.c: Add extern decl for Qxft.
133
134 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
135
136 * emacs.c, eval.c: Use bool for boolean.
137 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
138 (malloc_using_checking) [DOUG_LEA_MALLOC]:
139 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
140 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
141 (main, decode_env_path, Fdaemon_initialized):
142 * eval.c (call_debugger, Finteractive_p, interactive_p):
143 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
144 (maybe_call_debugger, Fbacktrace):
145 * process.c (read_process_output, exec_sentinel):
146 Use bool for booleans.
147 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
148 All callers changed.
149 * eval.c (interactive_p): Omit always-true boolean argument
150 EXCLUDE_SUBRS_P. All callers changed.
151 * dispextern.h, lisp.h: Reflect above API changes.
152 * firstfile.c (dummy): Use the address of 'main', whose signature
153 won't change, instead of the address of 'initialize', whose
154 signature just changed from int to bool.
155 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
156 * msdos.c (fatal_error_in_progress): ... from here.
157 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
158 of incrementing it.
159 (redisplay_internal, unwind_redisplay): Simply clear
160 REDISPLAYING_P when unwinding, instead of saving its previous,
161 always-false value and then restoring it.
162
163 Clean up some extern decls.
164 Mostly, this hoists extern decls out of .c files and into .h files.
165 That way, we're more likely to catch errors if the interfaces change.
166 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
167 declare xg_mark_data.
168 * dispextern.h (x_frame_parm_handlers):
169 * font.h (Qxft):
170 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
171 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
172 (Qultra_bold, Qoblique, Qitalic):
173 Move extern decl here from .c file.
174 * alloc.c (xg_mark_data) [USE_GTK]:
175 * doc.c (Qclosure):
176 * eval.c (Qlexical_binding):
177 * fns.c (time) [!HAVE_UNISTD_H]:
178 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
179 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
180 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
181 * lread.c (Qinternal_interpreter_environment):
182 * minibuf.c (Qbuffer):
183 * process.c (QCfamily, QCfilter):
184 * widget.c (free_frame_faces):
185 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
186 * xfont.c (x_clear_errors):
187 * xterm.c (x_frame_parm_handlers):
188 Remove now-redundant extern decls.
189 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
190 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
191 Now static.
192 * xfaces.c: Remove unnecessary static decls.
193 * xterm.c (updating_frame): Remove decl of nonexistent object.
194
195 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
196 when building globals.h, as the objects that are not built on
197 this host are not needed to compile C files on this host.
198
199 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
200
201 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
202
203 * frame.h: Add missing prototype for x_wm_set_size_hint.
204
205 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
206
207 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
208 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
209 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
210 (Fsubstitute_command_keys):
211 * editfns.c (region_limit, find_field, Fconstrain_to_field)
212 (save_excursion_save, save_excursion_restore)
213 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
214 (format_time_string, general_insert_function)
215 (make_buffer_string, make_buffer_string_both)
216 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
217 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
218 (copy_text, insert_1, insert_1_both, insert_from_string)
219 (insert_from_string_before_markers, insert_from_string_1)
220 (insert_from_buffer, insert_from_buffer_1, replace_range)
221 (replace_range_2, del_range_1, del_range_byte, del_range_both)
222 (del_range_2, modify_region):
223 * intervals.c (intervals_equal, balance_possible_root_interval)
224 (adjust_intervals_for_insertion, merge_properties_sticky)
225 (graft_intervals_into_buffer, lookup_char_property)
226 (adjust_for_invis_intang, set_point_both)
227 (get_property_and_range, compare_string_intervals)
228 (set_intervals_multibyte_1, set_intervals_multibyte):
229 * keyboard.c (decode_timer):
230 Use bool for boolean.
231 * intervals.h, lisp.h, systime.h: Reflect above API changes.
232 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
233
234 2012-09-02 Chong Yidong <cyd@gnu.org>
235
236 * keymap.c (push_key_description): Print M-TAB as C-M-i
237 (Bug#11758).
238
239 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
240
241 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
242 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
243 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
244 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
245 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
246 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
247 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
248
249 2012-09-01 Eli Zaretskii <eliz@gnu.org>
250
251 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
252 more than one grapheme cluster passed to the shaper: compute the
253 offset adjustment values separately for each cluster. (Bug#11860)
254
255 * image.c: Restore mistakenly removed inclusion of w32.h. Without
256 it, GCC doesn't see prototypes of w32_delayed_load, and complains
257 about implicit conversions from integer to pointer.
258
259 2012-09-01 Daniel Colascione <dancol@dancol.org>
260
261 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
262 system used too early.
263
264 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
265
266 Better seed support for (random).
267 * emacs.c (main): Call init_random.
268 * fns.c (Frandom): Set the seed from a string argument, if given.
269 Remove long-obsolete Gentzel cruft.
270 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
271 (init_random): New function.
272
273 2012-09-01 Daniel Colascione <dancol@dancol.org>
274
275 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
276 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
277 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
278 x_wm_set_size_hint, x_query_colors, x_real_positions,
279 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
280 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
281 all of which have been moved to common code.
282
283 * xfaces.c: Include TERM_HEADER instead of listing all possible
284 window-system headers.
285
286 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
287 to match header.
288
289 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
290 directly accessing frame internals.
291
292 * w32font.h: Include font.h. Define syms_of_w32font and
293 globals_of_w32font.
294
295 * process.c: Include TERM_HEADER instead of listing all possible
296 window-system headers.
297
298 * nsterm.h: Remove declarations now in frame.h. Define
299 FRAME_X_SCREEN, FRAME_X_VISUAL.
300
301 * menu.c: Include TERM_HEADER instead of listing all possible
302 window-system headers.
303
304 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
305 window system.
306
307 * keyboard.c: Include TERM_HEADER instead of listing all possible
308 window-system headers.
309
310 * image.c: Include TERM_HEADER instead of listing all possible
311 window-system headers. Declare Vlibrary_cache when compiling for
312 Windows.
313
314 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
315 window system declarations.
316
317 * frame.h: Move common functions here: set_frame_menubar,
318 x_set_window_size, x_sync, x_get_focus_frame,
319 x_set_mouse_position, x_set_mouse_pixel_position,
320 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
321 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
322 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
323 x_activate_menubar, x_real_positions, x_bitmap_icon,
324 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
325 and x_query_colors.
326
327 * frame.c: Include TERM_HEADER instead of listing all possible
328 window-system headers.
329
330 * font.c: Include TERM_HEADER instead of listing all possible
331 window-system headers.
332
333 * emacs.c: Include TERM_HEADER.
334
335 * dispnew.c: Include TERM_HEADER instead of listing all possible
336 window-system headers.
337
338 * ccl.h: Include character.h.
339
340 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
341 the current window system; include in list of objects to link into
342 Emacs.
343
344 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
345
346 Remove mark_ttys function and fix tty_display_info initialization.
347 * lisp.h (mark_ttys): Remove prototype.
348 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
349 to mark_ttys because all possible values of 'top_frame' slot are
350 the frames which are reachable from Vframe_list.
351 * term.c (mark_ttys): Remove.
352 (init_tty): Safely initialize 'top_frame' slot with Qnil.
353
354 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
355
356 Change struct frame bitfields from unsigned char to unsigned.
357 * frame.h (struct frame): Change type of 'display_preempted',
358 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
359 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
360 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
361 bitfields from unsigned char to unsigned.
362
363 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
364
365 Remove unused member of struct x_output and struct w32_output.
366 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
367 * w32term.h (struct w32_output): Likewise.
368
369 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
370
371 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
372 does not become zero (Bug#12234).
373
374 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
375
376 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
377 for GCC 4.7.1 x86-64.
378
379 2012-08-30 Glenn Morris <rgm@gnu.org>
380
381 * lread.c (init_lread): For out-of-tree builds, only add the
382 source directory's site-lisp dir to the load-path if it exists,
383 consistent with in-tree builds. (Bug#12302)
384
385 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
386
387 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
388 button_values to NULL. Call setStykeMask so dialogs get a close button.
389 (windowShouldClose:): Set window_closed.
390 (dealloc): New member, free button_values.
391 (process_dialog:): Make member function. Remove window argument,
392 replace window with self. Count buttons and allocate and store values
393 in button_values.
394 (addButton:value:row:): value is int with the name tag. Call setTag
395 with tag. Remove return self, declare return value as void.
396 (addString:row:): Remove return self, declare return value as void.
397 (addSplit): Remove return self, declare return value as void.
398 (clicked:): Remove return self, declare return value as void.
399 Set dialog_return to button_values[seltag]. Code formatting change.
400 (initFromContents:isQuestion:): Adjust call to process_dialog.
401 Code formatting change.
402 (timeout_handler:): Set timer_fired to YES.
403 (runDialogAt:): Set timer_fired to NO.
404 Handle click on close button as quit.
405
406 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
407 Add window_closed and button_values. Add void as return value for
408 add(Button|String|Split). addButton takes int instead of Lisp_Object.
409 Add process_dialog as new member.
410
411 2012-08-28 Eli Zaretskii <eliz@gnu.org>
412
413 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
414 is not one of the heaps we manage. (Bug#12242)
415
416 2012-08-28 Glenn Morris <rgm@gnu.org>
417
418 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
419
420 2012-08-28 Martin Rudalics <rudalics@gmx.at>
421
422 * window.c (Fset_window_configuration): Remove handling of
423 auto-buffer-name window parameter. Install revision of reverted
424 fix.
425
426 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
427
428 Do not allow to set major mode for a dead buffer.
429 * buffer.c (Fset_buffer_major_mode): Signal an error
430 if the buffer is dead.
431 (Fother_buffer, other_buffer_safely): Remove redundant
432 nested declaration.
433
434 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
435
436 Always use set_buffer_if_live to restore original buffer at unwind.
437 * buffer.h (record_unwind_current_buffer): New function.
438 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
439 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
440 * undo.c, window.c: Adjust users.
441 * buffer.c (set_buffer_if_live): Fix comment.
442
443 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
444
445 Fix usage of set_buffer_internal.
446 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
447 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
448 * coding.c (decode_coding): Omit redundant test.
449 * fileio.c (decide_coding_unwind): Likewise.
450 * fns.c (secure_hash): Likewise.
451 * insdel.c (modify_region): Likewise.
452 * keyboard.c (command_loop_1): Likewise.
453 * print.c (PRINTFINISH): Likewise.
454 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
455
456 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
457
458 * dispnew.c: Use bool for boolean.
459 (frame_garbaged, display_completed, delayed_size_change)
460 (fonts_changed_p, add_window_display_history)
461 (add_frame_display_history, verify_row_hash)
462 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
463 (row_equal_p, realloc_glyph_pool)
464 (allocate_matrices_for_frame_redisplay)
465 (showing_window_margins_p)
466 (adjust_frame_glyphs_for_frame_redisplay)
467 (build_frame_matrix_from_leaf_window, make_current)
468 (mirrored_line_dance, mirror_line_dance, update_frame)
469 (update_window_tree, update_single_window)
470 (check_current_matrix_flags, update_window, update_text_area)
471 (update_window_line, set_window_update_flags, scrolling_window)
472 (update_frame_1, scrolling, buffer_posn_from_coords)
473 (do_pending_window_change, change_frame_size)
474 (change_frame_size_1, sit_for):
475 Use bool for boolean.
476 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
477 and remove last int (actually boolean) argument, which was always 0.
478 All callers changed.
479 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
480 * dispextern.h (struct composition_it): Use bool for boolean.
481 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
482 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
483 * dired.c (file_name_completion):
484 Use bool for boolean. (This was missed in an earlier change.)
485
486 2012-08-27 Martin Rudalics <rudalics@gmx.at>
487
488 * window.c (Fset_window_configuration): Revert first part of
489 last change.
490
491 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
492
493 * nsterm.h (NSPanel): New class variable dialog_return.
494
495 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
496 dialog_return.
497 (windowShouldClose:): Use stop instead of stopModalWithCode.
498 (clicked:): Ditto, and also set dialog_return (Bug#12258).
499 (timeout_handler:): Use stop instead of abortModal. Send a dummy
500 event.
501 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
502 modal loop returns.
503
504 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
505
506 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
507 * composite.c (find_composition, composition_gstring_p)
508 (composition_reseat_it, find_automatic_composition):
509 * data.c (let_shadows_buffer_binding_p)
510 (let_shadows_global_binding_p, set_internal, make_blv)
511 (Fmake_variable_buffer_local, Fmake_local_variable)
512 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
513 (cons_to_signed, arith_driver):
514 * dbusbind.c (xd_in_read_queued_messages):
515 * dired.c (directory_files_internal, file_name_completion):
516 Use bool for booleans.
517 * dired.c (file_name_completion):
518 * process.h (fd_callback):
519 Omit int (actually boolean) argument. It wasn't being used.
520 All uses changed.
521 * composite.h, lisp.h: Reflect above API changes.
522
523 * cmds.c, coding.c: Use bool for booleans.
524 * cmds.c (move_point, Fself_insert_command):
525 * coding.h (struct composition status, struct coding_system):
526 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
527 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
528 (emacs_mule_char, decode_coding_emacs_mule)
529 (encode_coding_emacs_mule, detect_coding_iso_2022)
530 (decode_coding_iso_2022, encode_invocation_designation)
531 (encode_designation_at_bol, encode_coding_iso_2022)
532 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
533 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
534 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
535 (encode_coding_raw_text, detect_coding_charset)
536 (decode_coding_charset, encode_coding_charset, detect_eol)
537 (detect_coding, get_translation_table, produce_chars)
538 (consume_chars, reused_workbuf_in_use)
539 (make_conversion_work_buffer, code_conversion_save)
540 (decode_coding_object, encode_coding_object)
541 (detect_coding_system, char_encodable_p)
542 (Funencodable_char_position, code_convert_region)
543 (code_convert_string, code_convert_string_norecord)
544 (Fset_coding_system_priority):
545 * fileio.c (Finsert_file_contents):
546 Use bool for booleans.
547 * coding.h, lisp.h: Reflect above API changes.
548 * coding.c: Remove unnecessary static function decls.
549 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
550 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
551 not a boolean 'int', since callers never look at the return value.
552 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
553 * coding.h (decoding_buffer_size, encoding_buffer_size)
554 (emacs_mule_string_char): Remove unused extern decls.
555 (struct iso_2022_spec, struct coding_system):
556 Use 'unsigned int : 1' for boolean fields, since there's more than one.
557 (struct emacs_mule_spec): Remove unused field 'full_support'.
558 All initializations removed.
559 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
560
561 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
562
563 Fix spare memory change (Bug#12286).
564 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
565 (valid_lisp_object_p): Likewise.
566
567 2012-08-27 Martin Rudalics <rudalics@gmx.at>
568
569 * window.c (Fset_window_configuration): Record any window's old
570 buffer if it's replaced (see Bug#8789). If the new current
571 buffer doesn't appear in the selected window, go to its old
572 point (Bug#12208).
573
574 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
575
576 Special MEM_TYPE_SPARE to denote reserved memory.
577 * alloc.c (enum mem_type): New memory type.
578 (refill_memory_reserve): Use new type for spare memory.
579 This prevents live_cons_p and live_string_p from incorrect
580 detection of uninitialized objects from spare memory as live.
581
582 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
583
584 Spelling fixes.
585 * Makefile.in (.PHONY): versioclean -> versionclean.
586
587 Remove unused external symbols.
588 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
589 * window.c (Qwindow_valid_p, decode_valid_window):
590 Now static, not extern.
591 * data.c (Qinterval): Remove; unused.
592 (syms_of_data): Do not define 'interval'.
593 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
594 * window.h (decode_valid_window):
595 Remove decls.
596
597 * character.c, charset.c, chartab.c: Use bool for booleans.
598 * character.c (lisp_string_width, string_count_byte8)
599 (string_escape_byte8):
600 * charset.c (charset_map_loaded, load_charset_map, read_hex):
601 (load_charset_map_from_file, map_charset_chars)
602 (Fdefine_charset_internal, define_charset_internal)
603 (Fdeclare_equiv_charset, find_charsets_in_text)
604 (Ffind_charset_region, char_charset, Fiso_charset):
605 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
606 (sub_char_table_set, sub_char_table_set_range)
607 (char_table_set_range, optimize_sub_char_table)
608 (map_sub_char_table):
609 Use bool for boolean.
610 * character.c (str_to_unibyte): Omit last boolean argument; it was
611 always 0. All callers changed.
612 * character.h, charset.h: Adjust to match previous changes.
613 * character.h (char_printable_p): Remove decl of nonexistent function.
614 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
615 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
616 are all boolean, so make them single-bit bitfields.
617
618 * lisp.h (ASET): Remove attempt to detect side effects.
619 It was meant to be temporary and it often doesn't work,
620 because when IDX has side effects the behavior of IDX==IDX
621 is undefined. See Stefan Monnier in
622 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
623
624 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
625
626 * lisp.h (functionp): New function (extracted from Ffunctionp).
627 (FUNCTIONP): Use it.
628 * eval.c (Ffunctionp): Use it.
629
630 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
631
632 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
633 as that's faster and simpler than static storage. Don't bother
634 with the g_main_context_query overhead if g_main_context_pending
635 says no events are pending.
636 (gfds, gfds_size): Remove these static vars.
637 (xgselect_initialize): Remove; no longer needed.
638 All uses and decls removed.
639
640 * emacs.c (fatal_error_signal_hook): Remove.
641 All uses removed. This leftover from old code was always 0.
642
643 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
644 * casefiddle.c (casify_object, casify_region):
645 * casetab.c (set_case_table):
646 * category.c, category.h (word_boundary_p):
647 * category.h (CHAR_HAS_CATEGORY):
648 Use bool for booleans, instead of int.
649
650 2012-08-25 Eli Zaretskii <eliz@gnu.org>
651
652 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
653
654 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
655
656 On assertion failure, print backtrace if available.
657 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
658 (die) [ENABLE_CHECKING]: Print a backtrace if available.
659 * Makefile.in (LIB_EXECINFO): New macro.
660 (LIBES): Use it.
661
662 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
663 * bytecode.c (exec_byte_code):
664 * callint.c (check_mark, Fcall_interactively):
665 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
666 (getenv_internal, sync_process_alive, call_process_exited):
667 * lisp.h (USE_SAFE_ALLOCA):
668 Use bool for booleans, instead of int.
669 * lisp.h, process.h: Adjust prototypes to match above changes.
670 * callint.c (Fcall_interactively): Don't assume the mark's
671 offset fits in 'int'.
672
673 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
674
675 * buffer.c, buffer.h: Use bool for boolean.
676 * buffer.c (reset_buffer_local_variables)
677 (buffer_lisp_local_variables, Fset_buffer_modified_p)
678 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
679 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
680 (overlay_touches_p, overlay_strings, Foverlay_put)
681 (report_overlay_modification, call_overlay_mod_hooks):
682 (mmap_enlarge, mmap_set_vars):
683 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
684 Use bool for booleans, instead of int.
685 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
686 since the 1-or-0 return value is always ignored anyway.
687 (mmap_initialized_p):
688 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
689 * buffer.h, lisp.h: Adjust prototypes to match above changes.
690
691 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
692
693 * bidi.c: Use bool for boolean.
694 This is a bit more readable, and makes the text segment of bidi.o
695 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
696 Presumably it's faster too.
697 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
698 Now bool.
699 (bidi_cache_find_level_change, bidi_cache_iterator_state)
700 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
701 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
702 (bidi_explicit_dir_char, bidi_level_of_next_char)
703 (bidi_find_other_level_edge, bidi_move_to_visually_next):
704 Use bool for booleans, instead of int.
705 * dispextern.h (bidi_init_it, bidi_paragraph_init)
706 (bidi_unshelve_cache): Adjust decls to match code.
707
708 2012-08-23 Martin Rudalics <rudalics@gmx.at>
709
710 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
711 argument.
712
713 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
714
715 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
716 * atimer.h: Include <stdbool.h>.
717
718 2012-08-22 Dan Nicolaescu <dann@gnu.org>
719
720 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
721 compile time tests instead of run time tests on systems that do
722 not use them.
723 (FRAME_MAC_P): Remove leftover from deleted code.
724 * frame.c (syms_of_frame): Remove leftover from deleted code.
725
726 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
727
728 * nsterm.m (insertText:): Don't clear modifiers if code is space.
729
730 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
731
732 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
733 Otherwise, the compiler complains about (A?B:C) where B is void
734 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
735 (fontset_add): Return void, for FONTSET_ADD.
736
737 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
738
739 * alloc.c: Use bool for booleans.
740 (gc_in_progress, abort_on_gc)
741 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
742 (dont_register_blocks) [GC_MALLOC_CHECK]:
743 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
744 (check_string_bytes, make_specified_string, memory_full)
745 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
746 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
747 (mark_stack, valid_pointer_p, make_pure_string)
748 (Fgarbage_collect, survives_gc_p, gc_sweep):
749 Use bool for booleans, instead of int.
750 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
751 Remove unused local.
752 * alloc.c (PURE_POINTER_P):
753 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
754 * editfns.c (Fformat):
755 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
756 (Fdo_auto_save):
757 * fns.c (sweep_weak_table):
758 * lisp.h (suppress_checking, push_message, survives_gc_p)
759 (make_pure_string, gc_in_progress, abort_on_gc):
760 * lread.c (readchar, read1):
761 * print.c (Fprin1_to_string):
762 * xdisp.c (push_message):
763 Use bool for booleans affected directly or indirectly by
764 alloc.c's changes.
765
766 Make recently-introduced setters macros.
767 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
768 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
769 (set_fontset_default, set_fontset_fallback): Rename from their
770 upper-case counterparts, and make them functions rather than macros.
771 This is more consistent with the other recently-introduced setters.
772 These don't need to be inline, since they're local.
773
774 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
775
776 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
777 the loop (Bug#12247).
778
779 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
780
781 * lisp.h (vcopy): Use memcpy rather than our own loop.
782 This fixes a performance regression introduced by the recent
783 addition of vcopy. This means 'vcopy' will need to be modified
784 for a copying collector, but that's OK. Also, tighten the
785 checking in the assertion.
786
787 2012-08-21 Eli Zaretskii <eliz@gnu.org>
788
789 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
790 components for RTL text (Bug#11860). Adjust X-OFFSET of each
791 non-base glyph for the width of the base character, according to
792 what x_draw_composite_glyph_string_foreground expects.
793 Generate WADJUST value according to composition_gstring_width's
794 expectations, to produce correct width of the composed character.
795 Reverse the sign of the DU offset produced by ScriptPlace.
796
797 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
798
799 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
800
801 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
802
803 Avoid direct writes to contents member of struct Lisp_Vector.
804 * lisp.h (vcopy): New function to copy data into vector.
805 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
806 * fns.c (Ffillarray): Use ASET.
807 * keyboard.c (timer_check_2): Use AREF and ASET.
808 (append_tool_bar_item, Frecent_keys): Use vcopy.
809 * lread.c (read_vector): Use ASET.
810 * msdos.c (Frecent_doskeys): Use vcopy.
811 * xface.c (Finternal_copy_lisp_face): Use vcopy.
812 (Finternal_merge_in_global_face): Use ASET and vcopy.
813 * xfont.c (xfont_list_pattern): Likewise.
814
815 2012-08-21 Martin Rudalics <rudalics@gmx.at>
816
817 * window.c (Fwindow_point): For the selected window always return
818 the position of its buffer's point.
819 (Fset_window_point): For the selected window always go in its
820 buffer to the specified position.
821
822 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
823
824 Setter macros for fontsets.
825 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
826 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
827 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
828 Adjust users.
829
830 2012-08-20 Glenn Morris <rgm@gnu.org>
831
832 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
833 Don't assume that `ln -f' works.
834
835 2012-08-20 Eli Zaretskii <eliz@gnu.org>
836
837 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
838 and later about non-assignments with no effect. See discussion at
839 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
840 details.
841
842 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
843
844 Inline setter functions for Lisp_Objects slots of struct specbinding.
845 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
846 Adjust users.
847
848 2012-08-20 Martin Rudalics <rudalics@gmx.at>
849
850 * window.c (select_window): Always make selected window's buffer
851 current.
852
853 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
854
855 Use AREF and ASET for docstrings of category tables.
856 * category.h (CATEGORY_DOCSTRING): Use AREF.
857 (SET_CATEGORY_DOCSTRING): Use ASET.
858 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
859
860 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
861
862 Inline setter functions for hash table members.
863 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
864 (set_hash_hash, set_hash_index): Rename with _slot suffix.
865 (set_hash_key_and_value, set_hash_index, set_hash_next)
866 (set_hash_hash): New functions.
867 * charset.c, fns.c: Adjust users.
868
869 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
870
871 Inline getter and setter functions for per-buffer values.
872 * buffer.h (per_buffer_default, set_per_buffer_default)
873 (per_buffer_value, set_per_buffer_value): New functions.
874 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
875 * buffer.c, data.c: Adjust users.
876
877 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
878
879 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
880
881 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
882
883 Rely on <config.h> + <unistd.h> to declare 'environ',
884 as gnulib does this if the system doesn't.
885 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
886 Remove declaration. MS-Windows declares it on stdlib.h which is
887 included by conf_post.h.
888 * emacs.c (environ) [DOUG_LEA_MALLOC]:
889 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
890 * vm-limit.c: Include <unistd.h>, for 'environ'.
891
892 * unexaix.c, unexcoff.c: Include "mem-limits.h".
893 (start_of_data): Remove decl; mem-limits.h provides it.
894
895 * xdisp.c (handle_invisible_prop): Make it a bit faster
896 and avoid a gcc -Wmaybe-uninitialized diagnostic.
897
898 2012-08-19 Chong Yidong <cyd@gnu.org>
899
900 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
901 ends (Bug#3874).
902
903 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
904
905 * .gdbinit: Use call instead of set when calling a function in the
906 inferior.
907
908 * data.c (set_internal): Don't use set_blv_found.
909 (Fkill_local_variable): Likewise.
910
911 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
912
913 * nsfont.m (ns_ascii_average_width): Ensure the string
914 ascii_printable is initialized with a null-terminated character
915 array. Otherwise, it can contain undesired extra characters.
916
917 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
918
919 port new setting code to Sun C 5.8 2005/10/13
920 * chartab.c, lisp.h (char_table_set, char_table_set_range):
921 Return void, not Lisp_Object. Otherwise, the compiler
922 complains about (A?B:C) where B is void and C is Lisp_Object
923 when compiling CHAR_TABLE_SET, due to the recent change to
924 the API of sub_char_table_set_contents.
925
926 2012-08-18 Chong Yidong <cyd@gnu.org>
927
928 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
929 for the string case (Bug#3874).
930
931 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
932
933 * buffer.h (BSET): Remove (Bug#12215).
934 Replace all uses with calls to new setter functions.
935 (bset_bidi_paragraph_direction, bset_case_canon_table)
936 (bset_case_eqv_table, bset_directory, bset_display_count)
937 (bset_display_time, bset_downcase_table)
938 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
939 (bset_last_selected_window, bset_local_var_alist)
940 (bset_mark_active, bset_point_before_scroll, bset_read_only)
941 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
942 (bset_width_table):
943 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
944 (bset_auto_fill_function, bset_auto_save_file_format)
945 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
946 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
947 (bset_cache_long_line_scans, bset_case_fold_search)
948 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
949 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
950 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
951 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
952 (bset_header_line_format, bset_indicate_buffer_boundaries)
953 (bset_indicate_empty_lines, bset_invisibility_spec)
954 (bset_left_fringe_width, bset_major_mode, bset_mark)
955 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
956 (bset_name, bset_overwrite_mode, bset_pt_marker)
957 (bset_right_fringe_width, bset_save_length)
958 (bset_scroll_bar_width, bset_scroll_down_aggressively)
959 (bset_scroll_up_aggressively, bset_selective_display)
960 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
961 (bset_word_wrap, bset_zv_marker):
962 * category.c (bset_category_table):
963 * syntax.c (bset_syntax_table):
964 New setter functions.
965
966 * process.h (PSET): Remove (Bug#12215).
967 Replace all uses with calls to new setter functions.
968 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
969 (PROCESS_INLINE): New macro.
970 (pset_childp): New setter function.
971 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
972 * process.c (PROCESS_INLINE):
973 Define to EXTERN_INLINE, so that the corresponding functions
974 are compiled into code.
975 (pset_buffer, pset_command, pset_decode_coding_system)
976 (pset_decoding_buf, pset_encode_coding_system)
977 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
978 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
979 (pset_type, pset_write_queue): New setter functions.
980
981 * window.h (WSET): Remove (Bug#12215).
982 Replace all uses with calls to new setter functions.
983 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
984 (WINDOW_INLINE): New macro.
985 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
986 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
987 (wset_total_lines, wset_vertical_scroll_bar)
988 (wset_window_end_pos, wset_window_end_valid)
989 (wset_window_end_vpos): New setter functions.
990 * window.c (WINDOW_INLINE):
991 Define to EXTERN_INLINE, so that the corresponding functions
992 are compiled into code.
993 (wset_combination_limit, wset_dedicated, wset_display_table)
994 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
995 (wset_new_normal, wset_new_total, wset_next_buffers)
996 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
997 (wset_prev_buffers, wset_right_fringe_width)
998 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
999 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1000 (wset_window_parameters):
1001 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1002 (wset_column_number_displayed, wset_region_showing):
1003 New setter functions.
1004
1005 * termhooks.h (TSET): Remove (Bug#12215).
1006 Replace all uses with calls to new setter functions.
1007 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1008 (TERMHOOKS_INLINE): New macro.
1009 (tset_charset_list, tset_selection_alist): New setter functions.
1010 * terminal.c (TERMHOOKS_INLINE):
1011 Define to EXTERN_INLINE, so that the corresponding functions
1012 are compiled into code.
1013 (tset_param_alist): New setter function.
1014
1015 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1016
1017 * keyboard.h (KSET): Remove (Bug#12215).
1018 Replace all uses with calls to new setter functions.
1019 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1020 (KEYBOARD_INLINE): New macro.
1021 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1022 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1023 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1024 New setter functions.
1025 * keyboard.c (KEYBOARD_INLINE):
1026 Define to EXTERN_INLINE, so that the corresponding functions
1027 are compiled into code.
1028 (kset_echo_string, kset_kbd_queue)
1029 (kset_keyboard_translate_table, kset_last_prefix_arg)
1030 (kset_last_repeatable_command, kset_local_function_key_map)
1031 (kset_overriding_terminal_local_map, kset_real_last_command)
1032 (kset_system_key_syms): New setter functions.
1033
1034 * frame.h (FSET): Remove (Bug#12215).
1035 Replace all uses with calls to new setter functions.
1036 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1037 (FRAME_INLINE): New macro.
1038 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1039 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1040 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1041 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1042 (fset_param_alist, fset_root_window, fset_scroll_bars)
1043 (fset_selected_window, fset_title, fset_tool_bar_items)
1044 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1045 * frame.c (FRAME_INLINE):
1046 Define to EXTERN_INLINE, so that the corresponding functions
1047 are compiled into code.
1048 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1049
1050 A few more naming-convention fixes for getters and setters.
1051 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1052 and rename from buffer_overlays_set_before.
1053 (set_buffer_overlays_after): Move here from buffer.h, and rename
1054 from buffer_overlays_set_after.
1055 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1056 All uses changed.
1057 (set_buffer_intervals): Rename from buffer_set_intervals.
1058 * intervals.c (set_interval_object): Move here from intervals.h,
1059 and rename from interval_set_object.
1060 (set_interval_left): Move here from intervals.h, and rename from
1061 interval_set_left.
1062 (set_interval_right): Move here from intervals.h, and rename from
1063 interval_set_right.
1064 (copy_interval_parent): Move here from intervals.h, and rename from
1065 interval_copy_parent.
1066 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1067 (set_interval_plist): Rename from interval_set_plist.
1068 Return void, not Lisp_Object, since no caller uses the result.
1069 * lisp.h (string_intervals): Rename from string_get_intervals.
1070 (set_string_intervals): Rename from string_set_intervals.
1071
1072 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1073 (set_char_table_contents): Rename from char_table_set_contents.
1074 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1075 All uses changed. See the end of
1076 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1077
1078 * lisp.h (CSET): Remove (Bug#12215).
1079 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1080 (set_char_table_purpose): New functions,
1081 replacing CSET. All uses changed. For example, replace
1082 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1083 "set_char_table_parent (char_table, parent);".
1084 The old version was confusing because it used the same name
1085 'parent' for two different things.
1086
1087 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1088
1089 Functions to get and set Lisp_Object fields of buffer-local variables.
1090 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1091 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1092 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1093 * data.c, eval.c, frame.c: Adjust users.
1094
1095 2012-08-17 Chong Yidong <cyd@gnu.org>
1096
1097 * xfaces.c (merge_face_vectors): If the target font specfies a
1098 font spec, make the font's attributes take precedence over
1099 directly-specified attributes.
1100 (merge_face_ref): Recognize :font.
1101
1102 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1103
1104 Do not use memcpy for copying intervals.
1105 * intervals.c (reproduce_interval): New function.
1106 (reproduce_tree, reproduce_tree_obj): Use it.
1107 (reproduce_tree_obj): Remove prototype.
1108
1109 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1110
1111 * lisp.h (duration_to_sec_usec): Remove unused decl.
1112
1113 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1114
1115 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1116 to an allocated instance of NSString, not to the class itself.
1117
1118 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1119
1120 * makefile.w32-in (C_CTYPE_H): New macro.
1121 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1122 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1123 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1124
1125 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 Use ASCII tests for character types.
1128 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1129 * xfns.c, xterm.c:
1130 Don't include <ctype.h>; was not needed.
1131 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1132 * sysdep.c, xfaces.c:
1133 Include <c-ctype.h> instead of <ctype.h>.
1134 * nsterm.m: Include <c-ctype.h>.
1135 * charset.c (read_hex):
1136 * doc.c (Fsnarf_documentation):
1137 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1138 (DRIVE_LETTER) [DOS_NT]:
1139 (Ffile_name_directory, Fexpand_file_name)
1140 (Fsubstitute_in_file_name):
1141 * font.c (font_parse_xlfd, font_parse_fcname):
1142 * frame.c (x_set_font_backend):
1143 * gtkutil.c (xg_get_font):
1144 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1145 * nsimage.m (hexchar):
1146 * nsterm.m (ns_xlfd_to_fontname):
1147 * sysdep.c (system_process_attributes):
1148 * xfaces.c (hash_string_case_insensitive):
1149 Use C-locale tests instead of locale-specific tests for character
1150 types, since we want the ASCII interpretation here, not the
1151 interpretation suitable for whatever happens to be the current locale.
1152
1153 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1154
1155 Consistently check windows for validity/liveness
1156 (Bug#11984, Bug#12025, Bug#12026).
1157 * lisp.h (CHECK_VALID_WINDOW): New macro.
1158 * window.c (decode_window): Rename to decode_live_window.
1159 (decode_valid_window, Fwindow_valid_p): New functions.
1160 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1161 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1162 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1163 (Fwindow_prev_sibling, Fwindow_combination_limit)
1164 (Fset_window_combination_limit, Fwindow_use_time)
1165 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1166 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1167 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1168 (Fwindow_hscroll, Fset_window_hscroll)
1169 (Fwindow_redisplay_end_trigger)
1170 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1171 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1172 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1173 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1174 (Fwindow_end, Fset_window_point, Fset_window_start)
1175 (Fpos_visible_in_window_p, Fwindow_line_height)
1176 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1177 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1178 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1179 (Fset_window_parameter, Fwindow_display_table)
1180 (Fset_window_display_table, Fdelete_other_windows_internal)
1181 (Fset_window_buffer, Fset_window_new_total)
1182 (Fset_window_new_normal, Fdelete_window_internal)
1183 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1184 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1185 (Fwindow_scroll_bars): Check whether argument window is a valid or
1186 live window. Update doc-strings.
1187 (syms_of_window): New symbol Qwindow_valid_p.
1188 * keyboard.c (Fposn_at_x_y): Check whether argument
1189 frame_or_window denotes a valid window.
1190
1191 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1192
1193 Fix previous char table change.
1194 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1195 * chartab.c (optimize_sub_char_table): Likewise.
1196
1197 2012-08-16 Chong Yidong <cyd@gnu.org>
1198
1199 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1200
1201 * xfont.c (xfont_open):
1202 * xftfont.c (xftfont_open): Set the font's max_width field.
1203
1204 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1205 min_width to space_width and average_width to the average over
1206 printable ASCII characters.
1207 (ns_char_width): Code cleanup.
1208 (ns_ascii_average_width): New utility function.
1209
1210 * font.h (struct font): Update comments.
1211
1212 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1213
1214 Simple interface to set Lisp_Object fields of character tables.
1215 * lisp.h (CSET): New macro.
1216 (char_table_set_extras, char_table_set_contents)
1217 (sub_char_table_set_contents): New function.
1218 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1219 * syntax.c: Adjust users.
1220
1221 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1222
1223 * eval.c (eval_sub): Bind lexical-binding.
1224 * lread.c (Qlexical_binding): Make non-static.
1225
1226 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1227
1228 * nsmenu.m (popupSession): Remove.
1229 (pop_down_menu): Remove endModalSession.
1230 (timeout_handler:): New method.
1231 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1232 Call runModalForWindow. Check timer_fired when it returns.
1233 If not set, cancel timer and break out of loop.
1234 Otherwise loop again, with a new timeout.
1235
1236 * nsterm.m: Include fcntl.h if present.
1237 (fd_entry, t_readfds, inNsSelect): Remove.
1238 (select_writefds, select_valid, select_timeout, selfds)
1239 (select_mutex, apploopnr): Add.
1240 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1241 Otherwise call kbd_buffer_store_event.
1242 (ns_send_appdefined): Remove release of fd_entry.
1243 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1244 Increment and decrement apploopnr.
1245 (ns_select): If no file descriptors, just do a NSTimer.
1246 Otherwise copy read/write masks and start select thread (fd_handler).
1247 Start main loop and wait for application defined event.
1248 Inform select thread to stop selecting after main loop is exited.
1249 (ns_term_init): Create selfds pipe and set non-blocking.
1250 Initialize select_mutex. Start the select thread (fd_handler).
1251 (fd_handler:): Loop forever, wait for info from the main thread
1252 to either start or stop selecting. When select returns, send
1253 and appdefined event.
1254 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1255 If not call kbd_buffer_store_event.
1256
1257 * nsterm.h (EmacsApp): fd_handler takes id argument.
1258 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1259
1260 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1261
1262 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1263
1264 * region-cache.c (move_cache_gap): Update gap_len using the actual
1265 growth of the boundaries array. Do not change cache_len.
1266 (Bug#12196)
1267
1268 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1269
1270 Generalize and cleanup font subsystem checks.
1271 * font.h (FONT_DEBUG, font_assert): Remove.
1272 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1273 Change font_assert to eassert. Use eassert where appropriate.
1274
1275 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1276
1277 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1278
1279 2012-08-15 Chong Yidong <cyd@gnu.org>
1280
1281 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1282 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1283 extract the font descriptor instead of just the font name.
1284 In that case, return a font spec instead of a string.
1285 (x_last_font_name): Move to this file from xfns.c.
1286
1287 * xfns.c (Fx_select_font): The return value can also be a font
1288 spec. Move x_last_font_name management to gtkutil.c.
1289
1290 * xfaces.c: Make font weight and style symbols non-static.
1291
1292 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1293
1294 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1295 (bug#12117).
1296
1297 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1298
1299 * alloc.c (Fgarbage_collect): Use plural form consistently.
1300
1301 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1302
1303 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1304 iteration through the command loop. Fixes a problem whereby mouse
1305 movements are ignored until the first mouse click.
1306
1307 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1308
1309 Use bool, not int, for Lisp booleans.
1310 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1311 makes Emacs a bit smaller and presumably a bit faster.
1312 * lisp.h: Include <stdbool.h>.
1313 (struct Lisp_Boolfwd, defvar_bool):
1314 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1315 * regex.c [!emacs]: Include <stdbool.h>.
1316 (false, true): Remove; <stdbool.h> does this for us now.
1317
1318 2012-08-14 Chong Yidong <cyd@gnu.org>
1319
1320 * character.c (Fcharacterp): Doc fix (Bug#12076).
1321
1322 * data.c (Findirect_variable): Doc fix (Bug#11040).
1323
1324 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1325
1326 * editfns.c (Fformat): Doc fix (Bug#12059).
1327 (Fsave_current_buffer): Doc fix (Bug#11542).
1328
1329 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1330
1331 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1332 (bug#12022).
1333
1334 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1335
1336 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1337 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1338 * minibuf.c (choose_minibuf_frame, read_minibuf):
1339 * w32fns.c (x_create_tip_frame):
1340 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1341 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1342
1343 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1344
1345 * intervals.c (offset_intervals): Remove obsolete comment.
1346
1347 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1348
1349 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1350
1351 2012-08-14 Gergely Risko <gergely@risko.hu>
1352
1353 * coding.c (decode_coding): Record buffer modification before
1354 disabling undo_list (Bug#11773).
1355
1356 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1357
1358 Revert and cleanup some recent overlay changes.
1359 * buffer.h (enum overlay_type): Remove.
1360 (buffer_get_overlays, buffer_set_overlays): Likewise.
1361 (buffer_set_overlays_before, buffer_set_overlays_after):
1362 New function. Adjust users.
1363 (unchain_both): Add eassert.
1364
1365 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1368
1369 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1370
1371 * gtkutil.c (xg_mark_data): Don't assume C99.
1372
1373 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1374
1375 * gtkutil.c (xg_frame_tb_info): New struct.
1376 (TB_INFO_KEY): New define.
1377 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1378 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1379 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1380 if not present.
1381 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1382 is up to date. Otherwise store new data.
1383 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1384
1385 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1386
1387 Use KSET for write access to Lisp_Object members of struct kboard.
1388 * keyboard.h (KSET): New macro.
1389 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1390 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1391 * xterm.c: Adjust users.
1392
1393 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1394
1395 Use BSET for write access to Lisp_Object members of struct buffer.
1396 * buffer.h (BSET): New macro.
1397 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1398 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1399 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1400 * window.c, xdisp.c, xfns.c: Adjust users.
1401
1402 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1403
1404 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1405
1406 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1407
1408 * nsterm.m (not_in_argv): New function.
1409 (application:openFile, application:openTempFile:):
1410 (application:openFileWithoutUI:, application:openFiles:): Open file
1411 if not_in_argv returns non-zero (bug#12171).
1412
1413 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1414 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1415 Define for Gtk+ versions less than 3.2.
1416 (xg_get_font_name): Use those functions/macros here.
1417 Reported by Frans Oilinki <moilinki@gmail.com>.
1418
1419 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1420
1421 * unexmacosx.c (copy_data_segment): Copy initialized data in
1422 statically linked libraries from input file rather than memory.
1423
1424 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1425 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1426 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1427
1428 2012-08-10 Glenn Morris <rgm@gnu.org>
1429
1430 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1431 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1432
1433 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1434
1435 Fix last change to allow compilation with low optimization levels.
1436 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1437 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1438
1439 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1440
1441 Use common inline syntax in intervals.h.
1442 * intervals.h (INTERVALS_INLINE): New macro.
1443 Change all users from LISP_INLINE.
1444
1445 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1446
1447 Define Qnone once for all platforms.
1448 * frame.c (Qnone): Define here.
1449 (syms_of_frame): DEFSYM it.
1450 * lisp.h (Qnone): New declaration.
1451 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1452 * xfns.c: Remove duplication. Adjust users.
1453
1454 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1455
1456 Remove unused macros from intervals.h.
1457 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1458 * intervals.c: Adjust comment.
1459
1460 2012-08-10 Eli Zaretskii <eliz@gnu.org>
1461
1462 * w32fns.c <w32_unicode_gui>: New static variable.
1463 (globals_of_w32fns): Initialize it according to os_subtype.
1464 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1465 testing os_subtype.
1466
1467 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
1468 Eli Zaretskii <eliz@gnu.org>
1469
1470 Fix bug #10299 with Unicode characters sent by customized
1471 keyboards created by MSKLC.
1472 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1473 (w32_init_class): Use it to initialize the Emacs class with either
1474 ANSI or Unicode API calls.
1475 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1476 later.
1477 (w32_wnd_proc): If the character code sent by WM_CHAR or
1478 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1479 original message. Call DefWindowProcW on NT and later.
1480
1481 2012-08-10 Glenn Morris <rgm@gnu.org>
1482
1483 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1484
1485 * lisp.h (DIRECTORY_SEP): Let configure set it.
1486
1487 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1488
1489 Use TSET for write access to Lisp_Object slots of struct terminal.
1490 * termhooks.h (TSET): New macro.
1491 * coding.c, terminal.c, xselect.c: Adjust users.
1492
1493 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1494
1495 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1496 the failing expression, include them in the error message.
1497 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1498 * lisp.h (internal_condition_case_n): Update declaration.
1499
1500 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1501
1502 Inline functions to examine and change buffer overlays.
1503 * buffer.c (unchain_both): New function.
1504 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1505 (buffer_has_overlays): New function.
1506 (enum overlay_type): New enum.
1507 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1508 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1509
1510 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1511
1512 Inline functions to examine and change buffer intervals.
1513 * alloc.c (mark_interval_tree): Remove.
1514 (MARK_INTERVAL_TREE): Simplify.
1515 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1516 * intervals.c (buffer_balance_intervals): New function.
1517 (graft_intervals_into_buffer): Adjust indentation.
1518 (set_intervals_multibyte): Simplify.
1519 * buffer.h (BUF_INTERVALS): Remove.
1520 (buffer_get_intervals, buffer_set_intervals): New function.
1521 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1522 * intervals.c, textprop.c: Adjust users.
1523
1524 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1525
1526 Inline functions to examine and change string intervals.
1527 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1528 (string_get_intervals, string_set_intervals): New function.
1529 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1530 * lread.c, print.c, textprop.c: Adjust users.
1531
1532 2012-08-08 Glenn Morris <rgm@gnu.org>
1533
1534 * lisp.mk (lisp): Remove language/persian.elc.
1535
1536 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1537
1538 Cleanup intervals.
1539 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1540 (NULL_INTERVAL_P): Likewise. Adjust users.
1541 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1542 Adjust comment. Move under #if 0.
1543 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1544 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1545
1546 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1547
1548 Check total length of intervals with eassert.
1549 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1550 * intervals.c: Change all users to eassert.
1551
1552 2012-08-07 Eli Zaretskii <eliz@gnu.org>
1553
1554 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1555 Rename fields to match removal of FGET and WGET and disuse of
1556 INTERNAL_FIELD in Lisp_Cons.
1557
1558 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1559
1560 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1561 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1562 name since all xname users are fixed long time ago. Do not
1563 use INTERNAL_FIELD.
1564 (set_symbol_name, set_symbol_function, set_symbol_plist):
1565 (set_symbol_next, set_overlay_plist): New function.
1566 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1567 (struct Lisp_Overlay): Likewise.
1568 (CVAR, MVAR, SVAR): Remove.
1569 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1570 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1571 * xterm.c: Adjust users.
1572 * .gdbinit: Change to use name field of struct Lisp_Symbol
1573 where appropriate.
1574
1575 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1576
1577 Basic functions to set Lisp_Object and pointer slots of intervals.
1578 * intervals.h (interval_set_parent, interval_set_object):
1579 (interval_set_left, interval_set_right, interval_set_plist):
1580 (interval_copy_parent): New function.
1581 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1582 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1583 Adjust indentation.
1584 (INTERVAL_SIZE): Remove. Adjust users.
1585 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1586
1587 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1588
1589 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1590 * process.h (PGET): Remove.
1591 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1592 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1593
1594 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1595
1596 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1597 * window.h (WGET): Remove.
1598 (struct window): Do not use INTERNAL_FIELD.
1599 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1600 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1601 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1602 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1603 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1604 Adjust users.
1605
1606 2012-08-07 Chong Yidong <cyd@gnu.org>
1607
1608 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1609 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1610 (Fdelete_window_internal): Signal an error if the window is not on
1611 a live frame (Bug#12025).
1612
1613 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1614
1615 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1616 * frame.h (FGET): Remove.
1617 (struct frame): Do not use INTERNAL_FIELD.
1618 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1619 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1620 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1621 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1622
1623 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1624
1625 * w32.c: Silence compiler warnings.
1626 (map_w32_filename): Remove unused variable `is_fat'.
1627 (chase_symlinks): Add parentheses around expression.
1628
1629 2012-08-06 Glenn Morris <rgm@gnu.org>
1630
1631 * sysdep.c: Respect BROKEN_GETWD.
1632
1633 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1634 Let configure handle it.
1635 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1636
1637 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1638
1639 Use GCALIGNMENT where appropriate.
1640 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1641 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1642 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1643
1644 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1645
1646 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1647 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1648
1649 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1650
1651 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1652 that should be sufficient for everyone.
1653
1654 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1655
1656 * keyboard.c (timer_check_2): Add break so timer_check returns next
1657 timeout.
1658
1659 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1660
1661 Fix Windows build errors introduced after converting to WGET and WSET.
1662 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1663 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1664
1665 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1666
1667 * nsterm.m (ns_frame_rehighlight): Use FSET.
1668
1669 * nsmenu.m (ns_update_menubar): Use FSET.
1670
1671 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1672
1673 Separate read and write access to Lisp_Object slots of Lisp_Process.
1674 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1675 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1676
1677 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1678
1679 Separate read and write access to Lisp_Object slots of struct window.
1680 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1681 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1682 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1683 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1684 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1685 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1686 Adjust users.
1687
1688 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1689
1690 Fix Windows build errors introduced after converting to FGET and FSET.
1691 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1692 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1693 (w32_judge_scroll_bars): Change to use FSET.
1694 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1695
1696 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1697
1698 Fix replacement typo.
1699 * window.c (replace_window): Set root_window instead of
1700 selected_window. This fixes a total window subsystem
1701 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1702
1703 2012-08-06 Glenn Morris <rgm@gnu.org>
1704
1705 * lisp.mk (lisp): Add language/persian.elc.
1706
1707 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1708
1709 Separate read and write access to Lisp_Object slots of struct frame.
1710 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1711 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1712 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1713 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1714 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1715
1716 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1717
1718 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1719
1720 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1721
1722 Generalize common compile-time constants.
1723 * lisp.h (header_size, bool_header_size, word_size): Now here.
1724 (struct Lisp_Vector): Add comment.
1725 (struct Lisp_Bool_Vector): Move up to define handy constants.
1726 (VECSIZE, PSEUDOVECSIZE): Simplify.
1727 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1728 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1729 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1730 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1731 * xfont.c, xmenu.c: Use word_size where appropriate.
1732
1733 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1734
1735 * search.c (Freplace_match): Treat \? in the replacement text
1736 literally (Bug#8161).
1737
1738 2012-08-05 Chong Yidong <cyd@gnu.org>
1739
1740 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1741 * frame.c (Vdelete_frame_functions):
1742 * emacs.c (Vkill_emacs_hook): Doc fix.
1743
1744 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1745
1746 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1747 --with-x-toolkit=no builds.
1748 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1749
1750 2012-08-04 Chong Yidong <cyd@gnu.org>
1751
1752 * syntax.c (Fmodify_syntax_entry): Doc fix.
1753
1754 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1755
1756 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1757 * w32.c (init_environment): Change the default values of many
1758 environment variables in dflt_envvars[] to NULL, to avoid pushing
1759 them into environment when they were not already defined.
1760 Remove the code that deletes site-lisp subdirectories from the default
1761 value of EMACSLOADPATH, as it is no longer needed.
1762 (check_windows_init_file): Now external, not static.
1763 Use Vload_path as is, without adding anything, as this function is now
1764 called when Vload_path is already set up.
1765
1766 * w32.h (check_windows_init_file): Add prototype.
1767
1768 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1769 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1770 compatibility with Posix platforms.
1771 (main): Move the call to check_windows_init_file to here from
1772 w32.c.
1773 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1774 any, in the DEFALT argument into the root of the Emacs build or
1775 installation tree, as appropriate.
1776
1777 * callproc.c (init_callproc_1): Call decode_env_path instead of
1778 doing its equivalent by hand.
1779 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1780 the code that sets Vexec_path run on MS-Windows.
1781
1782 * lread.c (init_lread): Add comments to #ifdef's.
1783
1784 * msdos.c (dos_set_window_size, IT_update_begin)
1785 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1786 instead of direct references.
1787
1788 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1789
1790 Export DEFAULT_REHASH_* to GDB.
1791 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1792 Now constants, not macros.
1793
1794 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 Remove unnecessary casts involving pointers.
1797 These casts are no longer needed now that we assume C89 or later,
1798 since they involve casting to or from void *.
1799 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1800 (make_pure_float, make_pure_vector):
1801 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1802 * macros.c (Fstart_kbd_macro):
1803 * menu.c (find_and_return_menu_selection):
1804 * minibuf.c (read_minibuf_noninteractive):
1805 * sysdep.c (closedir):
1806 * xdisp.c (x_produce_glyphs):
1807 * xfaces.c (compare_fonts_by_sort_order):
1808 * xfns.c (x_real_positions, select_visual):
1809 * xselect.c (x_stop_queuing_selection_requests)
1810 (x_get_window_property, x_get_window_property_as_lisp_data):
1811 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1812 Remove unnecessary pointer casts.
1813 * alloc.c (record_xmalloc): New function.
1814 * lisp.h (record_xmalloc): New decl.
1815 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1816 more like a function. This is because the pointer cast is not
1817 needed. All uses changed.
1818 * print.c (print_string, print_error_message): Avoid length recalc.
1819
1820 Improve fix for macroexp crash with debugging (Bug#12118).
1821 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1822 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1823 not supposed to be invoked from the garbage collector.
1824 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1825 (gc_aset): New function, which is like ASET but can be
1826 used in the garbage collector.
1827 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1828 (set_hash_index): Use it instead of ASET.
1829
1830 2012-08-03 Eli Zaretskii <eliz@gnu.org>
1831
1832 Support symlinks on latest versions of MS-Windows.
1833 * w32.c: Include winioctl.h and aclapi.h.
1834 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1835 (revert_to_self): Forward declarations of static functions.
1836 <static BOOL g_b_init_get_security_info>:
1837 <g_b_init_create_symbolic_link>: New static flags.
1838 (globals_of_w32): Initialize them to zero.
1839 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1840 (map_w32_filename): Improve commentary. Simplify switch.
1841 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1842 headers (most versions of MinGW w32api don't).
1843 (get_security_info, create_symbolic_link)
1844 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1845 New functions.
1846 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1847 in the argument file name.
1848 (sys_access): Call unc_volume_file_attributes only if
1849 GetFileAttributes fails with network-related error codes.
1850 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1851 have the required privileges.
1852 (get_file_security_desc_by_name): Rename from
1853 get_file_security_desc.
1854 (stat_worker): New function, with most of the guts of 'stat', and
1855 with addition of handling of symlinks and support for 'lstat'.
1856 If possible, get file's attributes and security information by
1857 handle, not by name. Produce S_IFLNK bit for symlinks, when
1858 called from 'lstat'.
1859 (stat, lstat): New functions, call 'stat_worker'.
1860 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1861 symlinks when the underlying filesystem supports them.
1862
1863 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1864
1865 Fix macroexp crash on Windows with debugging (Bug#12118).
1866 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1867 checking subscripts; problem introduced with the recent
1868 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1869 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1870 since it's used in non-static inline functions now.
1871
1872 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1873 Don't assume buffer size fits in 'int'. Remove unused local.
1874
1875 Use C99-style 'extern inline' if available.
1876 * buffer.h (BUFFER_INLINE):
1877 * category.h (CATEGORY_INLINE):
1878 * character.h (CHARACTER_INLINE):
1879 * charset.h (CHARSET_INLINE):
1880 * composite.h (COMPOSITE_INLINE):
1881 * dispextern.h (DISPEXTERN_INLINE):
1882 * lisp.h (LISP_INLINE):
1883 * systime.h (SYSTIME_INLINE):
1884 New macro, replacing 'static inline' in this header.
1885 * buffer.h, category.h, character.h, charset.h, composite.h:
1886 * dispextern.h, lisp.h, systime.h:
1887 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1888 * alloc.c (LISP_INLINE):
1889 * buffer.c (BUFFER_INLINE):
1890 * category.c (CATEGORY_INLINE):
1891 * character.c (CHARACTER_INLINE):
1892 * charset.c (CHARSET_INLINE):
1893 * composite.c (COMPOSITE_INLINE):
1894 * dispnew.c (DISPEXTERN_INLINE):
1895 * sysdep.c (SYSTIME_INLINE):
1896 Define to EXTERN_INLINE, so that the corresponding functions
1897 are compiled into code.
1898 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1899 (INLINE_HEADER_END): New macros.
1900 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1901 since it's used in non-static inline functions now.
1902 (VALMASK) [!USE_LSB_TAG]: Likewise.
1903
1904 2012-08-02 Glenn Morris <rgm@gnu.org>
1905
1906 * s/: Remove empty directory.
1907
1908 * s/ms-w32.h: Move to ../nt/inc.
1909 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1910 Update for new ms-w32.h location.
1911
1912 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1913
1914 Port to Solaris 8.
1915 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1916
1917 2012-08-02 Glenn Morris <rgm@gnu.org>
1918
1919 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1920 hard-coding the path separator.
1921
1922 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1923
1924 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1925 This how ASET and AREF are supposed to work, and makes
1926 it easier to think about future improvements. See
1927 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1928 * charset.h (set_charset_attr): New function.
1929 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1930 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1931 (aref_addr): New function. All uses of &AREF(...) changed.
1932 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1933 (set_hash_index): New functions. All lvalue-style uses of
1934 HASH_KEY etc. changed.
1935 * keyboard.c (set_prop): New function. All lvalue-style uses
1936 of PROP changed.
1937
1938 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1939
1940 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1941 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1942 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1943 * nsfns.m (ns_set_name_as_filename): Likewise.
1944 * nsmenu.m (ns_update_menubar): Likewise.
1945 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1946
1947 2012-08-01 Eli Zaretskii <eliz@gnu.org>
1948
1949 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1950 Adapt to latest changes in field names of the corresponding Lisp
1951 objects.
1952
1953 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1954
1955 2012-08-01 Glenn Morris <rgm@gnu.org>
1956
1957 * s/msdos.h: Remove file.
1958 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1959 * Makefile.in (S_FILE): Remove.
1960 (config_h): Remove S_FILE.
1961
1962 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1963
1964 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1965 Remove; moved to nt/config.nt.
1966
1967 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1968
1969 Use INTERNAL_FIELD for conses and overlays.
1970 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1971 Remove obsolete comment.
1972 (MVAR): New macro.
1973 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1974 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1975
1976 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1977
1978 Use INTERNAL_FIELD for symbols.
1979 * lisp.h (SVAR): New macro. Adjust users.
1980 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1981 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1982
1983 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1984
1985 Use INTERNAL_FIELD for processes.
1986 * process.h (PVAR): New macro. Adjust style.
1987 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1988 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1989
1990 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1991
1992 Use INTERNAL_FIELD for windows.
1993 * window.h (WVAR): New macro.
1994 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1995 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1996 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1997 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1998 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1999 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2000
2001 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2002
2003 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2004
2005 2012-08-01 Glenn Morris <rgm@gnu.org>
2006
2007 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2008 Move to configure.ac.
2009
2010 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2011
2012 * makefile.w32-in (CONFIG_H): Update dependencies.
2013 (CONF_POST_H): New macro.
2014
2015 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2016
2017 2012-07-31 Glenn Morris <rgm@gnu.org>
2018
2019 * Makefile.in (S_FILE): No longer set by configure.
2020
2021 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2022 is available.
2023 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2024
2025 * process.h (NULL_DEVICE):
2026 * emacs.c (SEPCHAR):
2027 * editfns.c (USER_FULL_NAME): Let configure set them.
2028
2029 * s/README, s/template.h: Remove files.
2030
2031 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2032
2033 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2034 Move to configure.ac.
2035
2036 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2037
2038 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2039 resulting renaming of 'struct frame' members.
2040
2041 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2042
2043 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2044 after introduction of FVAR.
2045
2046 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2047
2048 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2049
2050 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2051 instead of compositeToPoint.
2052 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2053
2054 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2055
2056 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2057
2058 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2059 * lisp.h (INTERNAL_FIELD): New macro.
2060 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2061 (BVAR): Change to use INTERNAL_FIELD.
2062 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2063 (KVAR): Change to use INTERNAL_FIELD.
2064 * frame.h (FVAR): New macro.
2065 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2066 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2067 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2068 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2069 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2070
2071 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2072
2073 Miscellaneous fixes for non-default X toolkits.
2074 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2075 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2076 Move under #ifdef USE_LUCID.
2077 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2078 definition and usage to avoid warnings.
2079
2080 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2081
2082 * nsterm.m (openFiles): Fix previous checkin.
2083
2084 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2085
2086 * indent.c (compute_motion): Remove unused local.
2087
2088 2012-07-31 Glenn Morris <rgm@gnu.org>
2089
2090 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2091
2092 * conf_post.h [USG5_4]:
2093 Move remaining contents of s/usg5-4-common.h here.
2094 * s/usg5-4-common.h: Remove file.
2095
2096 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2097 * s/irix6-5.h: Remove file.
2098
2099 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2100 * s/darwin.h: Remove file.
2101
2102 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2103 * s/hpux10-20.h: Remove file, which is now empty.
2104
2105 2012-07-30 Glenn Morris <rgm@gnu.org>
2106
2107 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2108 * Makefile.in (config_h): Add conf_post.h.
2109 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2110
2111 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2112
2113 * nsterm.m (ns_do_open_file): New variable.
2114 (ns_term_init): Set ns_do_open_file to YES after run returns.
2115 (openFile, openTempFile, openFileWithoutUI, openFiles):
2116 Open files only if ns_do_open_file.
2117
2118 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2119
2120 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2121 This no-op macro hasn't been needed for many years.
2122 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2123
2124 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2125 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2126 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2127 gdb_make_enums_visible.
2128 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2129 (DIRECTORY_SEP): Now a constant, not a macro.
2130
2131 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2132
2133 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2134 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2135
2136 * w32term.c <w32_keyboard_codepage>: Renamed from
2137 keyboard_codepage and now external. All users changed.
2138
2139 * w32term.h: Add declaration of w32_keyboard_codepage.
2140
2141 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2142 the codepage to translate keys to Unicode. If this argument is
2143 -1, use the value returned by GetConsoleCP. All callers changed.
2144
2145 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2146
2147 Update .PHONY listings in makefiles.
2148 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2149 bootstrap-clean, distclean, maintainer-clean, versioclean,
2150 extraclean, frc.
2151
2152 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2153 This is a bit clearer. Fix some commentary typos.
2154
2155 2012-07-30 Glenn Morris <rgm@gnu.org>
2156
2157 * s/netbsd.h: Let configure include signal.h if needed.
2158 Remove file, which is now empty.
2159
2160 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2161 Let configure set them.
2162 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2163 No more need to undefine.
2164
2165 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2166
2167 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2168 non-single-byte char when adding meta modifier. (Bug#12090)
2169
2170 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2171
2172 Convert safe_call to use variable number of arguments.
2173 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2174 (safe_call2): Fix comment.
2175 * lisp.h (safe_call): Adjust prototype.
2176 * coding.c (encode_coding_object): Change to use safe_call2.
2177 * xfaces.c (merge_face_heights): Change to use safe_call1.
2178
2179 2012-07-30 Glenn Morris <rgm@gnu.org>
2180
2181 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2182 does that unconditionally. Remove file, which is now empty.
2183
2184 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2185 Remove empty files.
2186
2187 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2188
2189 Export to GDB most of lisp.h's remaining object-like macros.
2190 * lisp.h (min, max): Move earlier, because they're used earlier now.
2191 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2192 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2193 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2194 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2195 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2196 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2197 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2198 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2199 Now constants, for GDB. They need not be macros.
2200 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2201 Now constants, for GDB, as well as macros, for static initializers.
2202 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2203 Move to after the definition of struct Lisp_Char_Table,
2204 since the former now needs that type defined.
2205 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2206 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2207 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2208 New enums, for gdb_make_enums_visible.
2209 (GLYPH_MODE_LINE_FACE): Remove; unused.
2210 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2211 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2212 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2213 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2214 enum maxargs, enum MAX_ALLOCA.
2215 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2216 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2217 no longer needed, now that they are done in lisp.h.
2218
2219 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2220
2221 Cleanup string bytes checking.
2222 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2223 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2224 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2225 (check_sblock, compact_small_strings): Simplify.
2226
2227 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2228
2229 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2230 These macros are confusing and no longer need to be defined, as
2231 the enum values now suffice. All uses replaced with definiens.
2232 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2233
2234 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2235
2236 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2237 ($(BLD)/w32console.$(O)): Update dependencies.
2238
2239 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2240
2241 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2242 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2243 time. Adjust users.
2244 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2245
2246 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2247
2248 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2249 setting sitelisp (Bug#12010).
2250
2251 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2252
2253 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2254
2255 * w32heap.c (cache_system_info):
2256 * w32.c (sys_rename):
2257 * w32proc.c (find_child_console, sys_kill): All users changed.
2258
2259 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2260
2261 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2262
2263 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2264
2265 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2266
2267 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2268
2269 Cleanup statistics calculation in Fgarbage_collect.
2270 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2271 Fix zombies percentage calculation. Simplify elapsed time calculation.
2272
2273 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2274
2275 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2276 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2277 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2278 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2279 (replace_range, replace_range_2, del_range_2): Change to eassert.
2280 * marker.c (byte_char_debug_check): Adjust style.
2281
2282 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2283
2284 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2285 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2286 long-ago-commented-out code that talks about "WIN32".
2287 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2288 All uses changed.
2289
2290 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2291
2292 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2293 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2294 Simplify by using alignof.
2295 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2296 * lisp.h: Include <stdalign.h>.
2297 (GCALIGNMENT): New macro and constant.
2298 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2299 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2300 (stdalign): New macro, if not already defined.
2301
2302 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2303
2304 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2305 * w32inevt.c: Include w32inevt.h.
2306 (w32_read_console_input): New inline function, calls either
2307 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2308 w32_console_unicode_input.
2309 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2310 (w32_kbd_patch_key, key_event): Use the codepage returned by
2311 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2312 (key_event): use uChar.UnicodeChar only if
2313 w32_console_unicode_input is non-zero.
2314
2315 * w32console.c: Include w32heap.h.
2316 <w32_console_unicode_input>: New global variable.
2317 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2318 family of Windows, zero otherwise.
2319
2320 * w32inevt.h: Declare w32_console_unicode_input.
2321
2322 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2323 --without-x. (Bug#11742)
2324
2325 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2326
2327 Adjust GDB to reflect pvec_type changes (Bug#12036).
2328 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2329 2012-07-04 changes to pseudovector representation.
2330 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2331
2332 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2333
2334 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2335 bus address.
2336 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2337
2338 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2339
2340 * alloc.c (listn): Fix the order the arguments are consed onto the
2341 list.
2342
2343 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2344 enumeration constants, as PURE and HEAP are too general, and clash
2345 with other headers and sources, such as gmalloc.c and the
2346 MS-Windows system headers. All users changed.
2347
2348 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2349
2350 Revert last save_excursion_save and save_excursion_restore changes.
2351 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2352 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2353
2354 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2355
2356 Fix recently-introduced typos in Windows port.
2357 Reported by Martin Rudalics <rudalics@gmx.at>.
2358 * w32.c (init_environment): Replace comma with semicolon.
2359 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2360
2361 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2362
2363 Improve GDB symbol export (Bug#12036).
2364 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2365 arms of an 'if', not using conditional expressions; otherwise GDB
2366 complains about the types in the unevaluated arm when the argument
2367 is an integer literal.
2368 (xgetint): Simplify expression.
2369 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2370 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2371 Zaretskii in <http://bugs.gnu.org/12036#13>.
2372 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2373 needed now that we have gdb_make_enums_visible.
2374 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2375 (enum enum_USE_LSB_TAG):
2376 New enum types, packaging up enums that need to be exported to GDB.
2377
2378 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 Utility function to make a list from specified amount of objects.
2381 * lisp.h (enum constype): New datatype.
2382 (listn): New prototype.
2383 * alloc.c (listn): New function.
2384 (Fmemory_use_count, syms_of_alloc): Use it.
2385 * buffer.c (syms_of_buffer): Likewise.
2386 * callint.c (syms_of_callint): Likewise.
2387 * charset.c (define_charset_internal): Likewise.
2388 * coding.c (syms_of_coding): Likewise.
2389 * keymap.c (syms_of_keymap): Likewise.
2390 * search.c (syms_of_search): Likewise.
2391 * syntax.c (syms_of_syntax): Likewise.
2392 * w32.c (init_environment): Likewise.
2393 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2394 * xdisp.c (syms_of_xdisp): Likewise.
2395 * xfns.c (syms_of_xfns): Likewise.
2396
2397 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2398
2399 Fast save_excursion_save and save_excursion_restore.
2400 * lisp.h (struct Lisp_Excursion): New data type.
2401 (PVEC_EXCURSION): New pseudovector type.
2402 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2403 to deal with it. Adjust comments.
2404 (init_marker, attach_marker): New prototype.
2405 (unchain_marker): Adjust prototype.
2406 * marker.c (attach_marker): Change to global.
2407 (init_marker): New function.
2408 * alloc.c (Fmake_marker, build_marker): Use it.
2409 (build_marker): More easserts.
2410 (mark_object): Handle struct Lisp_Excursion.
2411 * editfns.c (save_excursion_save, save_excursion_restore):
2412 Reimplement to use struct Lisp_Excursion. Add comments.
2413
2414 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2415
2416 Fix export of symbols to GDB (Bug#12036).
2417 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2418 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2419 emacs.c, as this is a more-suitable home. Had this been done earlier
2420 the fix for 12036 would have avoided some of the problems noted in
2421 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2422 would have been more obvious.
2423 * emacs.c: Do not include <verify.h>; no longer needed.
2424 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2425 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2426 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2427 Remove; now done in lisp.h.
2428 * lisp.h (PUBLISH_TO_GDB): New macro.
2429 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2430 (DATA_SEG_BITS): Use it.
2431 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2432 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2433 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2434 not be usable in #if. This simplifies things.
2435
2436 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
2437
2438 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2439
2440 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2441
2442 Simplify export of symbols to GDB (Bug#12036).
2443 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2444 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2445 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2446 Adjust to changes in lisp.h and emacs.c, by using
2447 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2448 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2449 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2450 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2451 instead of gdb_valbits.
2452 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2453 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2454 instead of gdb_array_mark_flag.
2455 (xboolvector): Get size from $->size, not $->header.size.
2456 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2457 (xreload, hook-run, hookpost-run): Remove.
2458 * emacs.c: Include <verify.h>.
2459 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2460 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2461 Remove.
2462 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2463 (gdb_USE_LSB_TAG): New enum constants.
2464 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2465 Also define these as enum constants, so they're visible to GDB.
2466 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2467 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2468 as constants, so they're visible to GDB.
2469 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2470 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2471 Now enum constants, not macros, so they're visible to GDB.
2472 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2473 more convenient now. All uses changed.
2474 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2475 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2476
2477 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 Explicitly free restriction data that are not needed anymore.
2480 * editfns.c (save_restriction_restore): Free restriction data.
2481
2482 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2483
2484 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2485 add argument, tune behavior, and adjust all callers.
2486
2487 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2488
2489 Use typedef for EMACS_INT, EMACS_UINT.
2490 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2491 than macros. This simplifies debugging in the usual case, since
2492 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2493 and it allows expressions involving EMACS_INT casts.
2494 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2495
2496 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2497
2498 * nsterm.m (ns_read_socket): Return early if there is a modal
2499 window (Bug#12043).
2500
2501 2012-07-25 Martin Rudalics <rudalics@gmx.at>
2502
2503 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2504 that FOCUS-FRAME can be omitted.
2505
2506 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2507
2508 Adjust buffer text indirection counters at the end of Fkill_buffer.
2509 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2510 buffer is definitely dead. This should really fix an issue reported
2511 by Christoph Scholtes again. (Bug#12007).
2512 (init_buffer_once): Initialize indirection counters of
2513 buffer_defaults and buffer_local_symbols (for sanity and safety).
2514
2515 2012-07-24 Eli Zaretskii <eliz@gnu.org>
2516
2517 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2518 and continuation glyphs on tooltip frames, leave them at zero.
2519 Avoids continued lines in tooltips. (Bug#11832)
2520
2521 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2522
2523 Simplify copy_overlay.
2524 * buffer.c (copy_overlay): Simplify. Use build_marker.
2525 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2526
2527 2012-07-23 Eli Zaretskii <eliz@gnu.org>
2528
2529 * print.c (print_object): Don't crash when a frame's name is nil
2530 or invalid. (Bug#12025)
2531
2532 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2533 it signals an error when a tooltip frame is being created.
2534
2535 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2536
2537 Cleanup miscellaneous objects allocation and initialization.
2538 * alloc.c (allocate_misc): Change to static. Add argument to
2539 specify the subtype. Adjust comment and users.
2540 (build_overlay): New function.
2541 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2542 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2543 (allocate_misc): Remove prototype.
2544 (build_overlay): Add prototype.
2545
2546 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2547
2548 Swap buffer text indirection counters in Fbuffer_swap_text.
2549 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2550 This avoids crash reported by Christoph Scholtes at
2551 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2552
2553 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2554
2555 * nsmenu.m (Popdown_data): New struct.
2556 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2557 free Popdown_data.
2558 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2559 (initWithContentRect): Make imgView and contentView non-static
2560 and autorelease them. Also autorelease img and matrix (Bug#12005).
2561 (dealloc): Remove (Bug#12005).
2562
2563 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2564
2565 Adjust consing_since_gc when objects are explicitly freed.
2566 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2567 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2568 (free_cons, free_misc): Subtract object size from consing_since_gc.
2569
2570 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2571
2572 Simplify and cleanup markers positioning code.
2573 * marker.c (attach_marker): More useful eassert.
2574 (live_buffer, set_marker_internal): New function.
2575 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2576 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2577
2578 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2579
2580 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2581 as it's limited by the amount of memory, not by INT_MAX.
2582
2583 2012-07-21 Eli Zaretskii <eliz@gnu.org>
2584
2585 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2586 in special-event-map. See the discussion at
2587 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2588 for the reasons.
2589
2590 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2591 info.dwItemData. Fixes crashes on 64-bit Windows.
2592 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2593
2594 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2595
2596 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2597 (conversationIdentifier): Return value is NSInteger.
2598 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2599
2600 2012-07-21 Chong Yidong <cyd@gnu.org>
2601
2602 * window.c (decode_any_window): Signal an error if the window is
2603 on a dead frame (Bug#11984).
2604
2605 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2606
2607 Add indirection counting to speed up Fkill_buffer.
2608 * buffer.h (struct buffer): New member.
2609 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2610 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2611 base buffer indirection counter.
2612 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2613 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2614 through buffer list if indirection counter is 0.
2615
2616 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2617
2618 Extend the value returned by Fgarbage_collect with heap statistics.
2619 * alloc.c (Qheap): New symbol.
2620 (syms_of_alloc): DEFSYM it.
2621 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2622 (Fmemory_free): Remove.
2623 (syms_of_alloc): Don't defsubr it.
2624 * buffer.c (Fcompact_buffer): Remove.
2625 (syms_of_buffer): Don't defsubr it.
2626
2627 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2628
2629 Make maybe_gc inline.
2630 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2631 * lisp.h (consing_since_gc, gc_relative_threshold)
2632 (memory_full_cons_threshold): Revert declaration.
2633 (maybe_gc): Remove prototype, define as inline.
2634 * alloc.c: Remove old commented-out code.
2635 (consing_since_gc, gc_relative_threshold)
2636 (memory_full_cons_threshold): Revert to global.
2637 (maybe_gc): Remove.
2638
2639 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2640
2641 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2642 * lisp.h (build_unibyte_string): New function.
2643 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2644 * sysdep.c, w32fns.c, xfns.c: Use it.
2645 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2646 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2647 Adjust users accordingly.
2648 * font.h (font_open_by_name): Adjust prototype.
2649
2650 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2651
2652 Cleanup calls to Fgarbage_collect.
2653 * lisp.h (maybe_gc): New prototype.
2654 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2655 Remove declarations.
2656 * alloc.c (maybe_gc): New function.
2657 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2658 Make them static.
2659 * bytecode.c (MAYBE_GC): Use maybe_gc.
2660 * eval.c (eval_sub, Ffuncall): Likewise.
2661 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2662 to avoid dependency from auto-save feature.
2663
2664 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2665
2666 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2667 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2668 'for_each_per_buffer_object_at'.
2669 All uses changed. It's better to use upper-case for macros that
2670 cannot be implemented as functions, to give the reader a clue
2671 that they're special.
2672
2673 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2674
2675 * alloc.c (Fgarbage_collect): Tweak docstring.
2676
2677 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2678
2679 Tweak the value returned from Fgarbage_collect again.
2680 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2681 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2682 Adjust documentation.
2683 (total_vector_bytes): Rename to total_vector_slots, adjust
2684 accounting.
2685 (total_free_vector_bytes): Rename to total_free_vector_slots,
2686 adjust accounting.
2687 (Qstring_bytes, Qvector_slots): New symbols.
2688 (syms_of_alloc): DEFSYM them.
2689
2690 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2691
2692 Buffer compaction primitive which may be used from Lisp.
2693 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2694 (syms_of_buffer): Register Fcompact_buffer.
2695 * alloc.c (Fgarbage_collect): Use compact_buffer.
2696 * buffer.h (compact_buffer): New prototype.
2697 (struct buffer_text): New member.
2698
2699 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2700
2701 New macro to iterate over all buffers, miscellaneous cleanups.
2702 * lisp.h (all_buffers): Remove declaration.
2703 * buffer.h (all_buffers): Add declaration, with comment.
2704 (for_each_buffer): New macro.
2705 * alloc.c (Fgarbage_collect, mark_object): Use it.
2706 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2707 (init_buffer): Likewise.
2708 * data.c (Fset_default): Likewise.
2709 * coding.c (code_conversion_restore): Remove redundant check
2710 for dead buffer.
2711 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2712
2713 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2714
2715 Fix bug that created negative-length intervals.
2716 * intervals.c (merge_interval_right, merge_interval_left):
2717 Do not zero out this interval if it is absorbed by its children,
2718 as this interval's total length doesn't change in that case. See
2719 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2720
2721 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2722
2723 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2724 when invoking (make-bool-vector N t) and N is a positive
2725 multiple of 8 -- the last 8 bits were mistakenly cleared.
2726
2727 Remove some struct layout assumptions in bool vectors.
2728 * alloc.c (bool_header_size): New constant.
2729 (header_size, word_size): Move earlier, as they're now used earlier.
2730 Use 'word_size' in a few more places, where it's appropriate.
2731 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2732 padding before the data member of a bool vector.
2733 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2734 than doing the check by hand with an abort ().
2735
2736 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2737
2738 * eval.c (Fdefvar): Don't check constants since we only set the var if
2739 it's not yet defined anyway (bug#11904).
2740
2741 * lisp.h (last_undo_boundary): Declare new var.
2742 * keyboard.c (command_loop_1): Set it.
2743 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2744 were auto-added by the command loop (bug#11774).
2745
2746 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2747
2748 * w32font.c (Qsymbol): Remove local definition.
2749 (syms_of_w32font): Don't DEFSYM it.
2750
2751 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2752
2753 Fix sweep_vectors to handle large bool vectors correctly.
2754 * alloc.c (sweep_vectors): Account total_vector_bytes for
2755 bool vectors larger than VBLOCK_BYTES_MAX.
2756
2757 2012-07-18 Chong Yidong <cyd@gnu.org>
2758
2759 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2760 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2761
2762 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2763
2764 Return more descriptive data from Fgarbage_collect.
2765 Suggested by Stefan Monnier in
2766 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2767 * alloc.c (bounded_number): New function.
2768 (total_buffers, total_vectors): New variable.
2769 (total_string_size): Rename to total_string_bytes, adjust users.
2770 (total_vector_size): Rename to total_vector_bytes, adjust users.
2771 (sweep_vectors): Account total_vectors and total_vector_bytes.
2772 (Fgarbage_collect): New return value. Adjust documentation.
2773 (gc_sweep): Account total_buffers.
2774 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2775 (VECTOR_SIZE): Remove.
2776 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2777 (Qinterval, Qmisc): New symbols.
2778 (syms_of_data): Initialize them.
2779 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2780 (Qcons, Qbuffer): New declarations.
2781
2782 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2783
2784 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2785 Round up, not down. Improve doc.
2786
2787 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2788
2789 Restore old code in allocate_string_data to avoid Faset breakage.
2790 Reported by Julien Danjou <julien@danjou.info> in
2791 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2792 * alloc.c (allocate_string_data): Restore old code with minor
2793 adjustments, fix comment to explain this subtle issue.
2794
2795 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2796
2797 Remove FILE_SYSTEM_CASE.
2798 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2799
2800 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2801 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2802 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2803 call-process-region passes it through expand-file-name.
2804
2805 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2806
2807 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2808
2809 Fix crash when creating indirect buffer (Bug#11917)
2810 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2811 Don't handle unbound variables specially if non-zero.
2812 (Fbuffer_local_variables): Pass zero.
2813 (clone_per_buffer_values): Pass non-zero.
2814
2815 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2816
2817 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2818 to make the loop interruptible.
2819
2820 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2821
2822 * gnutls.c (emacs_gnutls_handshake): Only retry if
2823 GNUTLS_E_INTERRUPTED.
2824
2825 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2826
2827 Cleanup and convert miscellaneous checks to eassert.
2828 * alloc.c (mark_interval): Fix comment, partially rephrase
2829 old comment from intervals.h (see below).
2830 * intervals.c (find_interval, adjust_intervals_for_insertion)
2831 (delete_interval, adjust_intervals_for_deletion)
2832 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2833 Convert to eassert.
2834 (adjust_intervals_for_insertion, make_new_interval):
2835 Remove obsolete and unused code.
2836 * intervals.h (struct interval): Remove obsolete comment.
2837 * textprotp.c (erase_properties): Remove unused code.
2838 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2839 (Fremove_list_of_text_properties): Convert to eassert.
2840
2841 2012-07-17 Chong Yidong <cyd@gnu.org>
2842
2843 * editfns.c (Finsert_char): Doc fix.
2844
2845 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2846
2847 Fix previous change to make Fmemory_free always accurate.
2848 * alloc.c (make_interval): Update total_free_intervals.
2849 (make_float): Likewise for total_free_floats.
2850 (free_cons, Fcons): Likewise for total_free_conses.
2851 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2852 Likewise for total_free_vector_bytes.
2853 (Fmake_symbol): Likewise for total_free_symbols.
2854 (bytes_free): Remove.
2855
2856 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2857
2858 Simple free memory accounting feature.
2859 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2860 (sweep_vectors): Accumulate size of free vectors.
2861 (Fgarbage_collect): Setup bytes_free.
2862 (Fmemory_free): New function.
2863 (syms_of_alloc): Register it.
2864
2865 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2866
2867 Cleanup overlays checking.
2868 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2869 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2870 eassert and OVERLAYP.
2871 (sort_overlays): Change to use OVERLAYP.
2872
2873 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2874
2875 * editfns.c (Finsert_char): Make it interactive, and make the
2876 second arg optional. Copy interactive spec and docstring from
2877 ucs-insert.
2878
2879 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2880
2881 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2882 Unlike the other wrapped functions, fabs has an unspecified
2883 effect on errno.
2884
2885 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2886
2887 * nsterm.m (keyDown): Interpret flags without left/right bits
2888 as the left key (Bug#11670).
2889
2890 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2891
2892 Remove empty and useless init functions.
2893 * lisp.h (init_character_once, init_fns, init_image)
2894 (init_filelock, init_sound): Remove prototype.
2895 * character.c (init_character_once): Remove.
2896 * filelock.c (init_filelock): Likewise.
2897 * fns.c (init_fns): Likewise.
2898 * image.c (init_image): Likewise.
2899 * sound.c (init_sound): Likewise.
2900 * emacs.c (main): Adjust accordingly.
2901
2902 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2903
2904 * gtkutil.h: Tiny cleanups.
2905 (use_old_gtk_file_dialog): Remove useless declaration.
2906 (xg_uses_old_file_dialog): Add suggested const attribute.
2907
2908 2012-07-15 Eli Zaretskii <eliz@gnu.org>
2909
2910 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2911 (bidi_paragraph_init): Use it to limit search forward for a strong
2912 directional character in abnormally large paragraphs full of
2913 neutral or weak characters. (Bug#11943)
2914
2915 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2916
2917 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2918 the toolbar (Bug#9451).
2919 (xg_make_tool_item): Give the widget event box a transparent
2920 background.
2921
2922 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2923
2924 Cleanup basic allocation variables and functions.
2925 * alloc.c (ignore_warnings, init_intervals, init_float)
2926 (init_cons, init_symbol, init_marker): Remove.
2927 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2928 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2929 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2930 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2931 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2932 (staticidx, init_alloc_once, init_strings, free_ablock):
2933 Remove redundant initialization.
2934 * fns.c (init_weak_hash_tables): Remove.
2935 * lisp.h (init_weak_hash_tables): Remove prototype.
2936
2937 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2938
2939 Use zero_vector where appropriate.
2940 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2941 accordingly.
2942 * lisp.h (zero_vector): New declaration.
2943 * font.c (null_vector): Remove.
2944 (syms_of_font): Remove initialization and staticpro.
2945 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2946 * keymap.c (Faccessible_keymaps): Likewise.
2947
2948 2012-07-15 Leo Liu <sdl.web@gmail.com>
2949
2950 * fringe.c: Fix typo in comments.
2951
2952 2012-07-14 Leo Liu <sdl.web@gmail.com>
2953
2954 * fringe.c: Add a new bitmap exclamation-mark.
2955
2956 2012-07-14 Eli Zaretskii <eliz@gnu.org>
2957
2958 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2959
2960 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2961 (HAVE_MENUS): Don't define, defined by editing config.in with
2962 msdos/sed2v2.inp.
2963 (GMALLOC_INHIBIT_VALLOC): Don't define.
2964 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2965
2966 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
2967
2968 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2969
2970 2012-07-14 Glenn Morris <rgm@gnu.org>
2971
2972 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2973 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2974 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2975
2976 2012-07-13 Glenn Morris <rgm@gnu.org>
2977
2978 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2979
2980 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2981 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2982
2983 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2984
2985 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2986 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2987 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2988 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2989 where appropriate.
2990 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2991 as boolean expression.
2992 (x_set_window_size): Remove unused variable toolbar.
2993 (ns_get_color_default, ns_mod_to_lisp): Remove.
2994 (ns_mouse_position): Remove unused variables xchar and ychar.
2995 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2996 (ns_set_vertical_scroll_bar): Remove unused variable count.
2997 (ns_delete_terminal): Remove unused variable i.
2998 (ns_term_init): Remove unused variables r, g and b.
2999 (mouseDown): Remove unused variable window.
3000 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3001 (initFrameFromEmacs): Remove unused variable vbextra.
3002 (mouseEntered): Remove unused variables p and dpyinfo.
3003 (mouseExited): Remove unused variables p and r.
3004 (ns_define_frame_cursor, ns_clear_frame_area)
3005 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3006 (menuDown): Assign [sender tag] to variable and cast the variable.
3007
3008 * nsterm.h (menuDown): Add id as type to argument sender.
3009 (ns_display_info_for_name): Add Lisp_Object argument.
3010 (ns_term_init): Add Lisp_Object argument.
3011 (ns_map_event_to_object): Add void argument.
3012 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3013 prototype with arguments and only declare if __OBJC__.
3014 (nxatoms_of_nsselect): Add void argument.
3015 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3016 (ns_alloc_autorelease_pool): Add void argument.
3017 (ns_release_autorelease_pool): Add void* argument.
3018 (ns_get_defaults_value): Add const char* argument.
3019
3020 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3021 (initFromContents): Use SSDATA where appropriate.
3022 (ns_update_menubar): Add braces to ambigous if-else.
3023 (initWithTitle): Put () around assignment in if statement.
3024 (ns_menu_show): Remove unused variables window and keymap.
3025 (update_frame_tool_bar): Remove unused variable selected_p.
3026 (initWithContentRect): Remove unused variable this_cmd_name.
3027
3028 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3029 appropriate.
3030 (setXBMColor): Remove unused variable len.
3031 (setPixmapData): Put () around assignment in loop statement.
3032
3033 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3034 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3035 where appropriate.
3036 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3037 around assignment in loop statement.
3038 (nsfont_open): Remove unused variable i.
3039 (nsfont_open): Remove unused variable len.
3040 (nsfont_draw): Remove unused variable cs.
3041
3042 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3043 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3044 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3045 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3046 (Fns_font_name, Fns_perform_service)
3047 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3048 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3049 (ns_set_name): Remove unused variable view.
3050 (x_set_menu_bar_lines): Remove unused variable olines.
3051 (x_set_tool_bar_lines): Remove unused variable root_window.
3052 (Fns_list_colors): Put () around assignment in while statement.
3053 (Fns_perform_service): Remove unused variable len.
3054 (Fns_display_usable_bounds): Remove unused variable top.
3055 (syms_of_nsfns): Remove unused variable i.
3056
3057 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3058 memcpy (Bug#11907).
3059
3060 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3061
3062 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3063 and free it with DestroyExceptionInfo (Bug#11558).
3064
3065 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3066
3067 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3068 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3069 Set here, not in nt/config.nt.
3070
3071 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3072
3073 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3074 cursor overflow into the last glyph on display line when the right
3075 fringe is off. (Bug#11832)
3076
3077 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3078
3079 * xdisp.c (produce_special_glyphs): Now static.
3080 * dispextern.h (produce_special_glyphs): Remove decl.
3081
3082 2012-07-13 Glenn Morris <rgm@gnu.org>
3083
3084 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3085 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3086
3087 * s/usg5-4-common.h (USG, USG5):
3088 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3089 * s/sol2-6.h (SOLARIS2):
3090 * s/irix6-5.h (IRIX6_5):
3091 * s/hpux10-20.h (USG, USG5, HPUX):
3092 * s/gnu-linux.h (USG, GNU_LINUX):
3093 * s/freebsd.h (BSD_SYSTEM):
3094 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3095 * s/cygwin.h (CYGWIN):
3096 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3097 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3098
3099 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3100
3101 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3102
3103 2012-07-13 Glenn Morris <rgm@gnu.org>
3104
3105 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3106
3107 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3108
3109 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3110 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3111
3112 2012-07-12 Glenn Morris <rgm@gnu.org>
3113
3114 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3115
3116 * process.c (init_process_emacs): Rename from init_process.
3117 The old name is also the name of a Mach system call.
3118 * lisp.h, emacs.c: Update for this name change.
3119 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3120 longer needed.
3121
3122 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3123
3124 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3125 memmove call that removes glyphs covered by the left truncation
3126 glyph. Improve commentary.
3127 (display_line): Fix display of continuation glyphs on GUI frames
3128 when the right fringe is turned off and variable-size fonts are
3129 used in the window. Move the code that appends a stretch glyph to
3130 produce_special_glyphs, so that it could be used for truncation
3131 and continuation glyphs alike.
3132 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3133 glyph of a suitably computed width, to align the special glyphs at
3134 the window margin. Code moved from display_line. (Bug#11832)
3135
3136 2012-07-12 Glenn Morris <rgm@gnu.org>
3137
3138 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3139
3140 * s/gnu-linux.h, s/hpux10-20.h:
3141 Do not unconditionally define HAVE_XRMSETDATABASE.
3142
3143 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3144
3145 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 Fix typos that broke OS X build.
3148 Reported by Randal L. Schwartz in
3149 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3150 * nsterm.m (ns_timeout): Add missing local decl.
3151 (ns_get_color): snprintf -> sprintf, to fix typo.
3152
3153 2012-07-12 Glenn Morris <rgm@gnu.org>
3154
3155 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3156 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3157 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3158 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3159
3160 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3161 Move PTY_OPEN to configure.
3162
3163 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3164 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3165 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3166
3167 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3168
3169 Use empty_unibyte_string where applicable.
3170 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3171 * lread.c (read1): Likewise.
3172 * xsettings.c (syms_of_xsettings): Likewise.
3173
3174 2012-07-12 Glenn Morris <rgm@gnu.org>
3175
3176 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3177 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3178 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3179 * s/hpux10-20.h (RUN_TIME_REMAP):
3180 * s/bsd-common.h (TABDLY): Move to configure.
3181
3182 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3183
3184 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3185
3186 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3187 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3188
3189 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3190
3191 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3192 * s/template.h: Move NARROWPROTO to configure.
3193
3194 2012-07-11 Glenn Morris <rgm@gnu.org>
3195
3196 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3197 unused since 2011-01-17 change to systty.h.
3198
3199 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3200 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3201 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3202
3203 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3204
3205 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3206
3207 2012-07-11 Glenn Morris <rgm@gnu.org>
3208
3209 * s/darwin.h, s/gnu-linux.h, s/template.h:
3210 Move INTERRUPT_INPUT to configure.
3211
3212 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3213
3214 Minor adjustments to interning code.
3215 * lisp.h (intern, intern_c_string): Redefine as static inline
3216 wrappers for intern_1 and intern_c_string_1, respectively.
3217 (intern_1, intern_c_string_1): Rename prototypes.
3218 * lread.c (intern_1, intern_c_string_1, oblookup):
3219 Simplify Vobarray checking.
3220 * font.c (font_intern_prop): Likewise. Adjust comment.
3221 * w32font.c (intern_font_name): Likewise.
3222
3223 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3224
3225 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3226
3227 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3228 of Fcar/Fcdr if possible.
3229 * font.c (check_otf_features): Likewise.
3230 * fontset.c (Fnew_fontset): Likewise.
3231 * gnutls.c (Fgnutls_boot): Likewise.
3232 * minibuf.c (read_minibuf): Likewise.
3233 * msdos.c (IT_set_frame_parameters): Likewise.
3234 * xmenu.c (Fx_popup_dialog): Likewise.
3235 * w32menu.c (Fx_popup_dialog): Likewise.
3236
3237 2012-07-11 Glenn Morris <rgm@gnu.org>
3238
3239 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3240 since nothing has defined it on these platforms.
3241
3242 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3243 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3244
3245 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3246 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3247 Move CLASH_DETECTION to configure.
3248
3249 * s/gnu.h: Remove file, which is now empty.
3250
3251 * s/gnu.h, s/gnu-linux.h:
3252 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3253
3254 2012-07-11 John Wiegley <johnw@newartisans.com>
3255
3256 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3257 function attribute, so we only use it if it exists in the
3258 compiler.
3259
3260 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3261
3262 Avoid call to strlen in fast_c_string_match_ignore_case.
3263 * search.c (fast_c_string_match_ignore_case): Change to use
3264 length argument. Adjust users accordingly.
3265 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3266
3267 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3268
3269 Assume mkdir, rmdir.
3270 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3271 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3272
3273 Assume rename.
3274 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3275
3276 Assume perror.
3277 * s/hpux10-20.h (HAVE_PERROR): Remove.
3278 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3279 Remove dummy definition, as this problem was obsolete long ago.
3280
3281 Assume strerror.
3282 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3283
3284 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3285
3286 Avoid calls to strlen in font processing functions.
3287 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3288 (font_open_by_name): Change to use length argument.
3289 Adjust users accordingly.
3290 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3291 Adjust prototypes.
3292 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3293 Change to return ptrdiff_t.
3294 (xfont_list_pattern, xfont_match): Use length returned by
3295 xfont_decode_coding_xlfd.
3296 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3297
3298 2012-07-11 Glenn Morris <rgm@gnu.org>
3299
3300 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3301 Move DONT_REOPEN_PTY to configure.
3302
3303 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3304 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3305
3306 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3307
3308 Remove "#define unix" that is no longer needed (Bug#11905).
3309 * s/aix4-2.h (unix): Remove; no longer needed.
3310
3311 EMACS_TIME simplification (Bug#11875).
3312 This replaces macros (which typically do not work in GDB)
3313 with functions, typedefs and enums, making the code easier to debug.
3314 The functional style also makes code easier to read and maintain.
3315 * systime.h: Include <sys/time.h> on all hosts, not just if
3316 WINDOWSNT, since 'struct timeval' is needed in general.
3317 (EMACS_TIME): Now a typedef, not a macro.
3318 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3319 not macros.
3320 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3321 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3322 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3323 (EMACS_TIME_LE): Now functions, not macros.
3324 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3325 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3326 which are not functions. All uses rewritten to use:
3327 (make_emacs_time): New function.
3328 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3329 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3330 not functions. All uses rewritten to use the following, respectively:
3331 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3332 (add_emacs_time, sub_emacs_time): New functions.
3333 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3334 * fileio.c (Fcopy_file):
3335 * xterm.c (XTflash): Get the current time closer to when it's used.
3336 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3337
3338 * bytecode.c (targets): Suppress -Woverride-init warnings.
3339
3340 Simplify by avoiding confusing use of strncpy etc.
3341 * doc.c (Fsnarf_documentation):
3342 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3343 * frame.c (Fmake_terminal_frame):
3344 * gtkutil.c (get_utf8_string):
3345 * lread.c (openp):
3346 * nsmenu.m (ns_update_menubar):
3347 * regex.c (regerror):
3348 Prefer memcpy to strncpy and strncat when either will do.
3349 * fileio.c (Fsubstitute_in_file_name):
3350 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3351 (menu_separator_name_p):
3352 * nsmenu.m (ns_update_menubar):
3353 Prefer memcmp to strncmp when either will do.
3354 * nsterm.m: Include <ftoastr.h>.
3355 (ns_get_color):
3356 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3357 Prefer snprintf to strncpy.
3358 * nsterm.m (ns_term_init):
3359 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3360 * nsterm.m (ns_term_init):
3361 Avoid the need for strncpy, by using build_string or
3362 make_unibyte_string directly. Use dtoastr, not snprintf.
3363 * process.c (Fmake_network_process): Diagnose service names that
3364 are too long, rather than silently truncating them or creating
3365 non-null-terminated names.
3366 (Fnetwork_interface_info): Likewise, for interface names.
3367 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3368 Prefer sprintf to strncat.
3369 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3370 Prefer vsnprintf to vsprintf + strncpy.
3371
3372 2012-07-10 Glenn Morris <rgm@gnu.org>
3373
3374 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3375 Clarify fallback case.
3376
3377 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3378
3379 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3380 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3381 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3382 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3383 where argument type is known to be a Lisp_Cons.
3384
3385 2012-07-10 Tom Tromey <tromey@redhat.com>
3386
3387 * bytecode.c (BYTE_CODE_THREADED): New macro.
3388 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3389 (enum byte_code_op): New type.
3390 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3391 (exec_byte_code): Use them. Use token threading when applicable.
3392
3393 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3394
3395 Optimize pure C strings initialization.
3396 * lisp.h (make_pure_string): Fix prototype.
3397 (build_pure_c_string): New function, defined as static inline. This
3398 provides a better opportunity to optimize away calls to strlen when
3399 the function is called with compile-time constant argument.
3400 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3401 argument, adjust users accordingly. Use build_pure_c_string where
3402 appropriate.
3403 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3404 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3405 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3406
3407 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3408
3409 Avoid calls to strlen in miscellaneous functions.
3410 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3411 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3412 * lread.c (openp): Likewise.
3413
3414 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3415
3416 Avoid calls to strlen in path processing functions.
3417 * fileio.c (file_name_as_directory): Add comment. Change to add
3418 srclen argument and return the length of result. Adjust users
3419 accordingly.
3420 (directory_file_name): Fix comment. Change to add srclen argument,
3421 swap 1st and 2nd arguments to obey the common convention.
3422 Adjust users accordingly.
3423 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3424
3425 2012-07-10 Glenn Morris <rgm@gnu.org>
3426
3427 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3428 Move PENDING_OUTPUT_COUNT definition to configure.
3429
3430 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3431 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3432 * s/gnu.h (DATA_START): Move definitions to configure.
3433
3434 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3435 We include usg5-4-common.h, which defines them both.
3436
3437 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3438 O_RDONLY already includes it).
3439
3440 Stop ns builds setting the EMACSLOADPATH environment variable.
3441 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3442 Now it does not set EMACSLOADPATH, just returns the load-path string.
3443 * nsterm.h: Update accordingly.
3444 * lread.c [HAVE_NS]: Include nsterm.h.
3445 (init_lread) [HAVE_NS]: Use ns_load_path.
3446 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3447
3448 2012-07-09 Glenn Morris <rgm@gnu.org>
3449
3450 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3451 since the included bsd-common.h does so.
3452
3453 Stop ns builds setting the EMACSPATH environment variable.
3454 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3455 (ns_init_paths): Do not set EMACSPATH.
3456 * nsterm.h (ns_exec_path): Add it.
3457 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3458 Use ns_exec_path.
3459
3460 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3461
3462 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3463
3464 * process.c (wait_reading_process_output): 'waitchannels' was unset
3465 when read_kbd || !NILP (wait_for_cell); fix this.
3466
3467 Add GCC-style 'const' attribute to functions that can use it.
3468 * character.h (char_resolve_modifier_mask):
3469 * keyboard.h (make_ctrl_char):
3470 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3471 (init_character_once, next_almost_prime, init_fns, init_image)
3472 (flush_pending_output, init_sound):
3473 * mem-limits.h (start_of_data):
3474 * menu.h (finish_menu_items):
3475 Add ATTRIBUTE_CONST.
3476 * emacs.c (DEFINE_DUMMY_FUNCTION):
3477 Declare the dummy function with ATTRIBUTE_CONST.
3478 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3479 Add decls with ATTRIBUTE_CONST.
3480
3481 Minor improvements to make_formatted_string.
3482 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3483 where int is good enough, as vsprintf returns an int.
3484 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3485
3486 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3487
3488 Use make_formatted_string to avoid double length calculation.
3489 * lisp.h (make_formatted_string): New prototype.
3490 * alloc.c (make_formatted_string): New function.
3491 * buffer.c (Fgenerate_new_buffer_name): Use it.
3492 * dbus.c (syms_of_dbusbind): Likewise.
3493 * editfns.c (Fcurrent_time_zone): Likewise.
3494 * filelock.c (get_boot_time): Likewise.
3495 * frame.c (make_terminal_frame, set_term_frame_name)
3496 (x_report_frame_params): Likewise.
3497 * image.c (gs_load): Likewise.
3498 * minibuf.c (get_minibuffer): Likewise.
3499 * msdos.c (dos_set_window_size): Likewise.
3500 * process.c (make_process): Likewise.
3501 * xdisp.c (ensure_echo_area_buffers): Likewise.
3502 * xsettings.c (apply_xft_settings): Likewise.
3503
3504 2012-07-09 Glenn Morris <rgm@gnu.org>
3505
3506 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3507 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3508 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3509 * nsterm.h (ns_etc_directory): Add it.
3510 * callproc.c [HAVE_NS]: Include nsterm.h.
3511 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3512
3513 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3514
3515 Move marker debugging code under MARKER_DEBUG.
3516 * marker.c (MARKER_DEBUG): Move marker debugging code under
3517 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3518 for bootstrap with --enable-checking (~3x slowdown reported
3519 by Juanma Barranquero <lekktu@gmail.com>).
3520 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3521
3522 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3523
3524 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3525 See <http://bugs.gnu.org/11825#29>.
3526
3527 2012-07-08 Eli Zaretskii <eliz@gnu.org>
3528
3529 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3530 has no font, use the frame's font. (Bug#11813)
3531 (display_line): Add commentary about displaying truncation glyphs
3532 on GUI frames.
3533 (produce_special_glyphs): Move here from term.c.
3534
3535 * term.c (produce_special_glyphs): Move to xdisp.c.
3536
3537 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3538 section.
3539
3540 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3541
3542 * xdisp.c (display_line): Avoid warning about implicit declaration
3543 of FRAME_FONT.
3544
3545 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3546
3547 * lisp.h: Remove empty conditional.
3548
3549 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * lread.c (load_path_check): Now static.
3552
3553 Fix some minor --with-ns problems found by static checking.
3554 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3555 (x_set_font) [!HAVE_X_WINDOWS]:
3556 * image.c (xpm_load_image) [HAVE_NS]:
3557 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3558 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3559 Remove unused local.
3560 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3561 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3562 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3563 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3564 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3565 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3566 Fix pointer signedness problem.
3567 * xfaces.c (FRAME_X_FONT_TABLE):
3568 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3569
3570 2012-07-07 Glenn Morris <rgm@gnu.org>
3571
3572 * lread.c (load_path_check): New function, split from init_lread.
3573 (init_lread): Reorganize. Motivation:
3574 If EMACSLOADPATH is set, check/warn about that rather than the
3575 defaults, which we are not going to use. Hence we can remove
3576 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3577 Don't warn if site-lisp directories are missing.
3578 If not installed, start from a blank load-path, since
3579 PATH_LOADSEARCH refers to the eventual installation directories.
3580
3581 2012-07-07 Eli Zaretskii <eliz@gnu.org>
3582
3583 Support truncation and continuation glyphs on GUI frames, when
3584 fringes are disabled. (Bug#11832)
3585 * xdisp.c (init_iterator): Get dimensions of truncation and
3586 continuation glyphs even if on GUI frames.
3587 Adjust it->last_visible_x on GUI frames when the left or right fringes,
3588 or both, are absent.
3589 (start_display, move_it_in_display_line_to): Handle the case of a
3590 GUI frame without a fringe to display continuation or truncation
3591 glyphs.
3592 (insert_left_trunc_glyphs): Support GUI frames: make sure
3593 truncation glyphs overwrite enough glyphs from the current line to
3594 have sufficient space in pixels.
3595 (display_line): Support truncation and continuation glyphs on GUI
3596 frames. If some spare pixels are left on the line after inserting
3597 the truncation glyphs, fill that space with a stretch glyph of a
3598 suitably computed width.
3599
3600 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3601 produce_glyphs, to support GUI sessions.
3602
3603 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3604
3605 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3606
3607 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3608
3609 Do not require float-time's arg to fit in time_t (Bug#11825).
3610 This works better on hosts where time_t is unsigned, and where
3611 float-time is applied to the (negative) difference between two times.
3612 * editfns.c (decode_time_components): Last arg is now double *,
3613 not int *, and means to store all the result as a double, without
3614 worrying about whether the seconds part fits in time_t.
3615 All callers changed.
3616 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3617 All callers changed.
3618 (Ffloat_time): Do not fail merely because the specified time falls
3619 outside of time_t range.
3620
3621 2012-07-07 Glenn Morris <rgm@gnu.org>
3622
3623 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3624 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3625 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3626
3627 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3628
3629 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3630 Update dependencies.
3631
3632 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3633
3634 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3635
3636 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3637 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3638 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3639 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3640 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3641 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3642
3643 * xfont.c (compare_font_names): Redo to omit the need for casts.
3644
3645 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3646
3647 * xfns.c (Fx_change_window_property): Doc fix.
3648 * w32fns.c (Fx_change_window_property): Doc fix.
3649
3650 * w32fns.c (Fx_window_property): Accept the same arguments as the
3651 X Windows version. Doc fix.
3652 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3653
3654 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3655 Eli Zaretskii <eliz@gnu.org>
3656
3657 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3658 Windows-specific code from nt/config.nt moved here.
3659 Obsolete settings removed.
3660
3661 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3662
3663 * process.c: Avoid unnecessary calls to gettime.
3664 (wait_reading_process_output): Don't get the time of day
3665 when gobbling data immediately and not waiting, as there's no need
3666 for it in that case. This removes a FIXME.
3667
3668 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3669
3670 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3671 is defined (Bug#11768).
3672
3673 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3674
3675 Fix marker debugging code.
3676 * marker.c (byte_char_debug_check): Do not perform the check
3677 if buffer is not multibyte.
3678 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3679 Call byte_char_debug_check with correct arguments.
3680
3681 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3682
3683 Compile marker debugging code only if ENABLE_CHECKING is defined.
3684 * marker.c (byte_char_debug_check, count_markers):
3685 Use only if ENABLE_CHECKING is defined.
3686 (byte_debug_flag): Remove.
3687 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3688 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3689
3690 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3691
3692 Avoid code repetition in marker-related functions.
3693 * marker.c (attach_marker): New function.
3694 (Fset_marker, set_marker_restricted, set_marker_both)
3695 (set_marker_restricted_both): Use it.
3696 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3697 Consistently rename charno to charpos.
3698 (marker_position): Add eassert.
3699 (marker_byte_position): Convert to eassert.
3700
3701 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3702
3703 Simplify list operations in unchain_overlay and unchain_marker.
3704 * buffer.c (unchain_overlay): Simplify. Add comment.
3705 * marker.c (unchain_marker): Simplify. Fix comments.
3706
3707 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3708
3709 Introduce fast path for the widely used marker operation.
3710 * alloc.c (build_marker): New function.
3711 * lisp.h (build_marker): New prototype.
3712 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3713 * composite.c (autocmp_chars): Likewise.
3714 * editfns.c (buildmark): Remove.
3715 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3716 (save_restriction_save): Use build_marker.
3717 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3718 * window.c (save_window_save): Likewise.
3719
3720 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3721
3722 Do not use Fdelete_overlay in delete_all_overlays
3723 to avoid redundant calls to unchain_overlay.
3724 * buffer.c (drop_overlay): New function.
3725 (delete_all_overlays, Fdelete_overlay): Use it.
3726 * minibuf.c (get_minibuffer): Fix comment.
3727
3728 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3729
3730 Port to OpenBSD 5.1 amd64.
3731 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3732 This is needed for OpenBSD, and should be harmless on all BSD systems.
3733 Also, include <sys/sysctl.h>, as it should be available on all
3734 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3735 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3736 use p_pid member, not kp_proc.pid.
3737
3738 2012-07-06 Glenn Morris <rgm@gnu.org>
3739
3740 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3741
3742 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3743
3744 More xmalloc and related cleanup.
3745 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3746 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3747 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3748 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3749 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3750 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3751 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3752 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3753 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3754 * xterm.c:
3755 Omit needless casts involving void * pointers and allocation.
3756 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3757 as the former is more robust if P's type is changed.
3758 Prefer xzalloc to xmalloc + memset 0.
3759 Simplify malloc-or-realloc to realloc.
3760 Don't worry about xmalloc returning a null pointer.
3761 Prefer xstrdup to xmalloc + strcpy.
3762 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3763 growing it.
3764 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3765 alloca of a constant.
3766
3767 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3768
3769 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3770 hscroll is larger than the line width. Fixes long and futile
3771 looping inside extend_face_to_end_of_line (on a TTY) producing
3772 glyphs that are not needed and thrown away.
3773
3774 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3775
3776 * marker.c (set_marker_restricted_both): Simplify by using
3777 clip_to_bounds.
3778
3779 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3780
3781 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3782
3783 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3784
3785 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3786 not defined (Bug#11768).
3787 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3788 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3789 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3790 followed by gtk_box_set_homogeneous (Bug#11768).
3791 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3792 (update_theme_scrollbar_width, xg_create_scroll_bar):
3793 Use gtk_scrollbar_new (Bug#11768).
3794 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3795 (is_box_type): New function (Bug#11768).
3796 (xg_tool_item_stale_p): Call is_box_type.
3797 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3798 with default display (Bug#11768).
3799
3800 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3801
3802 * xdisp.c (window_hscroll_limited): New function.
3803 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3804 coordinates when window's hscroll is set to insanely large
3805 values. (Bug#11857)
3806
3807 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
3808
3809 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3810 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3811
3812 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3813
3814 Cleanup xmalloc.
3815 * lisp.h (xzalloc): New prototype. Omit needless casts.
3816 * alloc.c (xzalloc): New function. Omit needless casts.
3817 * charset.c: Omit needless casts. Convert all calls to
3818 xmalloc with following memset to xzalloc.
3819 * dispnew.c: Likewise.
3820 * fringe.c: Likewise.
3821 * image.c: Likewise.
3822 * sound.c: Likewise.
3823 * term.c: Likewise.
3824 * w32fns.c: Likewise.
3825 * w32font.c: Likewise.
3826 * w32term.c: Likewise.
3827 * xfaces.c: Likewise.
3828 * xfns.c: Likewise.
3829 * xterm.c: Likewise.
3830 * atimer.c: Omit needless casts.
3831 * buffer.c: Likewise.
3832 * callproc.c: Likewise.
3833 * ccl.c: Likewise.
3834 * coding.c: Likewise.
3835 * composite.c: Likewise.
3836 * doc.c: Likewise.
3837 * doprnt.c: Likewise.
3838 * editfns.c: Likewise.
3839 * emacs.c: Likewise.
3840 * eval.c: Likewise.
3841 * filelock.c: Likewise.
3842 * fns.c: Likewise.
3843 * gtkutil.c: Likewise.
3844 * keyboard.c: Likewise.
3845 * lisp.h: Likewise.
3846 * lread.c: Likewise.
3847 * minibuf.c: Likewise.
3848 * msdos.c: Likewise.
3849 * print.c: Likewise.
3850 * process.c: Likewise.
3851 * region-cache.c: Likewise.
3852 * search.c: Likewise.
3853 * sysdep.c: Likewise.
3854 * termcap.c: Likewise.
3855 * terminal.c: Likewise.
3856 * tparam.c: Likewise.
3857 * w16select.c: Likewise.
3858 * w32.c: Likewise.
3859 * w32reg.c: Likewise.
3860 * w32select.c: Likewise.
3861 * w32uniscribe.c: Likewise.
3862 * widget.c: Likewise.
3863 * xdisp.c: Likewise.
3864 * xmenu.c: Likewise.
3865 * xrdb.c: Likewise.
3866 * xselect.c: Likewise.
3867
3868 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3869
3870 * fileio.c (time_error_value): Check the right error number.
3871 Problem reported by Troels Nielsen in
3872 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3873
3874 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3877 This should be fixed in a better way; see Eli Zaretskii in
3878 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3879 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3880
3881 * fileio.c (time_error_value): Rename from special_mtime.
3882 The old name's problems were noted by Eli Zaretskii in
3883 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3884
3885 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3886 This variable's comment says Emacs needs at least one GDB-visible
3887 symbol of type enum pvec_type, to work around GDB problems.
3888 The symbol's value doesn't matter.
3889
3890 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3891 that causes compilation to fail on pre-C99 compilers.
3892
3893 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
3894
3895 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3896 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3897
3898 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3899
3900 * buffer.c (init_buffer_once): Fix initialization of
3901 headers for buffer_defaults and buffer_local_symbols.
3902 Reported by Juanma Barranquero <lekktu@gmail.com>.
3903
3904 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3905
3906 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3907 * lisp.h (enum pvec_type): Use fewer bits.
3908 (PSEUDOVECTOR_SIZE_BITS): New constant.
3909 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3910 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3911 change in pvec_type.
3912 (PSEUDOVECTOR_TYPEP): New macro.
3913 (TYPED_PSEUDOVECTORP): Use it.
3914 * fns.c (internal_equal): Adapt code to extract pvectype.
3915 * emacs.c (gdb_pvec_type): Update type.
3916 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3917 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3918 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3919 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3920 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3921 abusing vector->header.next.nbytes.
3922 (live_vector_p): Use PVEC_TYPE.
3923 (mark_object): Adapt code to extract pvectype. Use switch.
3924
3925 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3928 Tighten new eassert a bit.
3929
3930 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3931
3932 Fix compilation with --enable-gcc-warnings and -O1
3933 optimization level.
3934 * doprnt.c (doprnt): Change type of tem to int, initialize
3935 to avoid compiler warning. Add eassert.
3936 * search.c (simple_search): Initialize match_byte to avoid
3937 compiler warning. Add eassert.
3938
3939 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3940
3941 Avoid weird behavior with large horizontal scrolls.
3942 Without this change, for example, large hscroll values would
3943 mess up Emacs's display on Fedora 15 x86, presumably due to
3944 overflows in int calculations in the display code.
3945 Also, if buffers had long lines, Emacs would freeze.
3946 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3947 (set_window_hscroll): New function, containing the old guts of
3948 Fset_window_hscroll. Return the clipped value.
3949 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3950 This avoids the need to check against PTRDIFF_MAX.
3951
3952 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3953
3954 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3955
3956 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3957
3958 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3959
3960 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3961 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3962 since GCC 4.4.6 issues a bogus warning for them.
3963
3964 Fix bugs in file timestamp newness comparisons.
3965 * fileio.c (Ffile_newer_than_file_p):
3966 * lread.c (Fload): Use full timestamp resolution of files,
3967 not just the 1-second resolution, so that files that are only
3968 slightly newer still count as newer.
3969 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3970 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3971
3972 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3973
3974 * fileio.c: Improve handling of file time marker. (Bug#11852)
3975 (special_mtime): New function.
3976 (Finsert_file_contents, Fverify_visited_file_modtime):
3977 Use it to set special mtime values consistently.
3978
3979 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3980
3981 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3982 marker for non-existing file. (Bug#11852)
3983
3984 2012-07-03 Glenn Morris <rgm@gnu.org>
3985
3986 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3987 and did not make it into globals.h).
3988
3989 2012-07-03 Tom Tromey <tromey@redhat.com>
3990
3991 * window.c (Fset_window_margins, Fset_window_fringes)
3992 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3993 * textprop.c (Fprevious_property_change): No longer static.
3994 * syntax.c (Fsyntax_table_p): No longer static.
3995 * process.c (Fget_process, Fprocess_datagram_address): No longer
3996 static.
3997 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3998 * keyboard.c (Fcommand_execute): No longer static.
3999 Remove EXFUN.
4000 * insdel.c (Fcombine_after_change_execute): No longer static.
4001 * image.c (Finit_image_library): No longer static.
4002 * fileio.c (Fmake_symbolic_link): No longer static.
4003 * eval.c (Ffetch_bytecode): No longer static.
4004 * editfns.c (Fuser_full_name): No longer static.
4005 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4006 No longer static.
4007 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4008 static.
4009 * dired.c (Ffile_attributes): No longer static.
4010 * composite.c (Fcomposition_get_gstring): No longer static.
4011 * callproc.c (Fgetenv_internal): No longer static.
4012
4013 * ccl.h: Remove EXFUNs.
4014 * buffer.h: Remove EXFUNs.
4015 * dispextern.h: Remove EXFUNs.
4016 * intervals.h: Remove EXFUNs.
4017 * fontset.h: Remove EXFUN.
4018 * font.h: Remove EXFUNs.
4019 * dosfns.c (system_process_attributes): Remove EXFUN.
4020 * keymap.h: Remove EXFUNs.
4021 * lisp.h: Remove EXFUNs.
4022 * w32term.h: Remove EXFUNs.
4023 * window.h: Remove EXFUNs.
4024 * xsettings.h: Remove EXFUN.
4025 * xterm.h: Remove EXFUN.
4026
4027 2012-07-03 Glenn Morris <rgm@gnu.org>
4028
4029 * lisp.h (Frandom): Make it visible to C.
4030 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4031 buffer for invisible buffers. (Bug#1229)
4032
4033 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4034
4035 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4036 values which aren't power of 2.
4037 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4038 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4039 accordingly.
4040
4041 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4042
4043 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4044
4045 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4046
4047 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4048
4049 * alloc.c (allocate_vector_block): Remove redundant
4050 calls to mallopt if DOUG_LEA_MALLOC is defined.
4051 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4052 avoid calls to mallopt if zero_vector is returned.
4053
4054 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4055
4056 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4057 is enabled, avoid dereferencing NULL current_sblock if
4058 running undumped.
4059
4060 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4061
4062 Cleanup basic buffer management.
4063 * buffer.h (struct buffer): Change layout to use generic vector
4064 marking code. Fix some comments. Change type of 'clip_changed'
4065 to bitfield. Remove unused #ifndef old.
4066 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4067 (GET_OVERLAYS_AT): Fix indentation.
4068 (for_each_per_buffer_object_at): New macro.
4069 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4070 (Fbuffer_local_variables): Use it.
4071 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4072 * alloc.c (allocate_buffer): Adjust to match new layout of
4073 struct buffer. Fix comment.
4074 (mark_overlay): New function.
4075 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4076 Lisp area of struct buffer.
4077 (mark_object): Use it. Adjust marking of misc objects
4078 and related comments.
4079
4080 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4081
4082 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4083 wrapper that is not needed because the wrapped code is a no-op (zero
4084 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4085 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4086
4087 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4088
4089 * alloc.c (mark_buffer): Simplify. Remove prototype.
4090 (mark_object): Add comment. Reorganize marking of vector-like
4091 objects. Use CHECK_LIVE for all vector-like objects except buffers
4092 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4093 Avoid redundant calls to mark_vectorlike for bool vectors.
4094
4095 2012-06-30 Glenn Morris <rgm@gnu.org>
4096
4097 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4098
4099 * epaths.in (PATH_SITELOADSEARCH): New.
4100 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4101 This is rather than relying on --enable-locallisppath elements
4102 having "site-lisp" in their names. (Bug#10208#25, 11658)
4103
4104 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4105
4106 * w32proc.c (sys_select): Accept and ignore one more argument.
4107
4108 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4109
4110 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4111 (pselect) [!MS_DOS]: Redirect to sys_select.
4112
4113 * sysdep.c: Don't include dos.h and dosfns.h.
4114
4115 * process.c (sys_select):
4116 * msdos.c (sys_select): Accept one more argument and ignore it.
4117
4118 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4119 adapt data types and code to that.
4120
4121 * dosfns.c:
4122 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4123 which clashes with the gnulib function of the same name.
4124
4125 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4126
4127 * font.c (font_style_to_value, font_style_symbolic)
4128 (font_prop_validate_style): Add type checks for values in
4129 font_style_table.
4130
4131 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4132 argument.
4133 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4134 uses.
4135
4136 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4137
4138 * xdisp.c (try_window_id): Undo last change.
4139
4140 * w32.c (getwd): Adjust commentary about startup_dir.
4141 (init_environment): Always call sys_access, even in non-MSVC
4142 builds. Don't chdir to the directory of the Emacs executable.
4143 This undoes code from 1997 which was justified by the need to
4144 "avoid conflicts when removing and renaming directories". But its
4145 downside was that every relative file name was being interpreted
4146 relative to the directory of the Emacs executable, which can never
4147 be TRT. In particular, it broke sys_access when called with
4148 relative file names.
4149 (sys_access): Map GetLastError to errno.
4150
4151 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4152
4153 * window.h (struct window): Change type of 'fringes_outside_margins'
4154 to bitfield. Fix comment. Adjust users accordingly.
4155 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4156 Adjust comment.
4157 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4158 to ptrdiff_t.
4159
4160 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4161
4162 * gnutls.c (emacs_gnutls_handshake):
4163 Add QUIT to make the loop interruptible.
4164
4165 2012-06-29 Glenn Morris <rgm@gnu.org>
4166
4167 * charset.c (init_charset): Make lack of etc/charsets fatal.
4168
4169 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4170
4171 * editfns.c (region_limit): Fix type mismatch.
4172
4173 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4174
4175 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4176 undefined. Convert from xassert to eassert.
4177 * nsmenu.m: Convert from xassert to eassert.
4178 * nsterm.m: Likewise.
4179
4180 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4181
4182 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4183
4184 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4185
4186 Avoid integer overflow on scroll-left and scroll-right.
4187 * window.c (HSCROLL_MAX): New macro.
4188 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4189 overflow when requested scroll falls outside ptrdiff_t range.
4190
4191 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 * window.h (struct window): Change type of 'hscroll',
4194 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4195 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4196 Adjust users accordingly.
4197 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4198 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4199 from EMACS_INT to ptrdiff_t.
4200 (make_window): Omit redundant initialization.
4201
4202 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4203
4204 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4205
4206 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4207
4208 * window.h (struct window): Change type of 'use_time' and
4209 'sequence_number' from Lisp_Object to int.
4210 * frame.c (make_frame): Adjust users accordingly.
4211 * print.c (print_object): Likewise.
4212 * window.c (select_window, Fwindow_use_time, make_parent_window)
4213 (make_window): Likewise.
4214
4215 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4218 enabled with --enable-checking=[all,glyphs] configure option.
4219 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4220 adjust comments accordingly.
4221 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4222 undefined, adjust comments accordingly.
4223 * image.c: Likewise.
4224 * scroll.c: Likewise.
4225 * w32fns.c: Likewise.
4226 * w32term.c: Likewise.
4227 * xdisp.c: Likewise.
4228 * xfaces.c: Likewise.
4229 * xfns.c: Likewise.
4230 * xterm.c: Likewise.
4231
4232 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4233
4234 Generalize run-time debugging checks.
4235 * dispextern.h (XASSERTS): Remove.
4236 * fontset.c (xassert): Remove.
4237 Convert from xassert to eassert.
4238 * alloc.c: Convert from xassert to eassert.
4239 * bidi.c: Likewise.
4240 * dispnew.c: Likewise.
4241 * fns.c: Likewise.
4242 * fringe.c: Likewise.
4243 * ftfont.c: Likewise.
4244 * gtkutil.c: Likewise.
4245 * image.c: Likewise.
4246 * keyboard.c: Likewise.
4247 * menu.c: Likewise.
4248 * process.c: Likewise.
4249 * scroll.c: Likewise.
4250 * sound.c: Likewise.
4251 * term.c: Likewise.
4252 * w32console.c: Likewise.
4253 * w32fns.c: Likewise.
4254 * w32term.c: Likewise.
4255 * window.c: Likewise.
4256 * xdisp.c: Likewise.
4257 * xfaces.c: Likewise.
4258 * xfns.c: Likewise.
4259 * xselect.c: Likewise.
4260 * xterm.c: Likewise.
4261
4262 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4263
4264 * fns.c (maybe_resize_hash_table): Output message when growing the
4265 purify-hashtable.
4266
4267 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4268
4269 * alloc.c (allocate_string_data): Remove dead code.
4270 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4271 avoid GCC warning about unused macro.
4272
4273 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4274
4275 * alloc.c (allocate_string): Omit intervals initialization.
4276 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4277 as in make_pure_string and make_pure_c_string.
4278
4279 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4280
4281 * alloc.c (allocate_string): Fix last change.
4282
4283 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4284
4285 * alloc.c (allocate_string): Remove two redundant calls
4286 to memset, add explicit initialization where appropriate.
4287
4288 2012-06-27 Glenn Morris <rgm@gnu.org>
4289
4290 * lisp.mk (lisp): Remove paths.elc.
4291
4292 2012-06-27 Chong Yidong <cyd@gnu.org>
4293
4294 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4295
4296 2012-06-26 John Wiegley <johnw@newartisans.com>
4297
4298 * unexmacosx.c (copy_data_segment): Add two section names used
4299 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4300
4301 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4302 when building with Clang.
4303
4304 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4305
4306 * eval.c (Fapply): Allow calling it with a single argument.
4307
4308 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4309
4310 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4311 _stricmp and _strnicmp.
4312 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4313
4314 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4315
4316 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4317 allocated window.
4318 (allocate_process): Likewise for new process.
4319 (allocate_terminal): Change to use offsetof.
4320 (allocate_frame): Likewise.
4321 * frame.c (make_frame): Omit redundant initialization.
4322 * window.c (make_parent_window): Use memset.
4323 (make_window): Omit redundant initialization.
4324 * process.c (make_process): Omit redundant initialization.
4325 * terminal.c (create_terminal): Likewise.
4326
4327 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4328
4329 * term.c (delete_tty): Remove redundant call to memset.
4330
4331 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4332
4333 * alloc.c: Remove build_string.
4334 * lisp.h: Define build_string as static inline. This provides
4335 a better opportunity to optimize away calls to strlen when the
4336 function is called with compile-time constant argument.
4337 * image.c (imagemagick_error): Convert to build_string.
4338 * w32proc.c (sys_spawnve): Likewise.
4339 * xterm.c (x_term_init): Likewise.
4340
4341 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4342
4343 Use sprintf return value instead of invoking strlen on result.
4344 In the old days this wasn't portable, since some sprintf
4345 implementations returned char *. But they died out years ago and
4346 Emacs already assumes sprintf returns int.
4347 Similarly for float_to_string.
4348 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4349 * ccl.c (ccl_driver):
4350 * character.c (string_escape_byte8):
4351 * data.c (Fnumber_to_string):
4352 * doprnt.c (doprnt):
4353 * print.c (print_object):
4354 * xdisp.c (message_dolog):
4355 * xfns.c (syms_of_xfns):
4356 Use sprintf or float_to_string result to avoid need to call strlen.
4357 * data.c (Fnumber_to_string):
4358 Use make_unibyte_string, since the string must be ASCII.
4359 * lisp.h, print.c (float_to_string): Now returns int length.
4360 * term.c (produce_glyphless_glyph):
4361 Use sprintf result rather than recomputing it.
4362
4363 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4364 * Makefile.in (ALL_CFLAGS):
4365 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4366 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4367
4368 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4369
4370 * dispextern.h (xstrcasecmp): Define to library function
4371 strcasecmp if available.
4372 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4373
4374 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4375
4376 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4377 Avoid comma operator.
4378 * menu.c (push_submenu_start, push_submenu_end)
4379 (push_left_right_boundary, push_menu_pane): Likewise.
4380 * msdos.c (dos_rawgetc): Likewise.
4381
4382 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4383
4384 * xfns.c (xic_create_fontsetname): Remove redundant calls
4385 to memset.
4386
4387 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4388
4389 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4390 sprintf already null-terminates its output.
4391
4392 * xfns.c (x_window): Remove redundant cast.
4393
4394 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4397 `const char *' to `char *' to avoid compiler warning.
4398
4399 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4400
4401 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4402 instead of truncating it to 63 (admittedly a generous limit).
4403
4404 * process.c: Fix spelling and caps in comments.
4405
4406 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4407
4408 * emacs.c (setpgrp): Remove definition, unused.
4409 * sysdep.c (setpgrp): Remove definition, not used in this file.
4410
4411 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4412
4413 * makefile.w32-in: Update dependencies.
4414
4415 2012-06-24 Eli Zaretskii <eliz@gnu.org>
4416
4417 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4418 (SYSTIME_H): Add nt/inc/sys/time.h.
4419
4420 * systime.h [WINDOWSNT]: Include sys/time.h.
4421
4422 * s/ms-w32.h (struct timespec): Definition moved from
4423 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4424
4425 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4426
4427 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4428 * buffer.h (buffer_slot_type_mismatch):
4429 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4430 * eval.c (unwind_to_catch):
4431 * image.c (my_png_error, my_error_exit):
4432 * keyboard.c (quit_throw_to_read_char, user_error)
4433 (Fexit_recursive_edit, Fabort_recursive_edit):
4434 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4435 (wrong_type_argument, buffer_overflow, __executable_start)
4436 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4437 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4438 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4439 (fatal):
4440 (child_setup) [!DOS_NT]:
4441 * lread.c (end_of_file_error, invalid_syntax):
4442 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4443 * puresize.h (pure_write_error):
4444 * search.c (matcher_overflow):
4445 * sound.c (sound_perror, alsa_sound_perror):
4446 * sysdep.c, syssignal.h (croak):
4447 * term.c (maybe_fatal, vfatal):
4448 * textprop.c (text_read_only):
4449 * undo.c (user_error):
4450 * unexmacosx.c (unexec_error):
4451 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4452 Use _Noreturn rather than NO_RETURN.
4453 No need for separate decl merely because of _Noreturn.
4454 * sound.c (sound_warning, parse_sound):
4455 Remove unnecessary forward decls.
4456
4457 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4458
4459 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4460 * lisp.h (WAIT_READING_MAX): New macro.
4461 * dispnew.c (Fsleep_for, sit_for):
4462 * keyboard.c (kbd_buffer_get_event):
4463 * process.c (Faccept_process_output):
4464 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4465 This improves on the previous patch, which introduced a bug
4466 when time_t is unsigned and as wide as intmax_t.
4467 See <http://bugs.gnu.org/9000#51>.
4468
4469 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4470
4471 * dispnew.c (sit_for, Fsleep_for):
4472 * keyboard.c (kbd_buffer_get_event):
4473 * process.c (Faccept_process_output): Avoid compiler warnings when
4474 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4475
4476 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
4477
4478 * makefile.w32-in: Update dependencies.
4479
4480 * w32.c (ltime): Add return type and declare static.
4481 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4482
4483 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4484
4485 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4486 Privately reported by Herbert J. Skuhra.
4487 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4488 All uses changed.
4489 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4490 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4491
4492 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4493
4494 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4495 last argument of make_unibyte_string.
4496
4497 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4498 language ID in the event parameters.
4499
4500 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4501 event.code, not the obscure "character set ID".
4502
4503 2012-06-23 Chong Yidong <cyd@gnu.org>
4504
4505 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4506
4507 2012-06-23 Eli Zaretskii <eliz@gnu.org>
4508
4509 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4510 * w32.c (fdutimens): New function.
4511
4512 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4513
4514 * s/ms-w32.h (pselect): Redirect to sys_select.
4515
4516 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4517
4518 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4519 in the logic of incrementing and decrementing the value of
4520 use_relocatable_buffers.
4521
4522 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4523
4524 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4525 Privately reported by Herbert J. Skuhra.
4526 [__FreeBSD__]: Remove "*/" typo after "#include".
4527 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4528 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4529 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4530 Don't assume EMACS_TIME and struct timeval are the same type.
4531
4532 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4533
4534 Support higher-resolution time stamps (Bug#9000).
4535 The time stamps are only nanosecond-resolution at the C level,
4536 since that's the best that any real-world system supports now.
4537 But they are picosecond-resolution at the Lisp level, as that's
4538 easy, and leaves room for future OS improvements.
4539
4540 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4541 (LIBES): Use it.
4542
4543 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4544 Don't get current time unless it's needed.
4545
4546 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4547 now provides it if it's absent.
4548 (start_atimer): Port to higher-res time stamps.
4549 Check for time stamp overflow. Don't get current time more
4550 often than is needed.
4551
4552 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4553 Include systime.h, not time.h.
4554 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4555
4556 * dired.c: Include stat-time.h.
4557 (Ffile-attributes): File times now have higher resolution.
4558
4559 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4560 (struct image): Timestamp now has higher resolution.
4561
4562 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4563 has at least microseconds now. All uses removed.
4564 (update_frame, update_single_window, update_window, update_frame_1)
4565 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4566 (duration_to_sec_usec): Remove; no longer needed.
4567
4568 * editfns.c (time_overflow): Now extern.
4569 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4570 (float-time, Fformat_time_string, Fcurrent_time_string)
4571 (Fcurrent_time_zone): Accept and generate higher-resolution
4572 time stamps.
4573 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4574 (decode_time_components, lisp_seconds_argument): New functions.
4575 (make_time): Now static.
4576 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4577 Report an error if the time is invalid, rather than having the caller
4578 do that.
4579
4580 * fileio.c: Include <stat-time.h>
4581 (Fcopy_file): Copy higher-resolution time stamps.
4582 Prefer to set the time stamp via a file descriptor if that works.
4583 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4584 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4585 (Fvisited_file_modtime, Fset_visited_file_modtime):
4586 Support higher-resolution time stamps.
4587
4588 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4589
4590 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4591
4592 * image.c (prepare_image_for_display, clear_image_cache)
4593 (lookup_image): Port to higer-resolution time stamps.
4594
4595 * keyboard.c (start_polling, bind_polling_period):
4596 Check for time stamp overflow.
4597 (read_char, kbd_buffer_get_event, timer_start_idle)
4598 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4599 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4600 Port to higher-resolution time stamps. Do not assume time_t is signed.
4601 (decode_timer): New function. Timers are now vectors of length 9,
4602 not 8, to accommodate the picosecond component.
4603 (timer_check_2): Use it.
4604
4605 * nsterm.m (select_timeout, timeval_subtract): Remove.
4606 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4607 as they're a bit more accurate and handle overflow better.
4608 (ns_select): Change prototype to be compatible with pselect.
4609 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4610 * nsterm.h (ns_select): Adjust prototype.
4611
4612 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4613 us-resolution time stamps.
4614 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4615
4616 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4617
4618 * lisp.h (time_overflow): New decl.
4619 (wait_reading_process_output): First arg is now intmax_t, not int,
4620 to accommodate larger waits.
4621
4622 * process.h (struct Lisp_Process.read_output_delay):
4623 Now counts nanoseconds, not microseconds.
4624 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4625 EMACS_HAS_USECS.
4626 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4627 (wait_reading_process_output):
4628 Port to ns-resolution time stamps.
4629 (Faccept_process_output, wait_reading_process_output):
4630 Check for time stamp overflow. Do not assume time_t is signed.
4631 (select_wrapper): Remove; we now use pselect.
4632 (Fprocess_attributes): Now generates ns-resolution time stamps.
4633
4634 * sysdep.c: Include utimens.h. Don't include utime.h
4635 or worry about struct utimbuf; gnulib does that for us now.
4636 (gettimeofday): Remove; gnulib provides a substitute.
4637 (make_timeval): New function.
4638 (set_file_times): Now sets ns-resolution time stamps.
4639 New arg FD; all uses changed.
4640 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4641 (system_process_attributes):
4642 Now returns ns-resolution time stamp. All uses changed.
4643 Check for time stamp overflow.
4644
4645 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4646 provides a substitute now.
4647
4648 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4649 since it guarantees struct timespec.
4650 (EMACS_TIME): Now struct timespec, so that we can support
4651 ns-resolution time stamps.
4652 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4653 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4654 (EMACS_USECS): Remove.
4655 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4656 so multiply the arg by 1000 before storing it.
4657 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4658 New macros.
4659 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4660 Port to ns-resolution time stamps.
4661 (EMACS_TIME_NEG_P): Remove; replaced by....
4662 (EMACS_TIME_SIGN): New macro.
4663 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4664 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4665 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4666 (make_timeval, make_lisp_time, decode_time_components): New decls.
4667 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4668 that it mishandled time_t overflow. You can't compare by subtracting!
4669 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4670 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4671
4672 * term.c: Include <sys/time.h>.
4673 (timeval_to_Time): New function, for proper overflow wraparound.
4674 (term_mouse_position, term_mouse_click): Use it.
4675
4676 * undo.c (record_first_change): Support higher-resolution time stamps
4677 in the undo buffer.
4678 (Fprimitive_undo): Use them when restoring time stamps.
4679
4680 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4681 (w32_get_internal_run_time):
4682 Port to higher-resolution Emacs time stamps.
4683 (ltime): Now accepts single 64-bit integer, as that's more convenient
4684 for callers.
4685
4686 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4687
4688 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4689 for compatibility with pselect. Support ns-resolution time stamps.
4690
4691 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4692
4693 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4694 Check for time stamp overflow, and support ns-resolution time stamps.
4695
4696 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4697 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4698 (timeval_subtract): Remove; no longer needed.
4699 (XTflash, XTring_bell, x_wait_for_event):
4700 Port to ns-resolution time stamps. Don't assume time_t is signed.
4701
4702 2012-06-22 Chong Yidong <cyd@gnu.org>
4703
4704 * xdisp.c (x_consider_frame_title): Revert last change.
4705
4706 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4707
4708 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4709 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4710 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4711 staticidx goes up to 1597 out of 1600 = 0x640.)
4712
4713 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4714
4715 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4716 Otherwise, the umask might be mistakenly 0 while handling input signals.
4717
4718 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4719
4720 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4721
4722 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4723
4724 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4725 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4726 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4727 access to `contents' member of Lisp_Vector objects with AREF and ASET
4728 where appropriate.
4729
4730 2012-06-19 Chong Yidong <cyd@gnu.org>
4731
4732 * frame.c (delete_frame): When selecting a frame on a different
4733 text terminal, do not alter the terminal's top-frame.
4734
4735 * xdisp.c (format_mode_line_unwind_data): Record the target
4736 frame's selected window and its terminal's top-frame.
4737 (unwind_format_mode_line): Restore them.
4738 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4739 Callers changed.
4740 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4741 since tty frames can be explicitly named.
4742 (prepare_menu_bars): Likewise.
4743
4744 * term.c (Ftty_top_frame): New function.
4745
4746 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4747
4748 Port byte-code-meter to modern targets.
4749 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4750 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4751 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4752 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4753 (METER_1, METER_2): Simplify.
4754
4755 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4756
4757 * data.c (Fdefalias): Return `symbol' (bug#11686).
4758
4759 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4760
4761 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4762 gets killed during executing of this function (Bug#11665).
4763 Try to always return Qt when the buffer has been actually killed.
4764 (Vkill_buffer_query_functions): In doc-string say that functions
4765 run by this hook should not change the current buffer.
4766
4767 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4768
4769 Fix recently-introduced process.c problems found by static checking.
4770 * process.c (write_queue_push, write_queue_pop, send_process):
4771 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4772 (write_queue_pop): Fix pointer signedness problem.
4773 (send_process): Remove unused local.
4774
4775 2012-06-17 Chong Yidong <cyd@gnu.org>
4776
4777 * xdisp.c (redisplay_internal): No need to redisplay terminal
4778 frames that are not on top.
4779
4780 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4781
4782 * process.c (make_process): Initialize write_queue.
4783 (write_queue_push, write_queue_pop): New functions.
4784 (send_process): Use them to maintain correct ordering of process
4785 writes (Bug#10815).
4786
4787 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4788
4789 * lisp.h (eassert): Assume C89 or later.
4790 This removes the need for CHECK.
4791 (CHECK): Remove. Its comments about always evaluating its
4792 argument were confusing, as 'eassert' typically does not evaluate
4793 its argument.
4794
4795 * coding.c (produce_chars): Use ptrdiff_t, not int.
4796
4797 * xterm.c (x_draw_underwave): Check for integer overflow.
4798 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4799
4800 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
4801
4802 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4803 referenced (Bug#11583).
4804
4805 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4806
4807 Implement wave-style variant of underlining.
4808 * dispextern.h (face_underline_type): New enum.
4809 (face): Add field for underline type.
4810 * nsterm.m (ns_draw_underwave): New function.
4811 (ns_draw_text_decoration): Use it.
4812 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4813 New functions.
4814 (x_draw_glyph_string): Use them.
4815 * xfaces.c (Qline, Qwave): New Lisp objects.
4816 (check_lface_attrs, merge_face_ref)
4817 (Finternal_set_lisp_face_attribute, realize_x_face):
4818 Handle wave-style underline face attributes.
4819 * xterm.c (x_draw_underwave): New function.
4820 (x_draw_glyph_string): Use it.
4821
4822 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
4823
4824 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4825 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4826 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4827 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4828 ($(BLD)/w32select.$(O)): Update dependencies.
4829
4830 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4831
4832 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4833 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4834 * character.c (_fetch_multibyte_char_p): Remove.
4835 * alloc.c: Include "character.h" before "buffer.h".
4836 * bidi.c: Likewise.
4837 * buffer.c: Likewise.
4838 * bytecode.c: Likewise.
4839 * callint.c: Likewise.
4840 * callproc.c: Likewise.
4841 * casefiddle.c: Likewise.
4842 * casetab.c: Likewise.
4843 * category.c: Likewise.
4844 * cmds.c: Likewise.
4845 * coding.c: Likewise.
4846 * composite.c: Likewise.
4847 * dired.c: Likewise.
4848 * dispnew.c: Likewise.
4849 * doc.c: Likewise.
4850 * dosfns.c: Likewise.
4851 * editfns.c: Likewise.
4852 * emacs.c: Likewise.
4853 * fileio.c: Likewise.
4854 * filelock.c: Likewise.
4855 * font.c: Likewise.
4856 * fontset.c: Likewise.
4857 * fringe.c: Likewise.
4858 * indent.c: Likewise.
4859 * insdel.c: Likewise.
4860 * intervals.c: Likewise.
4861 * keyboard.c: Likewise.
4862 * keymap.c: Likewise.
4863 * lread.c: Likewise.
4864 * macros.c: Likewise.
4865 * marker.c: Likewise.
4866 * minibuf.c: Likewise.
4867 * nsfns.m: Likewise.
4868 * nsmenu.m: Likewise.
4869 * print.c: Likewise.
4870 * process.c: Likewise.
4871 * regex.c: Likewise.
4872 * region-cache.c: Likewise.
4873 * search.c: Likewise.
4874 * syntax.c: Likewise.
4875 * term.c: Likewise.
4876 * textprop.c: Likewise.
4877 * undo.c: Likewise.
4878 * unexsol.c: Likewise.
4879 * w16select.c: Likewise.
4880 * w32fns.c: Likewise.
4881 * w32menu.c: Likewise.
4882 * window.c: Likewise.
4883 * xdisp.c: Likewise.
4884 * xfns.c: Likewise.
4885 * xmenu.c: Likewise.
4886 * xml.c: Likewise.
4887 * xselect.c: Likewise.
4888
4889 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4890
4891 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4892 If all the glyphs of the glyph row came from strings, and we have no
4893 cursor positioning clues, put the cursor on the first glyph of the
4894 row.
4895 (handle_face_prop): Use chunk-relative overlay string index when
4896 indexing into it->string_overlays array. (Bug#11653)
4897 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4898 the rightmost. (Bug#11720)
4899
4900 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4901
4902 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4903 (CATEGORY_MEMBER): Enforce 1/0 value.
4904 * category.c (_temp_category_set): Remove.
4905
4906 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4907
4908 * window.c (Fdelete_other_windows_internal)
4909 (Fdelete_window_internal): Don't access frame's mouse highlight
4910 info of the initial frame. (Bug#11677)
4911
4912 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4915 Assume USE_2_TAGS_FOR_INTS.
4916 (xreload): Adjust $tagmask width to match recent lisp.h change.
4917
4918 Simplify lisp.h in minor ways that should not affect code.
4919 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4920 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4921 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4922 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4923 (INTTYPEBITS): New macro, for clarity.
4924 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
4925 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4926 Simplify now that USE_LSB_TAG is always defined.
4927 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4928 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4929
4930 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
4931
4932 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4933
4934 2012-06-13 Glenn Morris <rgm@gnu.org>
4935
4936 * s/bsd-common.h (BSD4_3):
4937 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4938
4939 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4940
4941 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4942 instead of union.
4943 (XLI, XIL): Define.
4944 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4945 Use them.
4946 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
4947 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
4948 * alloc.c (widen_to_Lisp_Object): Remove.
4949 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4950 * frame.c (delete_frame): Remove outdated comment.
4951 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4952 USE_LISP_UNION_TYPE.
4953 (Fw32_unregister_hot_key): Likewise.
4954 (Fw32_toggle_lock_key): Likewise.
4955 * w32menu.c (add_menu_item): Likewise.
4956 (w32_menu_display_help): Use XIL instead of checking
4957 USE_LISP_UNION_TYPE.
4958 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4959 (init_heap): Likewise.
4960 * w32term.c (w32_read_socket): Update comment.
4961
4962 2012-06-13 Glenn Morris <rgm@gnu.org>
4963
4964 * s/usg5-4-common.h, src/s/unixware.h:
4965 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4966
4967 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4968
4969 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4970
4971 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4972 * alloc.c (make_number) [!defined make_number]:
4973 Remove, as lisp.h always defines this now.
4974 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4975 (roundup_size): Verify that it is a power of 2.
4976 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4977 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4978 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4979 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4980 USE_LSB_TAG now is always defined to be either 0 or 1.
4981 All uses changed.
4982 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4983 code works fine either way, and efficiency is not a concern here,
4984 as the union type is for debugging, not for production.
4985 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4986 Use an inline function on all platforms when using the union type,
4987 since this is simpler and 'static inline' can be used portably
4988 within Emacs now.
4989 (LISP_INITIALLY_ZERO): New macro.
4990 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4991 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4992
4993 2012-06-12 Glenn Morris <rgm@gnu.org>
4994
4995 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4996
4997 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
4998
4999 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5000 Move BROKEN_SIGIO to configure.
5001
5002 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5003 Move NO_TERMIO to configure.
5004
5005 2012-06-12 Chong Yidong <cyd@gnu.org>
5006
5007 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5008 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5009 MagickExportImagePixels is undefined.
5010
5011 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 * image.c (imagemagick_load_image): Remove unused label.
5014
5015 2012-06-11 Glenn Morris <rgm@gnu.org>
5016
5017 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5018 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5019 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5020 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5021
5022 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5023
5024 * alloc.c (make_byte_code): New function.
5025 (Fmake_byte_code): Use it. Don't purify here.
5026 * lread.c (read1): Use it as well to avoid extra allocation.
5027
5028 2012-06-11 Chong Yidong <cyd@gnu.org>
5029
5030 * image.c (imagemagick_load_image): Implement transparency.
5031
5032 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5033
5034 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5035 account for preceding backslashes. (Bug#11663)
5036
5037 2012-06-09 Chong Yidong <cyd@gnu.org>
5038
5039 * term.c: Support italics in capable terminals (Bug#9652).
5040 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5041 (turn_on_face): Output using TS_enter_italic_mode if available.
5042 Don't handle unused blinking and alt-charset cases.
5043 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5044 and tty_alt_charset_p cases.
5045 (tty_capable_p, init_tty): Support italics.
5046
5047 * termchar.h (struct tty_display_info): Add field for italics.
5048 Remove unused blink field.
5049
5050 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5051 Handle slant.
5052
5053 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5054 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5055 tty_alt_charset_p. Add tty_italic_p.
5056
5057 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5058
5059 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5060 dbus_type_is_basic if available.
5061 (xd_extract_signed, xd_extract_unsigned): Rename from
5062 extract_signed and extract_unsigned, respectively. Adapt callers.
5063
5064 2012-06-09 Chong Yidong <cyd@gnu.org>
5065
5066 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5067
5068 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5069 case (Bug#9752).
5070
5071 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5072
5073 * xdisp.c (vmessage): Treat frame message as multibyte.
5074 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5075 would generate the diagnostic "Making \302\247 buffer-local while
5076 let-bound!".
5077
5078 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5079
5080 * dispnew.c (showing_window_margins_p): Undo last change, which
5081 was done due to an inadvertent commit.
5082 (adjust_frame_glyphs_for_frame_redisplay): Do call
5083 showing_window_margins_p.
5084
5085 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5086
5087 * eval.c (Fmake_var_non_special): New primitive.
5088 (syms_of_eval): Defsubr it.
5089 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5090
5091 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5092
5093 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5094 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5095
5096 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5097
5098 * alloc.c (allocate_vectorlike): Fix last change.
5099
5100 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5101
5102 Block-based vector allocation of small vectors.
5103 * lisp.h (struct vectorlike_header): New field `nbytes',
5104 adjust comment accordingly.
5105 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5106 to denote vector blocks. Adjust users (live_vector_p,
5107 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5108 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5109 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5110 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5111 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5112 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5113 (roundup_size): New constant.
5114 (struct vector_block): New data type.
5115 (vector_blocks, vector_free_lists, zero_vector): New variables.
5116 (all_vectors): Rename to `large_vectors'.
5117 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5118 (sweep_vectors): New functions.
5119 (allocate_vectorlike): Return `zero_vector' as the only vector of
5120 0 items. Allocate new vector from block if vector size is less than
5121 or equal to VBLOCK_BYTES_MAX.
5122 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5123 (init_alloc_once): Add call to init_vectors.
5124
5125 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5126
5127 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5128
5129 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5130
5131 * doprnt.c (doprnt): Truncate multibyte char correctly.
5132 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5133 would mishandle a string argument "Xc" if X was a multibyte
5134 character of length 2: it would truncate after X's first byte
5135 rather than including all of X.
5136
5137 2012-06-06 Chong Yidong <cyd@gnu.org>
5138
5139 * buffer.c (word_wrap): Doc fix.
5140
5141 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5142
5143 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5144
5145 2012-06-03 Glenn Morris <rgm@gnu.org>
5146
5147 * xdisp.c (tool-bar-style): Doc fix.
5148
5149 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5150
5151 * Makefile.in (PAXCTL): Define.
5152 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5153 binary via PaX flags if the paxctl utility is available.
5154 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5155 Restore PaX flags to their default. (Bug#11398)
5156
5157 2012-06-03 Chong Yidong <cyd@gnu.org>
5158
5159 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5160 buffer (Bug#11226).
5161
5162 2012-06-03 Chong Yidong <cyd@gnu.org>
5163
5164 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5165 (note_mode_line_or_margin_highlight): If there is no help echo,
5166 use mode-line-default-help-echo. Handle the case where the mouse
5167 position is past the end of the mode line string.
5168
5169 * buffer.c (buffer_local_value_1): New function, split from
5170 Fbuffer_local_value; can return Qunbound.
5171 (Fbuffer_local_value): Use it.
5172 (Vmode_line_format): Docstring tweaks.
5173
5174 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5175
5176 * sysdep.c (system_process_attributes): Improve comment.
5177
5178 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5179
5180 * keyboard.c: Export real-this-command to Elisp.
5181 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5182 and DEFVAR it. Update all users.
5183
5184 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5185
5186 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5187
5188 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5189 Convert pctcpu and pctmem to Lisp float properly.
5190 Let the compiler fold better, as 100.0/0x8000 is exact.
5191
5192 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5193
5194 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5195 cons_block.
5196
5197 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5200
5201 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5202
5203 For a 'struct window', replace some Lisp_Object fields to
5204 bitfields where appropriate, remove unused fields.
5205 * window.h (struct window): Remove unused 'last_mark_x' and
5206 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5207 change it's type from Lisp_Object to bitfield.
5208 Change type of 'force_start', 'optional_new_start',
5209 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5210 fields from Lisp_Object to bitfield. Adjust users accordingly.
5211
5212 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5213
5214 Pacify gcc -Wdouble-precision when using Xaw.
5215 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5216 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5217 Use 'float' consistently, rather than 'float' in most places
5218 and 'double' in a couple of places.
5219
5220 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5221
5222 * xdisp.c (handle_stop): Detect whether we have overlay strings
5223 loaded by testing it->current.overlay_string_index to be
5224 non-negative, instead of checking whether n_overlay_strings is
5225 positive. (Bug#11587)
5226
5227 2012-05-31 Chong Yidong <cyd@gnu.org>
5228
5229 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5230
5231 * doc.c (Fsubstitute_command_keys): Doc fix.
5232
5233 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5234
5235 * search.c (search_buffer): Remove calls to
5236 r_alloc_inhibit_buffer_relocation, as it is now called by
5237 maybe_unify_char, which was the cause of relocation of buffer text
5238 in bug#11519.
5239
5240 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5241
5242 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5243 for the duration of call to load_charset, to avoid problems with
5244 callers of maybe_unify_char that access buffer text through C
5245 pointers.
5246
5247 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5248 decrement the inhibition flag, instead of just setting or
5249 resetting it.
5250
5251 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5252
5253 Remove obsolete '#define static' cruft.
5254 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5255 This #undef was "temporary" in 2000; it is no longer needed
5256 now that '#define static' has gone away.
5257 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5258 (gray_bitmap_bits): Remove; no longer needed.
5259 All uses replaced with definiens.
5260 * xterm.c: Include "bitmaps/gray.xbm".
5261
5262 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5263
5264 Clean up __executable_start, monstartup when --enable-profiling.
5265 The following changes affect the code only when profiling.
5266 * dispnew.c (__executable_start): Rename from safe_bcopy.
5267 Define only on platforms that need it.
5268 * emacs.c: Include <sys/gmon.h> when profiling.
5269 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5270 (__executable_start): Remove decl, since lisp.h does it now.
5271 (safe_bcopy): Remove decl; no longer has that name.
5272 (main): Coalesce #if into single bit of code, for simplicity.
5273 Cast pointers to uintptr_t, since standard libraries want integers
5274 and not pointers.
5275 * lisp.h (__executable_start): New decl.
5276
5277 2012-05-31 Glenn Morris <rgm@gnu.org>
5278
5279 * image.c (Fimagemagick_types): Doc fix.
5280
5281 2012-05-30 Jim Meyering <meyering@redhat.com>
5282
5283 * callproc.c (Fcall_process_region): Include directory component
5284 in mkstemp error message (Bug#11586).
5285
5286 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5287
5288 * alloc.c, lisp.h (make_pure_vector): Now static.
5289
5290 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5291
5292 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5293 Move to byte-run.el.
5294 (Fautoload): Do the hash-doc more carefully.
5295 * data.c (Fdefalias): Purify definition, except for keymaps.
5296 (Qdefun): Move from eval.c.
5297 * lisp.h (Qdefun): Remove.
5298 * lread.c (read1): Tiny simplification.
5299
5300 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5301
5302 Do not create empty overlays with the evaporate property (Bug#9642).
5303 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5304 Bug#9642, but explicitly check that the buffer the overlay would
5305 be moved to is live and rearrange lines to make sure that errors
5306 will not put the overlay in an inconsistent state.
5307 (Fdelete_overlay): Cosmetics.
5308
5309 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5310
5311 * w32term.c (my_bring_window_to_top): New function.
5312 (x_raise_frame): Use handle returned by DeferWindowPos, which
5313 could be different from the original one.
5314 Call my_bring_window_to_top instead of my_set_foreground_window.
5315 (Bug#11513)
5316
5317 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5318 by calling BringWindowToTop.
5319
5320 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5321 (WM_EMACS_END): Increase by one.
5322
5323 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5324
5325 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5326 This avoids undefined behavior that might cause the eassert
5327 to not catch an out-of-range value.
5328
5329 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5330
5331 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5332 Update dependencies.
5333
5334 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5335
5336 * bidi.c (bidi_mirror_char): Fix last change.
5337
5338 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5339
5340 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5341 when referring to sectname field in printf format.
5342
5343 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5346 Only r_alloc_inhibit_buffer_relocation needed to be added;
5347 the others were already declared.
5348
5349 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5350 before checking whether it's out of range. Put the check inside
5351 eassert. See
5352 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5353
5354 2012-05-27 Ken Brown <kbrown@cornell.edu>
5355
5356 * callproc.c (Fcall_process): Restore a line that was accidentally
5357 commented out in the 2011-02-13 change (bug#11547).
5358
5359 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5360
5361 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5362 defined on ralloc.c.
5363
5364 * buffer.c [REL_ALLOC]: Remove prototypes of
5365 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5366 they are now on lisp.h.
5367
5368 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5369
5370 * search.c (search_buffer): Use it to inhibit relocation of buffer
5371 text while re_search_2 is doing its job, because re_search_2 is
5372 passed C pointers to buffer text. (Bug#11519)
5373
5374 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5375 Update value to 24.
5376
5377 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5378 state after an additional call to move_it_in_display_line_to, keep
5379 the values of it->max_ascent and it->max_descent found for the
5380 entire line.
5381 (pos_visible_p): Revert the comparison against bottom_y to what it
5382 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5383 (Bug#11464)
5384
5385 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5386
5387 Fix coding-related core dumps with gcc -ftrapv.
5388 The code was computing A - B, where A and B are pointers, and B is
5389 random garbage. This can lead to core dumps on platforms that
5390 have special pointer registers, and it also leads to core dumps on
5391 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5392 A - B only when B is initialized properly.
5393 * coding.c (coding_set_source, coding_set_destination): Return void.
5394 (coding_change_source, coding_change_destinations): New functions,
5395 with the old behaviors of coding_set_source and coding_set_destination.
5396 All callers that need an offset changed to use these new functions.
5397
5398 2012-05-26 Glenn Morris <rgm@gnu.org>
5399
5400 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5401
5402 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5403
5404 Extend mouse support on W32 text-mode console.
5405 * xdisp.c (draw_row_with_mouse_face):
5406 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5407
5408 * w32console.c: Include window.h.
5409 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5410 New functions.
5411 (initialize_w32_display): Initialize mouse-highlight data.
5412
5413 * w32inevt.c: Include termchar.h and window.h.
5414 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5415 moves, call note_mouse_highlight. If help_echo changed, call
5416 gen_help_event to produce help-echo message in the echo area.
5417 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5418 highlight info.
5419
5420 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5421
5422 * lread.c (read1): Simplify slightly to avoid an overflow warning
5423 with GCC 4.7.0 on x86-64.
5424
5425 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5426
5427 * bidi.c (bidi_mirror_char): Revert last change: an int is
5428 definitely wide enough here.
5429
5430 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
5431
5432 Fix integer width and related bugs (Bug#9874).
5433 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5434 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5435 (string_bytes, check_sblock, allocate_string_data):
5436 (compact_small_strings, Fmake_bool_vector, make_string)
5437 (make_unibyte_string, make_multibyte_string)
5438 (make_string_from_bytes, make_specified_string)
5439 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5440 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5441 (mark_vectorlike):
5442 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5443 (allocate_pseudovector):
5444 Use int, not EMACS_INT, where int is wide enough.
5445 (inhibit_garbage_collection, Fgarbage_collect):
5446 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5447 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5448 int might not be wide enough.
5449 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5450 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5451 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5452 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5453 (bidi_level_of_next_char, bidi_move_to_visually_next):
5454 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5455 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5456 (Fkill_buffer, Fset_buffer_major_mode)
5457 (advance_to_char_boundary, Fbuffer_swap_text)
5458 (Fset_buffer_multibyte, overlays_at, overlays_in)
5459 (overlay_touches_p, struct sortvec, record_overlay_string)
5460 (overlay_strings, recenter_overlay_lists)
5461 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5462 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5463 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5464 (Foverlay_recenter, last_overlay_modification_hooks_used)
5465 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5466 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5467 (validate_region): Omit unnecessary test for b <= e,
5468 since that's guaranteed by the previous test.
5469 (adjust_overlays_for_delete): Avoid pos + length overflow.
5470 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5471 (report_overlay_modification):
5472 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5473 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5474 Omit pointer cast, which isn't needed anyway, and doesn't work
5475 after the EMACS_INT -> ptrdiff_t change.
5476 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5477 * buffer.h: Adjust decls to match defn changes elsewhere.
5478 (struct buffer_text, struct buffer):
5479 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5480 Use EMACS_INT, not int, where int might not be wide enough.
5481 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5482 not int, to avoid needless 32-bit limit on 64-bit hosts.
5483 (exec_byte_code): Use tighter memory-full test, one that checks
5484 for alloca overflow. Don't compute the address of the object just
5485 before an array, as that's not portable. Use EMACS_INT, not
5486 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5487 * callint.c (Fcall_interactively):
5488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5489 * callproc.c (call_process_kill, Fcall_process):
5490 Don't assume pid_t fits into an Emacs fixnum.
5491 (call_process_cleanup, Fcall_process, child_setup):
5492 Don't assume pid_t fits into int.
5493 (call_process_cleanup, Fcall_process, delete_temp_file)
5494 (Fcall_process_region):
5495 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5496 (Fcall_process): Simplify handling of volatile integers.
5497 Use int, not EMACS_INT, where int will do.
5498 * casefiddle.c (casify_object, casify_region, operate_on_word)
5499 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5500 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5501 (casify_object): Avoid integer overflow when overallocating buffer.
5502 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5503 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
5504 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5505 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5506 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5507 integers are now checked earlier. All uses replaced with XINT.
5508 (ccl_driver):
5509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5510 For CCL_MapSingle, check that content and value are in int range.
5511 (ccl_driver, Fregister_code_conversion_map):
5512 Check that Vcode_version_map_vector is a vector.
5513 (resolve_symbol_ccl_program): Check that vector header is in range.
5514 Always copy the vector, so that we can check its contents reliably
5515 now rather than having to recheck each instruction as it's being
5516 executed. Check that vector words fit in 'int'.
5517 (ccl_get_compiled_code, Fregister_ccl_program)
5518 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5519 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5520 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5521 contents are in range.
5522 (Fccl_execute_on_string): Check that status is in range.
5523 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5524 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5525 Accept and return EMACS_INT, not int, because callers can pass values
5526 out of 'int' range.
5527 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5528 (multibyte_chars_in_text, parse_str_as_multibyte)
5529 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5530 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5531 (string_escape_byte8, Fget_byte):
5532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5533 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5534 avoid mishandling large integers.
5535 * character.h: Adjust decls to match defn changes elsewhere.
5536 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5537 (Ffind_charset_region):
5538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5539 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5540 (load_charset_map_from_vector, Fdefine_charset_internal):
5541 Don't assume fixnum fits in int.
5542 (load_charset_map_from_vector, Fmap_charset_chars):
5543 Remove now-unnecessary CHECK_NATNUMs.
5544 (Fdefine_charset_internal): Check ranges here, more carefully.
5545 Don't rely on undefined behavior with signed left shift overflow.
5546 Don't assume unsigned int fits into fixnum, or that fixnum fits
5547 into unsigned int. Don't require max_code to be a valid fixnum;
5548 that's not true for gb10830 4-byte on a 32-bit host. Allow
5549 invalid_code to be a cons, for the same reason. Require code_offset
5550 to be a character. Avoid int overflow if max_char is close
5551 to INT_MAX.
5552 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5553 this is intended anyway and avoids some undefined behavior.
5554 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5555 INDEX_TO_CODE_POINT, as that's what it expects.
5556 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5557 * charset.h (DECODE_CHAR): Return int, not unsigned;
5558 this is what was intended anyway, and it avoids undefined behavior.
5559 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5560 integer-overflow issues.
5561 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5562 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5563 where the argument is EMACS_INT, and this behavior is not intended.
5564 * chartab.c (Fmake_char_table, Fset_char_table_range)
5565 (uniprop_get_decoder, uniprop_get_encoder):
5566 Don't assume fixnum fits in int.
5567 * cmds.c (move_point): New function, that does the gist of
5568 Fforward_char and Fbackward_char, but does so while checking
5569 for integer overflow more accurately.
5570 (Fforward_char, Fbackward_char): Use it.
5571 (Fforward_line, Fend_of_line, internal_self_insert)
5572 (internal_self_insert):
5573 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5574 Fix a FIXME, by checking for integer overflow when calculating
5575 target_clm and actual_clm.
5576 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5577 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5578 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5579 (coding_alloc_by_making_gap, alloc_destination)
5580 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5581 (encode_coding_utf_16, detect_coding_emacs_mule)
5582 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5583 (detect_coding_iso_2022, decode_coding_iso_2022)
5584 (encode_invocation_designation, encode_designation_at_bol)
5585 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5586 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5587 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5588 (encode_coding_ccl, encode_coding_raw_text)
5589 (detect_coding_charset, decode_coding_charset)
5590 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5591 (produce_composition, produce_charset, produce_annotation)
5592 (decode_coding, handle_composition_annotation)
5593 (handle_charset_annotation, consume_chars, decode_coding_gap)
5594 (decode_coding_object, encode_coding_object, detect_coding_system)
5595 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5596 (code_convert_region, code_convert_string)
5597 (Fdefine_coding_system_internal)
5598 (coding_set_source, coding_set_destination):
5599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5600 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5601 (Fdefine_coding_system_internal):
5602 Don't assume fixnums fit in int.
5603 (decode_coding_gap, decode_coding_object, encode_coding_object)
5604 (Fread_coding_system, Fdetect_coding_region)
5605 (Funencodable_char_position, Fcheck_coding_systems_region)
5606 (get_translation, handle_composition_annotation, consume_chars):
5607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5608 (consume_chars): Rewrite to not calculate an address outside buffer.
5609 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5610 Don't access memory outside of the args array.
5611 (Fdefine_coding_system_internal): Check for charset-id overflow.
5612 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5613 result of ENCODE_CHAR.
5614 * coding.h: Adjust decls to match defn changes elsewhere.
5615 (struct coding_system):
5616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5617 * composite.c (get_composition_id, find_composition)
5618 (run_composition_function, update_compositions)
5619 (compose_text, composition_gstring_put_cache)
5620 (composition_gstring_p, composition_gstring_width)
5621 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5622 (composition_compute_stop_pos, composition_reseat_it)
5623 (composition_update_it, struct position_record)
5624 (find_automatic_composition, composition_adjust_point)
5625 (Fcomposition_get_gstring, Ffind_composition_internal):
5626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5627 (update_compositions):
5628 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5629 * composite.h: Adjust decls to match defn changes elsewhere.
5630 (struct composition):
5631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5632 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5633 Do not attempt to compute the address of the object just before a
5634 buffer; this is not portable.
5635 (Faref, Faset):
5636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5637 (Faset): Use int, not EMACS_INT, where int is wide enough.
5638 (Fstring_to_number): Don't assume fixnums fit in int.
5639 (Frem): Don't assume arg is nonnegative.
5640 * dbusbind.c (xd_append_arg): Check for integers out of range.
5641 (Fdbus_call_method): Don't overflow the timeout int.
5642 (extract_signed, extract_unsigned): New functions.
5643 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5644 (xd_get_connection_references): Return ptrdiff_t, not int.
5645 All uses changed.
5646 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5647 (xd_read_message_1):
5648 Use int, not unsigned, where the dbus API uses int.
5649 (Fdbus_message_internal): Don't overflow mtype.
5650 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5651 * dired.c (directory_files_internal, file_name_completion, scmp)
5652 (file_name_completion_stat):
5653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5654 (file_name_completion): Don't overflow matchcount.
5655 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5656 * dispextern.h: Adjust decls to match defn changes elsewhere.
5657 (struct text_pos, struct glyph, struct bidi_saved_info)
5658 (struct bidi_string_data, struct bidi_it, struct composition_it)
5659 (struct it):
5660 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5661 (struct display_pos, struct composition_it, struct it):
5662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5663 * dispnew.c (increment_matrix_positions)
5664 (increment_row_positions, mode_line_string)
5665 (marginal_area_string):
5666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5667 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5669 (duration_to_sec_usec): New function, to check for overflow better.
5670 (Fsleep_for, sit_for): Use it.
5671 * doc.c (get_doc_string, store_function_docstring):
5672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5673 (get_doc_string, Fsnarf_documentation):
5674 Use int, not EMACS_INT, where int is wide enough.
5675 (get_doc_string):
5676 Use SAFE_ALLOCA, not alloca.
5677 Check for overflow when converting EMACS_INT to off_t.
5678 * doprnt.c (doprnt):
5679 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5680 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5681 Don't assume uid_t fits into fixnum.
5682 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5683 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5684 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5685 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5686 (general_insert_function)
5687 (Finsert_char, make_buffer_string, make_buffer_string_both)
5688 (update_buffer_properties, Fbuffer_substring)
5689 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5690 (Fsubst_char_in_region, check_translation)
5691 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5692 (transpose_markers, Ftranspose_regions):
5693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5694 (clip_to_bounds): Move to lisp.h as an inline function).
5695 (Fconstrain_to_field): Don't assume integers are nonnegative.
5696 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5697 (Fsubst_char_in_region, Fsave_restriction):
5698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5699 (Femacs_pid): Don't assume pid_t fits into fixnum.
5700 (lo_time): Use int, not EMACS_INT, when int suffices.
5701 (lisp_time_argument): Check for usec out of range.
5702 (Fencode_time): Don't assume fixnum fits in int.
5703 (Fuser_login_name, Fuser_full_name): Signal an error
5704 if a uid argument is out of range, rather than relying on
5705 undefined behavior.
5706 (Fformat_time_string): Remove now-unnecessary check.
5707 lisp_time_argument checks for out-of-range usec now.
5708 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5709 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5710 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5711 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5712 (init_cmdargs, Fdump_emacs):
5713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5714 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5715 the bottom (typically) 32 bits of the fixnum.
5716 * eval.c (specpdl_size, call_debugger):
5717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5718 (when_entered_debugger, Fbacktrace_debug):
5719 Don't assume fixnum can fit in int.
5720 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5721 the object just before a buffer; this is not portable.
5722 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5723 (grow_specpdl, unbind_to):
5724 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5725 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5726 (grow_specpdl): Simplify allocation by using xpalloc.
5727 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5728 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5729 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5730 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5731 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5732 (a_write, e_write):
5733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5734 (Fcopy_file, non_regular_nbytes, read_non_regular)
5735 (Finsert_file_contents):
5736 Use int, not EMACS_INT, where int is wide enough.
5737 (READ_BUF_SIZE): Verify that it fits in int.
5738 (Finsert_file_contents): Check that counts are in proper range,
5739 rather than assuming fixnums fit into ptrdiff_t etc.
5740 Don't assume fixnums fit into int.
5741 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5742 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5743 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5744 (string_char_to_byte, string_byte_to_char)
5745 (string_make_multibyte, string_to_multibyte)
5746 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5747 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5748 (substring_both, Fdelete, internal_equal, Ffillarray)
5749 (Fclear_string, mapcar1)
5750 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5751 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5752 (larger_vector, make_hash_table, maybe_resize_hash_table)
5753 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5754 (Fmaphash, secure_hash):
5755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5756 (concat): Check for string index and length overflow.
5757 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5758 (Frequire):
5759 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5760 (larger_vector): New API (vec, incr_min, size_max) replaces old
5761 one (vec, new_size, init). This catches size overflow.
5762 INIT was removed because it was always Qnil.
5763 All callers changed.
5764 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5765 the upper bound on a hash table index size.
5766 (make_hash_table, maybe_resize_hash_table): Use it.
5767 (secure_hash): Computer start_byte and end_byte only after
5768 they're known to be in ptrdiff_t range.
5769 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5770 (Ffont_get_glyphs, Ffont_at):
5771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5772 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5773 (Flist_fonts, Fopen_font):
5774 Don't assume fixnum can fit in int.
5775 (check_gstring): Don't assume index can fit in int.
5776 (font_match_p): Check that fixnum is a character, not a nonnegative
5777 fixnum, since the later code needs to stuff it into an int.
5778 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5779 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5780 conversion overflow issues.
5781 (Fopen_font): Check for integer out of range.
5782 (Ffont_get_glyphs): Don't assume index can fit in int.
5783 * font.h: Adjust decls to match defn changes elsewhere.
5784 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5785 integer overflow.
5786 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5787 printmax_t, where ptrdiff_t is wide enough.
5788 (Finternal_char_font):
5789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5790 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5791 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5792 (Fset_frame_position, x_set_frame_parameters)
5793 (x_set_line_spacing, x_set_border_width)
5794 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5795 Check that fixnums are in proper range for system types.
5796 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5798 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5799 Use SAFE_ALLOCA_LISP, not alloca.
5800 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5801 intptr_t is wide enough.
5802 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5803 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5804 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5805 Check for fixnum out of range.
5806 * ftfont.c (ftfont_list): Don't assume index fits in int.
5807 Check that fixnums are in proper range for system types.
5808 (ftfont_shape_by_flt):
5809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5810 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5812 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5813 Check that fixnums are in proper range for system types.
5814 * gnutls.h: Adjust decls to match defn changes elsewhere.
5815 * gtkutil.c (xg_dialog_run):
5816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5817 (update_frame_tool_bar):
5818 Check that fixnums are in proper range for system types.
5819 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5820 (lookup_image): Check that fixnums are in range for system types.
5821 * indent.c (last_known_column, last_known_column_point):
5822 (current_column_bol_cache):
5823 (skip_invisible, current_column, check_display_width):
5824 (check_display_width, scan_for_column, current_column_1)
5825 (Findent_to, Fcurrent_indentation, position_indentation)
5826 (indented_beyond_p, Fmove_to_column, compute_motion):
5827 (Fcompute_motion, Fvertical_motion):
5828 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5829 (last_known_column_modified): Use EMACS_INT, not int.
5830 (check_display_width):
5831 (Fcompute_motion):
5832 Check that fixnums and floats are in proper range for system types.
5833 (compute_motion): Don't assume index or fixnum fits in int.
5834 (compute_motion, Fcompute_motion):
5835 Use int, not EMACS_INT, when it is wide enough.
5836 (vmotion): Omit local var start_hpos that is always 0; that way
5837 we don't need to worry about overflow in expressions involving it.
5838 * indent.h: Adjust decls to match defn changes elsewhere.
5839 (struct position):
5840 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5841 Use int, not EMACS_INT, where int is wide enough.
5842 Remove unused members ovstring_chars_done and tab_offset;
5843 all uses removed.
5844 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5845 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5846 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5847 (make_gap, copy_text, insert, insert_and_inherit)
5848 (insert_before_markers, insert_before_markers_and_inherit)
5849 (insert_1, count_combining_before, count_combining_after)
5850 (insert_1_both, insert_from_string)
5851 (insert_from_string_before_markers, insert_from_string_1)
5852 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5853 (adjust_after_replace, adjust_after_insert, replace_range)
5854 (replace_range_2, del_range, del_range_1, del_range_byte)
5855 (del_range_both, del_range_2, modify_region)
5856 (prepare_to_modify_buffer, signal_before_change)
5857 (signal_after_change, Fcombine_after_change_execute):
5858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5859 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5860 (balance_an_interval, split_interval_right, split_interval_left)
5861 (find_interval, next_interval, update_interval)
5862 (adjust_intervals_for_insertion, delete_node, delete_interval)
5863 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5864 (static_offset_intervals, offset_intervals)
5865 (merge_interval_right, merge_interval_left, make_new_interval)
5866 (graft_intervals_into_buffer, temp_set_point_both)
5867 (temp_set_point, set_point, adjust_for_invis_intang)
5868 (set_point_both, move_if_not_intangible, get_property_and_range)
5869 (get_local_map, copy_intervals, copy_intervals_to_string)
5870 (compare_string_intervals, set_intervals_multibyte_1):
5871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5872 * intervals.h: Adjust decls to match defn changes elsewhere.
5873 (struct interval):
5874 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5875 * keyboard.c (this_command_key_count, this_single_command_key_start)
5876 (before_command_key_count, before_command_echo_length, echo_now)
5877 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5878 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5879 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5880 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5881 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5882 (last_non_minibuf_size, last_point_position, echo_truncate)
5883 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5884 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5885 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5886 (stuff_buffered_input):
5887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5888 (last_auto_save, command_loop_1, read_char):
5889 Use EMACS_INT, not int, to avoid integer overflow.
5890 (record_char): Avoid overflow in total_keys computation.
5891 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5892 * keyboard.h: Adjust decls to match defn changes elsewhere.
5893 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5894 (Fkey_description, Fdescribe_vector, Flookup_key):
5895 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5896 (click_position): New function, to check that positions are in range.
5897 (Fcurrent_active_maps):
5898 (describe_command):
5899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5900 (Faccessible_keymaps, Fkey_description):
5901 (preferred_sequence_p):
5902 Don't assume fixnum can fit into int.
5903 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5904 Check for integer overflow in size calculations.
5905 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5906 avoid mishandling large integers.
5907 * lisp.h: Adjust decls to match defn changes elsewhere.
5908 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5909 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5910 (struct Lisp_Marker):
5911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5912 (clip_to_bounds): Now an inline function, moved here from editfns.c.
5913 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5914 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5915 All callers changed.
5916 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5917 Assume the arg has valid form, since it always does.
5918 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5919 unsigned integer system type.
5920 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5921 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5922 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5923 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5924 (duration_to_sec_usec): New decl.
5925 * lread.c (read_from_string_index, read_from_string_index_byte)
5926 (read_from_string_limit, readchar, unreadchar, openp)
5927 (read_internal_start, read1, oblookup):
5928 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5929 (Fload, readevalloop, Feval_buffer, Feval_region):
5930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5931 (openp): Check for out-of-range argument to 'access'.
5932 (read1): Use int, not EMACS_INT, where int is wide enough.
5933 Don't assume fixnum fits into int.
5934 Fix off-by-one error that can read outside a buffer.
5935 (read_filtered_event): Use duration_to_sec_usec
5936 to do proper overflow checking on durations.
5937 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5938 in size calculation.
5939 (Fexecute_kbd_macro):
5940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5941 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5942 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5943 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5944 (set_marker_both, set_marker_restricted_both, marker_position)
5945 (marker_byte_position, Fbuffer_has_markers_at):
5946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5947 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
5948 * menu.c (ensure_menu_items): Rename from grow_menu_items.
5949 It now merely ensures that the menu is large enough, without
5950 necessarily growing it, as this avoids some integer overflow issues.
5951 All callers changed.
5952 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5954 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5955 Use SAFE_ALLOCA_LISP, not alloca.
5956 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5957 to EMACS_INT. Check that fixnums are in proper range for system types.
5958 * minibuf.c (minibuf_prompt_width, string_to_object)
5959 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5960 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5962 (get_minibuffer, read_minibuf_unwind):
5963 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5964 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5965 this simplifies overflow checking. All callers changed.
5966 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5967 (Ftest_completion):
5968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5969 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5970 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5971 Check that fixnums are in proper range for system types.
5972 (Fx_create_frame, Fx_show_tip):
5973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5974 * nsfont.m (ns_findfonts, nsfont_list_family):
5975 Don't assume fixnum fits in long.
5976 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5977 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5978 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5979 wide enough.
5980 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
5981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5982 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5983 (PRINTDECLARE, PRINTPREPARE):
5984 (strout, print_string):
5985 (print, print_preprocess, print_check_string_charset_prop)
5986 (print_object):
5987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5988 (PRINTDECLARE):
5989 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5991 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
5992 (printchar, strout): Use xpalloc to catch size calculation overflow.
5993 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
5994 (print_error_message): Use SAFE_ALLOCA, not alloca.
5995 (print_object): Use int, not EMACS_INT, where int is wide enough.
5996 (print_depth, new_backquote_output, print_number_index):
5997 Use ptrdiff_t, not int, where int might not be wide enough.
5998 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5999 (Fset_process_window_size, Fformat_network_address)
6000 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6001 (sigchld_handler):
6002 Check that fixnums are in proper range for system types.
6003 (Fsignal_process): Simplify by avoiding a goto.
6004 Check for process-ids out of pid_t range rather than relying on
6005 undefined behavior.
6006 (process_tick, update_tick): Use EMACS_INT, not int.
6007 (Fformat_network_address, read_process_output, send_process)
6008 (Fprocess_send_region, status_notify):
6009 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6010 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6011 (wait_reading_process_output, read_process_output, exec_sentinel):
6012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6013 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6014 (Faccept_process_output): Use duration_to_sec_usec to do proper
6015 overflow checking on durations.
6016 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6017 Don't assume pid_t fits in int.
6018 * process.h (struct Lisp_Process): Members tick and update_tick
6019 are now of type EMACS_INT, not int.
6020 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6021 configured --with-wide-int.
6022 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6023 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6024 * search.c (looking_at_1, string_match_1):
6025 (fast_string_match, fast_c_string_match_ignore_case)
6026 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6027 (scan_newline, find_before_next_newline, search_command)
6028 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6029 (set_search_regs, wordify):
6030 (Freplace_match):
6031 (Fmatch_data):
6032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6033 (string_match_1, search_buffer, set_search_regs):
6034 (Fmatch_data):
6035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6036 (wordify): Check for overflow in size calculation.
6037 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6038 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6039 Check that fixnums are in proper range for system types.
6040 * sound.c (struct sound_device)
6041 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6043 (Fplay_sound_internal):
6044 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6045 * syntax.c (struct lisp_parse_state, find_start_modiff)
6046 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6047 (Fparse_partial_sexp):
6048 Don't assume fixnums can fit in int.
6049 (struct lisp_parse_state, find_start_pos, find_start_value)
6050 (find_start_value_byte, find_start_begv)
6051 (update_syntax_table, char_quoted, dec_bytepos)
6052 (find_defun_start, prev_char_comend_first, back_comment):
6053 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6054 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6056 (Finternal_describe_syntax_value): Check that match_lisp is a
6057 character, not an integer, since the code stuffs it into int.
6058 (scan_words, scan_sexps_forward):
6059 Check that fixnums are in proper range for system types.
6060 (Fforward_word):
6061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6062 (scan_sexps_forward):
6063 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6064 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6065 * syntax.h: Adjust decls to match defn changes elsewhere.
6066 (struct gl_state_s):
6067 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6068 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6069 MOST_POSITIVE_FIXNUM.
6070 * sysdep.c (wait_for_termination_1, wait_for_termination)
6071 (interruptible_wait_for_termination, mkdir):
6072 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6073 (emacs_read, emacs_write):
6074 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6075 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6076 and double all fit in int.
6077 * term.c (set_tty_color_mode):
6078 Check that fixnums are in proper range for system types.
6079 * termhooks.h (struct input_event):
6080 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6081 * textprop.c (validate_interval_range, interval_of)
6082 (Fadd_text_properties, set_text_properties_1)
6083 (Fremove_text_properties, Fremove_list_of_text_properties)
6084 (Ftext_property_any, Ftext_property_not_all)
6085 (copy_text_properties, text_property_list, extend_property_ranges)
6086 (verify_interval_modification):
6087 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6088 (Fnext_single_char_property_change)
6089 (Fprevious_single_char_property_change):
6090 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6091 (copy_text_properties):
6092 Check for integer overflow in index calculation.
6093 * undo.c (last_boundary_position, record_point, record_insert)
6094 (record_delete, record_marker_adjustment, record_change)
6095 (record_property_change):
6096 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6097 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6099 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6100 (Fx_hide_tip, Fx_file_dialog):
6101 * w32menu.c (set_frame_menubar):
6102 Use ptrdiff_t, not int, for consistency with rest of code.
6103 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6104 (select_window, Fdelete_other_windows_internal)
6105 (window_scroll_pixel_based, window_scroll_line_based)
6106 (Frecenter, Fset_window_configuration):
6107 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6108 (Fset_window_hscroll, run_window_configuration_change_hook)
6109 (set_window_buffer, temp_output_buffer_show, scroll_command)
6110 (Fscroll_other_window, Frecenter):
6111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6112 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6113 Don't assume fixnum fits in int.
6114 (Fset_window_scroll_bars):
6115 Check that fixnums are in proper range for system types.
6116 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6117 (string_pos, c_string_pos, number_of_chars, init_iterator)
6118 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6119 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6120 (compute_display_string_end, handle_face_prop)
6121 (face_before_or_after_it_pos, handle_invisible_prop)
6122 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6123 (display_prop_intangible_p, string_buffer_position_lim)
6124 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6125 (get_overlay_strings_1, get_overlay_strings)
6126 (iterate_out_of_display_property, forward_to_next_line_start)
6127 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6128 (get_next_display_element, set_iterator_to_next)
6129 (get_visually_first_element, compute_stop_pos_backwards)
6130 (handle_stop_backwards, next_element_from_buffer)
6131 (move_it_in_display_line_to, move_it_in_display_line)
6132 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6133 (add_to_log, message_dolog, message_log_check_duplicate)
6134 (message2, message2_nolog, message3, message3_nolog
6135 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6136 (current_message_1, truncate_echo_area, truncate_message_1)
6137 (set_message, set_message_1, store_mode_line_noprop)
6138 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6139 (text_outside_line_unchanged_p, check_point_in_composition)
6140 (reconsider_clip_changes)
6141 (redisplay_internal, set_cursor_from_row, try_scrolling)
6142 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6143 (redisplay_window, find_last_unchanged_at_beg_row)
6144 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6145 (trailing_whitespace_p, find_row_edges, display_line)
6146 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6147 (display_mode_element, store_mode_line_string)
6148 (pint2str, pint2hrstr, decode_mode_spec)
6149 (display_count_lines, display_string, draw_glyphs)
6150 (x_produce_glyphs, x_insert_glyphs)
6151 (rows_from_pos_range, mouse_face_from_buffer_pos)
6152 (fast_find_string_pos, mouse_face_from_string_pos)
6153 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6155 (safe_call, init_from_display_pos, handle_fontified_prop)
6156 (handle_single_display_spec, load_overlay_strings)
6157 (with_echo_area_buffer, setup_echo_area_for_printing)
6158 (display_echo_area, echo_area_display)
6159 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6160 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6161 (redisplay_window, dump_glyph_row, display_mode_line)
6162 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6163 (handle_display_spec, display_prop_string_p):
6164 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6165 (handle_single_display_spec, build_desired_tool_bar_string)
6166 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6167 (get_specified_cursor_type):
6168 Check that fixnums are in proper range for system types.
6169 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6170 (Flookup_image_map):
6171 Don't assume fixnums fit in int.
6172 (compare_overlay_entries):
6173 Avoid mishandling comparisons due to subtraction overflow.
6174 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6175 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6176 (handle_tool_bar_click):
6177 Use int, not unsigned, since we prefer signed and the signedness
6178 doesn't matter here.
6179 (get_next_display_element, next_element_from_display_vector):
6180 Use int, not EMACS_INT, when int is wide enough.
6181 (start_hourglass): Use duration_to_sec_usec to do proper
6182 overflow checking on durations.
6183 * xfaces.c (Fbitmap_spec_p):
6184 Check that fixnums are in proper range for system types.
6185 (compare_fonts_by_sort_order):
6186 Avoid mishandling comparisons due to subtraction overflow.
6187 (Fx_family_fonts, realize_basic_faces):
6188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6189 (Fx_family_fonts):
6190 Don't assume fixnum fits in int.
6191 Use SAFE_ALLOCA_LISP, not alloca.
6192 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6193 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6194 (face_at_buffer_position, face_for_overlay_string)
6195 (face_at_string_position):
6196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6197 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6198 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6199 (Fx_show_tip):
6200 Check that fixnums are in proper range for system types.
6201 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6202 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6204 (Fx_change_window_property): Don't assume fixnums fit in int.
6205 * xfont.c (xfont_chars_supported):
6206 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6207 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6208 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6210 * xml.c (parse_region):
6211 * xrdb.c (magic_file_p):
6212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6213 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6214 (x_get_local_selection, x_reply_selection_request)
6215 (x_handle_selection_request, wait_for_property_change):
6216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6217 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6218 short is wide enough.
6219 (x_send_client_event): Don't assume fixnum fits in int.
6220 * xterm.c (x_x_to_emacs_modifiers):
6221 Don't assume EMACS_INT overflows nicely into int.
6222 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6223 may come from Lisp.
6224 (handle_one_xevent): NATNUMP can eval its arg twice.
6225 (x_connection_closed):
6226 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6227 * xterm.h: Adjust decls to match defn changes elsewhere.
6228 (struct scroll_bar): Use struct vectorlike_header
6229 rather than rolling our own approximation.
6230 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6231
6232 2012-05-25 Glenn Morris <rgm@gnu.org>
6233
6234 * lisp.mk (lisp): Update for more files being compiled now.
6235
6236 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6237
6238 * lread.c: Remove `read_pure' which makes no difference.
6239 (read_pure): Remove var.
6240 (unreadpure): Remove function.
6241 (readevalloop): Don't call read_list with -1 flag.
6242 (read1, read_vector): Don't test read_pure any more.
6243 (read_list): Simplify.
6244
6245 * fileio.c, character.h: Minor style tweaks.
6246
6247 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6248
6249 * window.h (clip_changed): Remove useless declaration.
6250
6251 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6252
6253 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6254 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6255
6256 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6257
6258 Remove src/m/*.
6259 This directory predates autoconf and is no longer needed nowadays.
6260 Move its few remaining bits of functionality to where they're needed.
6261 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6262 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6263 * m/template.h: Remove.
6264 * Makefile.in (M_FILE): Remove. All uses removed.
6265 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6266 * lisp.h (USE_LSB_TAG):
6267 * mem-limits.h (EXCEEDS_LISP_PTR):
6268 Use VAL_MAX, not VALBITS, in #if.
6269 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6270 (EMACS_UINT): Define unconditionally now.
6271 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6272 (BITS_PER_EMACS_INT): New constants, replacing
6273 what used to be in config.h, but not useful in #if.
6274 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6275 define them any more.
6276 (VAL_MAX): New macro.
6277 (VALMASK): Use it.
6278 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6279 BITS_PER_EMACS_INT, in #if.
6280 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6281 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6282 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6283 * s/ms-w32.h (DATA_START):
6284 Move here from removed file m/intel386.h.
6285 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6286 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6287
6288 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6289
6290 Assume C89 or later.
6291 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6292 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6293 (xrealloc):
6294 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6295 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6296 * textprop.c, tparam.c (NULL): Remove.
6297 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6298 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6299 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6300 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6301 * xterm.c (input_signal_count): Assume volatile works.
6302
6303 2012-05-21 Ken Brown <kbrown@cornell.edu>
6304
6305 * xgselect.c (xg_select): Fix first argument in call to 'select'
6306 (bug#11508).
6307
6308 2012-05-20 Ken Brown <kbrown@cornell.edu>
6309
6310 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6311 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6312
6313 2012-05-19 Ken Brown <kbrown@cornell.edu>
6314
6315 * xfns.c (x_in_use): Remove `static' qualifier.
6316 * xterm.h (x_in_use): Declare.
6317 * xgselect.c: Include xterm.h.
6318 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6319 and `display_arg' (bug#9754).
6320
6321 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6322
6323 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6324
6325 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6326 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6327
6328 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6329
6330 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6331
6332 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6333 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6334
6335 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6336 reference to image_cache->refcount.
6337 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6338
6339 2012-05-17 Juri Linkov <juri@jurta.org>
6340
6341 * search.c (Fword_search_regexp, Fword_search_backward)
6342 (Fword_search_forward, Fword_search_backward_lax)
6343 (Fword_search_forward_lax): Move functions to isearch.el
6344 (bug#10145, bug#11381).
6345
6346 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6347
6348 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6349
6350 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6351
6352 * lread.c (init_obarray): Declare Qt and Qnil as special.
6353
6354 2012-05-14 Glenn Morris <rgm@gnu.org>
6355
6356 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6357 Put "libexec" before "bin", for the sake of init_callproc_1.
6358
6359 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6360
6361 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6362
6363 * unexaix.c: Port to more-recent AIX compilers.
6364 (report_error, report_error_1, make_hdr, copy_sym)
6365 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6366 Make arguments const char *, not char *, to avoid violations of C
6367 standard and to fix some AIX warnings reported by Gilles Pion.
6368
6369 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6370
6371 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6372 already have overlays loaded.
6373 (handle_single_display_spec): Before returning without displaying
6374 fringe bitmap, synchronize the bidi iterator with the main display
6375 iterator, by calling iterate_out_of_display_property.
6376 (iterate_out_of_display_property): Detect buffer iteration by
6377 testing that it->string is a Lisp string.
6378 (get_next_display_element): When the current object is exhausted,
6379 and there's something on it->stack, call set_iterator_to_next to
6380 proceed with what's on the stack, instead of returning zero.
6381 (set_iterator_to_next): If called at the end of a Lisp string,
6382 proceed to consider_string_end without incrementing string
6383 position. Don't increment display vector index past the end of
6384 the display vector. (Bug#11417)
6385 (pos_visible_p): Don't report a position visible when move_it_to
6386 stopped at the last line of window, which happens to be scanned
6387 backwards by the bidi iteration. (Bug#11464)
6388
6389 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6390
6391 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6392 and right-margin display specs even if the spec is invalid or we
6393 are on a TTY, and thus unable to display on the fringes.
6394 That's because the text with the property will not be displayed anyway,
6395 so we need to signal to the caller that this is a "replacing"
6396 display spec. This fixes display when the spec is invalid or we
6397 are on a TTY.
6398
6399 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6400
6401 * unexaix.c (make_hdr): Fix typo in prototype.
6402 This bug broke the build on AIX. Problem reported by Gilles Pion.
6403
6404 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6405
6406 * keyboard.c (kbd_buffer_get_event): Read special events also in
6407 batch mode. (Bug#11415)
6408
6409 2012-05-12 Glenn Morris <rgm@gnu.org>
6410
6411 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6412
6413 2012-05-12 Eli Zaretskii <eliz@gnu.org>
6414
6415 * lisp.mk (lisp): Add newcomment.elc.
6416
6417 2012-05-12 Glenn Morris <rgm@gnu.org>
6418
6419 * Makefile.in (MKDIR_P): New, set by configure.
6420 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6421
6422 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6423
6424 Remove unused function hourglass_started.
6425 * dispextern.h (hourglass_started):
6426 * w32fns.c (hourglass_started):
6427 * xdisp.c (hourglass_started): Remove.
6428
6429 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
6430
6431 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6432 Update dependencies.
6433
6434 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6435
6436 * xgselect.c (xg_select): Put maxfds+1 into a var.
6437 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6438
6439 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6440
6441 2012-05-10 Dave Abrahams <dave@boostpro.com>
6442
6443 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6444 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6445
6446 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
6447
6448 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6449 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6450 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6451 Initialize xd_registered_buses.
6452
6453 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6454
6455 Untag more efficiently if USE_LSB_TAG.
6456 This is based on a proposal by YAMAMOTO Mitsuharu in
6457 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6458 For an admittedly artificial (nth 8000 longlist) benchmark on
6459 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6460 Emacs's overall text size by 1%.
6461 * lisp.h (XUNTAG): New macro.
6462 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6463 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6464 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6465 * eval.c (Fautoload):
6466 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6467 * frame.h (XFRAME): Use XUNTAG.
6468
6469 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6470 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6471 Remove unportable assumptions about print widths of types like
6472 dbus_uint32_t.
6473 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6474 intptr_t when converting between pointer and integer, to avoid GCC
6475 warnings about wrong width.
6476
6477 2012-05-09 Eli Zaretskii <eliz@gnu.org>
6478
6479 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6480 stack for each reader_thread, instead of defaulting to 8MB
6481 determined by the linker. This avoids failures in creating
6482 subprocesses on Windows 7, see the discussion in this thread:
6483 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6484
6485 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6486
6487 Fix up display of the *Minibuf-0* buffer in the mini window.
6488 * keyboard.c (read_char): Don't clear the echo area if there's no
6489 message to clear.
6490 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6491 contents of *Minibuf-0*) if there's no message displayed in its stead.
6492
6493 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
6494
6495 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6496 batch mode.
6497
6498 2012-05-06 Chong Yidong <cyd@gnu.org>
6499
6500 * lisp.mk (lisp): Update.
6501
6502 2012-05-05 Jim Meyering <meyering@redhat.com>
6503
6504 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6505
6506 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6507
6508 * data.c (PUT_ERROR): New macro.
6509 (syms_of_data): Use it. Add new error type `user-error'.
6510 * undo.c (user_error): New function.
6511 (Fprimitive_undo): Use it.
6512 * print.c (print_error_message): Adjust print style for `user-error'.
6513 * keyboard.c (user_error): New function.
6514 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6515
6516 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6517
6518 Do not limit current-time-string to years 1000..9999.
6519 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6520 (Fcurrent_time_string): Support any year that is supported by the
6521 underlying localtime representation. Don't use asctime, as it
6522 has undefined behavior for years outside the range -999..9999.
6523
6524 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6525
6526 Fix race conditions involving setenv, gmtime, localtime, asctime.
6527 Without this fix, interrupts could mess up code that uses these
6528 nonreentrant functions, since setting TZ invalidates existing
6529 tm_zone or tzname values, and since most of these functions return
6530 pointers to static storage.
6531 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6532 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6533 Grow the critical sections to include not just invoking
6534 localtime/gmtime, but also accessing these functions' results
6535 including their tm_zone values if any, and any related TZ setting.
6536 (format_time_string): Last arg is now struct tm *, not struct tm **,
6537 so that the struct tm is saved in the critical section.
6538 All callers changed. Simplify allocation of initial buffer, partly
6539 motivated by the fact that memory allocation needs to be outside
6540 the critical section.
6541
6542 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6543
6544 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6545 with RESET_INTERVAL.
6546
6547 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6548 Remove duplicated buffer name initialization.
6549
6550 2012-05-02 Jim Meyering <jim@meyering.net>
6551
6552 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6553
6554 * xfns.c (x_window): Use xstrdup (Bug#11375).
6555
6556 2012-05-02 Eli Zaretskii <eliz@gnu.org>
6557
6558 * xdisp.c (pos_visible_p): If already at a newline from the
6559 display string before the 'while' loop, don't walk back the glyphs
6560 from it3.glyph_row. Solves assertion violation when the display
6561 string begins with a newline (egg.el). (Bug#11367)
6562
6563 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6564
6565 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6566 Move to simple.el.
6567
6568 2012-05-01 Glenn Morris <rgm@gnu.org>
6569
6570 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6571 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6572 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6573 All were removed before 23.1.
6574
6575 * dispnew.c: Remove HAVE_LIBNCURSES test;
6576 it is always true on relevant platforms.
6577
6578 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6579 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6580
6581 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6582
6583 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6584
6585 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6586 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6587 Remove.
6588
6589 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6590
6591 Do not avoid creating empty evaporating overlays (Bug#9642).
6592 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6593 That is, do not delete an evaporating overlay if it becomes
6594 empty after its bounds are adjusted to fit within its buffer.
6595 This fix caused other problems, and I'm reverting it until we get
6596 to the bottom of them.
6597
6598 2012-04-27 Chong Yidong <cyd@gnu.org>
6599
6600 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6601
6602 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6603
6604 * xdisp.c (pos_visible_p): If the window start position is beyond
6605 ZV, start the display from buffer beginning. Prevents assertion
6606 violation in init_iterator when the minibuffer window is scrolled
6607 via the scroll bar.
6608
6609 * window.c (window_scroll_pixel_based): Likewise.
6610
6611 2012-04-27 Chong Yidong <cyd@gnu.org>
6612
6613 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6614
6615 2012-04-27 Glenn Morris <rgm@gnu.org>
6616
6617 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6618 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6619
6620 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6621
6622 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6623 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6624
6625 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6626
6627 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6628 display element, check also the underlying string or buffer
6629 character. (Bug#11341)
6630
6631 * w32menu.c: Include w32heap.h.
6632 (add_menu_item): If the call to AppendMenuW (via
6633 unicode_append_menu) fails, disable Unicode menus only if we are
6634 running on Windows 9X/Me.
6635
6636 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6637
6638 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6639 (xgetint): Add missing shift for LSB tags.
6640
6641 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6642
6643 * keyboard.c (read_char): Don't wipe echo area for select window
6644 events: These might get delayed via `mouse-autoselect-window'
6645 (Bug#11304).
6646
6647 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6648
6649 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6650 manipulation of :loaded-from data.
6651
6652 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6653
6654 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6655 now a cons (bug#11311).
6656
6657 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6658
6659 Do not create empty overlays with the evaporate property (Bug#9642).
6660 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6661 if it becomes empty after its bounds are adjusted to fit within
6662 its buffer. Without this fix, in a nonempty buffer (let ((o
6663 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6664 yields an empty overlay that has the evaporate property, which is
6665 not supposed to happen.
6666
6667 Fix minor GTK3 problems found by static checking.
6668 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6669 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6670 (struct _EmacsFixedClass, emacs_fixed_get_type):
6671 Move decls here from emacsgtkfixed.h, since they needn't be public.
6672 (emacs_fixed_get_type): Now static.
6673 (emacs_fixed_class_init): Omit unused local.
6674 (emacs_fixed_child_type): Remove; unused.
6675 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6676 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6677 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6678 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6679 (EMACS_FIXED_GET_CLASS): Remove; unused.
6680 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6681
6682 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6683 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6684
6685 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6686
6687 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6688 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6689 (__malloc_size_t, __malloc_ptrdiff_t):
6690 Remove. All uses removed, replaced by the definiens if needed,
6691 since we can assume C89 or better now.
6692 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6693 (protect_malloc_state, align, get_contiguous_space)
6694 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6695 (malloc_atfork_handler_child, malloc_enable_thread)
6696 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6697 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6698 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6699 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6700 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6701 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6702 Define using prototypes, not old style.
6703 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6704 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6705 (align): Don't assume that signed integer overflow wraps around.
6706 Omit unused local var.
6707 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6708 (_free_internal_nolock, memalign, mallochook, reallochook):
6709 Omit no-longer-needed casts.
6710 (valloc): Use getpagesize, not __getpagesize.
6711 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6712 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6713
6714 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6715
6716 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6717
6718 Move functions from C to Lisp. Make non-blocking method calls
6719 the default. Implement further D-Bus standard interfaces.
6720
6721 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6722 (QCdbus_request_name_allow_replacement)
6723 (QCdbus_request_name_replace_existing)
6724 (QCdbus_request_name_do_not_queue)
6725 (QCdbus_request_name_reply_primary_owner)
6726 (QCdbus_request_name_reply_in_queue)
6727 (QCdbus_request_name_reply_exists)
6728 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6729 (QCdbus_registered_serial, QCdbus_registered_method)
6730 (QCdbus_registered_signal): New Lisp objects.
6731 (XD_DEBUG_MESSAGE): Use sizeof.
6732 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6733 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6734 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6735 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6736 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6737 (xd_signature, xd_append_arg): Allow float for integer types.
6738 (xd_get_connection_references): New function.
6739 (xd_get_connection_address): Rename from xd_initialize.
6740 Return cached address.
6741 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6742 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6743 level.
6744 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6745 Return number of refcounts.
6746 (Fdbus_get_unique_name): Make stronger parameter check.
6747 (Fdbus_message_internal): New defun.
6748 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6749 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6750 (Fdbus_send_signal, Fdbus_register_service)
6751 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6752 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6753 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6754 (Vdbus_compiled_version, Vdbus_runtime_version)
6755 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6756 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6757 (Vdbus_message_type_signal): New defvars.
6758 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6759 Adapt docstring.
6760
6761 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6762
6763 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6764 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6765 Do not assume ptrdiff_t is the same width as 'int'.
6766
6767 * alloc.c: Handle unusual debugging option combinations.
6768 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6769 since the two debugging options are incompatible.
6770 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6771 is defined.
6772 (mem_init, mem_insert, mem_insert_fixup):
6773 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6774 (NEED_MEM_INSERT): Remove; no longer needed.
6775
6776 2012-04-22 Leo Liu <sdl.web@gmail.com>
6777
6778 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6779
6780 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6781
6782 * sysdep.c [__FreeBSD__]: Minor cleanups.
6783 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6784 Use Emacs indenting style more consistently. Avoid some casts.
6785 Use 'double' consistently rather than mixing 'float' and 'double'.
6786
6787 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6788
6789 * sysdep.c (list_system_processes, system_process_attributes):
6790 Add implementation for FreeBSD (Bug#5243).
6791
6792 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6793
6794 * lisp.mk (lisp): Update.
6795
6796 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6797
6798 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6799 It is never used otherwise.
6800
6801 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6802
6803 * print.c (print_preprocess): Only check print_depth if print-circle
6804 is nil.
6805 (print_object): Check for cycles even when print-circle is nil and
6806 print-gensym is t, but only check print_depth if print-circle is nil.
6807
6808 2012-04-20 Chong Yidong <cyd@gnu.org>
6809
6810 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6811 set the status to "failed" and ensure that sentinel is run.
6812
6813 2012-04-20 Glenn Morris <rgm@gnu.org>
6814
6815 * process.c (Fset_process_inherit_coding_system_flag)
6816 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
6817 (Fmake_network_process, Fmake_serial_process): Doc fix.
6818
6819 2012-04-20 Eli Zaretskii <eliz@gnu.org>
6820
6821 * xdisp.c (string_buffer_position_lim): Limit starting position to
6822 BEGV.
6823 (set_cursor_from_row): If called for a mode-line or header-line
6824 row, return zero immediately.
6825 (try_cursor_movement): If inside continuation line, don't back up
6826 farther than the first row after the header line, if any.
6827 Don't consider the header-line row as "partially visible", even if
6828 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6829
6830 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6831
6832 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6833 (bug#11238).
6834
6835 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6836 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
6837
6838 configure: new option --enable-gcc-warnings (Bug#11207)
6839 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6840 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6841 (ALL_CFLAGS): Use new macros rather than old.
6842 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6843 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6844 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6845 -Wunused-result, -Wunused-variable. This should go away once
6846 the Emacs and Gnulib regex code is merged.
6847 (xmalloc, xrealloc): Now static.
6848
6849 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6850
6851 * dired.c (Fsystem_groups): Remove unused local.
6852
6853 2012-04-17 Glenn Morris <rgm@gnu.org>
6854
6855 * dired.c (Fsystem_users): Doc fix.
6856
6857 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6858
6859 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6860 (syms_of_dired): Add them.
6861
6862 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6863
6864 Fix minor alloc.c problems found by static checking.
6865 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6866 New extern decls, to avoid calling undeclared functions.
6867 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6868 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6869 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6870 (NEED_MEM_INSERT): New macro.
6871 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
6872 Remove one incorrect comment and fix another.
6873
6874 Fix minor ralloc.c problems found by static checking.
6875 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6876 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6877 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6878 (r_alloc_sbrk): Now static.
6879
6880 Improve ralloc.c interface checking.
6881 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6882 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6883 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6884 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6885 [REL_ALLOC]: ... to here, to check interface.
6886 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6887 Remove decls. This fixes an "It stinks!".
6888
6889 * alloc.c (which_symbols): Fix alignment issue / type clash.
6890
6891 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6892
6893 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6894 (struct Lisp_Misc_Any): Likewise.
6895 (struct Lisp_Free): Likewise.
6896 * alloc.c (union aligned_Lisp_Symbol): Define.
6897 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6898 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6899 (union aligned_Lisp_Misc): Define.
6900 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6901 aligned_Lisp_Misc instead of union Lisp_Misc.
6902 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
6903
6904 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6905
6906 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6907 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6908 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6909 * s/netbsd.h, s/sol2-6.h:
6910 Remove definition of GC_MARK_STACK, since the default now works.
6911 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6912 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6913 no longer the default.
6914 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6915
6916 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6917
6918 * lread.c (lisp_file_lexically_bound_p):
6919 Fix hang at ";-*-\n" (bug#11238).
6920
6921 2012-04-14 Eli Zaretskii <eliz@gnu.org>
6922
6923 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6924 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6925
6926 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6927
6928 * nsterm.m (constrainFrameRect): Always constrain when there is only
6929 one screen (Bug#10962).
6930
6931 2012-04-13 Ken Brown <kbrown@cornell.edu>
6932
6933 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6934
6935 2012-04-13 Reuben Thomas <rrt@sc3d.org>
6936
6937 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6938
6939 2012-04-11 Daniel Colascione <dancol@dancol.org>
6940
6941 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6942 against is gone. It's better to use vfork now so that when Cygwin
6943 gains a new, working vfork, we use it automatically (bug#10398).
6944
6945 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6946
6947 * window.c (save_window_save): Obey window-point-insertion-type.
6948
6949 2012-04-11 Glenn Morris <rgm@gnu.org>
6950
6951 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6952
6953 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6954
6955 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6956
6957 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6958
6959 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6960 (force_quit_count): New var.
6961 (handle_interrupt): Use it.
6962
6963 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
6964
6965 * w32.c (w32_delayed_load): Record the full path of the library
6966 being loaded (bug#10424).
6967
6968 2012-04-09 Glenn Morris <rgm@gnu.org>
6969
6970 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6971 not just in the obarray, before snarfing them. (Bug#11036)
6972
6973 * Makefile.in ($(leimdir)/leim-list.el):
6974 Pass EMACS rather than BUILT_EMACS.
6975
6976 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6977
6978 * process.c (make_process):
6979 * process.h: Add integer `gnutls_handshakes_tried' member to
6980 process struct.
6981
6982 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6983 Add convenience `GNUTLS_LOG2i' macro.
6984
6985 * gnutls.c (gnutls_log_function2i): Convenience log function.
6986 (emacs_gnutls_read): Use new log functions,
6987 `gnutls_handshakes_tried' process member, and
6988 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6989 attempts per process (connection).
6990
6991 2012-04-09 Chong Yidong <cyd@gnu.org>
6992
6993 * eval.c (Fuser_variable_p, user_variable_p_eh)
6994 (lisp_indirect_variable): Functions deleted.
6995 (Fdefvar): Caller changed.
6996
6997 * callint.c (Finteractive, Fcall_interactively):
6998 * minibuf.c (Fread_variable): Callers changed.
6999
7000 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7001
7002 * xdisp.c (set_cursor_from_row): If the display string appears in
7003 the buffer at position that is closer to point than the position
7004 after the display string, display the cursor on the first glyph of
7005 the display string. Fixes cursor display when a 'display' text
7006 property immediately follows invisible text. (Bug#11094)
7007
7008 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7009
7010 composite.c: use 'double' consistently
7011 * composite.c (get_composition_id): Use 'double' consistently
7012 instead of converting 'float' to 'double' and vice versa; this is
7013 easier to understand and avoids a GCC warning.
7014
7015 2012-04-09 Glenn Morris <rgm@gnu.org>
7016
7017 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7018 preparation for dumping it with emacs. (Bug#4789)
7019 (leimdir): New variable.
7020 ($(leimdir)/leim-list.el): New rule.
7021 (emacs$(EXEEXT)): Depend on leim-list.el.
7022
7023 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7024 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7025 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7026
7027 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7028
7029 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7030 proper alignment.
7031
7032 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7033
7034 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7035 Remove unused local variable.
7036
7037 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7038
7039 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7040 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7041 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7042 objects, as mark_maybe_pointer will catch them otherwise.
7043 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7044 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7045
7046 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7047
7048 Fix typo that broke non-Windows builds.
7049 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7050
7051 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7052
7053 Support building on MS-Windows with libxml2.
7054
7055 * makefile.w32-in (OBJ2): Add xml.$(O).
7056 (GLOBAL_SOURCES): Add xml.c.
7057 ($(BLD)/xml.$(O)): New dependency list.
7058
7059 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7060 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7061 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7062 [!WINDOWSNT]: New macros.
7063 (init_libxml2_functions, libxml2_loaded_p): New functions.
7064 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7065 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7066 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7067 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7068 linked in).
7069 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7070 Call init_libxml2_functions before calling libxml2 functions.
7071 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7072
7073 * emacs.c: Don't include libxml/parser.h.
7074 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7075 xmlCleanupParser directly.
7076
7077 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7078
7079 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7080
7081 * indent.c (Fvertical_motion): If there is a display string at
7082 point, use it.vpos to compute how many lines to backtrack after
7083 move_it_to point. (Bug#11133)
7084
7085 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7086
7087 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7088 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7089 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7090 macros related to unification of CJK characters. For the details,
7091 see the discussion following the message here:
7092 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7093
7094 2012-04-04 Chong Yidong <cyd@gnu.org>
7095
7096 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7097
7098 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7099
7100 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7101 instead of alloca. (Bug#11138)
7102
7103 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7104
7105 * w32menu.c (is_simple_dialog): Properly check lisp types.
7106 (Bug#11141)
7107
7108 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7109
7110 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7111 position we get to after a call to move_it_to fails the
7112 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7113 only if we wind up in a string from display property. (Bug#11063)
7114
7115 * window.c (Fdelete_other_windows_internal): Invalidate the row
7116 and column information about mouse highlight, so that redisplay
7117 restores it after reallocating the glyph matrices. (Bug#7464)
7118
7119 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7120 string comes from a `display' text property, use the buffer
7121 position of that property as if we actually saw that position in
7122 the row's glyphs.
7123 (move_it_by_lines): Remove the assertion that
7124 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7125 violated when there's a before-string at the beginning of a line.
7126 (Bug#11063)
7127
7128 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7129
7130 * xdisp.c (append_space_for_newline): If the default face was
7131 remapped, use the remapped face for the appended newline.
7132 (extend_face_to_end_of_line): Use the remapped default face for
7133 extending the face to the end of the line.
7134 (display_line): Call extend_face_to_end_of_line when the default
7135 face was remapped. (Bug#11068)
7136
7137 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7138
7139 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7140
7141 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7142
7143 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7144
7145 2012-03-27 Glenn Morris <rgm@gnu.org>
7146
7147 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7148 Doc fixes.
7149
7150 2012-03-26 Kenichi Handa <handa@m17n.org>
7151
7152 * dispextern.h (struct glyph): Fix previous change. Change the
7153 bit length of glyphless.ch to 25 (Bug#11082).
7154
7155 2012-03-26 Chong Yidong <cyd@gnu.org>
7156
7157 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7158 (command_loop_1): Use it; inhibit selection update for
7159 handle-select-window too (Bug#8996).
7160
7161 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7162
7163 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7164
7165 2012-03-25 Kenichi Handa <handa@m17n.org>
7166
7167 * dispextern.h (struct glyph): Change the bit length of
7168 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7169
7170 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7171
7172 * s/ms-w32.h (tzname): Include time.h before redirecting to
7173 _tzname. Fixes the MSVC build. (Bug#9960)
7174
7175 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7176
7177 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7178 characters.
7179
7180 * xterm.c (XTread_socket): Only modify handling_signal if
7181 !SYNC_INPUT. (Bug#11080)
7182
7183 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7184
7185 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7186 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7187 when fetching a multibyte character consumes more bytes than
7188 CHAR_BYTES returns, due to unification of CJK characters in
7189 string_char. (Bug#11073)
7190
7191 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7192
7193 * process.c (wait_reading_process_output): Handle pty disconnect
7194 by refraining from sending oneself a SIGCHLD (bug#10933).
7195
7196 2012-03-22 Chong Yidong <cyd@gnu.org>
7197
7198 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7199
7200 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7201 Mark string as coming from a prefix property.
7202 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7203 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7204
7205 2012-03-21 Chong Yidong <cyd@gnu.org>
7206
7207 * xfaces.c (Vface_remapping_alist): Doc fix.
7208
7209 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7210
7211 * w32proc.c (Fw32_set_console_codepage)
7212 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7213 Doc fixes.
7214
7215 2012-03-20 Chong Yidong <cyd@gnu.org>
7216
7217 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7218 to reflect default non-nil value of redisplay-dont-pause.
7219
7220 2012-03-19 Kenichi Handa <handa@m17n.org>
7221
7222 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7223 it fit in a valid range (Bug#11003).
7224
7225 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7226
7227 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7228 that is not from display property, accept the row as a "cursor
7229 row" if one of the string's character has a non-nil `cursor'
7230 property. Fixes cursor positioning when there are newlines in
7231 overlay strings, e.g. in icomplete.el. (Bug#11035)
7232
7233 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7234
7235 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7236
7237 2012-03-12 Chong Yidong <cyd@gnu.org>
7238
7239 * eval.c (inhibit_lisp_code): Rename from
7240 inhibit_window_configuration_change_hook; move from window.c.
7241
7242 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7243 * window.c (run_window_configuration_change_hook)
7244 (syms_of_window): Callers changed.
7245
7246 2012-03-11 Chong Yidong <cyd@gnu.org>
7247
7248 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7249
7250 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7251
7252 2012-03-10 Chong Yidong <cyd@gnu.org>
7253
7254 * frame.c (other_visible_frames): Don't assume the selected frame
7255 is visible (Bug#10955).
7256
7257 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7258
7259 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7260
7261 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7262
7263 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7264 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7265 zero (Bug#10954).
7266
7267 2012-03-03 Glenn Morris <rgm@gnu.org>
7268
7269 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7270
7271 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7272
7273 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7274 position past the first glyph_row that ends at ZV. (Bug#10902)
7275 (redisplay_window, next_element_from_string): Fix typos in
7276 comments.
7277 (redisplay_window): Pass to move_it_vertically the margin in
7278 pixels, not in screen lines.
7279
7280 2012-03-02 Glenn Morris <rgm@gnu.org>
7281
7282 * buffer.c (buffer-list-update-hook): Doc fix.
7283
7284 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7285
7286 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7287 push_it before setting up the iterator for the first overlay
7288 string, even if we have an empty string loaded.
7289 (next_overlay_string): If there's an empty string on the iterator
7290 stack, pop the stack. (Bug#10903)
7291
7292 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7293
7294 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7295 Suggested by Stefan Monnier in
7296 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7297 * alloc.c (widen_to_Lisp_Object): New static function.
7298 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7299 and widening them to Lisp_Objects. This would work even if
7300 USE_LSB_TAG is defined and wide integers are used, which might
7301 happen in a future version of Emacs.
7302
7303 2012-02-25 Chong Yidong <cyd@gnu.org>
7304
7305 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7306 Doc fix.
7307
7308 * xselect.c (Fx_selection_exists_p): Doc fix.
7309 (x_clipboard_manager_save_all): Print an informative message
7310 before saving to clipboard manager.
7311
7312 2012-02-24 Chong Yidong <cyd@gnu.org>
7313
7314 * keyboard.c (process_special_events): Handle all X selection
7315 requests in kbd_buffer, not just the next one (Bug#8869).
7316
7317 2012-02-23 Chong Yidong <cyd@gnu.org>
7318
7319 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7320 call when setting menu-bar-lines and tool-bar-lines parameters.
7321 (unwind_create_frame_1): New helper function.
7322
7323 * window.c (inhibit_window_configuration_change_hook): New var.
7324 (run_window_configuration_change_hook): Obey it.
7325 (syms_of_window): Initialize it.
7326
7327 2012-02-22 Chong Yidong <cyd@gnu.org>
7328
7329 * xterm.c (x_draw_image_relief): Add missing type check for
7330 Vtool_bar_button_margin (Bug#10743).
7331
7332 2012-02-21 Chong Yidong <cyd@gnu.org>
7333
7334 * fileio.c (Vfile_name_handler_alist): Doc fix.
7335
7336 * buffer.c (Fget_file_buffer): Protect against invalid file
7337 handler return value.
7338
7339 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7340
7341 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7342 when computing $valmask.
7343
7344 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7345 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7346 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7347 It's useless in that case, and it can cause problems on hosts
7348 that allocate halves of EMACS_INT values separately.
7349 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7350 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7351 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7352 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7353 it avoids undefined behavior on hosts where shifting right by more
7354 than the word width has undefined behavior.
7355
7356 2012-02-19 Chong Yidong <cyd@gnu.org>
7357
7358 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7359 (Funhandled_file_name_directory, Ffile_name_as_directory)
7360 (Fdirectory_file_name, Fexpand_file_name)
7361 (Fsubstitute_in_file_name): Protect against invalid file handler
7362 return values (Bug#10845).
7363
7364 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7365
7366 * .gdbinit (pitx): Fix incorrect references to fields of the
7367 iterator stack.
7368
7369 2012-02-17 Chong Yidong <cyd@gnu.org>
7370
7371 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7372
7373 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7374
7375 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7376 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7377
7378 2012-02-15 Chong Yidong <cyd@gnu.org>
7379
7380 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7381 marked as special. Also, starting docstrings with * is obsolete.
7382
7383 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7384
7385 * gnutls.c (emacs_gnutls_write): Fix last change.
7386
7387 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7388
7389 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7390 send_process.
7391
7392 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7393
7394 * keymap.c (Fsingle_key_description): Handle char ranges.
7395
7396 2012-02-12 Chong Yidong <cyd@gnu.org>
7397
7398 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7399 as that creates a dangerous corner case.
7400
7401 * window.c (Fdelete_window_internal): Invalidate the mouse
7402 highlight (Bug#9904).
7403
7404 2012-02-12 Glenn Morris <rgm@gnu.org>
7405
7406 * xselect.c (Fx_own_selection_internal)
7407 (Fx_get_selection_internal, Fx_disown_selection_internal)
7408 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7409 * nsselect.m (Fx_own_selection_internal)
7410 (Fx_disown_selection_internal, Fx_selection_exists_p)
7411 (Fx_selection_owner_p, Fx_get_selection_internal):
7412 Sync docs and argument specs with the xselect.c versions.
7413
7414 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7415
7416 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7417
7418 2012-02-11 Eli Zaretskii <eliz@gnu.org>
7419
7420 * w32select.c (Fx_selection_exists_p): Sync doc string and
7421 argument list with xselect.c. (Bug#10783)
7422
7423 * w16select.c (Fx_selection_exists_p): Sync doc string and
7424 argument list with xselect.c. (Bug#10783)
7425
7426 2012-02-10 Glenn Morris <rgm@gnu.org>
7427
7428 * fns.c (Fsecure_hash): Doc fix.
7429
7430 2012-02-09 Kenichi Handa <handa@m17n.org>
7431
7432 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7433
7434 2012-02-07 Chong Yidong <cyd@gnu.org>
7435
7436 * buffer.c (Fbuffer_local_variables)
7437 (buffer_lisp_local_variables): Handle unbound vars correctly;
7438 don't let Qunbound leak into Lisp.
7439
7440 2012-02-07 Glenn Morris <rgm@gnu.org>
7441
7442 * image.c (Fimagemagick_types): Doc fix.
7443
7444 * image.c (imagemagick-render-type): Change it from a lisp object
7445 to an integer. Move the doc here from the lisp manual.
7446 Treat all values not equal to 0 the same.
7447
7448 2012-02-06 Chong Yidong <cyd@gnu.org>
7449
7450 * doc.c (store_function_docstring): Avoid applying docstring of
7451 alias to base function (Bug#2603).
7452
7453 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7454
7455 * .gdbinit (pp1, pv1): Remove redundant defines.
7456 (pr): Use pp.
7457
7458 2012-02-04 Chong Yidong <cyd@gnu.org>
7459
7460 * nsterm.m: Declare a global (Bug#10694).
7461
7462 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7463
7464 * w32.c (get_emacs_configuration_options):
7465 Include --enable-checking, if specified, in the return value.
7466
7467 2012-02-04 Martin Rudalics <rudalics@gmx.at>
7468
7469 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7470 after rounding frame sizes. (Bug#9723)
7471
7472 2012-02-04 Eli Zaretskii <eliz@gnu.org>
7473
7474 * keyboard.c (adjust_point_for_property): Don't position point
7475 before BEGV. (Bug#10696)
7476
7477 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7478
7479 Handle overflow when computing char display width (Bug#9496).
7480 * character.c (char_width): Return EMACS_INT, not int.
7481 (char_width, c_string_width): Check for overflow when
7482 computing the width; this is possible now that individual
7483 characters can have unbounded width. Problem introduced
7484 by merge from Emacs 23 on 2012-01-19.
7485
7486 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
7487
7488 * dbusbind.c (Fdbus_register_method): Mention the return value
7489 :ignore in the docstring.
7490
7491 2012-02-02 Glenn Morris <rgm@gnu.org>
7492
7493 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7494
7495 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7496 Unconditionally set to t. (Bug#10673)
7497 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7498 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7499 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7500
7501 2012-02-02 Kenichi Handa <handa@m17n.org>
7502
7503 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7504 0, do not call append_composite_glyph.
7505
7506 2012-02-02 Kenichi Handa <handa@m17n.org>
7507
7508 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7509 NULL (Bug#6988).
7510 (x_produce_glyphs): If the component of a composition is a null
7511 string, set it->pixel_width to 1 to avoid zero-width glyph.
7512
7513 2012-02-01 Eli Zaretskii <eliz@gnu.org>
7514
7515 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7516 first 2 arguments are identical. This makes inserting large
7517 output from a subprocess an order of magnitude faster on
7518 MS-Windows, where all sbrk'ed memory is always contiguous.
7519
7520 2012-01-31 Glenn Morris <rgm@gnu.org>
7521
7522 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7523 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7524 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7525
7526 2012-01-29 Glenn Morris <rgm@gnu.org>
7527
7528 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7529
7530 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7531
7532 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7533
7534 2012-01-28 Chong Yidong <cyd@gnu.org>
7535
7536 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7537
7538 2012-01-26 Chong Yidong <cyd@gnu.org>
7539
7540 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7541
7542 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7543 repeat counts (Bug#10507).
7544
7545 2012-01-26 Glenn Morris <rgm@gnu.org>
7546
7547 * lread.c (syms_of_lread): Doc fix.
7548
7549 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7550
7551 * coding.c (encode_designation_at_bol): Change return value to
7552 EMACS_INT.
7553
7554 2012-01-25 Chong Yidong <cyd@gnu.org>
7555
7556 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7557
7558 2012-01-21 Chong Yidong <cyd@gnu.org>
7559
7560 * floatfns.c (Fcopysign): Make the second argument non-optional,
7561 since nil is not allowed anyway.
7562
7563 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7564
7565 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7566 (send_process): Likewise.
7567
7568 2012-01-19 Martin Rudalics <rudalics@gmx.at>
7569
7570 * window.c (save_window_save, Fcurrent_window_configuration)
7571 (Vwindow_persistent_parameters): Do not use Qstate.
7572 Rewrite doc-strings.
7573
7574 2012-01-19 Kenichi Handa <handa@m17n.org>
7575
7576 * character.c (char_width): New function.
7577 (Fchar_width, c_string_width, lisp_string_width):
7578 Use char_width (Bug#9496).
7579
7580 2012-01-16 Martin Rudalics <rudalics@gmx.at>
7581
7582 * window.c (Vwindow_persistent_parameters): New variable.
7583 (Fset_window_configuration, save_window_save): Handle persistent
7584 window parameters.
7585
7586 2012-01-14 Eli Zaretskii <eliz@gnu.org>
7587
7588 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7589 thrashing the stack of the thread. (Bug#9087)
7590
7591 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7592
7593 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7594
7595 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7596
7597 * xdisp.c (rows_from_pos_range): Handle the case where the
7598 highlight ends on a newline. (Bug#10464)
7599 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7600 he end column for display of highlight that ends on a newline
7601 before a R2L line.
7602
7603 2012-01-11 Glenn Morris <rgm@gnu.org>
7604
7605 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7606 from load-path also when installation-directory is nil. (Bug#10208)
7607
7608 2012-01-10 Glenn Morris <rgm@gnu.org>
7609
7610 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7611
7612 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7613 Update template values to be closer to their typical values these days.
7614
7615 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7616
7617 * xdisp.c (rows_from_pos_range): Accept additional argument
7618 DISP_STRING, and accept any glyph in a row whose object is that
7619 string as eligible for mouse highlight. Fixes mouse highlight of
7620 display strings from overlays. (Bug#10464)
7621
7622 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7623
7624 emacs: fix an auto-save permissions race condition (Bug#10400)
7625 * fileio.c (auto_saving_dir_umask): New static var.
7626 (Fmake_directory_internal): Use it.
7627 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7628 creating the directory. The old code temporarily assigns
7629 too-generous permissions to the directory.
7630 (do_auto_save_eh): Clear it.
7631 (Fdo_auto_save): Catch all errors, not just file errors, so
7632 that the var is always cleared.
7633
7634 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7635
7636 * search.c (scan_buffer): Pass character positions to
7637 know_region_cache, not byte positions. (Bug#6540)
7638
7639 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7640
7641 * w32.c (sys_rename): Report EXDEV when rename of a directory
7642 fails because the target is on another logical disk. (Bug#10284)
7643
7644 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7645
7646 * xterm.c (x_embed_request_focus): New function.
7647
7648 * xterm.h: Add prototype.
7649
7650 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7651
7652 2012-01-05 Glenn Morris <rgm@gnu.org>
7653
7654 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7655
7656 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7657
7658 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7659 Load gnutls_transport_set_lowat only if GnuTLS version is below
7660 2.11.1.
7661 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7662 GnuTLS versions below 2.11.1.
7663
7664 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7665
7666 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7667 to the doc string advising against its use for altering the way
7668 windows are scrolled.
7669
7670 2011-12-28 Kenichi Handa <handa@m17n.org>
7671
7672 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7673 coding-system ASCII compatible only when it does not produce BOM
7674 on encoding (Bug#10383).
7675
7676 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7677
7678 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7679 can scroll.
7680 (create_and_show_popup_menu): Always use menu_position_func for
7681 Gtk3 (Bug#10361).
7682
7683 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7684
7685 * callint.c (Fcall_interactively): Don't truncate prompt string.
7686
7687 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7688
7689 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7690 property that ends at ZV, so that the bidi iteration could be
7691 resumed from there (after widening). (Bug#10360)
7692
7693 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7694
7695 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7696
7697 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7698
7699 * nsterm.m (x_free_frame_resources):
7700 Release f->output_data.ns->miniimage.
7701 (ns_index_color): Fix indentation. Do not retain
7702 color_table->colors[i].
7703
7704 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7705 before returning.
7706
7707 * nsfns.m (x_set_background_color): Assign return value from
7708 ns_index_color to face-background instead of NSColor*.
7709 (ns_implicitly_set_icon_type): Fix indentation.
7710 Change assignment in for loop to comparison.
7711
7712 * emacs.c (ns_pool): New variable.
7713 (main): Assign ns_pool.
7714 (Fkill_emacs): Call ns_release_autorelease_pool.
7715
7716 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7717 autorelease fdesc, release fdAttrs and tdict.
7718 (ns_get_covering_families): Release charset.
7719 (ns_findfonts): Release NSFontDescriptor created with new.
7720 (ns_uni_to_glyphs): Fix indentation.
7721 (setString): Release attrStr before assigning new value.
7722
7723 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7724
7725 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7726 and NS_IMPL_COCOA.
7727 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7728 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7729
7730 2011-12-18 David Reitter <reitter@cmu.edu>
7731
7732 * nsterm.m (ns_term_init): Subscribe for notifications
7733 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7734 to method trackingNotification in EmacsMenu.
7735
7736 * nsmenu.m (trackingMenu): New variable.
7737 (trackingNotification): New method (from Aquamacs).
7738 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7739 from Aquamacs (Bug#7030).
7740
7741 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7742
7743 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7744 (symbol_to_nsstring): Fix indentation.
7745 (ns_symbol_to_pb): New function.
7746 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7747 (Fns_rotate_cut_buffers_internal): Remove.
7748 (Fns_store_selection_internal): Rename from
7749 Fns_store_cut_buffer_internal.
7750 (ns_get_foreign_selection, Fx_own_selection_internal)
7751 (Fx_disown_selection_internal, Fx_selection_exists_p)
7752 (Fns_get_selection_internal, Fns_store_selection_internal):
7753 Use ns_symbol_to_pb and check if return value is nil.
7754 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7755 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7756 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7757 renamed to Sns_store_selection_internal.
7758 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7759 and remove this function.
7760 (ns_handle_selection_clear): Remove, never used.
7761 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7762 here.
7763
7764 2011-12-17 Ken Brown <kbrown@cornell.edu>
7765
7766 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7767 GID is unknown (Bug#10257).
7768
7769 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7770
7771 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7772 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7773 which caused a build failure on GNU/Linux IA-64. This problem was
7774 introduced by my 2011-10-07 patch.
7775
7776 2011-12-15 Juri Linkov <juri@jurta.org>
7777
7778 * image.c (imagemagick_error): New function. (Bug#10112)
7779 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7780 Use `imagemagick_error' where ImageMagick functions return
7781 `MagickFalse'.
7782 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7783 proper order.
7784
7785 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7786
7787 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7788 fill background (Bug#8992).
7789
7790 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7791
7792 * window.c (Vwindow_combination_resize)
7793 (Vwindow_combination_limit): Use t instead of non-nil in
7794 doc-strings.
7795 (Vrecenter_redisplay): Add first sentence of doc-string on
7796 separate line.
7797 (Frecenter): Fix doc-string typo.
7798
7799 2011-12-11 Kenichi Handa <handa@m17n.org>
7800
7801 * coding.c (Funencodable_char_position): Pay attention to the
7802 buffer text relocation (Bug#9389).
7803
7804 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7805
7806 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7807 gtk_init (Bug#10100).
7808
7809 2011-12-10 Eli Zaretskii <eliz@gnu.org>
7810
7811 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7812 IT->string is nil. (Bug#10263)
7813
7814 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7815
7816 * nsterm.h (x_free_frame_resources): Declare.
7817
7818 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7819 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7820
7821 * nsterm.h (ns_get_defaults_value): Declare.
7822
7823 * nsterm.m (ns_default): Call ns_get_defaults_value.
7824
7825 2011-12-09 Eli Zaretskii <eliz@gnu.org>
7826
7827 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7828 (Bug#10170)
7829
7830 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7831
7832 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7833 that where the value of an _OBJC_* symbol points to is in the .bss
7834 section (Bug#10240).
7835
7836 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7837
7838 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
7839 after the loop to call ccl_driver at least once (Bug#8619).
7840
7841 2011-12-08 Kenichi Handa <handa@m17n.org>
7842
7843 * ftfont.c (get_adstyle_property): Fix previous change
7844 (Bug#10233).
7845
7846 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
7847
7848 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7849 dirs from the default value of EMACSLOADPATH (bug#10208).
7850
7851 2011-12-07 Glenn Morris <rgm@gnu.org>
7852
7853 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7854 installation and source directories as well. (Bug#10208)
7855
7856 2011-12-06 Chong Yidong <cyd@gnu.org>
7857
7858 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7859
7860 2011-12-06 Glenn Morris <rgm@gnu.org>
7861
7862 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7863 as an error, not just -1. (Bug#10217)
7864
7865 2011-12-05 Chong Yidong <cyd@gnu.org>
7866
7867 * keyboard.c (process_special_events): New function.
7868 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7869
7870 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7871
7872 * coding.c (encode_designation_at_bol): Don't use uninitialized
7873 local variable (Bug#9318).
7874
7875 2011-12-05 Kenichi Handa <handa@m17n.org>
7876
7877 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7878 return Qnil (Bug#8046, Bug#10193).
7879
7880 2011-12-05 Kenichi Handa <handa@m17n.org>
7881
7882 * coding.c (encode_designation_at_bol): New args charbuf_end and
7883 dst. Return the number of produced bytes. Callers changed.
7884 (coding_set_source): Return how many bytes coding->source was
7885 relocated.
7886 (coding_set_destination): Return how many bytes
7887 coding->destination was relocated.
7888 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
7889 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
7890
7891 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7892
7893 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7894 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7895 macro (Bug#9318).
7896
7897 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7898
7899 The following changes are to fix Bug#9318.
7900
7901 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
7902 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7903 (encode_coding_iso_2022, encode_coding_sjis)
7904 (encode_coding_big5, encode_coding_charset): Use the above macros.
7905
7906 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
7907
7908 * lisp.h (process_quit_flag): Fix external declaration.
7909
7910 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7911
7912 Don't macro-inline non-performance-critical code.
7913 * eval.c (process_quit_flag): New function.
7914 * lisp.h (QUIT): Use it.
7915
7916 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7917
7918 * nsfns.m (get_geometry_from_preferences): New function.
7919 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7920
7921 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7922
7923 * emacs.c (Qkill_emacs): Define.
7924 (syms_of_emacs): Initialize it.
7925 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7926 Qquit_flag to `kill-emacs' instead.
7927 (quit_throw_to_read_char): Add parameter `from_signal'.
7928 All callers changed. Call Fkill_emacs if requested and safe.
7929 * lisp.h (QUIT): Call Fkill_emacs if requested.
7930
7931 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7932
7933 * widget.c (update_wm_hints): Return if wmshell is null.
7934 (widget_update_wm_size_hints): New function.
7935
7936 * widget.h (widget_update_wm_size_hints): Declare.
7937
7938 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7939 widget_update_wm_size_hints (Bug#10104).
7940
7941 2011-12-03 Eli Zaretskii <eliz@gnu.org>
7942
7943 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7944 before a newline, prepare the bidi iterator for consuming the
7945 newline, and keep the current paragraph direction. (Bug#10183)
7946 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
7947
7948 2011-12-02 Juri Linkov <juri@jurta.org>
7949
7950 * search.c (Fword_search_regexp): New Lisp function created from
7951 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7952 (Fword_search_backward, Fword_search_forward)
7953 (Fword_search_backward_lax, Fword_search_forward_lax):
7954 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7955 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7956
7957 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7958
7959 * fileio.c (Finsert_file_contents): Move after-change-function call
7960 to before the "handled:" label, since all "goto handled" appear in
7961 cases where the *-change-functions have already been properly called
7962 (bug#10117).
7963
7964 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7965
7966 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7967 waiting for input. (Bug#10169)
7968
7969 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7970
7971 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7972 verifies glyph row's hash code--we have just reallocated the
7973 glyphs, so their contents can be complete garbage. (Bug#10164)
7974
7975 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
7976
7977 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7978
7979 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7980
7981 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7982 attributes are tested _before_ calling verify_row_hash, to protect
7983 against GCC re-ordering of the tests. (Bug#10164)
7984
7985 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7986
7987 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7988
7989 * xterm.c (handle_one_xevent): Only set async_visible and friends
7990 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7991 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
7992 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7993
7994 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7995
7996 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7997 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7998 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7999 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8000 All uses changed to use GCPRO1 etc.
8001 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8002 Revert to old implementation (i.e., before 2011-03-11).
8003
8004 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8005
8006 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8007 of scroll runs so as to avoid assigning disabled bogus rows and
8008 unnecessary graphics copy operations.
8009
8010 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8011
8012 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8013 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8014 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8015 (malloc, free, realloc, calloc): Redirect to e_* only when
8016 compiling Emacs.
8017
8018 * lisp.h (GCTYPEBITS): Move before first use.
8019 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8020 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8021 this macro definition.
8022
8023 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8024 _MSC_VER.
8025
8026 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8027
8028 * gtkutil.c (xg_create_frame_widgets):
8029 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8030 present with Gtk+ 2.0.
8031
8032 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8033
8034 * fileio.c (Finsert_file_contents): Undo previous change; see
8035 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8036
8037 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8038
8039 Rename locals to avoid shadowing.
8040 * fileio.c (Finsert_file_contents):
8041 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8042 * process.c (wait_reading_process_output):
8043 Rename inner 'proc' to 'p' to avoid shadowing.
8044 Indent for consistency with usual Emacs style.
8045
8046 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8047
8048 * xdisp.c (redisplay_window): If cursor row is not fully visible
8049 after recentering, and scroll-conservatively is set to a large
8050 number, scroll window by a few more lines to make the cursor fully
8051 visible and out of scroll-margin. (Bug#10105)
8052 (start_display): Don't move to the next line if the display should
8053 start at a newline that is part of a display vector or an overlay
8054 string. (Bug#10119)
8055
8056 2011-11-24 Juri Linkov <juri@jurta.org>
8057
8058 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8059 after the `MagickPingImage' call. (Bug#10112)
8060
8061 2011-11-23 Chong Yidong <cyd@gnu.org>
8062
8063 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8064
8065 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8066
8067 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8068 making another buffer current. (Bug#10114)
8069
8070 2011-11-23 Glenn Morris <rgm@gnu.org>
8071
8072 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8073
8074 2011-11-23 Chong Yidong <cyd@gnu.org>
8075
8076 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8077 using it (Bug#5984).
8078
8079 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8080
8081 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8082 and header-lines, as they don't have one computed for them.
8083 (Bug#10098)
8084
8085 * .gdbinit (prow): Make displayed values more self-explaining.
8086 Add row's hash code.
8087
8088 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8089
8090 * process.c (wait_reading_process_output): Fix asynchrounous
8091 GnuTLS socket handling on some versions of the GnuTLS library.
8092 (wait_reading_process_output): Add comment and URL.
8093
8094 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8095
8096 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8097
8098 2011-11-21 Chong Yidong <cyd@gnu.org>
8099
8100 * window.c (Fnext_window, Fprevious_window): Doc fix.
8101
8102 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8103
8104 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8105
8106 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8107
8108 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8109
8110 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8111
8112 * window.c (Fset_window_combination_limit): Rename argument
8113 STATUS to LIMIT.
8114 (Vwindow_combination_limit): Remove "status" from doc-string.
8115
8116 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8117
8118 * m/ibms390.h: Remove.
8119 * m/ibms390x.h: Don't include "ibms390.h".
8120
8121 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8122
8123 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8124 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8125
8126 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8127
8128 * casetab.c (Fset_case_table):
8129 * charset.c (Fcharset_after): Fix typos.
8130
8131 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8132
8133 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8134 Otherwise, valgrind does not work on some platforms.
8135 Problem reported by Andreas Schwab in
8136 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8137 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8138 is set, removing the need for VIRT_ADDRESS_VARIES.
8139 (PURE_P): Use a more-efficient implementation that needs just one
8140 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8141 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8142 to 4 (xorl, subq, cmpq, setbe).
8143 * alloc.c (pure): Always extern now, since that's the
8144 VIRT_ADDR_VARIES behavior.
8145 (PURE_POINTER_P): Use a single comparison, not two, for
8146 consistency with the new puresize.h.
8147 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8148 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8149 Remove VIRT_ADDR_VARIES no longer needed.
8150
8151 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8152
8153 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8154 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8155 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8156 behave as if the cursor position were at the window margin.
8157
8158 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8159 and the cursor position is out of bounds, behave as if the cursor
8160 position were at the window margin. (Bug#10075)
8161
8162 2011-11-18 Chong Yidong <cyd@gnu.org>
8163
8164 * window.c (Fwindow_combination_limit): Make first argument
8165 non-optional, since it is meaningless for live windows like the
8166 selected window.
8167
8168 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8169
8170 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8171
8172 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8173
8174 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8175 (graft_intervals_into_buffer): Simplify.
8176
8177 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8178
8179 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8180 hash values of the two rows.
8181 (copy_row_except_pointers): Preserve the used[] arrays and the
8182 hash values of the two rows. (Bug#10035)
8183 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8184
8185 * xdisp.c (row_hash): New function, body extracted from
8186 compute_line_metrics.
8187 (compute_line_metrics): Call row_hash, instead of computing the
8188 hash code inline.
8189
8190 * dispnew.c (verify_row_hash): Call row_hash for computing the
8191 hash code of a row, instead of duplicating code from xdisp.c.
8192
8193 * dispextern.h (row_hash): Add prototype.
8194
8195 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8196
8197 * frame.c (delete_frame): Don't delete the terminal when the last
8198 X frame is closed if emacs is built with GTK toolkit.
8199
8200 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8201
8202 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8203
8204 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8205
8206 * window.c (Vwindow_splits): Rename to
8207 Vwindow_combination_resize. Suggested by Juri Linkov.
8208 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8209 of Vwindow_splits.
8210
8211 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8212
8213 * nsfns.m (Fns_font_name):
8214 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8215
8216 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8217
8218 * window.h (window): Rename slot "nest" to "combination_limit".
8219 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8220 (Fset_window_nest): Rename to Fset_window_combination_limit.
8221 (Vwindow_nest): Rename to Vwindow_combination_limit.
8222 (recombine_windows, make_parent_window, make_window)
8223 (Fsplit_window_internal, saved_window)
8224 (Fset_window_configuration, save_window_save): Rename all
8225 occurrences of window_nest to window_combination_limit.
8226
8227 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8228
8229 * image.c (imagemagick_load_image): Fix typo.
8230
8231 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8232
8233 * xdisp.c (display_line): Move the call to
8234 highlight_trailing_whitespace before the call to
8235 compute_line_metrics, since the latter needs to see the final
8236 faces of all the glyphs to compute ROW's hash value.
8237 Fixes assertion violations in row_equal_p. (Bug#10035)
8238
8239 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8240
8241 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8242 just return (bug#10044).
8243
8244 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8245
8246 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8247 with user-defined heap size. Bump the default size of the temacs
8248 heap to 27MB, to avoid memory warning when running temacs.
8249 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8250
8251 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8252 current_matrix and desired_matrix. (Bug#9990)
8253 (verify_row_hash) [XASSERTS]: New function.
8254 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8255 that the hash value of glyph rows is correct.
8256
8257 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8258
8259 * window.h (window): Remove splits slot.
8260 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8261 (Fdelete_other_windows_internal, make_parent_window)
8262 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8263 (Fset_window_configuration, save_window_save): Don't deal with
8264 split status of windows.
8265 (saved_window): Remove splits slot.
8266 (Vwindow_splits): Rewrite doc-string.
8267
8268 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8269
8270 * xfns.c (unwind_create_frame):
8271 * nsfns.m (unwind_create_frame):
8272 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8273 Vframe_list (Bug#9999).
8274
8275 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8276
8277 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8278
8279 2011-11-11 Kenichi Handa <handa@m17n.org>
8280
8281 * callproc.c (Fcall_process): Set the member dst_multibyte of
8282 process_coding.
8283
8284 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8285
8286 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8287 avoid a crash (bug#9496).
8288
8289 2011-11-09 Chong Yidong <cyd@gnu.org>
8290
8291 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8292 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8293
8294 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8295
8296 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8297
8298 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8299
8300 Avoid some portability problems by eschewing 'extern inline' functions.
8301 The trivial performance wins aren't worth the portability hassles; see
8302 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8303 et seq.
8304 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8305 (window_box_width, window_box_left, window_box_left_offset)
8306 (window_box_right, window_box_right_offset): Undo previous change,
8307 by removing the "extern"s.
8308 * intervals.c (adjust_intervals_for_insertion)
8309 (adjust_intervals_for_deletion): Undo previous change,
8310 making these static again.
8311 (offset_intervals, temp_set_point_both, temp_set_point)
8312 (copy_intervals_to_string): No longer inline.
8313 * xdisp.c (window_text_bottom_y, window_box_width)
8314 (window_box_height, window_box_left_offset)
8315 (window_box_right_offset, window_box_left, window_box_right)
8316 (window_box): No longer inline.
8317
8318 2011-11-08 Chong Yidong <cyd@gnu.org>
8319
8320 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8321 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8322 Signal an error if not a live window.
8323 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8324 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8325
8326 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8327
8328 * lisp.h (syms_of_abbrev): Remove declaration.
8329 Reported by CHENG Gao <chenggao@royau.me>.
8330
8331 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8332
8333 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8334 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8335 of temacs in GUI mode.
8336
8337 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8338
8339 * window.h: Declare delete_all_child_windows instead of
8340 delete_all_subwindows.
8341 * window.c (Fwindow_nest, Fset_window_nest)
8342 (Fset_window_new_total, Fset_window_new_normal)
8343 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8344 (delete_all_subwindows): Rename to delete_all_child_windows.
8345 (Fdelete_other_windows_internal, Fset_window_configuration):
8346 Call delete_all_child_windows instead of delete_all_subwindows.
8347 * frame.c (delete_frame): Call delete_all_child_windows instead
8348 of delete_all_subwindows.
8349
8350 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8351
8352 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8353 This is also needed for porting to any host where GC_MARK_STACK is
8354 not GC_MAKE_GCPROS_NOOPS.
8355 (which_symbols): Use it.
8356
8357 2011-11-07 Kenichi Handa <handa@m17n.org>
8358
8359 * coding.c (coding_set_destination): Check coding->src_pos only
8360 when coding->src_object is a buffer (bug#9910).
8361
8362 * process.c (send_process): Set the member src_multibyte of coding
8363 to 0 (bug#9911) when sending a unibyte text.
8364
8365 * callproc.c (Fcall_process): Set the member src_multibyte of
8366 process_coding to 0 (bug#9912).
8367
8368 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8369
8370 * xmenu.c (cleanup_widget_value_tree): New function.
8371 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8372 calling free_menubar_widget_value_tree directly (Bug#9830).
8373
8374 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8375
8376 Fix some portability problems with 'inline'.
8377 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8378 (window_box_width, window_box_left, window_box_left_offset)
8379 (window_box_right, window_box_right_offset): Declare extern.
8380 Otherwise, these inline functions do not conform to C99 and
8381 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8382 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8383 * intervals.c (adjust_intervals_for_insertion)
8384 (adjust_intervals_for_deletion): Now extern, because otherwise the
8385 extern inline functions 'offset_intervals' couldn't refer to it.
8386 (static_offset_intervals): Remove.
8387 (offset_intervals): Rewrite using the old contents of
8388 static_offset_intervals. The old version didn't conform to C99
8389 because an extern inline function contained a reference to an
8390 identifier with static linkage.
8391
8392 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8393
8394 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8395 GC.
8396
8397 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8398
8399 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8400 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8401 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8402 return Qleft_to_right.
8403
8404 2011-11-06 Chong Yidong <cyd@gnu.org>
8405
8406 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8407 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8408 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8409 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8410 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8411 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8412 (Fwindow_vscroll): Doc fix.
8413 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8414 argument, since it makes no sense to pass a live window and for
8415 consistency with window-child.
8416
8417 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8418
8419 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8420 support MSVC.
8421
8422 2011-11-05 Jason Rumney <jasonr@gnu.org>
8423
8424 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8425 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8426 fonts (Bug#6029).
8427 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8428 bitwise arithmetic preventing use of unicode-sip and non-truetype
8429 opentype fonts.
8430
8431 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8432
8433 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8434 "emacs"-only part.
8435
8436 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8437 initialization code to keep similarity to xfns.c after changes
8438 from 2011-11-05.
8439
8440 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8441
8442 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8443 (unwind_create_frame): New function (Bug#9943).
8444 (Fx_create_frame): Restructure code to be more similar to the one in
8445 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8446 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8447 Move terminal->reference_count++ just before making the frame official
8448 (Bug#9943).
8449
8450 * nsterm.m (x_free_frame_resources): New function.
8451 (x_destroy_window): Move code to x_free_frame_resources.
8452
8453 * xfns.c (unwind_create_frame): Fix comment.
8454 (Fx_create_frame, x_create_tip_frame):
8455 Move terminal->reference_count++ just before making the frame
8456 official. Move initialization of image_cache_refcount and
8457 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8458
8459 2011-11-05 Eli Zaretskii <eliz@gnu.org>
8460
8461 Support MSVC build with newer versions of Visual Studio.
8462 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8463 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8464 nt/gmake.defs.
8465
8466 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8467 which are not supported by MSVC.
8468 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8469 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8470 bitfields.
8471 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8472 types in bitfields.
8473 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8474
8475 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8476
8477 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
8478
8479 Support MSVC build with newer versions of Visual Studio.
8480 * w32.c: Don't include w32api.h for MSVC.
8481 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8482
8483 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8484 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8485 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8486 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8487 e_* cousins.
8488 (alloca) [_MSC_VER]: Define to _alloca.
8489
8490 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8491
8492 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8493
8494 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8495
8496 * xdisp.c (note_mouse_highlight): If either of
8497 previous/next-single-property-change returns nil, treat that as
8498 the beginning or the end of the buffer. (Bug#9955)
8499
8500 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8501
8502 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8503 label is not null (Bug#9951).
8504 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8505 may be NULL.
8506
8507 2011-11-04 Eli Zaretskii <eliz@gnu.org>
8508
8509 * window.c (Fwindow_body_size): Mention in the doc string that the
8510 return value is in frame's canonical units. (Bug#9949)
8511
8512 2011-11-03 Eli Zaretskii <eliz@gnu.org>
8513
8514 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8515
8516 * w32fns.c (unwind_create_frame): If needed, free the glyph
8517 matrices of the partially constructed frame. (Bug#9943)
8518 * xfns.c (unwind_create_frame): Likewise.
8519
8520 2011-11-01 Eli Zaretskii <eliz@gnu.org>
8521
8522 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8523 Don't stop backward scan on the continuation glyph, even though
8524 its CHARPOS is positive.
8525 (mouse_face_from_buffer_pos, note_mouse_highlight):
8526 Rename cover_string to disp_string.
8527
8528 2011-11-01 Martin Rudalics <rudalics@gmx.at>
8529
8530 * window.c (temp_output_buffer_show): Don't use
8531 Vtemp_buffer_show_specifiers.
8532 (Vtemp_buffer_show_specifiers): Remove unused variable.
8533
8534 2011-10-30 Eli Zaretskii <eliz@gnu.org>
8535
8536 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8537 past the beginning of the current glyph matrix.
8538
8539 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
8540
8541 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8542 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8543 HAVE_GTK3 (Bug#9869).
8544
8545 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8546 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8547
8548 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8549
8550 * xterm.c: Declare x_handle_net_wm_state to return int.
8551 (handle_one_xevent): Check if we are iconified but don't have
8552 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8553 (get_current_wm_state): Return non-zero if not hidden,
8554 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8555 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8556 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8557 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8558
8559 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8560
8561 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8562 so that this new function doesn't get optimized away by a
8563 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8564
8565 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8566
8567 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8568
8569 2011-10-29 Eli Zaretskii <eliz@gnu.org>
8570
8571 Fix the `xbytecode' command.
8572 * .gdbinit (xprintbytestr): New command.
8573 (xwhichsymbols): Rename from `which'; all callers changed.
8574 (xbytecode): Print the byte-code string as well.
8575
8576 2011-10-29 Kim Storm <storm@cua.dk>
8577
8578 * alloc.c (which_symbols): New function.
8579
8580 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8581
8582 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8583 line. (Bug#9903)
8584
8585 2011-10-29 Glenn Morris <rgm@gnu.org>
8586
8587 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8588 Not clear what it was for, and it causes various bugs. (Bug#9839)
8589
8590 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8591
8592 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8593 possible random value that matches one of those tested as
8594 condition to clear the mouse face.
8595
8596 2011-10-28 Chong Yidong <cyd@gnu.org>
8597
8598 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8599
8600 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8601
8602 * window.c (make_window): Initialize phys_cursor_on_p.
8603
8604 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8605
8606 * lisp.h (struct Lisp_Symbol): Update comments.
8607
8608 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8609
8610 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8611
8612 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8613
8614 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8615 <oslsachem@gmail.com> for helping to debug this.
8616
8617 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8618 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8619 (g_b_init_get_glyph_outline_w): New static variables.
8620 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8621 (GetGlyphOutlineW_Proc): New typedefs.
8622 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8623 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8624 New functions.
8625 (w32font_open_internal, compute_metrics):
8626 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8627 instead of calling the "wide" APIs directly.
8628
8629 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8630
8631 * w32.h (syms_of_w32font): Add prototype.
8632
8633 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8634
8635 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8636 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8637 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8638 (Fmove_to_window_line): Doc fix.
8639
8640 2011-10-27 Chong Yidong <cyd@gnu.org>
8641
8642 * process.c (make_process): Set gnutls_state to NULL.
8643
8644 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8645 non-NULL, regardless of GNUTLS_INITSTAGE.
8646 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8647 an error. Set process slots as soon as we allocate them.
8648
8649 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8650
8651 2011-10-27 Chong Yidong <cyd@gnu.org>
8652
8653 * gnutls.c (emacs_gnutls_deinit): New function.
8654 Deallocate credentials structures as well as calling gnutls_deinit.
8655 (Fgnutls_deinit, Fgnutls_boot): Use it.
8656
8657 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8658 (deactivate_process): Call emacs_gnutls_deinit.
8659
8660 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8661
8662 * image.c (x_create_x_image_and_pixmap):
8663 * w32.c (sys_rename, w32_delayed_load):
8664 * w32font.c (fill_in_logfont):
8665 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8666
8667 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8668
8669 * w32fns.c (w32_default_color_map): New function,
8670 extracted from Fw32_default_color_map.
8671 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8672
8673 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8674
8675 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8676
8677 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8678
8679 * keyboard.c (test_undefined): New function (bug#9751).
8680 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8681
8682 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8683
8684 * sysdep.c (init_sys_modes): Fix the check for the controlling
8685 terminal (Bug#6649).
8686
8687 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8688
8689 * dispextern.h (struct bidi_it): New member next_en_type.
8690
8691 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8692 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8693 current character, check also for next_en_type being WEAK_EN.
8694 (bidi_resolve_weak): Don't enter the expensive loop if the current
8695 position is before next_en_pos. Record the bidi type of the first
8696 non-ET, non-BN character we find, in addition to its position.
8697 (bidi_level_of_next_char): Invalidate next_en_type when
8698 next_en_pos is over-stepped.
8699
8700 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8701
8702 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8703 * editfns.c: Rewrite current-time-zone so that it invokes
8704 the equivalent of (format-time-string "%Z") to get the time zone name.
8705 This fixes a bug when the time zone name contains characters that
8706 need converting from the system time locale to Emacs internal format.
8707 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8708 that patch fixed format-time-string to do the conversion, but
8709 I forgot to fix current-time-zone.
8710 (format_time_string): New function, containing most of
8711 what Fformat_time_string used to contain.
8712 (Fformat_time_string): Rewrite in terms of format_time_string.
8713 This doesn't change this function's behavior.
8714 (current-time-zone): Rewrite to use format_time_string.
8715 This fixes the bug reported by Michael Schierl in
8716 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8717 Jason Rumney's 2007-06-07 change worked around this bug, but
8718 didn't fix it.
8719 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8720
8721 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8722
8723 * xdisp.c (start_display): If the character at POS is displayed
8724 via a display vector, reset IT->current.dpvec_index to zero.
8725 (try_window_reusing_current_matrix): If a line ends in a display
8726 vector or the next line starts in a display vector, continue
8727 redrawing the window even though the character position of
8728 start_row was reached.
8729 (Bug#9771, part 2)
8730
8731 2011-10-18 Chong Yidong <cyd@gnu.org>
8732
8733 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8734 with nobreak-char-display too.
8735
8736 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8737
8738 Fix part 3 of bug#9771.
8739 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8740 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8741 non-neutral characters if the current character is a paragraph
8742 separator (a.k.a. Newline). This avoids running the same
8743 expensive loop twice, once when we consume the preceding newline
8744 and the other time when the line actually needs to be displayed.
8745 Avoid the loop when we see neutrals on the base embedding level
8746 following a character whose directionality is the same as the
8747 paragraph's. This avoids running the expensive loop when a line
8748 ends in a long sequence of neutrals, like control characters.
8749 Add assertion against STRONG_AL type. Slightly rearrange code
8750 that determines the type of a neutral given the first non-neutral
8751 that follows it.
8752 (bidi_level_of_next_char): Set next_en_pos to zero when
8753 invalidating its info.
8754
8755 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8756
8757 * xdisp.c (push_display_prop): Determine whether to record string
8758 or buffer position by IT->string, not by IT->method. Allow
8759 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8760 (move_it_vertically_backward): Don't look for character position
8761 immediately after the newline when in a continuation line.
8762 (Bug#9771, part 1)
8763
8764 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8765
8766 * window.c (coordinates_in_window): Rewrite and delabelize
8767 vertical border check. (Bug#5357) (Bug#9618)
8768
8769 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8770
8771 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8772 errors in XSetWindowBorder (bug#9310).
8773
8774 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8775
8776 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8777 avoid crash when xmalloc overrun checking is enabled.
8778
8779 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8780
8781 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8782 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8783 cursor motion with <left> and <right> arrow keys.
8784
8785 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8786 some callers set that themselves.
8787
8788 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8789
8790 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8791 display string and the previous row comes from the same string and
8792 is empty. (Bug#9739) (Bug#9738)
8793
8794 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8795
8796 * doc.c (get_doc_string): Encode file name (bug#9735).
8797
8798 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8799
8800 * bidi.c (bidi_level_of_next_char):
8801 * xdisp.c (get_visually_first_element): Remove old incorrect
8802 comments regarding the Unicode Line Separator character.
8803
8804 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8805
8806 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8807
8808 * alloc.c (Fgc_status): Do not access beyond zombies array
8809 boundary if nzombies > MAX_ZOMBIES.
8810 * alloc.c (dump_zombies): Add missing format specifier.
8811
8812 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8813
8814 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8815 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8816
8817 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8818 Some packages use them to denote characters with modifiers.
8819
8820 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8821
8822 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8823 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8824 matching a pp-number. Rename parameter var to var1.
8825
8826 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8827
8828 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8829
8830 2011-10-08 Glenn Morris <rgm@gnu.org>
8831
8832 * callint.c (Fcall_interactively): Give a more explicit error for the
8833 'c' case with a non-character input. (Bug#8479)
8834
8835 2011-10-08 Eli Zaretskii <eliz@gnu.org>
8836
8837 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8838 lines.
8839 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8840 lines that are hscrolled on the left.
8841
8842 * dispnew.c (buffer_posn_from_coords): Account for a possible
8843 presence of header-line. (Bug#4426)
8844
8845 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8846
8847 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8848 Don't advertise functionality which we discourage or doesn't work.
8849
8850 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8851
8852 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8853 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8854 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8855 this makes Emacs dump core during garbage collection on rare
8856 occasions. sizeof is obviously inferior to offsetof here, so
8857 stick with offsetof.
8858 (GC_POINTER_ALIGNMENT): New macro.
8859 (mark_memory): Omit 3rd (offset) arg; caller changed.
8860 Don't assume EMACS_INT alignment is the same as pointer alignment.
8861
8862 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8863
8864 * keyboard.c (read_key_sequence_remapped): New var.
8865 (read_key_sequence): Compute remapping in the right buffer.
8866 (command_loop_1): Use read_key_sequence's remapping directly.
8867
8868 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8869
8870 * dired.c (file_name_completion): Don't expand file name.
8871 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8872 before checking file name handler.
8873
8874 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8875 they've been requested explicitly (bug#9591).
8876
8877 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
8878
8879 * keymap.c (Fsingle_key_description): Use make_specified_string
8880 instead of build_string to build string from push_key_description.
8881 (Bug#5193)
8882
8883 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8884
8885 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8886 This fixes a Y2038 bug on 64-bit hosts.
8887 * buffer.c (reset_buffer):
8888 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8889 (Fclear_buffer_auto_save_failure):
8890 Use 0, not -1, to represent an unset failure time, since time_t
8891 might not be signed.
8892
8893 Remove dependency on glibc malloc internals.
8894 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8895 Move back here from lisp.h, but with their new implementations.
8896 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8897 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8898 * charset.c (charset_table_init): New static var.
8899 (syms_of_charset): Use it instead of xmalloc. This removes a
8900 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8901 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8902 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8903 Move back to alloc.c.
8904 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8905 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8906
8907 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8908
8909 * nsterm.m (windowDidResize): Call x_set_window_size only when
8910 ns_in_resize is true. Otherwise set pixelwidth/height and
8911 call change_frame_size (Bug#9628).
8912
8913 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8914
8915 Port --enable-checking=all to Fedora 14 x86-64.
8916 * charset.c (syms_of_charset): Also account for glibc malloc's
8917 internal overhead when calculating the initial malloc maximum.
8918
8919 Port --enable-checking=all to Fedora 14 x86.
8920 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8921 Move to lisp.h.
8922 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8923 (overrun_check_realloc, overrun_check_free):
8924 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8925 That way, xmalloc returns a properly-aligned pointer even if
8926 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8927 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8928 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8929 into account when calculating the initial malloc maximum.
8930 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8931 Move here from alloc.c, so that charset.c can use it too.
8932 Properly align; the old code wasn't right for common 32-bit hosts
8933 when configured with --enable-checking=all.
8934 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8935 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8936
8937 2011-09-29 Eli Zaretskii <eliz@gnu.org>
8938
8939 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
8940 use EDOM.
8941
8942 2011-09-28 Eli Zaretskii <eliz@gnu.org>
8943
8944 * xdisp.c (compute_display_string_end): If there's no display
8945 string at CHARPOS, return -1.
8946
8947 * bidi.c (bidi_fetch_char): When compute_display_string_end
8948 returns a negative value, treat the character as a normal
8949 character not covered by a display string. (Bug#9624)
8950
8951 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
8952
8953 * lread.c (Fread_from_string): Fix typo in docstring.
8954
8955 2011-09-27 Eli Zaretskii <eliz@gnu.org>
8956
8957 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8958 newline, reseat the iterator instead of bidi-iterating there one
8959 character at a time. (Bug#9610)
8960 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8961 TO_CHARPOS if the bidi iterator is at base embedding level.
8962
8963 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8964
8965 * lread.c (readevalloop): Use correct code for NBSP.
8966 (read1): Likewise. (Bug#9608)
8967
8968 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
8969
8970 * dbusbind.c (Fdbus_register_signal): When service is not
8971 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8972
8973 2011-09-25 Glenn Morris <rgm@gnu.org>
8974
8975 * buffer.c (truncate-lines): Doc fix.
8976
8977 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
8978
8979 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8980 (Fset_window_next_buffers): Doc fix.
8981
8982 2011-09-24 Glenn Morris <rgm@gnu.org>
8983
8984 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8985
8986 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8987
8988 Fix minor problems found by static checking.
8989 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
8990 * indent.c (Fvertical_motion): Fix == vs = typo.
8991
8992 2011-09-24 Eli Zaretskii <eliz@gnu.org>
8993
8994 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8995 Default value is now t. Doc fix.
8996
8997 * indent.c (Fvertical_motion): Compute and apply the overshoot
8998 logic when moving up, not only when moving down. Fix the
8999 confusing name and values of the it_overshoot_expected variable;
9000 logic changes accordingly. (Bug#9254) (Bug#9549)
9001
9002 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9003 CHARPOS is covered by a display string which includes newlines.
9004 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9005 is covered by a display string with embedded newlines.
9006
9007 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9008
9009 * dbusbind.c (Fdbus_register_signal): Add match rule to
9010 Vdbus_registered_objects_table. (Bug#9581)
9011 (Fdbus_register_method, Vdbus_registered_objects_table):
9012 Fix docstring.
9013
9014 2011-09-24 Jim Meyering <meyering@redhat.com>
9015
9016 do not ignore write error for any output size
9017 The previous change was incomplete.
9018 While it makes emacs --batch detect the vast majority of stdout
9019 write failures, errors were still ignored whenever the output size is
9020 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9021 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9022 && echo FAIL: ignored write error
9023 FAIL: ignored write error
9024 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9025 && echo FAIL: ignored write error
9026 FAIL: ignored write error
9027 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9028
9029 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9030
9031 * emacs.c (Fkill_emacs): In noninteractive mode exit
9032 non-successfully if a write error occurred on stdout. (Bug#9574)
9033
9034 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9035
9036 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9037 the xassert test.
9038
9039 * dispextern.h (struct it): Update the comment documenting what
9040 can it->OBJECT be.
9041
9042 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9043
9044 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9045 a display string, extend search for cursor position to end of row.
9046 (find_row_edges): If the row ends in a newline from a display
9047 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9048 Handle the case of a display string with multiple newlines.
9049 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9050 non-empty line. Fixes confusing cursor motion with arrow keys at
9051 the beginning of a line that starts with whitespace.
9052
9053 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9054
9055 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9056 (bug#9493).
9057
9058 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9059
9060 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9061 boolean (Bug#9154).
9062
9063 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9064
9065 * xdisp.c (display_line): Record maximum and minimum buffer
9066 positions even if no glyphs were produced (e.g., by a zero-width
9067 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9068 buffer positions that will be removed from the glyph row because
9069 they don't fit.
9070 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9071 column is beyond frame width: don't subtract 1 "pixel" when
9072 computing width of the stretch.
9073 (reseat_at_next_visible_line_start): Undo the change made on
9074 2011-09-17 that saved paragraph information and restored it after
9075 the call to `reseat'. (Bug#9545)
9076
9077 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9078
9079 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9080 and turn window cursor on if cleared (Bug#9415).
9081
9082 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9083
9084 * search.c (boyer_moore): Take unibyte characters from pattern
9085 literally. (Bug#9458)
9086
9087 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9088
9089 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9090
9091 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 Fix minor problem found by static checking.
9094 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9095 initialized, to pacify gcc -Wuninitialized.
9096
9097 * fileio.c: Report proper errno when syscall falls.
9098 (Finsert_file_contents): Save and restore errno,
9099 so that report_file_error outputs the correct diagnostic.
9100 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9101
9102 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9103
9104 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9105
9106 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9107
9108 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9109 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9110
9111 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9112
9113 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9114 about the current paragraph and restore it after the call to reseat.
9115
9116 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9117 (bidi_find_paragraph_start): Search back for paragraph beginning
9118 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9119 (bidi_move_to_visually_next): Only trigger paragraph-related
9120 computations when the last character is a newline or at EOB, not
9121 just any NEUTRAL_B. (Bug#9470)
9122
9123 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9124 truncated lines if point is covered by a display string. (Bug#9524)
9125
9126 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9129 (cons_to_x_long): New function.
9130 (lisp_data_to_selection_data): Use it. Correct the test for
9131 short-versus-long data; it was negated. Break out of vector
9132 loop, for efficiency, when a long datum is discovered.
9133
9134 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9135
9136 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9137
9138 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9139
9140 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9141 GCC PR/17406) by declaring this function with external scope.
9142
9143 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9144
9145 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9146 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9147
9148 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9149
9150 * editfns.c (Fformat): Correctly handle text properties on "%%".
9151
9152 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9153
9154 * xterm.c (x_draw_composite_glyph_string_foreground):
9155 * w32term.c (x_draw_composite_glyph_string_foreground):
9156 * term.c (encode_terminal_code):
9157 * composite.c (composition_update_it, get_composition_id):
9158 * xdisp.c (get_next_display_element)
9159 (fill_composite_glyph_string): Add comments about special meaning
9160 of TAB characters in a composition.
9161
9162 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9163
9164 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9165 This occurs when processing a multibyte format.
9166 Problem reported by Wolfgang Jenker.
9167
9168 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9169
9170 * xdisp.c (try_cursor_movement): Only check for exact match if
9171 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9172
9173 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9174
9175 Remove unused external symbols.
9176 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9177 * xdisp.c (calc_pixel_width_or_height): Now static.
9178 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9179 * indent.c (check_display_width):
9180 * w32term.c: Fix comment to match code.
9181 * xterm.c, xterm.h (x_catching_errors): Remove.
9182
9183 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9184
9185 * xselect.c: Use signed conversions more consistently (Bug#9498).
9186 (selection_data_to_lisp_data): Assume incoming selection data are
9187 signed integers, not unsigned. This is to be consistent with
9188 outgoing selection data, which was modified to use signed integers
9189 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9190 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9191 expects long, not unsigned long.
9192
9193 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9194
9195 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9196 computation of loop end. Reported by Johan Bockgård
9197 <bojohan@gnu.org>.
9198
9199 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9200
9201 * frame.c (Fother_visible_frames_p): Function deleted.
9202
9203 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9204
9205 * indent.c (compute_motion): Process display vector front to back
9206 rather than the other way around. (Bug#2496)
9207
9208 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9209
9210 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9211
9212 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9213
9214 * minibuf.c (Fread_from_minibuffer): Doc fix.
9215
9216 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9217
9218 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9219 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9220
9221 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9222
9223 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9224 value for non-existent files.
9225
9226 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9227
9228 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9229 set its "size" to -1. This will set the modtime_size field of
9230 the corresponding buffer to -1, which is what
9231 verify-visited-file-modtime expects for files that do not exist.
9232 (Bug#9139)
9233
9234 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9235
9236 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9237 here ...
9238 * lisp.h: ... from here. push_key_description is no longer
9239 defined in keyboard.c, so its declaration should not be in
9240 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9241 logically belongs with push_key_description.
9242
9243 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9244
9245 * buffer.h: Include <sys/types.h> instead of <time.h>.
9246 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9247 Problem reported by Herbert J. Skuhra.
9248
9249 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9250
9251 * xml.c (parse_region): Make the parsing work for
9252 non-comment-starting XML files again (bug#9144).
9253
9254 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9255
9256 * image.c (gif_load): Fix calculation of bottom and right corner.
9257 (Bug#9468)
9258
9259 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9260
9261 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9262 redisplay in small windows.
9263
9264 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9265
9266 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9267
9268 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9269
9270 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9271 Operate on live windows only.
9272
9273 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9274
9275 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9276
9277 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9278
9279 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9280 only under bidi iteration.
9281
9282 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9283
9284 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9285
9286 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9287
9288 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9289 Without this fix, the command to link temacs failed due to an
9290 undefined symbol __builtin_isnan. This is because
9291 /usr/include/iso/math_c99.h #defines isnan(x) to
9292 __builtin_isnan(x), but the bundled gcc, which identifies itself
9293 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9294 a __builtin_isnan.
9295 * floatfns.c (isnan): #undef, and then #define to a clone of
9296 what's in data.c.
9297 (Fisnan): Always define, since it's always available now.
9298 (syms_of_floatfns): Always define isnan at the Lisp level.
9299
9300 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9301
9302 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9303
9304 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9305
9306 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9307 The previous code assumed that file offsets (off_t values) fit in
9308 EMACS_INT variables, which is not true on typical 32-bit hosts.
9309 The code messed up by falsely reporting buffer overflow in cases
9310 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9311 when "big" contains more than 2**29 bytes, even though this
9312 inserts just one byte and does not overflow the buffer.
9313 (Finsert_file_contents): Store file offsets as off_t
9314 values, not as EMACS_INT values. Check for overflow when
9315 converting between EMACS_INT and off_t. When checking for
9316 buffer overflow or for overlap, take the offsets into account.
9317 Don't use EMACS_INT for small values where int suffices.
9318 When checking for overlap, fix a typo: ZV was used where
9319 ZV_BYTE was intended.
9320 (Fwrite_region): Don't assume off_t fits into 'long'.
9321 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9322
9323 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9324
9325 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9326
9327 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9328
9329 sprintf-related integer and memory overflow issues (Bug#9412).
9330
9331 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9332 (esprintf, exprintf, evxprintf): New functions.
9333 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9334 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9335 (modify_event_symbol): Do not assume that the length of
9336 name_alist_or_stem is safe to alloca and fits in int.
9337 (Fexecute_extended_command): Likewise for function name and binding.
9338 (Frecursion_depth): Wrap around reliably on integer overflow.
9339 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9340 since some callers pass EMACS_INT values.
9341 (Fsingle_key_description): Don't crash if symbol name contains more
9342 than MAX_ALLOCA bytes.
9343 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9344 (get_minibuffer): Arg is now EMACS_INT, not int.
9345 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9346 (esprintf, exprintf, evxprintf): New decls.
9347 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9348
9349 * dbusbind.c (signature_cat): New function.
9350 (xd_signature, Fdbus_register_signal):
9351 Do not overrun buffer; instead, report string overflow.
9352
9353 * dispnew.c (add_window_display_history): Don't overrun buffer.
9354 Truncate instead; this is OK since it's just a log.
9355
9356 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9357 even if the time zone offset is outlandishly large.
9358 Don't mishandle offset == INT_MIN.
9359
9360 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9361 when creating daemon; the previous buffer-overflow check was incorrect.
9362
9363 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9364 which has the guts of the old verror function.
9365
9366 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9367 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9368
9369 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9370 (font_unparse_xlfd): Don't blindly alloca long strings.
9371 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9372 fits in int, when using sprintf. Use single snprintf to count
9373 length of string rather than counting it via multiple sprintfs;
9374 that's simpler and more reliable.
9375 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9376 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9377 sprintf, in case result does not fit in int.
9378
9379 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9380 (fontset_from_font): Print it.
9381
9382 * frame.c (tty_frame_count): Now printmax_t, not int.
9383 (make_terminal_frame, set_term_frame_name): Print it.
9384 (x_report_frame_params): In X, window IDs are unsigned long,
9385 not signed long, so print them as unsigned.
9386 (validate_x_resource_name): Check for implausibly long names,
9387 and don't assume name length fits in 'int'.
9388 (x_get_resource_string): Don't blindly alloca invocation name;
9389 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9390 not fit in int.
9391
9392 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9393 (xg_check_special_colors, xg_set_geometry):
9394 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9395
9396 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9397 Use esprintf, not sprintf, in case result does not fit in int.
9398
9399 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9400 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9401 it as a large positive number.
9402 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9403 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9404
9405 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9406 in case result does not fit in int.
9407
9408 * print.c (float_to_string): Detect width overflow more reliably.
9409 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9410 buffer overrun. Don't assume list length fits in 'int'. Treat
9411 print length of 0 as 0, not as infinity; to be consistent with other
9412 uses of print length in this function. Don't overflow print length
9413 index. Don't assume hash table size fits in 'long', or that
9414 vectorlike size fits in 'unsigned long'.
9415
9416 * process.c (make_process): Use printmax_t, not int, to format
9417 process-name gensyms.
9418
9419 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9420
9421 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9422 to avoid potential buffer overrun.
9423
9424 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9425 if X resource line is longer than 512 bytes.
9426
9427 * xfns.c (x_window): Make sprintf buffer a bit bigger
9428 to avoid potential buffer overrun.
9429
9430 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9431
9432 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9433
9434 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9435
9436 Integer overflow fixes for scrolling, etc.
9437 Without these, Emacs silently mishandles large integers sometimes.
9438 For example, "C-u 4294967297 M-x recenter" was treated as if
9439 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9440
9441 * xdisp.c (try_window_id): Check Emacs fixnum range before
9442 converting to 'int'.
9443
9444 * window.c (window_scroll_line_based, Frecenter):
9445 Check that an Emacs fixnum is in range before assigning it to 'int'.
9446 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9447 values converted from Emacs fixnums.
9448 (Frecenter): Don't wrap around a line count if it is out of 'int'
9449 range; instead, treat it as an extreme value.
9450 (Fset_window_configuration, compare_window_configurations):
9451 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9452
9453 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9454 that can exceed INT_MAX. Check that EMACS_INT value is in range
9455 before assigning it to the (possibly-narrower) index.
9456 (match_limit): Don't assume that a fixnum can fit in 'int'.
9457
9458 * print.c (print_object): Use ptrdiff_t, not int, for index that can
9459 exceed INT_MAX.
9460
9461 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9462 (Fvertical_motion): Don't wrap around LINES values that don't fit
9463 in 'int'. Instead, treat them as extreme values. This is good
9464 enough for windows, which can't have more than INT_MAX lines anyway.
9465
9466 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9467
9468 * Require libxml/parser.h to avoid compilation warning.
9469
9470 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9471
9472 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9473 since this reportedly can destroy thread storage.
9474
9475 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
9476
9477 * syntax.c (find_defun_start): Update all cache variables if
9478 exiting early (Bug#9401).
9479
9480 2011-08-30 Eli Zaretskii <eliz@gnu.org>
9481
9482 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9483
9484 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9485 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9486 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9487
9488 * term.c (tty_append_glyph): New function.
9489 (produce_stretch_glyph): Static function and its prototype deleted.
9490
9491 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9492 Add prototypes.
9493
9494 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9495
9496 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9497 when checking :margin (Bug#9390).
9498 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9499 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9500 so that the name doesn't mislead. All uses changed.
9501
9502 2011-08-28 Johan Bockgård <bojohan@gnu.org>
9503
9504 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9505 set_tty_hooks.
9506
9507 2011-08-27 Eli Zaretskii <eliz@gnu.org>
9508
9509 * xdisp.c (move_it_to): Don't bail out early when reaching
9510 position beyond to_charpos, if we are scanning backwards.
9511 (move_it_vertically_backward): When DY == 0, make sure we get to
9512 the first character in the line after the newline.
9513
9514 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9515
9516 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9517 (ccl_driver): Do not generate an out-of-range pointer.
9518 (Fccl_execute_on_string): Remove unnecessary check for
9519 integer overflow, noted by Stefan Monnier in
9520 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9521 Remove a FIXME that didn't need fixing.
9522 Simplify the newly-introduced buffer reallocation code.
9523
9524 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
9525
9526 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9527
9528 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 Integer and memory overflow issues (Bug#9196).
9531
9532 * doc.c (get_doc_string): Rework so that
9533 get_doc_string_buffer_size is the actual buffer size, rather than
9534 being 1 less than the actual buffer size; this makes xpalloc more
9535 convenient.
9536
9537 * image.c (x_allocate_bitmap_record, cache_image):
9538 * xselect.c (Fx_register_dnd_atom):
9539 Simplify previous changes by using xpalloc.
9540
9541 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9542 since either will do and ptrdiff_t is convenient with xpalloc.
9543
9544 * charset.c (charset_table_size)
9545 (struct charset_sort_data.priority): Now ptrdiff_t.
9546 (charset_compare): Don't overflow if priorities differ greatly.
9547 (Fsort_charsets): Don't assume list length fits in int.
9548 Check for size-calculation overflow when allocating sort data.
9549 (syms_of_charset): Allocate an initial charset table that is
9550 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9551
9552 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9553
9554 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9555 The actual value is always <= INT_MAX, and leaving it unsigned made
9556 overflow checking harder.
9557
9558 * dispextern.h (struct glyph_matrix.rows_allocated)
9559 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9560 with xpalloc. The values are still always <= INT_MAX.
9561
9562 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9563
9564 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9565 (SAFE_NALLOCA): New macro.
9566
9567 * region-cache.c (struct boundary.pos, find_cache_boundary)
9568 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9569 (set_cache_region, invalidate_region_cache)
9570 (revalidate_region_cache, know_region_cache, region_cache_forward)
9571 (region_cache_backward, pp_cache):
9572 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9573 so that ptrdiff_t * can be passed to xpalloc.
9574 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9575 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9576 (pp_cache): Don't assume cache_len fits in int.
9577 * region-cache.h: Adjust extern decls to match.
9578
9579 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9580 EMACS_INT, since either will do, for xpalloc.
9581
9582 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9583 (xnmalloc, xnrealloc, xpalloc): New functions.
9584
9585 * bidi.c (bidi_shelve_header_size): New constant.
9586 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9587 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9588
9589 * bidi.c (bidi_cache_shrink):
9590 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9591 (overlay_strings):
9592 Don't update size of array until after memory allocation succeeds,
9593 because xmalloc/xrealloc may not return.
9594 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9595 now that we have proper integer overflow checking.
9596 (record_overlay_string, overlay_strings): Catch overflows when
9597 calculating size of overlay_str_buf.
9598
9599 * callproc.c (Fcall_process): Check for size overflow when
9600 calculating size of args2.
9601 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9602 Normally we prefer signed values, but sticking with ptrdiff_t would
9603 require adding more-complicated checks.
9604
9605 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9606 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9607 Redo buffer-overflow calculations to avoid integer overflow.
9608 Add a FIXME comment where memory seems to be over-allocated.
9609
9610 * character.c (Fstring): Check for size-calculation overflow.
9611
9612 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9613 unnecessary integer overflow. Check for size overflow.
9614 (encode_coding_object): Don't update size until xmalloc succeeds.
9615
9616 * composite.c (get_composition_id): Check for overflow in glyph
9617 length calculations.
9618
9619 Integer and memory overflow fixes for display code.
9620 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9621 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9622 (scrolling_window): Check for overflow in size calculations.
9623 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9624 Don't assume glyph table len fits in int.
9625 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9626 (row_table_size): Now ptrdiff_t, not int.
9627 (scrolling_window): Avoid overflow in size calculations.
9628 Don't update size until allocation succeeds.
9629 * fns.c (concat): Check for overflow in size calculations.
9630 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9631 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9632 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9633
9634 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9635 (get_doc_string): Check for size calculation overflow.
9636 Don't update size until allocation succeeds.
9637 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9638 EMACS_INT, where ptrdiff_t will do.
9639 (Fsubstitute_command_keys): Check for string overflow.
9640
9641 * editfns.c (set_time_zone_rule): Don't assume environment length
9642 fits in int.
9643 (message_length): Now ptrdiff_t, not int.
9644 (Fmessage_box): Don't update size until allocation succeeds.
9645 Don't assume message length fits in int.
9646 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9647
9648 * emacs.c (main): Do not reallocate argv, since there is a null at
9649 the end that can be overwritten, and this way there's no need to
9650 worry about size-calculation overflow.
9651 (sort_args): Check for size-calculation overflow.
9652
9653 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9654 alloc succeeds.
9655 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9656
9657 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9658 (x_set_scroll_bar_width, x_figure_window_size):
9659 Check for integer overflow.
9660 (x_set_alpha): Do not assume XINT fits in int.
9661
9662 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9663 This is for the members text_lines, text_cols, total_lines, total_cols,
9664 where the system imposes an 'int' limit.
9665
9666 * fringe.c (Fdefine_fringe_bitmap):
9667 Don't update size until alloc works.
9668
9669 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9670 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9671
9672 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9673 Check for size-calculation overflow.
9674 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9675 do, as we prefer signed integers.
9676 (id_to_widget.max_size, id_to_widget.used)
9677 (xg_store_widget_in_map, xg_remove_widget_from_map)
9678 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9679 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9680 Use and return ptrdiff_t, not int.
9681 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9682 * gtkutil.h: Change prototypes to match the above.
9683
9684 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9685 are duplicate now that they've been promoted to lisp.h.
9686 (x_allocate_bitmap_record, x_alloc_image_color)
9687 (make_image_cache, cache_image, xpm_load):
9688 Don't update size until alloc is done.
9689 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9690 (x_detect_edges):
9691 Check for size calculation overflow.
9692 (ct_colors_allocated_max): New constant.
9693 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9694 overflow.
9695
9696 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9697 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9698 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9699 Use ptrdiff_t, not int, to count maps.
9700 (read_char_minibuf_menu_prompt): Check for overflow in size
9701 calculations. Don't update size until allocation succeeds.
9702 Redo calculations to avoid overflow.
9703 * keyboard.h: Change prototypes to match the above.
9704
9705 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9706 to count maps.
9707 (current_minor_maps): Check for size calculation overflow.
9708 * keymap.h: Change prototypes to match the above.
9709
9710 * lread.c (read1, init_obarray): Don't update size until alloc done.
9711
9712 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9713 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9714
9715 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9716 Now ptrdiff_t, not int.
9717 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9718 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9719
9720 * process.c (Fnetwork_interface_list): Check for overflow
9721 in size calculation.
9722
9723 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9724
9725 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9726 overflow. Don't bother calling xmalloc when xrealloc will do.
9727
9728 * search.c (Freplace_match): Check for size calculation overflow.
9729 (Fset_match_data): Don't assume list lengths fit in 'int'.
9730
9731 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9732 for command line length. Do not attempt to address one before the
9733 beginning of an array, as that's not portable.
9734
9735 * term.c (max_frame_lines): Remove; unused.
9736 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9737 not int.
9738 (encode_terminal_code, calculate_costs): Check for size
9739 calculation overflow.
9740 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9741 table lengths and related sizes. Don't update size until alloc
9742 done. Redo calculations to avoid overflow.
9743 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9744
9745 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9746 subtracting pointers.
9747 (gobble_line): Check for overflow more carefully. Don't update size
9748 until alloc done.
9749
9750 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9751 Don't update size until alloc done.
9752 Redo size calculations to avoid overflow.
9753 Check for size calculation overflow.
9754 (main) [DEBUG]: Fix typo in invoking tparam1.
9755
9756 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9757 Use ptrdiff_t, not int, for sizes.
9758 (store_mode_line_noprop_char): Don't update size until alloc done.
9759
9760 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9761 Use ptrdiff_t, not int, for sizes.
9762 (Finternal_make_lisp_face, cache_face):
9763 Check for size calculation overflow.
9764 (cache_face): Treat size calculation overflows as if they were
9765 memory exhaustion (the usual treatment), rather than aborting.
9766
9767 * xfns.c (x_encode_text, x_set_name_internal)
9768 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9769 sizes, since they can exceed INT_MAX in size. Check for size
9770 calculation overflow.
9771
9772 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9773 (xg_select): Check for size calculation overflow.
9774 Don't update size until alloc done.
9775
9776 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9777 as sprintf is limited to int lengths.
9778
9779 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9780 (X_LONG_MIN): New macros.
9781 Use them to make the following changes clearer.
9782 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9783 This change doesn't affect the value now, but it may help remind
9784 future maintainers not to raise the value too much later.
9785 (SELECTION_QUANTUM): Remove, replacing with ...
9786 (selection_quantum): ... new function, which avoids overflow.
9787 All uses changed.
9788 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9789 assumption that selection length fits in 'int'.
9790 (x_reply_selection_request, x_handle_selection_request)
9791 (x_get_window_property, receive_incremental_selection)
9792 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9793 (lisp_data_to_selection_data, clean_local_selection_data):
9794 Use ptrdiff_t, not int, to record length of selection.
9795 (x_reply_selection_request, x_get_window_property)
9796 (receive_incremental_selection, x_property_data_to_lisp):
9797 Redo calculations to avoid overflow.
9798 (x_reply_selection_request): When sending hint, ceiling it at
9799 X_LONG_MAX rather than relying on wraparound overflow to send
9800 something.
9801 (x_get_window_property, receive_incremental_selection)
9802 (lisp_data_to_selection_data, x_property_data_to_lisp):
9803 Check for size-calculation overflow.
9804 (x_get_window_property, receive_incremental_selection)
9805 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9806 Don't store size until memory allocation succeeds.
9807 (x_get_window_property): Plug memory leak on memory exhaustion.
9808 Don't double-block input; malloc is safe here. Don't assume 2**34
9809 - 4 fits in unsigned long. Add an xassert to check
9810 XGetWindowProperty overflow. Be more careful about overflow
9811 calculations, and distinguish size from memory overflow better.
9812 (receive_incremental_selection): When tracing, don't assume
9813 unsigned int is less than INT_MAX.
9814 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9815 harmful) conversions of unsigned short to int.
9816 (lisp_data_to_selection_data): Don't assume that integers
9817 in the range -65535 through -1 fit in an X unsigned short.
9818 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9819 result parameters unless successful. Rely on cons_to_unsigned
9820 to report problems with elements; the old code wasn't right anyway.
9821 (x_check_property_data): Check for int overflow; we cannot use
9822 a wider type due to X limits.
9823 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9824
9825 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
9826
9827 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9828 (x_term_init): Check for size calculation overflow.
9829 (x_color_cells): Don't store size until memory allocation succeeds.
9830 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
9831 Don't assume alloca size is less than MAX_ALLOCA.
9832 (x_term_init): Don't assume length fits in int (sprintf is limited
9833 to int size).
9834
9835 Use ptrdiff_t for composition IDs.
9836 * character.c (lisp_string_width):
9837 * composite.c (composition_table_size, n_compositions)
9838 (get_composition_id, composition_gstring_from_id):
9839 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9840 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9841 * window.c (Frecenter):
9842 Use ptrdiff_t, not int, for composition IDs.
9843 * composite.c (get_composition_id): Check for integer overflow.
9844 * composite.h: Adjust prototypes to match the above changes.
9845
9846 Use ptrdiff_t for hash table indexes.
9847 * category.c (hash_get_category_set):
9848 * ccl.c (ccl_driver):
9849 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9850 * coding.c (coding_system_charset_list, detect_coding_system):
9851 * coding.h (struct coding_system.id):
9852 * composite.c (get_composition_id, gstring_lookup_cache):
9853 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9854 * image.c (xpm_get_color_table_h):
9855 * lisp.h (hash_lookup, hash_put):
9856 * minibuf.c (Ftest_completion):
9857 Use ptrdiff_t for hash table indexes, not int (which is too
9858 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9859 32-bit --with-wide-int hosts).
9860
9861 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9862 Add a FIXME comment about memory leaks.
9863 (syms_of_charset): Don't assume xmalloc returns.
9864
9865 Don't assume that stated character widths fit in int.
9866 * character.c (Fchar_width, c_string_width, lisp_string_width):
9867 * character.h (CHAR_WIDTH):
9868 * indent.c (MULTIBYTE_BYTES_WIDTH):
9869 Use sanitize_char_width to avoid undefined and/or bad behavior
9870 with outlandish widths.
9871 * character.h (sanitize_tab_width): Rename from sanitize_width,
9872 now that we have two such functions. All uses changed.
9873 (sanitize_char_width): New inline function.
9874
9875 Don't assume that tab-width fits in int.
9876 * character.h (sanitize_width): New inline function.
9877 (SANE_TAB_WIDTH): New macro.
9878 (ASCII_CHAR_WIDTH): Use it.
9879 * indent.c (sane_tab_width): Remove. All uses replaced by
9880 SANE_TAB_WIDTH (current_buffer).
9881 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9882
9883 * fileio.c: Integer overflow issues with file modes.
9884 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9885
9886 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9887 Remove unreachable code.
9888 (read_hex, load_charset_map_from_file): Check for integer overflow.
9889
9890 * xterm.c: Don't go over XClientMessageEvent limit.
9891 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9892 (x_send_scroll_bar_event): Likewise. Check that the size does not
9893 exceed limits imposed by XClientMessageEvent, as well as the usual
9894 ptrdiff_t and size_t limits.
9895
9896 * keyboard.c: Overflow, signedness and related fixes.
9897 (make_lispy_movement): Use same integer type in forward decl
9898 that is used in the definition.
9899 (read_key_sequence, keyremap_step):
9900 Change bufsize argument back to int, undoing my 2011-03-30 change.
9901 We prefer signed types, and int is wide enough here.
9902 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9903 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9904 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9905 length, not size_t. Use ptrdiff_t for index, not int.
9906 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9907 possibility of integer overflow.
9908
9909 Overflow, signedness and related fixes for images.
9910
9911 * dispextern.h (struct it.stack[0].u.image.image_id)
9912 (struct_it.image_id, struct image.id, struct image_cache.size)
9913 (struct image_cache.used, struct image_cache.ref_count):
9914 * gtkutil.c (update_frame_tool_bar):
9915 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9916 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9917 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9918 * nsmenu.m (update_frame_tool_bar):
9919 * xdisp.c (calc_pixel_width_or_height):
9920 * xfns.c (image_cache_refcount):
9921 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9922 on typical 64-bit hosts.
9923
9924 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9925 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9926 Omit unnecessary casts to int.
9927 (parse_image_spec): Check that integers fall into 'int' range
9928 when the callers expect that.
9929 (image_ascent): Redo ascent calculation to avoid int overflow.
9930 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9931 (lookup_image): Remove unnecessary tests.
9932 (xbm_image_p): Locals are now of int, not EMACS_INT,
9933 since parse_image_check makes sure they fit into int.
9934 (png_load, gif_load, svg_load_image):
9935 Prefer int to unsigned where either will do.
9936 (tiff_handler): New function, combining the cores of the
9937 old tiff_error_handler and tiff_warning_handler.
9938 This function is rewritten to use vsnprintf and thereby avoid
9939 stack buffer overflows. It uses only the features of vsnprintf
9940 that are common to both POSIX and native Microsoft.
9941 (tiff_error_handler, tiff_warning_handler): Use it.
9942 (tiff_load, gif_load, imagemagick_load_image):
9943 Don't assume :index value fits in 'int'.
9944 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9945 (imagemagick_load_image): Check that crop parameters fit into
9946 the integer types that MagickCropImage accepts. Don't assume
9947 Vimagemagick_render_type has a nonnegative value. Don't assume
9948 size_t fits in 'long'.
9949 (gs_load): Use printmax_t to print the widest integers possible.
9950 Check for integer overflow when computing image height and width.
9951
9952 2011-08-26 Eli Zaretskii <eliz@gnu.org>
9953
9954 * xdisp.c (redisplay_window): Don't force window start if point
9955 will be invisible in the resulting window. (Bug#9324)
9956
9957 2011-08-25 Eli Zaretskii <eliz@gnu.org>
9958
9959 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9960 the display spec is of the form `(space ...)'.
9961 (handle_display_spec): Return the value returned by
9962 handle_single_display_spec, not just 1 or zero.
9963 (handle_single_display_spec): If the display spec is of the form
9964 `(space ...)', and specifies display in the text area, return 2
9965 rather than 1.
9966 (try_cursor_movement): Check for the need to scroll more
9967 accurately, and prefer exact match for point under bidi.
9968 Don't advance `row' beyond the last row of the window.
9969
9970 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9971 into disp_prop; all users changed.
9972
9973 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9974 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9975 for the text covered by the display property.
9976
9977 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
9978
9979 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9980 Change return value to nil.
9981 (Frecord_buffer): Delete unused function.
9982
9983 2011-08-24 Eli Zaretskii <eliz@gnu.org>
9984
9985 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9986 buffers, return left-to-right.
9987 (set_cursor_from_row): Consider candidate row a win if its glyph
9988 represents a newline and point is on that newline. Fixes cursor
9989 positioning on the newline at EOL of R2L text within L2R
9990 paragraph, and vice versa.
9991 (try_cursor_movement): Check continued rows, in addition to
9992 continuation rows. Fixes unwarranted scroll when point enters a
9993 continued line of R2L text within an L2R paragraph, or vice versa.
9994 (cursor_row_p): Consider the case of point being equal to
9995 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9996 from the end of a short line to the beginning of a continued line
9997 of R2L text within L2R paragraph.
9998 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9999 composed characters.
10000
10001 * bidi.c (bidi_check_type): Use xassert.
10002 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10003 members.
10004
10005 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10006
10007 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10008 a character.
10009
10010 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10011
10012 * nsfont.m (ns_otf_to_script): Fix typo.
10013
10014 2011-08-22 Kenichi Handa <handa@m17n.org>
10015
10016 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10017 extra slot even if the purpose is char-code-property-table.
10018
10019 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10020
10021 * xdisp.c (redisplay_window): When computing centering_position,
10022 account for the height of the header line. (Bug#8874)
10023
10024 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10025 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10026 candidate is selected by the mouse, and that candidate has a
10027 composed character under the mouse.
10028
10029 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10030 coordinates reported by pos-visible-in-window-p for a composed
10031 character in column zero.
10032
10033 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10034
10035 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10036
10037 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10038
10039 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10040 consider it a hit if to_charpos is anywhere in the range of the
10041 composed buffer positions.
10042
10043 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10044
10045 * image.c (gif_load): Don't assume that each subimage has the same
10046 dimensions as the base image. Handle disposal method that is
10047 "undefined" by the gif spec (Bug#9335).
10048
10049 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10050
10051 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10052 (Fcondition_case): Document `debug' symbol in error handler.
10053
10054 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10055
10056 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10057 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10058 from an Org mode buffer to a Speedbar frame.
10059
10060 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10061 a composition, take its buffer position from IT->cmp_it.charpos.
10062 Fixes cursor positioning at the beginning of a line that begins
10063 with a composed character.
10064
10065 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10066
10067 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10068 character bidirectional type, use STRONG_L instead. Fixes crashes
10069 in a buffer produced by `describe-categories'.
10070
10071 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10072 members before the level stack, so they would be saved and
10073 restored when copying iterator state. Fixes incorrect reordering
10074 around TABs covered by display properties.
10075
10076 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10077
10078 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10079
10080 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10081
10082 * eval.c (internal_condition_case, internal_condition_case_1)
10083 (internal_condition_case_2, internal_condition_case_n):
10084 Remove unnecessary aborts (Bug#9081).
10085
10086 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10087
10088 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10089 has no `load' handler, try opening the file locally. (Bug#9311)
10090
10091 2011-08-16 Ken Brown <kbrown@cornell.edu>
10092
10093 * gmalloc.c: Expand comment.
10094
10095 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10096
10097 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10098 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10099
10100 2011-08-16 Ken Brown <kbrown@cornell.edu>
10101
10102 Fix memory allocation problems in Cygwin build (Bug#9273).
10103
10104 * unexcw.c ( __malloc_initialized): Declare external variable.
10105 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10106
10107 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10108 New variables.
10109 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10110 dumped emacs.
10111 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10112 in the static heap.
10113 [CYGWIN] (special_realloc): New function.
10114 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10115 requests to realloc storage in the static heap.
10116
10117 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10118
10119 * bidi.c (bidi_initialize): Remove unused local.
10120
10121 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10122
10123 * bidimirror.h:
10124 * biditype.h: Remove file.
10125 * makefile.w32-in ($(BLD)/bidi.$(O)):
10126 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10127
10128 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10129
10130 * chartab.c: Improve commentary for the uniprop_table API.
10131
10132 * bidi.c (bidi_paragraph_init): Support zero value of
10133 bidi_ignore_explicit_marks_for_paragraph_level.
10134 (bidi_initialize): Use uniprop_table instead of including
10135 biditype.h and bidimirror.h.
10136
10137 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10138 coordinates of the iterator when restoring from ppos_it.
10139 (Bug#9296)
10140
10141 2011-08-14 Kenichi Handa <handa@m17n.org>
10142
10143 * process.c (create_process): Call setup_process_coding_systems
10144 after the pid of the process is set to -1 (Bug#8162).
10145
10146 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10147
10148 * xdisp.c (move_it_in_display_line_to): Don't invoke
10149 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10150 ppos_it. Fixes vertical cursor motion when line beginning is
10151 covered by an image. (Bug#9296)
10152
10153 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10154
10155 * nsterm.h (ns_run_ascript): Declare.
10156 (NSAPP_DATA2_RUNASSCRIPT): Define.
10157
10158 * nsfns.m (as_script, as_result, as_status): New static variables.
10159 (ns_run_ascript): New function.
10160 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10161 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10162 the event loop. Get status from as_status (Bug#7276).
10163
10164 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10165 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10166 the event loop (Bug#7276).
10167
10168 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10169
10170 * gnutls.c (QCgnutls_bootprop_priority)
10171 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10172 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10173 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10174 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10175 (QCgnutls_bootprop_verify_hostname_error)
10176 (QCgnutls_bootprop_callbacks_verify): Rename from
10177 Qgnutls_bootprop_..., all uses changed.
10178
10179 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10180 uses changed.
10181
10182 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10183
10184 * xfaces.c (Qframe_set_background_mode): Now static.
10185 * dispextern.h (Qframe_set_background_mode): Remove decl.
10186
10187 * process.c (Fnetwork_interface_info): Declare local only if needed.
10188
10189 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10190
10191 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10192 (Fnetwork_interface_list): Allocate in increments of bytes instead
10193 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10194 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10195 sockaddr.
10196 (struct ifflag_def): notrailers is smart on OSX.
10197 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10198 Get hardware address with getifaddrs if available.
10199
10200 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10201
10202 * xdisp.c (iterate_out_of_display_property): xassert that
10203 IT->position is set to within IT->object's boundaries. Break from
10204 the loop as soon as EOB is reached; avoids infloops in redisplay
10205 when IT->position is set up wrongly due to some bug.
10206 Set IT->current to match the bidi iterator unconditionally.
10207 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10208 entry. Force push_it to save on the stack the current
10209 buffer/string position, to be restored by pop_it. Fix flags in
10210 the iterator structure wrt the object coming from a display
10211 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10212 properties. (Bug#9284)
10213
10214 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10215
10216 * fontset.c (fontset_get_font_group): Add proper type checks.
10217 (Bug#9172)
10218
10219 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10220
10221 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10222 and LC_VERSION_MIN_MACOSX.
10223 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10224 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10225
10226 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10227
10228 * xdisp.c (forward_to_next_line_start): Allow to use the
10229 no-display-properties-and-no-overlays under bidi display.
10230 Set disp_pos in the bidi iterator to avoid searches for display
10231 properties and overlays.
10232
10233 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10234
10235 * editfns.c (Fset_time_zone_rule): Document relationship with the
10236 setenv function.
10237
10238 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10239 the font entity extracted from the cache (Bug#8109).
10240
10241 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10242
10243 * composite.c (autocmp_chars): Don't reset point. That is done by
10244 restore_point_unwind (Bug#5984).
10245
10246 2011-08-07 Juri Linkov <juri@jurta.org>
10247
10248 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10249 to show the arg `TIME' instead of `TIMEVAL'.
10250
10251 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10252
10253 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10254 display property strides EOL and includes a newline, as in
10255 longlines-mode. (Bug#9254)
10256 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10257 word-wrap under bidirectional display. (Bug#9224)
10258
10259 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10260 is non-zero, even if the data buffer is NULL. Fixes a crash in
10261 vertical-motion with longlines-mode. (Bug#9254)
10262
10263 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10264
10265 * bidi.c <bidi_cache_total_alloc>: Now static.
10266 (bidi_initialize): Initialize bidi_cache_total_alloc.
10267
10268 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10269 cache. (Bug#9221)
10270
10271 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10272 amount allocated this far in `bidi_cache_total_alloc'.
10273 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10274 non-zero, only free the data buffer without restoring the cache
10275 contents. All callers changed.
10276
10277 * dispextern.h (bidi_unshelve_cache): Update prototype.
10278
10279 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10280 (move_it_in_display_line, move_it_to)
10281 (move_it_vertically_backward, move_it_by_lines): Replace the call
10282 to xfree to an equivalent call to bidi_unshelve_cache.
10283 (move_it_in_display_line_to): Fix logic of returning
10284 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10285
10286 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10287
10288 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10289 came from a string character with a `cursor' property. (Bug#9229)
10290
10291 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10292
10293 * Makefile.in (LIB_PTHREAD): New variable.
10294 (LIBES): Add LIB_PTHREAD (Bug#9216).
10295
10296 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10297 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10298
10299 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10300
10301 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10302
10303 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10304
10305 * xterm.c (x_find_topmost_parent): New function.
10306 (x_set_frame_alpha): Find topmost parent window with
10307 x_find_topmost_parent and set the property there also (bug#9181).
10308 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10309
10310 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10311
10312 * callproc.c (Fcall_process): Avoid vfork clobbering
10313 the local vars buffer, coding_systems, current_dir.
10314
10315 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10316
10317 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10318
10319 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10320
10321 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10322 so that it is not optimized away.
10323
10324 * xdisp.c (compute_display_string_pos): Remove unused local.
10325
10326 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10327
10328 Fix slow cursor motion and scrolling in large buffers with
10329 selective display, like Org Mode buffers. (Bug#9218)
10330
10331 * dispextern.h (struct bidi_it): New member disp_prop_p.
10332
10333 * xdisp.c: Remove one-slot cache of display string positions.
10334 (compute_display_string_pos): Accept an additional argument
10335 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10336 for a display string or property. If found, set DISP_PROP_P
10337 non-zero.
10338
10339 * bidi.c (bidi_fetch_char): Accept an additional argument
10340 DISP_PROP_P, and pass it to compute_display_string_pos.
10341 Only handle text covered by a display string if DISP_PROP_P is returned
10342 non-zero. All callers of bidi_fetch_char changed.
10343
10344 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10345
10346 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10347
10348 2010-12-03 Don March <don@ohspite.net>
10349
10350 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10351 last character M-[char] is translated to ESC [char] (bug#7541).
10352
10353 2011-08-02 Kenichi Handa <handa@m17n.org>
10354
10355 * lisp.h (uniprop_table): Extern it.
10356
10357 * chartab.c (uniprop_table): Make it non-static.
10358
10359 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10360
10361 * xdisp.c (forward_to_next_line_start): Accept additional argument
10362 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10363 on the newline.
10364 (reseat_at_next_visible_line_start): Use the bidi iterator state
10365 returned by forward_to_next_line_start to restore the state of
10366 it->bidi_it after backing up to previous newline. (Bug#9212)
10367
10368 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10369
10370 * regex.c (re_comp): Protoize.
10371 (re_exec): Fix return type.
10372 (regexec): Fix type of `ret'. (Bug#9203)
10373
10374 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10375
10376 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10377 This is needed if max-image-size is a floating-point number.
10378
10379 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10380
10381 * print.c (print_object): Print empty symbol as ##.
10382
10383 * lread.c (read1): Read ## as empty symbol.
10384
10385 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10386
10387 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10388 setting frame foreground color (Bug#9175).
10389 (x_set_background_color): Likewise.
10390
10391 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10392 contents (Bug#9176).
10393 (EmacsTooltip -init): Remove bezels and add shadows to
10394 tooltip windows.
10395
10396 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10397 or scroll bar (Bug#8470).
10398
10399 * nsfont.m (nsfont_open): Remove assignment to voffset and
10400 unnecessary vars hshink, expand, hd, full_height, min_height.
10401 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10402
10403 * nsterm.h (nsfont_info): Remove voffset field.
10404
10405 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10406
10407 Implement strike-through and overline on NextStep (Bug#8863).
10408
10409 * nsfont.m (nsfont_open): Use underline position provided by font,
10410 instead of hard-coded value of 2.
10411 (nsfont_draw): Call ns_draw_text_decoration instead.
10412
10413 * nsterm.h: Add declaration for ns_draw_text_decoration.
10414
10415 * nsterm.m (ns_draw_text_decoration): New function for drawing
10416 underline, overline, and strike-through.
10417 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10418 ns_draw_text_decoration. Change treatment of cursor drawing to
10419 accommodate underlining, etc.
10420
10421 2011-07-28 Eli Zaretskii <eliz@gnu.org>
10422
10423 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10424 default.
10425
10426 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10427
10428 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10429 Without this fix, if a signal arrives just after memory fills up,
10430 'malloc' might be invoked reentrantly.
10431
10432 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10433 In other words, assume that every image size is allowed, on non-X
10434 hosts. This assumption is probably wrong, but it lets Emacs compile.
10435
10436 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10437
10438 * regex.c (re_iswctype): Convert return values to boolean.
10439
10440 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10441
10442 * xdisp.c (compute_display_string_pos): Don't use cached display
10443 string position if the buffer had its restriction changed.
10444 (Bug#9184)
10445
10446 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10447
10448 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10449
10450 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10451
10452 Integer signedness and overflow and related fixes. (Bug#9079)
10453
10454 * bidi.c: Integer size and overflow fixes.
10455 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10456 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10457 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10458 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10459 (bidi_find_other_level_edge):
10460 Use ptrdiff_t instead of EMACS_INT where either will do.
10461 This works better on 32-bit hosts configured --with-wide-int.
10462 (bidi_cache_ensure_space): Check for size-calculation overflow.
10463 Use % rather than repeated addition, for better worst-case speed.
10464 Don't set bidi_cache_size until after xrealloc returns, because it
10465 might not return.
10466 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10467 (bidi_cache_ensure_space): Also check that the bidi cache size
10468 does not exceed that of the largest Lisp string or buffer. See Eli
10469 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10470
10471 * alloc.c (__malloc_size_t): Remove.
10472 All uses replaced by size_t. See Andreas Schwab's note
10473 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10474
10475 * image.c: Improve checking for integer overflow.
10476 (check_image_size): Assume that f is nonnull, since
10477 it is always nonnull in practice. This is one less thing to
10478 worry about when checking for integer overflow later.
10479 (x_check_image_size): New function, which checks for integer
10480 overflow issues inside X.
10481 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10482 This removes the need for a memory_full check.
10483 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10484 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10485 (xbm_read_bitmap_data): Change locals back to 'int', since
10486 their values must fit in 'int'.
10487 (xpm_load_image, png_load, tiff_load):
10488 Invoke x_create_x_image_and_pixmap earlier,
10489 to avoid much needless work if the image is too large.
10490 (tiff_load): Treat overly large images as if
10491 x_create_x_image_and_pixmap failed, not as malloc failures.
10492 (gs_load): Use x_check_image_size.
10493
10494 * gtkutil.c: Omit integer casts.
10495 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10496 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10497
10498 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10499
10500 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10501 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10502 would wrongly return t on a 64-bit host.
10503
10504 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10505 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10506 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10507 and therefore cause GCC to emit a bogus diagnostic in some cases.
10508
10509 * image.c: Integer signedness and overflow and related fixes.
10510 This is not an exhaustive set of fixes, but it's time to
10511 record what I've got.
10512 (lookup_pixel_color, check_image_size): Remove redundant decls.
10513 (check_image_size): Don't assume that arbitrary EMACS_INT values
10514 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10515 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10516 (tiff_load, imagemagick_load_image):
10517 Check for overflow in size calculations.
10518 (x_create_x_image_and_pixmap): Remove unnecessary test for
10519 xmalloc returning NULL; that can't happen.
10520 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10521 (xpm_color_bucket): Use better integer hashing function.
10522 (xpm_cache_color): Don't possibly over-allocate memory.
10523 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10524 (gif_memory_source):
10525 Use ptrdiff_t, not int or size_t, to record sizes.
10526 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10527 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10528 either works, as we prefer signed integers.
10529 (tiff_read_from_memory, tiff_write_from_memory):
10530 Return tsize_t, not size_t, since that's what the TIFF API wants.
10531 (tiff_read_from_memory): Don't fail simply because the read would
10532 go past EOF; instead, return a short read.
10533 (tiff_load): Omit no-longer-needed casts.
10534 (Fimagemagick_types): Don't assume size fits into 'int'.
10535
10536 Improve hashing quality when configured --with-wide-int.
10537 * fns.c (hash_string): New function, taken from sxhash_string.
10538 Do not discard information about ASCII character case; this
10539 discarding is no longer needed.
10540 (sxhash-string): Use it. Change sig to match it. Caller changed.
10541 * lisp.h: Declare it.
10542 * lread.c (hash_string): Remove, since we now use fns.c's version.
10543 The fns.c version returns a wider integer if --with-wide-int is
10544 specified, so this should help the quality of the hashing a bit.
10545
10546 * emacs.c: Integer overflow minor fix.
10547 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10548 Define only if GNU_LINUX.
10549 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10550
10551 * dispnew.c: Integer signedness and overflow fixes.
10552 Remove unnecessary forward decls, that were a maintenance hassle.
10553 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10554 All uses changed.
10555 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10556 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10557 (prepare_desired_row, line_draw_cost):
10558 Use int, not unsigned, where either works.
10559 (save_current_matrix, restore_current_matrix):
10560 Use ptrdiff_t, not size_t, where either works.
10561 (init_display): Check for overflow more accurately, and without
10562 relying on undefined behavior.
10563
10564 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10565 Remove, replacing with the new symbols in lisp.h. All uses changed.
10566 * fileio.c (make_temp_name):
10567 * filelock.c (lock_file_1, lock_file):
10568 * xdisp.c (message_dolog):
10569 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10570 Use pMd etc. instead.
10571 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10572 replacing the pWIDE etc. symbols removed from editfns.c.
10573
10574 * keyboard.h (num_input_events): Now uintmax_t.
10575 This is (very slightly) less likely to mess up due to wraparound.
10576 All uses changed.
10577
10578 * buffer.c: Integer signedness fixes.
10579 (alloc_buffer_text, enlarge_buffer_text):
10580 Use ptrdiff_t rather than size_t when either will do, as we prefer
10581 signed integers.
10582
10583 * alloc.c: Integer signedness and overflow fixes.
10584 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10585 (__malloc_size_t): Default to size_t, not to int.
10586 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10587 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10588 Prefer ptrdiff_t to size_t when either would do, as we prefer
10589 signed integers.
10590 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10591 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10592 Now const. Initialize with values that are in range even if char
10593 is signed.
10594 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10595 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10596 These functions do the right thing with sizes > 2**32.
10597 (check_depth): Now ptrdiff_t, not int.
10598 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10599 Adjust to new way of storing sizes. Check for size overflow bugs
10600 in rest of code.
10601 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10602 slightly wrong anyway, as it missed one instance of
10603 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10604 (refill_memory_reserve): Omit needless cast to size_t.
10605 (mark_object_loop_halt): Mark as externally visible.
10606
10607 * xselect.c: Integer signedness and overflow fixes.
10608 (Fx_register_dnd_atom, x_handle_dnd_message):
10609 Use ptrdiff_t, not size_t, since we prefer signed.
10610 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10611 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10612 x_dnd_atoms_size and x_dnd_atoms_length.
10613
10614 * doprnt.c: Prefer signed to unsigned when either works.
10615 * eval.c (verror):
10616 * doprnt.c (doprnt):
10617 * lisp.h (doprnt):
10618 * xdisp.c (vmessage):
10619 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10620 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10621 prefer signed arithmetic to avoid comparison confusion.
10622 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10623 but is a bit tricky.
10624
10625 Assume freestanding C89 headers, string.h, stdlib.h.
10626 * data.c, doprnt.c, floatfns.c, print.c:
10627 Include float.h unconditionally.
10628 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10629 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10630 * regex.c: Likewise for stddef.h, string.h.
10631 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10632 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10633 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10634 (STDC_HEADERS): Remove obsolete defines.
10635 * sysdep.c: Include limits.h unconditionally.
10636
10637 Assume support for memcmp, memcpy, memmove, memset.
10638 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10639 * regex.c (memcmp, memcpy):
10640 Remove; we assume C89 now.
10641
10642 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10643 (__malloc_safe_bcopy): Remove; no longer needed.
10644
10645 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10646 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10647 well either way, and we prefer signed to unsigned.
10648
10649 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10650
10651 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10652 closes the connection while we're reading (bug#9182).
10653
10654 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10655
10656 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10657 are specified (Bug#9168).
10658
10659 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10660
10661 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10662 Found by GCC static checking and --with-wide-int on a 32-bit host.
10663
10664 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10665
10666 * xdisp.c (compute_display_string_pos): Fix logic of caching
10667 previous display string position. Initialize cached_prev_pos to
10668 -1. Fixes slow-down at the beginning of a buffer.
10669
10670 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10671
10672 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10673 for attrs[LFACE_FONTSET_INDEX].
10674
10675 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10676
10677 * xml.c (parse_region): Remove unused local
10678 that was recently introduced.
10679
10680 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10681
10682 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10683 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10684
10685 * xdisp.c (move_it_in_display_line_to): Record the best matching
10686 position for TO_CHARPOS while scanning the line, and restore it on
10687 exit if none of the characters scanned was an exact match.
10688 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10689 when exact match is impossible due to invisible text, and the
10690 lines are truncated.
10691
10692 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10693
10694 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10695 for OSX >= 10.7.
10696
10697 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10698
10699 Fix a significant slow-down of cursor motion with C-n, C-p,
10700 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10701 auto-repeat under bidi redisplay in fontified buffers.
10702 * xdisp.c (compute_stop_pos_backwards): New function.
10703 (next_element_from_buffer): Call compute_stop_pos_backwards to
10704 find a suitable prev_stop when we find ourselves before
10705 base_level_stop.
10706 (reseat): Don't look for prev_stop, as that could mean a very long
10707 run.
10708 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10709 <cached_disp_overlay_modiff>: Cache for last found display string
10710 position.
10711 (compute_display_string_pos): Return the cached position if asked
10712 about the same buffer in the same area of character positions, and
10713 the buffer wasn't changed since the time the display string
10714 position was cached.
10715
10716 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10717
10718 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10719 is an integer, which is important for empty lines. (Bug#9149)
10720
10721 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10722
10723 * frame.c (Fmodify_frame_parameters): In tty case, update the
10724 default face if necessary (Bug#4238).
10725
10726 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10727
10728 * editfns.c (Fstring_to_char): No need to explain what a character
10729 is in the docstring (Bug#6576).
10730
10731 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10732
10733 * xml.c (parse_region): Make sure we always return a tree.
10734
10735 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10736
10737 * xml.c (parse_region): If a document contains only comments,
10738 return that, too.
10739
10740 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10741
10742 * xml.c (make_dom): Return comments, too.
10743
10744 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10745
10746 Port to OpenBSD.
10747 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10748 and the surrounding thread.
10749 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10750 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10751 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10752 timer goes off.
10753 * s/openbsd.h (BROKEN_SIGIO): Define.
10754 * unexelf.c (unexec) [__OpenBSD__]:
10755 Don't update the .mdebug section of the Alpha COFF symbol table.
10756
10757 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10758
10759 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10760 (bug#8460).
10761
10762 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10763
10764 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10765 This fixes some race conditions on the permissions of any newly
10766 created file.
10767
10768 * alloc.c (valid_pointer_p): Use pipe, not open.
10769 This fixes some permissions issues when debugging.
10770
10771 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10772 If fchown fails to set both uid and gid, try to set just gid,
10773 as that is sometimes allowed. Adjust the file's mode to eliminate
10774 setuid or setgid bits that are inappropriate if fchown fails.
10775
10776 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10777
10778 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10779 to compare Lisp_Objects.
10780 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10781 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10782 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10783
10784 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10785
10786 * lread.c (read_integer): Unread even EOF character.
10787 (read1): Likewise. Properly record start position of symbol.
10788
10789 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10790 symbol character follows.
10791
10792 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10793
10794 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10795 This works around a problem with the previous change to Fcopy_file.
10796 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10797 and without this change, GCC might complain about discarding
10798 fchown's return value.
10799
10800 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
10801
10802 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10803
10804 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10805
10806 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10807
10808 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10809
10810 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10811 it's used from the C level.
10812
10813 * process.c: Use the same condition for POLL_FOR_INPUT in both
10814 keyboard.c and process.c (bug#1858).
10815
10816 2011-07-09 Lawrence Mitchell <wence@gmx.li>
10817
10818 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10819 (Fgnutls_boot): Use it.
10820
10821 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10822
10823 * doc.c (Fsubstitute_command_keys): Revert last change.
10824
10825 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10826
10827 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10828 quotes the next character, and doesn't affect other longer
10829 sequences (bug#8935).
10830
10831 * lread.c (syms_of_lread): Clarify that is isn't only
10832 `eval-buffer' and `eval-defun' that's affected by
10833 `lexical-binding' (bug#8460).
10834
10835 2011-07-15 Eli Zaretskii <eliz@gnu.org>
10836
10837 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
10838 bidi redisplay when a line includes both an image and is truncated.
10839
10840 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10841
10842 Fix minor problems found by static checking.
10843 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10844 (elsz): Now a signed constant, not a size_t var. We prefer signed
10845 types to unsigned, to avoid integer comparison confusion. Without
10846 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10847 "cannot optimize loop, the loop counter may overflow", a symptom
10848 of the confusion.
10849 * indent.c (Fvertical_motion): Mark locals as initialized.
10850 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10851
10852 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10853
10854 * search.c (Fre_search_backward): Mention `case-fold-search' in
10855 all the re_search_* functions (bug#8138).
10856
10857 * keyboard.c (Fopen_dribble_file): Document when the file is
10858 closed (bug#8056).
10859
10860 2011-07-14 Eli Zaretskii <eliz@gnu.org>
10861
10862 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10863 bidi_cache_idx.
10864
10865 Support bidi reordering of display and overlay strings.
10866 * xdisp.c (compute_display_string_pos)
10867 (compute_display_string_end): Accept additional argument STRING.
10868 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10869 (reseat_to_string): Initialize bidi_it->string.s and
10870 bidi_it->string.schars.
10871 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
10872 NULL (avoids a crash in bidi_paragraph_init).
10873 Initialize itb.string.lstring.
10874 (init_iterator): Call bidi_init_it only of a valid
10875 buffer position was specified. Initialize paragraph_embedding to
10876 L2R.
10877 (reseat_to_string): Initialize the bidi iterator.
10878 (display_string): If we need to ignore text properties of
10879 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10880 original value of -1 will not work with bidi.)
10881 (compute_display_string_pos): First arg is now struct
10882 `text_pos *'; all callers changed. Support display properties on
10883 Lisp strings.
10884 (compute_display_string_end): Support display properties on Lisp
10885 strings.
10886 (init_iterator, reseat_1, reseat_to_string): Initialize the
10887 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10888 when iterating on a string not from display properties).
10889 (compute_display_string_pos, compute_display_string_end):
10890 Fix calculation of the object to scan. Fixes an error when using
10891 arrow keys.
10892 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
10893 base_level_stop; instead, set base_level_stop to BEGV.
10894 Fixes crashes in vertical-motion.
10895 (next_element_from_buffer): Improve commentary for when
10896 the iterator is before prev_stop.
10897 (init_iterator): Initialize bidi_p from the default value of
10898 bidi-display-reordering, not from buffer-local value. Use the
10899 buffer-local value only if initializing for buffer iteration.
10900 (handle_invisible_prop): Support invisible properties on strings
10901 that are being bidi-reordered.
10902 (set_iterator_to_next): Support bidi reordering of C strings and
10903 Lisp strings.
10904 (next_element_from_string): Support bidi reordering of Lisp
10905 strings.
10906 (handle_stop_backwards): Support Lisp strings as well.
10907 (display_string): Support display of R2L glyph rows.
10908 Use IT_STRING_CHARPOS when displaying from a Lisp string.
10909 (init_iterator): Don't initialize it->bidi_p for strings
10910 here.
10911 (reseat_to_string): Initialize it->bidi_p for strings here.
10912 (next_element_from_string, next_element_from_c_string)
10913 (next_element_from_buffer): Add xassert's for correspondence
10914 between IT's object being iterated and it->bidi_it.string
10915 structure.
10916 (face_before_or_after_it_pos): Support bidi iteration.
10917 (next_element_from_c_string): Handle the case of the first string
10918 character that is not the first one in the visual order.
10919 (get_visually_first_element): New function, refactored from common
10920 parts of next_element_from_buffer, next_element_from_string, and
10921 next_element_from_c_string.
10922 (tool_bar_lines_needed, redisplay_tool_bar)
10923 (display_menu_bar): Force left-to-right direction. Add a FIXME
10924 comment for making that be controlled by a user option.
10925 (push_it, pop_it): Save and restore the state of the
10926 bidi iterator. Save and restore the bidi_p flag.
10927 (pop_it): Iterate out of display property for string iteration as
10928 well.
10929 (iterate_out_of_display_property): Support iteration over strings.
10930 (handle_single_display_spec): Set up it->bidi_it for iteration
10931 over a display string, and call bidi_init_it.
10932 (handle_single_display_spec, next_overlay_string)
10933 (get_overlay_strings_1, push_display_prop): Set up the bidi
10934 iterator for displaying display or overlay strings.
10935 (forward_to_next_line_start): Don't use the shortcut if
10936 bidi-iterating.
10937 (back_to_previous_visible_line_start): If handle_display_prop
10938 pushed the iterator stack, restore the internal state of the bidi
10939 iterator by calling bidi_pop_it same number of times.
10940 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10941 and we are bidi-iterating, don't decrement the iterator position;
10942 instead, set the first_elt flag in the bidi iterator, to produce
10943 the same effect.
10944 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10945 (push_display_prop): xassert that we are iterating a buffer.
10946 (push_it, pop_it): Save and restore paragraph_embedding member.
10947 (handle_single_display_spec, next_overlay_string)
10948 (get_overlay_strings_1, reseat_1, reseat_to_string)
10949 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10950 correctly. Don't assume unibyte strings are not bidi-reordered.
10951 (compute_display_string_pos)
10952 (compute_display_string_end): Fix handling the case of C string.
10953 (push_it, pop_it): Save and restore from_disp_prop_p.
10954 (handle_single_display_spec, push_display_prop): Set the
10955 from_disp_prop_p flag.
10956 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10957 (pop_it): Call iterate_out_of_display_property only if we are
10958 popping after iteration over a string that came from a display
10959 property. Fix a typo in popping stretch info. Add an assertion
10960 for verifying that the iterator position is in sync with the bidi
10961 iterator.
10962 (handle_single_display_spec, get_overlay_strings_1)
10963 (push_display_prop): Fix initialization of paragraph direction for
10964 string when that of the parent object is not yet determined.
10965 (reseat_1): Call bidi_init_it to resync the bidi
10966 iterator with IT's position. (Bug#7616)
10967 (find_row_edges): If ROW->start.pos gives position
10968 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10969 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10970 Reset the from_disp_prop_p flag.
10971 (SAVE_IT, RESTORE_IT): New macros.
10972 (pos_visible_p, face_before_or_after_it_pos)
10973 (back_to_previous_visible_line_start)
10974 (move_it_in_display_line_to, move_it_in_display_line)
10975 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10976 (try_scrolling, redisplay_window, display_line): Use them when
10977 saving a temporary copy of the iterator and restoring it back.
10978 (back_to_previous_visible_line_start, reseat_1)
10979 (init_iterator): Empty the bidi cache "stack".
10980 (move_it_in_display_line_to): If iterator ended up at
10981 EOL, but we never saw any buffer positions smaller than
10982 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10983 motion in bidi-reordered lines.
10984 (move_it_in_display_line_to): Record prev_method and prev_pos
10985 immediately before the call to set_iterator_to_next. Fixes cursor
10986 motion in bidi-reordered lines with stretch glyphs and strings
10987 displayed in margins. (Bug#8133) (Bug#8867)
10988 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10989 TO_CHARPOS.
10990 (pos_visible_p): Support positions in bidi-reordered lines.
10991 Save and restore bidi cache.
10992
10993 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10994 (bidi_paragraph_info): Delete unused struct.
10995 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10996 (bidi_cache_start): New variable.
10997 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10998 to zero.
10999 (bidi_cache_fetch_state, bidi_cache_search)
11000 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11001 (bidi_cache_find, bidi_peek_at_next_level)
11002 (bidi_level_of_next_char, bidi_find_other_level_edge)
11003 (bidi_move_to_visually_next): Compare cache index with
11004 bidi_cache_start rather than with zero.
11005 (bidi_fetch_char): Accept new argument STRING; all callers
11006 changed. Support iteration over a string. Support strings with
11007 display properties. Support unibyte strings. Fix the type of
11008 `len' according to what STRING_CHAR_AND_LENGTH expects.
11009 (bidi_paragraph_init, bidi_resolve_explicit_1)
11010 (bidi_resolve_explicit, bidi_resolve_weak)
11011 (bidi_level_of_next_char, bidi_move_to_visually_next):
11012 Support iteration over a string.
11013 (bidi_set_sor_type, bidi_resolve_explicit_1)
11014 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11015 can now be zero (for strings); special values 0 and -1 were
11016 changed to -1 and -2, respectively.
11017 (bidi_char_at_pos): New function.
11018 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11019 Call it instead of FETCH_MULTIBYTE_CHAR.
11020 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11021 initialized to valid values.
11022 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11023 values.
11024 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11025 the test for valid cached positions. Fix the logic for looking up
11026 the sentinel state in the cache. GCPRO the Lisp string we are
11027 iterating.
11028 (bidi_push_it, bidi_pop_it): New functions.
11029 (bidi_initialize): Initialize the bidi cache start stack pointer.
11030 (bidi_cache_ensure_space): New function, refactored from part of
11031 bidi_cache_iterator_state. Don't assume the required size is just
11032 one BIDI_CACHE_CHUNK away.
11033 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11034 (bidi_count_bytes, bidi_char_at_pos): New functions.
11035 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11036 always valid if bidi_cache_idx is valid.
11037 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11038 is valid if it's going to be used.
11039 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11040 (bidi_cache_fetch_state, bidi_cache_search)
11041 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11042 (bidi_cache_iterator_state, bidi_cache_find)
11043 (bidi_find_other_level_edge, bidi_cache_start_stack):
11044 All variables related to cache indices are now EMACS_INT.
11045
11046 * dispextern.h (struct bidi_string_data): New structure.
11047 (struct bidi_it): New member `string'. Make flag members be 1-bit
11048 fields, and put them last in the struct.
11049 (compute_display_string_pos, compute_display_string_end):
11050 Update prototypes.
11051 (bidi_push_it, bidi_pop_it): Add prototypes.
11052 (struct iterator_stack_entry): New members bidi_p,
11053 paragraph_embedding, and from_disp_prop_p.
11054 (struct it): Member bidi_p is now a bit field 1 bit wide.
11055 (bidi_shelve_cache, bidi_unshelve_cache):
11056 Declare prototypes.
11057
11058 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11059 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11060 and vector-like objects.
11061
11062 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11063 cache around display iteration.
11064
11065 * window.c (Fwindow_end, window_scroll_pixel_based)
11066 (displayed_window_lines, Frecenter): Save and restore the bidi
11067 cache around display iteration.
11068
11069 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11070
11071 * editfns.c (Fdelete_region): Clarify the use of the named
11072 parameters (bug#6788).
11073
11074 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11075
11076 * indent.c (Fvertical_motion): Set and restore w->pointm when
11077 saving and restoring the window's buffer (Bug#9006).
11078
11079 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11080
11081 * editfns.c (Fstring_to_char): Clarify just what is returned
11082 (bug#6576). Text by Eli Zaretskii.
11083
11084 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11085
11086 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11087
11088 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11089
11090 * buffer.c (mmap_find): Fix a typo.
11091
11092 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11093
11094 Fix execution of x selection hooks.
11095 * xselect.c (Qx_lost_selection_functions)
11096 (Qx_sent_selection_functions): New vars.
11097 (syms_of_xselect): DEFSYM them.
11098 (x_handle_selection_request): Pass Qx_sent_selection_functions
11099 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11100 (x_handle_selection_clear,x_clear_frame_selections):
11101 Pass Qx_lost_selection_functions rather than
11102 Vx_lost_selection_functions to Frun_hook_with_args.
11103
11104 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11105
11106 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11107 The old code sometimes used this field without initializing it.
11108
11109 * alloc.c (gc_sweep): Don't read past end of array.
11110 In theory, the old code could also have corrupted Emacs internals,
11111 though it'd be very unlikely.
11112
11113 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11114
11115 * character.c (Fcharacterp): Don't advertise optional ignored
11116 argument. (Bug#4026)
11117
11118 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11119
11120 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11121 key" (bug#4257).
11122
11123 * window.c (Fset_window_start): Doc fix (bug#4199).
11124 (Fset_window_hscroll): Ditto.
11125
11126 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11127
11128 Fix minor new problems caught by GCC 4.6.1.
11129 * term.c (init_tty): Remove unused local.
11130 * xsettings.c (store_monospaced_changed): Define this function only
11131 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11132 not used otherwise.
11133
11134 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11135
11136 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11137
11138 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11139
11140 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11141 are the mini-buffer and the echo area (bug#3320).
11142
11143 * term.c (init_tty): Remove support for supdup, c10 and perq
11144 terminals, which are no longer supported (bug#1482).
11145
11146 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11147
11148 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11149
11150 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11151
11152 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11153 for non-popups (Bug#3642).
11154
11155 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11156
11157 * alloc.c (reset_malloc_hooks): Protoize.
11158 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11159 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11160 * cm.c (losecursor): Likewise.
11161 * data.c (fmod): Likewise.
11162 * dispnew.c (swap_glyphs_in_rows): Likewise.
11163 * emacs.c (memory_warning_signal): Likewise.
11164 * floatfns.c (float_error): Likewise.
11165 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11166 (otf_open, font_otf_capability, generate_otf_features)
11167 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11168 Likewise.
11169 * image.c (pbm_read_file): Likewise.
11170 * indent.c (string_display_width): Likewise.
11171 * intervals.c (check_for_interval, search_for_interval)
11172 (inc_interval_count, count_intervals, root_interval)
11173 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11174 * lread.c (defalias): Likewise.
11175 * ralloc.c (r_alloc_check): Likewise.
11176 * regex.c (set_image_of_range_1, set_image_of_range)
11177 (regex_grow_registers): Likewise.
11178 * sysdep.c (strerror): Likewise.
11179 * termcap.c (valid_filename_p, tprint, main): Likewise.
11180 * tparam.c (main): Likewise.
11181 * unexhp9k800.c (run_time_remap, save_data_space)
11182 (update_file_ptrs, read_header, write_header, calculate_checksum)
11183 (copy_file, copy_rest, display_header): Likewise.
11184 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11185 Likewise.
11186 * xdisp.c (check_it): Likewise.
11187 * xfaces.c (register_color, unregister_color, unregister_colors):
11188 Likewise.
11189 * xfns.c (print_fontset_result): Likewise.
11190 * xrdb.c (member, fatal, main): Likewise.
11191
11192 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11193
11194 Fix minor problems found by static checking (Bug#9031).
11195 * chartab.c (char_table_set_range, map_sub_char_table):
11196 Remove unused locals.
11197 (uniprop_table): Now static.
11198 * composite.c (_work_char): Remove unused static var.
11199
11200 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11201
11202 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11203
11204 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11205
11206 * gtkutil.c (qttip_cb): Remove code without function.
11207
11208 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11209
11210 * w32.c (pthread_sigmask): New stub.
11211
11212 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11213
11214 Use pthread_sigmask, not sigprocmask (Bug#9010).
11215 sigprocmask is portable only for single-threaded applications, and
11216 Emacs can be multi-threaded when it uses GTK.
11217 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11218 (LIBES): Use it.
11219 * callproc.c (Fcall_process):
11220 * process.c (create_process):
11221 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11222 Use pthread_sigmask, not sigprocmask.
11223
11224 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11225
11226 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11227 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11228 wrong (Bug#8591).
11229
11230 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11231
11232 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11233 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11234 (xg_hide_tooltip): Fix comment.
11235
11236 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11237 in registerServicesMenuSendTypes.
11238 (validRequestorForSendType): Don't check ns_return_types.
11239
11240 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11241 ns_return_type.
11242
11243 2011-07-08 Jason Rumney <jasonr@gnu.org>
11244
11245 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11246 SH_SHOW for hidden windows (Bug#5482).
11247
11248 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11249 frame struct members of non-existent frames (Bug#6284).
11250
11251 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11252
11253 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11254 variable firstTime not needed on OSX >= 10.6.
11255 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11256 >= 10.5. Use setKnobProportion, setDoubleValue.
11257
11258 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11259 (MAC_OS_X_VERSION_10_5): Define if not defined.
11260 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11261 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11262 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11263
11264 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11265 cString and lossyCString on OSX >= 10.4.
11266
11267 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11268 sizeToFit on OSX >= 10.2.
11269
11270 * nsimage.m (allocInitFromFile): Don't use deprecated method
11271 bestRepresentationForDevice on OSX >= 10.6.
11272
11273 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11274 to avoid warning.
11275
11276 * emacs.c: Declare unexec_init_emacs_zone.
11277
11278 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11279
11280 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11281
11282 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11283 on svcsMenu (Bug#8842).
11284
11285 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11286 ns_return_types.
11287 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11288
11289 * nsterm.m (QUTF8_STRING): Declare.
11290 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11291 (validRequestorForSendType): Return type is (id).
11292 Change indexOfObjectIdenticalTo to indexOfObject.
11293 Check if we have local selection before returning self (Bug#8842).
11294 (writeSelectionToPasteboard): Put local selection into paste board
11295 if we have a local selection (Bug#8842).
11296 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11297
11298 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11299 (ns_get_local_selection): Declare.
11300
11301 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11302
11303 * keymap.c (describe_map_tree): Don't insert a double newline at
11304 the end of the buffer (bug#1169) and return whether we inserted
11305 something.
11306
11307 * callint.c (Fcall_interactively): Change "reading args" to
11308 "providing args" to try to clarify what it does (bug#1010).
11309
11310 2011-07-07 Kenichi Handa <handa@m17n.org>
11311
11312 * composite.c (composition_compute_stop_pos): Ignore a static
11313 composition starting before CHARPOS (Bug#8915).
11314
11315 * xdisp.c (handle_composition_prop): Likewise.
11316
11317 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11318
11319 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11320 (Bug#9015)
11321
11322 2011-07-07 Kenichi Handa <handa@m17n.org>
11323
11324 * character.h (unicode_category_t): New enum type.
11325
11326 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11327 (Qchar_code_property_table): New variable.
11328 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11329 (UNIPROP_COMPRESSED_FORM_P): New macros.
11330 (char_table_ascii): Uncompress the compressed values.
11331 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11332 Uncompress the compressed values.
11333 (sub_char_table_ref_and_range): Likewise.
11334 (char_table_ref_and_range): Uncompress the compressed values.
11335 (sub_char_table_set): New arg is_uniprop. Callers changed.
11336 Uncompress the compressed values.
11337 (sub_char_table_set_range): Args changed. Callers changed.
11338 (char_table_set_range): Adjuted for the above change.
11339 (map_sub_char_table): Delete args default_val and parent. Add arg
11340 top. Give decoded values to a Lisp function.
11341 (map_char_table): Adjust for the above change. Give decoded
11342 values to a Lisp function. Gcpro more variables.
11343 (uniprop_table_uncompress)
11344 (uniprop_decode_value_run_length): New functions.
11345 (uniprop_decoder, uniprop_decoder_count): New variables.
11346 (uniprop_get_decoder, uniprop_encode_value_character)
11347 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11348 New functions.
11349 (uniprop_encoder, uniprop_encoder_count): New variables.
11350 (uniprop_get_encoder, uniprop_table)
11351 (Funicode_property_table_internal, Fget_unicode_property_internal)
11352 (Fput_unicode_property_internal): New functions.
11353 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11354 Sunicode_property_table_internal, Sget_unicode_property_internal,
11355 and Sput_unicode_property_internal. Defvar_lisp
11356 char-code-property-alist.
11357
11358 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11359 Vunicode_category_table.
11360
11361 * font.c (font_range): Adjust for the change of
11362 Vunicode_category_table.
11363
11364 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11365
11366 * m/iris4d.h: Remove file, move contents ...
11367 * s/irix6-5.h: ... here.
11368
11369 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11370
11371 Remove unportable assumption about struct layout (Bug#8884).
11372 * alloc.c (mark_buffer):
11373 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11374 (clone_per_buffer_values): Don't assume that
11375 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11376 This isn't true in general, and it's particularly not true
11377 if Emacs is configured with --with-wide-int.
11378 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11379 New macros, used in the buffer.c change.
11380
11381 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11382
11383 * xsettings.c: Use both GConf and GSettings if both are available.
11384 (store_config_changed_event): Add comment.
11385 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11386 (store_tool_bar_style_changed): New functions.
11387 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11388 (struct xsettings): Move font inside HAVE_XFT.
11389 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11390 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11391 Move inside HAVE_XFT.
11392 (something_changed_gsettingsCB): Rename from something_changedCB.
11393 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11394 also.
11395 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11396 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11397 (something_changed_gconfCB): Rename from something_changedCB.
11398 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11399 (parse_settings): Move check for font inside HAVE_XFT.
11400 (read_settings, apply_xft_settings): Add comment.
11401 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11402 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11403 call store_font_name_changed.
11404 (xft_settings_event): Add comment.
11405 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11406 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11407 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11408 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11409 (xsettings_initialize): Call init_gsettings last.
11410 (xsettings_get_system_font, xsettings_get_system_normal_font):
11411 Add comment.
11412
11413 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11414
11415 Random fixes. E.g., (random) never returned negative values.
11416 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11417 subseconds part to the entropy, as that's a bit more random.
11418 Prefer signed to unsigned, since the signedness doesn't matter and
11419 in general we prefer signed. When given a limit, use a
11420 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11421 latter isn't right if USE_2_TAGS_FOR_INTS.
11422 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11423 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11424
11425 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11426
11427 * textprop.c (text_property_stickiness):
11428 Obey Vtext_property_default_nonsticky.
11429 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11430 * w32fns.c (syms_of_w32fns):
11431 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11432
11433 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11434
11435 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11436 This is more efficient than Ffile_directory_p and avoids a minor race.
11437
11438 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11439
11440 * buffer.c (Foverlay_put): Say what the return value is
11441 (bug#7835).
11442
11443 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11444 is a directory before asking whether to use the file name
11445 (bug#7564).
11446 (barf_or_query_if_file_exists): Make the "File is a directory"
11447 error be more correct.
11448
11449 * fns.c (Frequire): Remove the mention of the .gz files, since
11450 that's installation-specific, but keep the mention of
11451 `get-load-suffixes'.
11452
11453 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11454
11455 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11456 Report string overflow if the output is too long.
11457
11458 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
11459
11460 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11461 (syms_of_gnutls): Remove duplicate DEFSYM for
11462 Qgnutls_bootprop_verify_hostname_error, an error for
11463 Qgnutls_bootprop_verify_error (which is no longer used).
11464
11465 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11466 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11467 Also (re)move comments that are misplaced or no longer relevant.
11468
11469 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11470
11471 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11472
11473 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
11474
11475 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11476 and background color parameters if they have been changed.
11477
11478 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11479
11480 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11481
11482 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11483
11484 * xsettings.c (SYSTEM_FONT): Define only when used.
11485 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11486
11487 * keymap.c (access_keymap_1): Now static.
11488
11489 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
11490
11491 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11492 leave any prefix arg for the up event (Bug#1586).
11493
11494 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11495
11496 * lread.c (syms_of_lread): Mention single symbols defined by
11497 `defvar' or `defconst' (bug#7154).
11498
11499 * fns.c (Frequire): Mention .el.gz files (bug#7314).
11500 (Frequire): Mention get-load-suffixes.
11501
11502 2011-07-02 Martin Rudalics <rudalics@gmx.at>
11503
11504 * window.h (window): Remove clone_number slot.
11505 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11506 Remove.
11507 (make_parent_window, make_window, saved_window)
11508 (Fset_window_configuration, save_window_save): Don't deal with
11509 clone numbers.
11510 * buffer.c (Qclone_number): Remove declaration.
11511 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11512
11513 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11514
11515 Add multiple inheritance to keymaps.
11516 * keymap.c (Fmake_composed_keymap): New function.
11517 (Fset_keymap_parent): Simplify.
11518 (fix_submap_inheritance): Remove.
11519 (access_keymap_1): New function extracted from access_keymap to handle
11520 embedded parents and handle lists of maps.
11521 (access_keymap): Use it.
11522 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11523 (Fcopy_keymap): Handle embedded parents.
11524 (Fcommand_remapping, define_as_prefix): Simplify.
11525 (Fkey_binding): Simplify.
11526 (syms_of_keymap): Move minibuffer-local-completion-map,
11527 minibuffer-local-filename-completion-map,
11528 minibuffer-local-must-match-map, and
11529 minibuffer-local-filename-must-match-map to Elisp.
11530 (syms_of_keymap): Defsubr make-composed-keymap.
11531 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11532 (parse_menu_item): Trivial simplification.
11533
11534 2011-07-01 Glenn Morris <rgm@gnu.org>
11535
11536 * Makefile.in (SETTINGS_LIBS): Fix typo.
11537
11538 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11539
11540 * coding.c (Fencode_coding_string): Record the last coding system
11541 used, as the function doc string says (bug#8738).
11542
11543 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11544
11545 * xsettings.c (store_monospaced_changed): Take new font as arg and
11546 check for change against current_mono_font.
11547 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11548 (emacs_settings_constructor, emacs_settings_get_property)
11549 (emacs_settings_set_property, emacs_settings_class_init)
11550 (emacs_settings_init, gsettings_obj): Remove.
11551 (something_changedCB): New function for HAVE_GSETTINGS.
11552 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11553 with value as argument.
11554 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11555 g_settings_new (Bug#8967). Do not create gsettings_obj.
11556 Remove calls to g_settings_bind. Connect something_changedCB to
11557 "changed".
11558
11559 * xgselect.c: Add defined (HAVE_GSETTINGS).
11560 (xgselect_initialize): Ditto.
11561
11562 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11563 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11564 xg_select.
11565
11566 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11567
11568 * eval.c (struct backtrace): Simplify and port the data structure.
11569 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11570 signed bit field, as this assumption is not portable and it makes
11571 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11572 "char debug_on_exit : 1" as this is not portable either; instead,
11573 use the portable "unsigned int debug_on_exit : 1". Remove unused
11574 member evalargs. Remove obsolete comments about cc bombing out.
11575
11576 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11577
11578 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11579 Let HAVE_GSETTINGS override HAVE_GCONF.
11580 (store_monospaced_changed): New function.
11581 (EMACS_SETTINGS): A new type derived from GObject to handle
11582 GSettings notifications.
11583 (emacs_settings_constructor, emacs_settings_get_property)
11584 (emacs_settings_set_property, emacs_settings_class_init):
11585 New functions.
11586 (gsettings_client, gsettings_obj): New variables.
11587 (GSETTINGS_SCHEMA): New define.
11588 (something_changedCB): Call store_monospaced_changed.
11589 (init_gsettings): New function.
11590 (xsettings_initialize): Call init_gsettings.
11591 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11592 to NULL.
11593
11594 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11595 GCONF_CFLAGS/LIBS.
11596
11597 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11598
11599 * window.c (resize_root_window, grow_mini_window)
11600 (shrink_mini_window): Rename Qresize_root_window to
11601 Qwindow_resize_root_window and Qresize_root_window_vertically to
11602 Qwindow_resize_root_window_vertically.
11603
11604 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11605
11606 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11607
11608 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11609
11610 * makefile.w32-in: Redesign dependencies so they reflect more
11611 clearly which files are directly included by each source file,
11612 and not through other includes.
11613
11614 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11615
11616 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11617 (sort_overlays, overlay_strings): When an overlay's clone number
11618 matches the window's clone number process the overlay even if
11619 the overlay's window property doesn't match the current window.
11620
11621 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11622 (Fwindow_hchild): Rename to Fwindow_left_child.
11623 (Fwindow_next): Rename to Fwindow_next_sibling.
11624 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11625 (resize_window_check): Rename to window_resize_check.
11626 (resize_window_apply): Rename to window_resize_apply.
11627 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11628 (Fdelete_other_windows_internal, resize_frame_windows)
11629 (Fsplit_window_internal, Fdelete_window_internal)
11630 (grow_mini_window, shrink_mini_window)
11631 (Fresize_mini_window_internal): Fix callers accordingly.
11632
11633 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11634
11635 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11636 (emacs_fixed_set_min_size): Remove.
11637 (emacs_fixed_new): Take frame as argument.
11638
11639 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11640 (_EmacsFixedPrivate): Remove minwidth/height.
11641 Add struct frame *f.
11642 (emacs_fixed_init): Initialize priv->f.
11643 (get_parent_class, emacs_fixed_set_min_size): Remove.
11644 (emacs_fixed_new): Set priv->f to argument.
11645 (emacs_fixed_get_preferred_width)
11646 (emacs_fixed_get_preferred_height): Use min_width/height from
11647 frames size_hint to set minimum and natural (Bug#8919).
11648 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11649 and use min_width/height from frames size_hint to set
11650 min_width/height (Bug#8919).
11651
11652 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11653 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11654 Fix indentation.
11655
11656 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11657
11658 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11659 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11660 called at ZV.
11661
11662 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11663
11664 * process.c (wait_reading_process_output): Bypass select if
11665 waiting for a cell while ignoring keyboard input, and input is
11666 pending. Suggested by Jan Djärv (Bug#8869).
11667
11668 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 Use gnulib's dup2 module instead of rolling our own.
11671 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11672
11673 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11674
11675 * dispnew.c (scrolling_window): Before scrolling, turn off a
11676 mouse-highlight in the window being scrolled.
11677
11678 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11679
11680 Move DEFSYM to lisp.h and use everywhere.
11681
11682 * character.h (DEFSYM): Move declaration...
11683 * lisp.h (DEFSYM): ...here.
11684
11685 * gnutls.c:
11686 * minibuf.c:
11687 * w32menu.c:
11688 * w32proc.c:
11689 * w32select.c: Don't include character.h.
11690
11691 * alloc.c (syms_of_alloc):
11692 * buffer.c (syms_of_buffer):
11693 * bytecode.c (syms_of_bytecode):
11694 * callint.c (syms_of_callint):
11695 * casefiddle.c (syms_of_casefiddle):
11696 * casetab.c (init_casetab_once):
11697 * category.c (init_category_once, syms_of_category):
11698 * ccl.c (syms_of_ccl):
11699 * cmds.c (syms_of_cmds):
11700 * composite.c (syms_of_composite):
11701 * dbusbind.c (syms_of_dbusbind):
11702 * dired.c (syms_of_dired):
11703 * dispnew.c (syms_of_display):
11704 * doc.c (syms_of_doc):
11705 * editfns.c (syms_of_editfns):
11706 * emacs.c (syms_of_emacs):
11707 * eval.c (syms_of_eval):
11708 * fileio.c (syms_of_fileio):
11709 * fns.c (syms_of_fns):
11710 * frame.c (syms_of_frame):
11711 * fringe.c (syms_of_fringe):
11712 * insdel.c (syms_of_insdel):
11713 * keymap.c (syms_of_keymap):
11714 * lread.c (init_obarray, syms_of_lread):
11715 * macros.c (syms_of_macros):
11716 * msdos.c (syms_of_msdos):
11717 * print.c (syms_of_print):
11718 * process.c (syms_of_process):
11719 * search.c (syms_of_search):
11720 * sound.c (syms_of_sound):
11721 * syntax.c (init_syntax_once, syms_of_syntax):
11722 * terminal.c (syms_of_terminal):
11723 * textprop.c (syms_of_textprop):
11724 * undo.c (syms_of_undo):
11725 * w32.c (globals_of_w32):
11726 * window.c (syms_of_window):
11727 * xdisp.c (syms_of_xdisp):
11728 * xfaces.c (syms_of_xfaces):
11729 * xfns.c (syms_of_xfns):
11730 * xmenu.c (syms_of_xmenu):
11731 * xsettings.c (syms_of_xsettings):
11732 * xterm.c (syms_of_xterm): Use DEFSYM.
11733
11734 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11735
11736 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11737
11738 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11739
11740 Integer and buffer overflow fixes (Bug#8873).
11741
11742 * print.c (printchar, strout): Check for string overflow.
11743 (PRINTPREPARE, printchar, strout):
11744 Don't set size unless allocation succeeds.
11745
11746 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11747 for sizes. Check for string overflow more accurately.
11748 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11749
11750 * macros.c: Integer and buffer overflow fixes.
11751 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11752 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11753 Use ptrdiff_t, not int, for sizes.
11754 Don't increment bufsize until after realloc succeeds.
11755 Check for size-calculation overflow.
11756 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11757
11758 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11759
11760 * lread.c: Integer overflow fixes.
11761 (read_integer): Radix is now EMACS_INT, not int,
11762 to improve quality of diagnostics for out-of-range radices.
11763 Calculate buffer size correctly for out-of-range radices.
11764 (read1): Check for integer overflow in radices, and in
11765 read-circle numbers.
11766 (read_escape): Avoid int overflow.
11767 (Fload, openp, read_buffer_size, read1)
11768 (substitute_object_recurse, read_vector, read_list, map_obarray):
11769 Use ptrdiff_t, not int, for sizes.
11770 (read1): Use EMACS_INT, not int, for sizes.
11771 Check for size overflow.
11772
11773 * image.c (cache_image): Check for size arithmetic overflow.
11774
11775 * lread.c: Integer overflow issues.
11776 (saved_doc_string_size, saved_doc_string_length)
11777 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11778 Now ptrdiff_t, not int.
11779 (read1): Don't assume doc string length fits in int. Check for
11780 out-of-range doc string lengths.
11781 (read_list): Don't assume file position fits in int.
11782 (read_escape): Check for hex character overflow.
11783
11784 2011-06-22 Leo Liu <sdl.web@gmail.com>
11785
11786 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11787 Move to minibuffer.el.
11788
11789 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11790
11791 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11792 The following patches are for when GLYPH_DEBUG && !XASSERT.
11793 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11794 * dispnew.c (flush_stdout):
11795 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11796 Mark as externally visible.
11797 * dispnew.c (check_window_matrix_pointers): Now static.
11798 * dispnew.c (window_to_frame_vpos):
11799 * xfns.c (unwind_create_frame):
11800 * xterm.c (x_check_font): Remove unused local.
11801 * scroll.c (CHECK_BOUNDS):
11802 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11803 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11804 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11805 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11806 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11807 Now static.
11808 (debug_method_add): Use va_list and vsprintf rather than relying
11809 on undefined behavior with wrong number of arguments.
11810 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11811 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11812 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11813 since we're not interested in debugging glyphs with old libraries.
11814 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11815 GCC 4.6.0's static checking.
11816
11817 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11818
11819 Integer overflow and signedness fixes (Bug#8873).
11820 A few related buffer overrun fixes, too.
11821
11822 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11823
11824 * dispextern.h (struct face.stipple):
11825 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11826 (x_bitmap_mask, x_allocate_bitmap_record)
11827 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11828 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11829 (x_create_bitmap_from_xpm_data):
11830 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11831 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11832 (.bitmaps_last):
11833 * xfaces.c (load_pixmap):
11834 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11835 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11836 (.bitmaps_last, struct x_output.icon_bitmap):
11837 Use ptrdiff_t, not int, for bitmap indexes.
11838 (x_allocate_bitmap_record): Check for size overflow.
11839 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11840
11841 Use ptrdiff_t, not int, for overlay counts.
11842 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11843 * editfns.c (overlays_around, get_pos_property):
11844 * textprop.c (get_char_property_and_overlay):
11845 * xdisp.c (next_overlay_change, note_mouse_highlight):
11846 * xfaces.c (face_at_buffer_position):
11847 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11848 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11849 (Fnext_overlay_change, Fprevious_overlay_change)
11850 (mouse_face_overlay_overlaps, Foverlays_in):
11851 Use ptrdiff_t, not int, for sizes.
11852 (overlays_at, overlays_in): Check for size-calculation overflow.
11853
11854 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11855
11856 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11857 (x_session_initialize): Do not assume string length fits in int.
11858
11859 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11860 This is unlikely, but can occur if DPI is outlandish.
11861
11862 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
11863 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11864
11865 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11866 * xrdb.c (magic_file_p, search_magic_path):
11867 Omit last arg SUFFIX; it was always 0. All callers changed.
11868 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11869
11870 * xfont.c (xfont_match): Avoid need for strlen.
11871
11872 * xfns.c: Don't assume strlen fits in int.
11873 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11874
11875 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11876 not unsigned long, as we prefer signed integers. All callers changed.
11877 Detect integer overflow in repeat count.
11878 (message_dolog): Don't assume print length fits in 39 bytes.
11879 (display_mode_element): Don't assume strlen fits in int.
11880
11881 * termcap.c: Don't assume sizes fit in int and never overflow.
11882 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11883 (gobble_line): Check for size-calculation overflow.
11884
11885 * minibuf.c (Fread_buffer):
11886 * lread.c (intern, intern_c_string):
11887 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11888 Don't assume string length fits in int.
11889
11890 * keyboard.c (parse_tool_bar_item):
11891 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11892
11893 * font.c: Don't assume string length fits in int.
11894 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11895 Use ptrdiff_t, not int.
11896 (font_intern_prop): Don't assume string length fits in int.
11897 Don't assume integer property fits in fixnum.
11898 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
11899
11900 * filelock.c: Fix some buffer overrun and integer overflow issues.
11901 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
11902 Reformulate so as not to need the command string.
11903 Invoke gzip -cd rather than gunzip, as it's more portable.
11904 (lock_info_type, lock_file_1, lock_file):
11905 Don't assume pid_t and time_t fit in unsigned long.
11906 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11907 (current_lock_owner): Prefer signed type for sizes.
11908 Use memcpy, not strncpy, where memcpy is what is really wanted.
11909 Don't assume (via atoi) that time_t and pid_t fit in int.
11910 Check for time_t and/or pid_t out of range, e.g., via a network share.
11911 Don't alloca where an auto var works fine.
11912
11913 * fileio.c: Fix some integer overflow issues.
11914 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11915 Don't assume string length fits in int.
11916 (directory_file_name): Don't assume string length fits in long.
11917 (make_temp_name): Don't assume pid fits in int, or that its print
11918 length is less than 20.
11919
11920 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11921
11922 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11923
11924 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11925
11926 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11927 We prefer signed integers, even for size calculations.
11928
11929 * emacs.c: Don't assume string length fits in 'int'.
11930 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11931 (main): Don't invoke strlen when not needed.
11932
11933 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11934 (XD_DEBUG_MESSAGE): Don't waste a byte.
11935
11936 * callproc.c (getenv_internal_1, getenv_internal)
11937 (Fgetenv_internal):
11938 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11939
11940 * lread.c (invalid_syntax): Omit length argument.
11941 All uses changed. This doesn't fix a bug, but it simplifies the
11942 code away from its former Hollerith-constant appearance, and it's
11943 one less 'int' to worry about when looking at integer-overflow issues.
11944 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
11945
11946 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11947 This didn't break anything, but it didn't help either.
11948 It's confusing to put a bogus integer in a place where the actual
11949 value does not matter.
11950 (LIST_END_P): Remove unused macro and its bogus comment.
11951 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
11952
11953 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11954 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11955 implementation.
11956 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11957 We prefer signed types, and the value cannot exceed the EMACS_INT
11958 range anyway (because otherwise the length would not be representable).
11959 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11960 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11961 This avoids a GCC warning when WIDE_EMACS_INT.
11962
11963 * indent.c (sane_tab_width): New function.
11964 (current_column, scan_for_column, Findent_to, position_indentation)
11965 (compute_motion): Use it. This is just for clarity.
11966 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
11967
11968 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
11969
11970 * lisp.h (lint_assume): New macro.
11971 * composite.c (composition_gstring_put_cache):
11972 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11973
11974 * editfns.c, insdel.c:
11975 Omit unnecessary forward decls, to simplify future changes.
11976
11977 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11978
11979 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11980
11981 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
11982 Use much-faster test for byte-length change.
11983 Don't assume string byte-length fits in 'int'.
11984 Check that character arg fits in 'int'.
11985 (mapcar1): Declare byte as byte, for clarity.
11986
11987 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11988
11989 * fns.c (concat): Catch string overflow earlier.
11990 Do not rely on integer wraparound.
11991
11992 * dispextern.h (struct it.overlay_strings_charpos)
11993 (struct it.selective): Now EMACS_INT, not int.
11994 * xdisp.c (forward_to_next_line_start)
11995 (back_to_previous_visible_line_start)
11996 (reseat_at_next_visible_line_start, next_element_from_buffer):
11997 Don't arbitrarily truncate the value of 'selective' to int.
11998
11999 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12000
12001 * composite.c: Don't truncate sizes to 'int'.
12002 (composition_gstring_p, composition_reseat_it)
12003 (composition_adjust_point): Use EMACS_INT, not int.
12004 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12005 not EMACS_UINT, for indexes.
12006
12007 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12008
12009 * buffer.c: Include <verify.h>.
12010 (struct sortvec.priority, struct sortstr.priority):
12011 Now EMACS_INT, not int.
12012 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12013 (struct sortstr.size, record_overlay_string)
12014 (struct sortstrlist.size, struct sortlist.used):
12015 Don't truncate size to int.
12016 (record_overlay_string): Check for size-calculation overflow.
12017 (init_buffer_once): Check at compile-time, not run-time.
12018
12019 2011-06-22 Jim Meyering <meyering@redhat.com>
12020
12021 Don't leak an XBM-image-sized buffer
12022 * image.c (xbm_load): Free the image buffer after using it.
12023
12024 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12025
12026 Port to Sun C.
12027 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12028 that Sun C diagnosed.
12029 * fns.c (secure_hash): Fix pointer signedness issue.
12030 * intervals.c (static_offset_intervals): New function.
12031 (offset_intervals): Use it.
12032
12033 2011-06-21 Leo Liu <sdl.web@gmail.com>
12034
12035 * deps.mk (fns.o):
12036 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12037 sha512.h.
12038
12039 * fns.c (secure_hash): Rename from crypto_hash_function and change
12040 the first arg to accept symbols.
12041 (Fsecure_hash): New primitive.
12042 (syms_of_fns): New symbols.
12043
12044 2011-06-20 Deniz Dogan <deniz@dogan.se>
12045
12046 * process.c (Fset_process_buffer): Clarify return value in
12047 docstring.
12048
12049 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12050
12051 * dispnew.c (add_window_display_history): Use BVAR.
12052
12053 * xdisp.c (debug_method_add): Use BVAR.
12054 (check_window_end, dump_glyph_matrix, dump_glyph)
12055 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12056
12057 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12058 Likewise.
12059
12060 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12061 check till after the cache is created in init_frame_faces.
12062
12063 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12064
12065 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12066
12067 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12068
12069 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12070 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12071 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12072
12073 Improve buffer-overflow checking (Bug#8873).
12074 * fileio.c (Finsert_file_contents):
12075 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12076 Remove the old (too-loose) buffer overflow checks.
12077 They weren't needed, since make_gap checks for buffer overflow.
12078 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12079 The old code merely checked for Emacs fixnum overflow, and relied
12080 on undefined (wraparound) behavior. The new code avoids undefined
12081 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12082
12083 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12084 Tune. Don't use wider integers than needed. Don't use alloca.
12085 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12086
12087 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12088
12089 * insdel.c, lisp.h (buffer_overflow): New function.
12090 (insert_from_buffer_1, replace_range, replace_range_2):
12091 * insdel.c (make_gap_larger):
12092 * editfns.c (Finsert_char):
12093 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12094
12095 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12096
12097 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12098
12099 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12100
12101 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12102 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12103
12104 * fileio.c: Don't assume EMACS_INT fits in off_t.
12105 (emacs_lseek): New static function.
12106 (Finsert_file_contents, Fwrite_region): Use it.
12107 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12108
12109 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12110
12111 * fns.c: Don't overflow int when computing a list length.
12112 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12113 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12114 truncation on 64-bit hosts. Check for QUIT every
12115 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12116 faster and is responsive enough.
12117 (Flength): Report an error instead of overflowing an integer.
12118 (Fsafe_length): Return a float if the value is not representable
12119 as a fixnum. This shouldn't happen except in contrived situations.
12120 (Fnthcdr, Fsort): Don't assume list length fits in int.
12121 (Fcopy_sequence): Don't assume vector length fits in int.
12122
12123 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12124 (header_size, word_size): New constants.
12125 (allocate_vectorlike): Don't check size overflow here.
12126 (allocate_vector): Check it here instead, since this is the only
12127 caller of allocate_vectorlike that could cause overflow.
12128 Check that the new vector's length is representable as a fixnum.
12129
12130 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12131 The previous code was bogus. For example, next_almost_prime (32)
12132 returned 39, which is undesirable as it is a multiple of 3; and
12133 next_almost_prime (24) returned 25, which is a multiple of 5 so
12134 why was the code bothering to check for multiples of 7?
12135
12136 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12137
12138 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12139
12140 Variadic C functions now count arguments with ptrdiff_t.
12141 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12142 Back then I didn't know that the Emacs coding style prefers signed int.
12143 Also, in the meantime I found a few more instances where arguments
12144 were being counted with int, which may truncate counts on 64-bit
12145 machines, or EMACS_INT, which may be unnecessarily wide.
12146 * lisp.h (struct Lisp_Subr.function.aMANY)
12147 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12148 Arg counts are now ptrdiff_t, not size_t.
12149 All variadic functions and their callers changed accordingly.
12150 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12151 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12152 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12153 * callint.c (Fcall_interactively): Check arg count for overflow,
12154 to avoid potential buffer overrun. Use signed char, not 'int',
12155 for 'varies' array, so that we needn't bother to check its size
12156 calculation for overflow.
12157 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12158 * eval.c (apply_lambda):
12159 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12160 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12161 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12162
12163 * callint.c (Fcall_interactively): Don't use index var as event count.
12164
12165 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12166 * mem-limits.h (SIZE): Remove; no longer used.
12167
12168 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12169
12170 Remove unnecessary casts.
12171 * xterm.c (x_term_init):
12172 * xfns.c (x_set_border_pixel):
12173 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12174 These aren't needed now that we assume ANSI C.
12175
12176 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12177 It's more likely to cause problems (due to unsigned overflow)
12178 than to cure them.
12179
12180 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12181
12182 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12183
12184 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12185
12186 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12187
12188 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12189
12190 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12191
12192 GLYPH_CODE_FACE returns EMACS_INT, not int.
12193 * dispextern.h (merge_faces):
12194 * xfaces.c (merge_faces):
12195 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12196 Don't assume EMACS_INT fits in int.
12197
12198 * character.h (CHAR_VALID_P): Remove unused parameter.
12199 * fontset.c, lisp.h, xdisp.c: All uses changed.
12200
12201 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12202
12203 * fns.c (concat): Minor tuning based on overflow analysis.
12204 This doesn't fix any bugs. Use int to hold character, instead
12205 of constantly refetching from Emacs object. Use XFASTINT, not
12206 XINT, for value known to be a character. Don't bother comparing
12207 a single byte to 0400, as it's always less.
12208
12209 * floatfns.c (Fexpt):
12210 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12211
12212 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12213 for characters.
12214
12215 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12216
12217 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12218 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12219 incorrectly succeed when S was a string, because 4294967386 was
12220 truncated before it was used.
12221
12222 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12223 Otherwise, an out-of-range integer could cause undefined behavior
12224 on a 64-bit host.
12225
12226 * composite.c: Use int, not EMACS_INT, for characters.
12227 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12228 EMACS_INT, for values that are known to be in character range.
12229 This doesn't fix any bugs but is the usual style inside Emacs and
12230 may generate better code on 32-bit machines.
12231
12232 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12233 This is for reasons similar to the recent CHAR_STRING fix.
12234 * charset.c (Fencode_char): Check that character arg is actually
12235 a character. Pass an int to ENCODE_CHAR.
12236 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12237 wider than 'int', as a compile-time check to prevent future regressions
12238 in this area.
12239
12240 * character.c (char_string): Remove unnecessary casts.
12241
12242 Make sure a 64-bit char is never passed to CHAR_STRING.
12243 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12244 by silently ignoring the top 32 bits, allowing some values
12245 that were far too large to be valid characters.
12246 * character.h: Include <verify.h>.
12247 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12248 arguments are no wider than unsigned, as a compile-time check
12249 to prevent future regressions in this area.
12250 * data.c (Faset):
12251 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12252 (Fsubst_char_in_region):
12253 * fns.c (concat):
12254 * xdisp.c (decode_mode_spec_coding):
12255 Adjust to CHAR_STRING's new requirement.
12256 * editfns.c (Finsert_char, Fsubst_char_in_region):
12257 * fns.c (concat): Check that character args are actually
12258 characters. Without this test, these functions did the wrong
12259 thing with wildly out-of-range values on 64-bit hosts.
12260
12261 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12262 These casts should not be needed on 32-bit hosts, either.
12263 * keyboard.c (read_char):
12264 * lread.c (Fload): Remove casts to unsigned.
12265
12266 * lisp.h (UNSIGNED_CMP): New macro.
12267 This fixes comparison bugs on 64-bit hosts.
12268 (ASCII_CHAR_P): Use it.
12269 * casefiddle.c (casify_object):
12270 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12271 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12272 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12273 * dispextern.h (FACE_FROM_ID):
12274 * keyboard.c (read_char): Use UNSIGNED_CMP.
12275
12276 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12277 not to EMACS_INT, to avoid GCC warning.
12278
12279 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12280
12281 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12282 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12283 isn't needed on 32-bit machines.
12284
12285 * buffer.c (Fgenerate_new_buffer_name):
12286 Use EMACS_INT for count, not int.
12287 (advance_to_char_boundary): Return EMACS_INT, not int.
12288
12289 * data.c (Qcompiled_function): Now static.
12290
12291 * window.c (window_body_lines): Now static.
12292
12293 * image.c (gif_load): Rename local to avoid shadowing.
12294
12295 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12296 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12297 * alloc.c (make_save_value): Integer argument is now of type
12298 ptrdiff_t, not int.
12299 (mark_object): Use ptrdiff_t, not int.
12300 * lisp.h (pD): New macro.
12301 * print.c (print_object): Use it.
12302
12303 * alloc.c: Use EMACS_INT, not int, to count objects.
12304 (total_conses, total_markers, total_symbols, total_vector_size)
12305 (total_free_conses, total_free_markers, total_free_symbols)
12306 (total_free_floats, total_floats, total_free_intervals)
12307 (total_intervals, total_strings, total_free_strings):
12308 Now EMACS_INT, not int. All uses changed.
12309 (Fgarbage_collect): Compute overall total using a double, so that
12310 integer overflow is less likely to be a problem. Check for overflow
12311 when converting back to an integer.
12312 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12313 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12314 These were 'int' variables that could overflow on 64-bit hosts;
12315 they were never used, so remove them instead of repairing them.
12316 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12317 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12318 Previously, this ceilinged at INT_MAX, but that doesn't work on
12319 64-bit machines.
12320 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12321
12322 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12323 (allocate_vectorlike): Check for ptrdiff_t overflow.
12324 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12325 when a (possibly-narrower) signed value would do just as well.
12326 We prefer using signed arithmetic, to avoid comparison confusion.
12327
12328 * alloc.c: Catch some string size overflows that we were missing.
12329 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12330 for convenience in STRING_BYTES_MAX.
12331 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12332 The definition here is exact; the one in lisp.h was approximate.
12333 (allocate_string_data): Check for string overflow. This catches
12334 some instances we weren't catching before. Also, it catches
12335 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12336 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12337 and ptrdiff_t and EMACS_INT are both 64 bits.
12338
12339 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12340 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12341 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12342
12343 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12344
12345 * alloc.c (Fmake_string): Check for out-of-range init.
12346
12347 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12348
12349 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12350
12351 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12352
12353 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12354 xg_get_default_scrollbar_width.
12355
12356 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12357 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12358 (style_changed_cb): Call update_theme_scrollbar_width and call
12359 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12360 all frames (Bug#8505).
12361 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12362 Call gtk_window_set_resizable if HAVE_GTK3.
12363 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12364 and height if HAVE_GTK3 (Bug#8505).
12365 (scroll_bar_width_for_theme): New variable.
12366 (update_theme_scrollbar_width): New function.
12367 (xg_get_default_scrollbar_width): Move code to
12368 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12369 (xg_initialize): Call update_theme_scrollbar_width.
12370
12371 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12372
12373 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12374
12375 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12376
12377 * frame.c (make_frame): Call other_buffer_safely instead of
12378 other_buffer.
12379
12380 * window.c (temp_output_buffer_show): Call display_buffer with
12381 second argument Vtemp_buffer_show_specifiers and reset latter
12382 immediately after the call.
12383 (Vtemp_buffer_show_specifiers): New variable.
12384 (auto_window_vscroll_p, next_screen_context_lines)
12385 (Vscroll_preserve_screen_position): Remove leading asterisks from
12386 doc-strings.
12387
12388 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12389
12390 Fix minor problems found by GCC 4.6.0 static checking.
12391 * buffer.c (Qclone_number): Remove for now, as it's unused.
12392 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12393 (record_buffer): Remove unused local.
12394 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12395 (set_frame_buffer_list): Remove; unused.
12396 * frame.h (other_visible_frames): Remove decl.
12397 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12398 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12399 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12400 if HAVE_GPM.
12401 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12402 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12403 Define only if HAVE_GPM.
12404 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12405 (update_hints_inhibit): Remove; never set. All uses removed.
12406 * widgetprv.h (emacsFrameClassRec): Remove decl.
12407 * window.c (delete_deletable_window): Now returns void, since it
12408 wasn't returning anything.
12409 (compare_window_configurations): Remove unused locals.
12410 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12411 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12412 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12413 the same widths as pointers. This follows up on the 2011-05-06 patch.
12414 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12415 * xterm.h: Likewise.
12416 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12417
12418 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
12419
12420 * makefile.w32-in: Update dependencies.
12421 (LISP_H): Add lib/intprops.h.
12422
12423 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12424
12425 * image.c (gif_load): Add animation frame delay to the metadata.
12426 (syms_of_image): Use DEFSYM. New symbol `delay'.
12427
12428 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12429
12430 * window.c (delete_deletable_window): Re-add.
12431 (Fset_window_configuration): Rewrite to handle dead buffers and
12432 consequently deletable windows.
12433 (window_tree, Fwindow_tree): Remove. Supply functionality in
12434 window.el.
12435 (compare_window_configurations): Simplify code.
12436
12437 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12438
12439 * image.c (imagemagick_load_image): Fix type mismatch.
12440 (Fimagemagick_types): Likewise.
12441
12442 * window.h (replace_buffer_in_windows): Declare.
12443
12444 2011-06-11 Martin Rudalics <rudalics@gmx.at>
12445
12446 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12447 Qclone_number. Remove external declaration of Qdelete_window.
12448 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12449 code.
12450 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12451 Run Qbuffer_list_update_hook if allowed.
12452 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12453 buffer list implementation.
12454 (other_buffer_safely): New function.
12455 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12456 calls to replace_buffer_in_windows and
12457 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12458 if allowed.
12459 (record_buffer): Inhibit quitting and rewrite using quittable
12460 functions. Run Qbuffer_list_update_hook if allowed.
12461 (Frecord_buffer, Funrecord_buffer): New functions.
12462 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12463 Move switch-to-buffer to window.el.
12464 (bury-buffer): Move to window.el.
12465 (Vbuffer_list_update_hook): New variable.
12466
12467 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12468 section.
12469
12470 * window.h (resize_frame_windows): Move up in code.
12471 (Fwindow_frame): Remove EXFUN.
12472 (replace_buffer_in_all_windows): Remove prototype.
12473 (replace_buffer_in_windows_safely): Add prototype.
12474
12475 * window.c: Declare Qdelete_window static again. Move down
12476 declaration of select_count.
12477 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12478 (Fother_window): Move to window.el.
12479 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12480 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12481 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12482 window.el.
12483 (replace_buffer_in_windows): Implement by calling
12484 Qreplace_buffer_in_windows.
12485 (replace_buffer_in_all_windows): Remove with some functionality
12486 moved into replace_buffer_in_windows_safely.
12487 (replace_buffer_in_windows_safely): New function.
12488 (select_window_norecord, select_frame_norecord): Move in front
12489 of run_window_configuration_change_hook. Remove now obsolete
12490 declarations.
12491 (Fset_window_buffer): Rewrite doc-string.
12492 Call Qrecord_window_buffer.
12493 (keys_of_window): Move binding for other-window to window.el.
12494
12495 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
12496
12497 * dispextern.h (struct image): Replace data member, whose int_val
12498 and ptr_val fields were not used by anything, with a single
12499 lisp_val object.
12500
12501 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12502 (gif_clear_image, gif_load, imagemagick_load_image)
12503 (gs_clear_image, gs_load): Callers changed.
12504
12505 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12506
12507 * buffer.h: Include <time.h>, for time_t.
12508 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12509
12510 Fix minor problems found by static checking.
12511
12512 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12513
12514 Make identifiers static if they are not used in other modules.
12515 * data.c (Qcompiled_function, Qframe, Qvector):
12516 * image.c (QimageMagick, Qsvg):
12517 * minibuf.c (Qmetadata):
12518 * window.c (resize_window_check, resize_root_window): Now static.
12519 * window.h (resize_window_check, resize_root_window): Remove decls.
12520
12521 * window.c (window_deletion_count, delete_deletable_window):
12522 Remove; unused.
12523 (window_body_lines): Now static.
12524 (Fdelete_other_windows_internal): Mark vars as initialized.
12525 Make sure 'resize_failed' is initialized.
12526 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12527 (resize_window_apply): Remove unused local.
12528 * window.h (delete_deletable_window): Remove decl.
12529
12530 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12531 (imagemagick_load_image): Fix pointer signedness problem by changing
12532 last arg from unsigned char * to char *. All uses changed.
12533 Also, fix a local for similar reasons.
12534 Remove unused locals. Remove locals to avoid shadowing.
12535 (fn_rsvg_handle_free): Remove; unused.
12536 (svg_load, svg_load_image): Fix pointer signedness problem.
12537 (imagemagick_load_image): Don't use garbage pointer image_wand.
12538
12539 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12540
12541 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
12542
12543 * image.c (gif_load): Fix omitted cast error introduced by
12544 2011-06-06 change.
12545
12546 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12547
12548 * window.h (resize_proportionally, orig_total_lines)
12549 (orig_top_line): Remove from window structure.
12550 (set_window_height, set_window_width, change_window_heights)
12551 (Fdelete_window): Remove prototypes.
12552 (resize_frame_windows): Remove duplicate declaration.
12553
12554 2011-06-10 Eli Zaretskii <eliz@gnu.org>
12555
12556 * window.h (resize_frame_windows, resize_window_check)
12557 (delete_deletable_window, resize_root_window)
12558 (resize_frame_windows): Declare prototypes.
12559
12560 * window.c (resize_window_apply): Make definition be "static" to
12561 match the prototype.
12562
12563 2011-06-10 Martin Rudalics <rudalics@gmx.at>
12564
12565 * window.c: Remove declarations of Qwindow_size_fixed,
12566 window_min_size_1, window_min_size_2, window_min_size,
12567 size_window, window_fixed_size_p, enlarge_window, delete_window.
12568 Remove static from declaration of Qdelete_window, it's
12569 temporarily needed by Fbury_buffer.
12570 (replace_window): Don't assign orig_top_line and
12571 orig_total_lines.
12572 (Fdelete_window, delete_window): Remove. Window deletion is
12573 handled by window.el.
12574 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12575 Replace Fdelete_window calls with calls to Qdelete_window.
12576 (Fdelete_other_windows): Remove. Deleting other windows is
12577 handled by window.el.
12578 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12579 handled in window.el.
12580 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12581 Window minimum sizes are handled in window.el.
12582 (shrink_windows, size_window, set_window_height)
12583 (set_window_width, change_window_heights, window_height)
12584 (window_width, CURBEG, CURSIZE, enlarge_window)
12585 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12586 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12587 handled in window.el.
12588 (make_dummy_parent): Rename to make_parent_window and give it a
12589 second argument horflag.
12590 (make_window): Don't set resize_proportionally any more.
12591 (Fsplit_window): Remove. Windows are split in window.el.
12592 (save_restore_action, save_restore_orig_size)
12593 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12594 Resize mini windows in window.el.
12595 (grow_mini_window, shrink_mini_window): Implement by calling
12596 Qresize_root_window_vertically, resize_window_check and
12597 resize_window_apply.
12598 (saved_window, Fset_window_configuration, save_window_save):
12599 Do not handle orig_top_line, orig_total_lines, and
12600 resize_proportionally.
12601 (window_min_height, window_min_width): Move to window.el.
12602 (keys_of_window): Move bindings for delete-other-windows,
12603 split-window, delete-window and enlarge-window to window.el.
12604
12605 * buffer.c: Temporarily extern Qdelete_window.
12606 (Fbury_buffer): Temporarily call Qdelete_window instead of
12607 Fdelete_window (Fbury_buffer will move to window.el soon).
12608
12609 * frame.c (set_menu_bar_lines_1): Remove code handling
12610 orig_top_line and orig_total_lines.
12611
12612 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12613 set_window_height but set heights directly.
12614 (change_frame_size_1): Use resize_frame_windows.
12615
12616 * xdisp.c (init_xdisp): Don't use set_window_height but set
12617 heights directly.
12618
12619 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12620 Use resize_frame_windows instead of change_window_heights and run
12621 run_window_configuration_change_hook.
12622
12623 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12624 instead of change_window_heights and run
12625 run_window_configuration_change_hook.
12626
12627 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12628
12629 * window.c (replace_window): Rename second argument REPLACEMENT to
12630 NEW. New third argument SETFLAG. Rewrite.
12631 (delete_window, make_dummy_parent): Call replace_window with
12632 third argument 1.
12633 (window_list_1): Move down in code.
12634 (run_window_configuration_change_hook): Move set_buffer part
12635 before select_frame_norecord part in order to unwind correctly.
12636 Rename count1 to count.
12637 (recombine_windows, delete_deletable_window, resize_root_window)
12638 (Fdelete_other_windows_internal)
12639 (Frun_window_configuration_change_hook, make_parent_window)
12640 (resize_window_check, resize_window_apply, Fresize_window_apply)
12641 (resize_frame_windows, Fsplit_window_internal)
12642 (Fdelete_window_internal, Fresize_mini_window_internal):
12643 New functions.
12644 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12645
12646 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12647
12648 * window.h (window): Add some new members to window structure -
12649 normal_lines, normal_cols, new_total, new_normal, clone_number,
12650 splits, nest, prev_buffers, next_buffers.
12651 (WINDOW_TOTAL_SIZE): Move here from window.c.
12652 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12653
12654 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12655 Remove.
12656 (make_dummy_parent): Set new members of windows structure.
12657 (make_window): Move down in code. Handle new members of window
12658 structure.
12659 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12660 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12661 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12662 (Fset_window_prev_buffers, Fwindow_next_buffers)
12663 (Fset_window_next_buffers, Fset_window_clone_number):
12664 New functions.
12665 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12666 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12667 Doc-string fixes.
12668 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12669 Argument WINDOW can be now internal window too.
12670 (Fwindow_use_time): Move up in code.
12671 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12672 Rewrite doc-string.
12673 (Fset_window_configuration, saved_window)
12674 (Fcurrent_window_configuration, save_window_save): Handle new
12675 members of window structure.
12676 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12677 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12678 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12679 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12680 Qget_mru_window, Qresize_root_window,
12681 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12682 Qauto_buffer_name; staticpro them.
12683
12684 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12685
12686 * window.c (Fwindow_total_size, Fwindow_left_column)
12687 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12688 (Fwindow_list_1): New functions.
12689 (window_box_text_cols): Replace with window_body_cols.
12690 (Fwindow_width, Fscroll_left, Fscroll_right):
12691 Use window_body_cols instead of window_box_text_cols.
12692 (delete_window, Fset_window_configuration):
12693 Call delete_all_subwindows with window as argument.
12694 (delete_all_subwindows): Take a window as argument and not a
12695 structure. Rewrite.
12696 (window_loop): Remove handling of GET_LRU_WINDOW and
12697 GET_LARGEST_WINDOW.
12698 (Fget_lru_window, Fget_largest_window): Move to window.el.
12699
12700 * window.h: Extern window_body_cols instead of
12701 window_box_text_cols. delete_all_subwindows now takes a
12702 Lisp_Object as argument.
12703
12704 * indent.c (compute_motion, Fcompute_motion):
12705 Use window_body_cols instead of window_box_text_cols.
12706
12707 * frame.c (delete_frame): Call delete_all_subwindows with root
12708 window as argument.
12709
12710 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12711
12712 * fns.c (Fputhash): Document return value.
12713
12714 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12715
12716 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12717
12718 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12719
12720 Cons<->int and similar integer overflow fixes (Bug#8794).
12721
12722 Check for overflow when converting integer to cons and back.
12723 * charset.c (Fdefine_charset_internal, Fdecode_char):
12724 Use cons_to_unsigned to catch overflow.
12725 (Fencode_char): Use INTEGER_TO_CONS.
12726 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12727 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12728 * data.c (long_to_cons, cons_to_long): Remove.
12729 (cons_to_unsigned, cons_to_signed): New functions.
12730 These signal an error for invalid or out-of-range values.
12731 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12732 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12733 * font.c (Ffont_variation_glyphs):
12734 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12735 * lisp.h: Include <intprops.h>.
12736 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12737 (cons_to_signed, cons_to_unsigned): New decls.
12738 (long_to_cons, cons_to_long): Remove decls.
12739 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12740 (Fprimitive_undo): Use CONS_TO_INTEGER.
12741 * xfns.c (Fx_window_property): Likewise.
12742 * xselect.c: Include <limits.h>.
12743 (x_own_selection, selection_data_to_lisp_data):
12744 Use INTEGER_TO_CONS.
12745 (x_handle_selection_request, x_handle_selection_clear)
12746 (x_get_foreign_selection, Fx_disown_selection_internal)
12747 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12748 (lisp_data_to_selection_data): Use cons_to_unsigned.
12749 (x_fill_property_data): Use cons_to_signed.
12750 Report values out of range.
12751
12752 Check for buffer and string overflow more precisely.
12753 * buffer.h (BUF_BYTES_MAX): New macro.
12754 * lisp.h (STRING_BYTES_MAX): New macro.
12755 * alloc.c (Fmake_string):
12756 * character.c (string_escape_byte8):
12757 * coding.c (coding_alloc_by_realloc):
12758 * doprnt.c (doprnt):
12759 * editfns.c (Fformat):
12760 * eval.c (verror):
12761 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12762 since they may not be the same number.
12763 * editfns.c (Finsert_char):
12764 * fileio.c (Finsert_file_contents):
12765 Likewise for BUF_BYTES_MAX.
12766
12767 * image.c: Use ptrdiff_t, not int, for sizes.
12768 (slurp_file): Switch from int to ptrdiff_t.
12769 All uses changed.
12770 (slurp_file): Check that file size fits in both size_t (for
12771 malloc) and ptrdiff_t (for sanity and safety).
12772
12773 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12774 if b->modtime has its maximal value.
12775
12776 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12777
12778 Don't assume time_t can fit into int.
12779 * buffer.h (struct buffer.modtime): Now time_t, not int.
12780 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12781 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12782
12783 Minor fixes for signed vs unsigned integers.
12784 * character.h (MAYBE_UNIFY_CHAR):
12785 * charset.c (maybe_unify_char):
12786 * keyboard.c (read_char, reorder_modifiers):
12787 XINT -> XFASTINT, since the integer must be nonnegative.
12788 * ftfont.c (ftfont_spec_pattern):
12789 * keymap.c (access_keymap, silly_event_symbol_error):
12790 XUINT -> XFASTINT, since the integer must be nonnegative.
12791 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12792 since it makes no difference and we prefer signed.
12793 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12794 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12795 nonnegative.
12796
12797 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12798
12799 * window.h (Fwindow_frame): Declare.
12800
12801 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12802
12803 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12804 (SPARE_MEMORY): Always define.
12805 (LARGE_REQUEST): Remove.
12806 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12807
12808 2011-06-06 Martin Rudalics <rudalics@gmx.at>
12809
12810 * lisp.h: Move EXFUNS for Fframe_root_window,
12811 Fframe_first_window and Fset_frame_selected_window to window.h.
12812
12813 * window.h: Move EXFUNS for Fframe_root_window,
12814 Fframe_first_window and Fset_frame_selected_window here from
12815 lisp.h.
12816
12817 * frame.c (Fwindow_frame, Fframe_first_window)
12818 (Fframe_root_window, Fframe_selected_window)
12819 (Fset_frame_selected_window): Move to window.c.
12820 (Factive_minibuffer_window): Move to minibuf.c.
12821 (Fother_visible_frames_p): New function.
12822
12823 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12824
12825 * window.c (decode_window, decode_any_window): Move up in code.
12826 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12827 (inhibit_frame_unsplittable): Remove unused variable.
12828 (Fwindow_buffer): Move up and rewrite doc-string.
12829 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12830 (Fwindow_prev): New functions.
12831 (Fwindow_frame): Move here from frame.c. Accept any window as
12832 argument.
12833 (Fframe_root_window, Fframe_first_window)
12834 (Fframe_selected_window): Move here from frame.c. Accept frame
12835 or arbitrary window as argument. Update doc-strings.
12836 (Fminibuffer_window): Move up in code.
12837 (Fwindow_minibuffer_p): Move up in code and simplify.
12838 (Fset_frame_selected_window): Move here from frame.c.
12839 Marginal rewrite.
12840 (Fselected_window, select_window, Fselect_window): Move up in
12841 code. Minor doc-string fixes.
12842
12843 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12844
12845 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12846 Do not assume that spare memory exists; that assumption is valid
12847 only if SYSTEM_MALLOC.
12848 (LARGE_REQUEST): New macro, so that the issue of large requests
12849 is separated from the issue of spare memory.
12850
12851 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12852
12853 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12854 format. (Bug#8806)
12855
12856 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12857
12858 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12859 before statements.
12860
12861 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12862
12863 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12864
12865 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12866
12867 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12868 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12869
12870 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
12871
12872 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12873
12874 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
12875
12876 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12877 (x_clipboard_manager_save): Add return value.
12878 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12879 New error handlers.
12880 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12881 Obey Vx_select_enable_clipboard_manager. Catch errors in
12882 x_clipboard_manager_save (Bug#8779).
12883 (Vx_select_enable_clipboard_manager): New variable.
12884 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
12885
12886 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
12887
12888 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12889
12890 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12891
12892 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12893 in the current matrix if keep_current_p is non-zero.
12894
12895 2011-06-04 Eli Zaretskii <eliz@gnu.org>
12896
12897 * bidi.c (bidi_level_of_next_char): Fix last change.
12898
12899 2011-06-03 Eli Zaretskii <eliz@gnu.org>
12900
12901 Support bidi reordering of text covered by display properties.
12902
12903 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12904 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12905 (bidi_cache_search, bidi_cache_iterator_state)
12906 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12907 (bidi_level_of_next_char, bidi_move_to_visually_next):
12908 Support character positions inside a run of characters covered by a
12909 display string.
12910 (bidi_paragraph_init, bidi_resolve_explicit_1)
12911 (bidi_level_of_next_char): Call bidi_fetch_char and
12912 bidi_fetch_char_advance instead of FETCH_CHAR and
12913 FETCH_CHAR_ADVANCE.
12914 (bidi_init_it): Initialize new members.
12915 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12916 definitions.
12917 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12918 instead of using explicit *_CHAR codes.
12919 (bidi_resolve_explicit, bidi_resolve_weak):
12920 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
12921 bidirectional text is supported only in multibyte buffers.
12922 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12923 it to initialize the frame_window_p member of struct bidi_it.
12924 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12925 (bidi_resolve_explicit, bidi_resolve_weak)
12926 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12927 bidi_it->nchars is non-positive.
12928 (bidi_level_of_next_char): Don't try to lookup the cache for the
12929 next/previous character if nothing is cached there yet, or if we
12930 were just reseat()'ed to a new position.
12931
12932 * xdisp.c (set_cursor_from_row): Set start and stop points
12933 according to the row's direction when priming the loop that looks
12934 for the glyph on which to display cursor.
12935 (single_display_spec_intangible_p): Function deleted.
12936 (display_prop_intangible_p): Reimplement to call
12937 handle_display_spec instead of single_display_spec_intangible_p.
12938 Accept 3 additional arguments needed by handle_display_spec.
12939 This fixes incorrect cursor motion across display property with complex
12940 values: lists, `(when COND...)' forms, etc.
12941 (single_display_spec_string_p): Support property values that are
12942 lists with the argument STRING its top-level element.
12943 (display_prop_string_p): Fix the condition for processing a
12944 property that is a list to be consistent with handle_display_spec.
12945 (handle_display_spec): New function, refactored from the
12946 last portion of handle_display_prop.
12947 (compute_display_string_pos): Accept additional argument
12948 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12949 value of a `display' property is a "replacing spec".
12950 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12951 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12952 the display property, but just return a value indicating whether
12953 the display property will replace the characters it covers.
12954 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12955 frame_window_p members of struct bidi_it.
12956 (compute_display_string_pos, compute_display_string_end):
12957 New functions.
12958 (push_it): Accept second argument POSITION, where pop_it should
12959 jump to continue iteration.
12960 (reseat_1): Initialize bidi_it.disp_pos.
12961
12962 * keyboard.c (adjust_point_for_property): Adjust the call to
12963 display_prop_intangible_p to its new signature.
12964
12965 * dispextern.h (struct bidi_it): New member frame_window_p.
12966 (bidi_init_it): Update prototypes.
12967 (display_prop_intangible_p): Update prototype.
12968 (compute_display_string_pos, compute_display_string_end):
12969 Declare prototypes.
12970 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12971 EMACS_INT.
12972
12973 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
12974
12975 Malloc failure behavior now depends on size of allocation.
12976 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12977 * lisp.h: Change signatures accordingly.
12978 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12979 All callers changed. (Bug#8762)
12980
12981 * gnutls.c: Use Emacs's memory allocators.
12982 Without this change, the gnutls library would invoke malloc etc.
12983 directly, which causes problems on non-SYNC_INPUT hosts, and which
12984 runs afoul of improving memory_full behavior. (Bug#8761)
12985 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12986 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12987 xfree instead of the default malloc, realloc, free.
12988 (Fgnutls_boot): No need to check for memory allocation failure,
12989 since xmalloc does that for us.
12990
12991 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
12992 * category.c (hash_get_category_set):
12993 * ccl.c (ccl_driver):
12994 * charset.c (Fdefine_charset_internal):
12995 * charset.h (struct charset.hash_index):
12996 * composite.c (get_composition_id, gstring_lookup_cache)
12997 (composition_gstring_put_cache):
12998 * composite.h (struct composition.hash_index):
12999 * dispextern.h (struct image.hash):
13000 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13001 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13002 (hashfn_equal, hashfn_user_defined, make_hash_table)
13003 (maybe_resize_hash_table, hash_lookup, hash_put)
13004 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13005 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13006 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13007 * image.c (make_image, search_image_cache, lookup_image)
13008 (xpm_put_color_table_h):
13009 * lisp.h (struct Lisp_Hash_Table):
13010 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13011 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13012 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13013 * alloc.c (allocate_vectorlike):
13014 Check for overflow in vector size calculations.
13015 * ccl.c (ccl_driver):
13016 Check for overflow when converting EMACS_INT to int.
13017 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13018 need to be updated by these changes.
13019 * fns.c (make_hash_table, maybe_resize_hash_table):
13020 Check for integer overflow with large hash tables.
13021 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13022 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13023 (SXHASH_REDUCE): New macro.
13024 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13025 Use it instead of discarding useful hash info with large hash values.
13026 (sxhash_float): New function.
13027 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13028 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13029 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13030 Rewrite to use FIXNUM_BITS, as this simplifies things.
13031 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13032 Adjust signatures to match updated version of code.
13033 (consing_since_gc): Now EMACS_INT, since a single hash table can
13034 use more than INT_MAX bytes.
13035
13036 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13037
13038 Make it possible to build with GCC-4.6+ -O2 -flto.
13039
13040 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13041
13042 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13043
13044 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13045 Call minibuffer-inactive-mode.
13046
13047 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13048
13049 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13050 Update dependencies.
13051
13052 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13053
13054 * data.c (init_data): Remove code for UTS, this system is not
13055 supported anymore.
13056
13057 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13058
13059 Don't force ./temacs to start in terminal mode.
13060
13061 * frame.c (make_initial_frame): Initialize faces in all cases, not
13062 only when CANNOT_DUMP is defined.
13063 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13064
13065 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13066
13067 * dispnew.c (add_window_display_history): Use const for the string
13068 pointer. Remove declaration, not needed.
13069
13070 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13071
13072 Use 'inline', not 'INLINE'.
13073 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13074 * alloc.c, fontset.c (INLINE): Remove.
13075 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13076 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13077 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13078 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13079 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13080
13081 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13082
13083 Make it possible to run ./temacs.
13084
13085 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13086 syms_of_callproc does the same thing. Remove test for
13087 "initialized", do it in the caller.
13088 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13089
13090 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13091
13092 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13093 (read_minibuf): Use get_minibuffer.
13094 (syms_of_minibuf): Use DEFSYM.
13095 (Qmetadata): New var.
13096 * data.c (Qbuffer): Don't make it static.
13097 (syms_of_data): Use DEFSYM.
13098
13099 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13100
13101 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13102 (CCL_CODE_MIN): New macro.
13103
13104 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13105
13106 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13107
13108 * eval.c (Qdebug): Now static.
13109 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13110 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13111 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13112
13113 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13114
13115 * image.c: Various fixes to ImageMagick code comments.
13116 (Fimagemagick_types): Doc fix.
13117
13118 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13119
13120 Minor fixes prompted by GCC 4.6.0 warnings.
13121
13122 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13123
13124 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13125 (x_clipboard_manager_save_all): Move extern decl to ...
13126 * xterm.h: ... here, so that it can be checked for consistency.
13127
13128 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13129
13130 * xselect.c (x_clipboard_manager_save_frame)
13131 (x_clipboard_manager_save_all): New functions.
13132 (Fx_clipboard_manager_save): Lisp function deleted.
13133
13134 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13135 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13136
13137 * xterm.h: Update prototype.
13138
13139 2011-05-28 William Xu <william.xwl@gmail.com>
13140
13141 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13142 exiting (Bug#8239).
13143
13144 2011-05-28 Jim Meyering <meyering@redhat.com>
13145
13146 Avoid a sign-extension bug in crypto_hash_function.
13147 * fns.c (to_uchar): Define.
13148 (crypto_hash_function): Use it to convert some newly-signed
13149 variables to unsigned, to avoid sign-extension bugs. For example,
13150 without this change, (md5 "truc") would evaluate to
13151 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13152 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13153 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13154
13155 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13156
13157 Integer overflow fixes.
13158
13159 * dbusbind.c: Serial number integer overflow fixes.
13160 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13161 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13162 to hold a serial number that is too large for a fixnum.
13163 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13164 Check for serial numbers out of range. Decode any serial number
13165 that was so large that it became a float. (Bug#8722)
13166
13167 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13168 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13169 Use XFASTINT rather than XUINT when numbers are nonnegative.
13170 (xd_append_arg, Fdbus_method_return_internal):
13171 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13172 arguments, check that Lisp number is nonnegative, rather than
13173 silently wrapping negative numbers around. (Bug#8722)
13174 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13175 (Bug#8722)
13176
13177 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13178
13179 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13180
13181 ccl: Add integer overflow checks.
13182 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13183 (IN_INT_RANGE): New macros.
13184 (ccl_driver): Use them to check for integer overflow when
13185 decoding a CCL program. Many of the new checks are whether XINT (x)
13186 fits in int; it doesn't always, on 64-bit hosts. The new version
13187 doesn't catch all possible integer overflows, but it's an
13188 improvement. (Bug#8719)
13189
13190 * alloc.c (make_event_array): Use XINT, not XUINT.
13191 There's no need for unsigned here.
13192
13193 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13194 This follows up to the 2011-05-06 change that substituted uintptr_t
13195 for EMACS_INT. This case wasn't caught back then.
13196
13197 Rework Fformat to avoid integer overflow issues.
13198 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13199 now (part of C89). Include <verify.h>.
13200 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13201 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13202 (Fformat): Avoid the prepass trying to compute sizes; it was only
13203 approximate and thus did not catch overflow reliably. Instead, walk
13204 through the format just once, formatting and computing sizes as we go,
13205 checking for integer overflow at every step, and allocating a larger
13206 buffer as needed. Keep track separately whether the format is
13207 multibyte. Keep only the most-recently calculated precision, rather
13208 than them all. Record whether each argument has been converted to
13209 string. Use EMACS_INT, not int, for byte and char and arg counts.
13210 Support field widths and precisions larger than INT_MAX. Avoid
13211 sprintf's undefined behavior with conversion specifications such as %#d
13212 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13213 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13214 formatting out-of-range floating point numbers with int
13215 formats. (Bug#8668)
13216
13217 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13218
13219 * data.c: Avoid integer truncation in expressions involving floats.
13220 * data.c: Include <intprops.h>.
13221 (arith_driver): When there's an integer overflow in an expression
13222 involving floating point, convert the integers to floating point
13223 so that the resulting value does not suffer from catastrophic
13224 integer truncation. For example, on a 64-bit host (* 4
13225 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13226 Do not rely on undefined behavior after integer overflow.
13227
13228 merge count_size_as_multibyte, parse_str_to_multibyte
13229 * character.c, character.h (count_size_as_multibyte):
13230 Rename from parse_str_to_multibyte; all uses changed.
13231 Check for integer overflow.
13232 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13233 since it's now a duplicate of the other. This is more of
13234 a character than a buffer op, so better that it's in character.c.
13235 * fns.c, print.c: Adjust to above changes.
13236
13237 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13238
13239 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13240
13241 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13242
13243 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13244 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13245 (x_clipboard_manager_save): Now static.
13246 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13247
13248 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13249 (crypto_hash_function): Now static.
13250 Fix pointer signedness problems. Avoid unnecessary initializations.
13251
13252 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13253
13254 * termhooks.h (Vselection_alist): Make it terminal-local.
13255
13256 * terminal.c (create_terminal): Initialize it.
13257
13258 * xselect.c: Support for clipboard managers.
13259 (Vselection_alist): Move to termhooks.h as terminal-local var.
13260 (LOCAL_SELECTION): New macro.
13261 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13262 (symbol_to_x_atom): Remove gratuitous arg.
13263 (x_handle_selection_request, lisp_data_to_selection_data)
13264 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13265 (x_own_selection, x_get_local_selection, x_convert_selection):
13266 New arg, specifying work frame. Use terminal-local Vselection_alist.
13267 (some_frame_on_display): Delete unused function.
13268 (Fx_own_selection_internal, Fx_get_selection_internal)
13269 (Fx_disown_selection_internal, Fx_selection_owner_p)
13270 (Fx_selection_exists_p): New optional frame arg.
13271 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13272 (x_handle_selection_clear): Don't treat other terminals with the
13273 same keyboard specially. Use the terminal-local Vselection_alist.
13274 (x_clear_frame_selections): Use Frun_hook_with_args.
13275
13276 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13277
13278 * xterm.h: Add support for those atoms.
13279
13280 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13281
13282 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13283 (converted_selections, conversion_fail_tag): New global variables.
13284 (x_selection_request_lisp_error): Free the above.
13285 (x_get_local_selection): Remove unnecessary code.
13286 (x_reply_selection_request): Args changed; handle arbitrary array
13287 of converted selections stored in converted_selections.
13288 Separate the XChangeProperty and SelectionNotify steps.
13289 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13290 (x_convert_selection): New function.
13291 (x_handle_selection_event): Simplify.
13292 (x_get_foreign_selection): Don't ignore incoming requests while
13293 waiting for an answer; this will fail when we implement
13294 SAVE_TARGETS, and seems unnecessary anyway.
13295 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13296 (Vx_sent_selection_functions): Doc fix.
13297
13298 2011-05-26 Leo Liu <sdl.web@gmail.com>
13299
13300 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13301
13302 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13303
13304 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13305
13306 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13307 for fringe update if it has periodic bitmap.
13308 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13309 and fringe_bitmap_periodic_p.
13310
13311 * fringe.c (get_fringe_bitmap_data): New function.
13312 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13313 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13314 row. Mark glyph row for fringe update if periodicity changed.
13315
13316 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13317 for fringe update unless it has periodic bitmap.
13318
13319 2011-05-25 Kenichi Handa <handa@m17n.org>
13320
13321 * xdisp.c (get_next_display_element): Set correct it->face_id for
13322 a static composition.
13323
13324 2011-05-24 Leo Liu <sdl.web@gmail.com>
13325
13326 * deps.mk (fns.o):
13327 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13328
13329 * fns.c (crypto_hash_function, Fsha1): New function.
13330 (Fmd5): Use crypto_hash_function.
13331 (syms_of_fns): Add Ssha1.
13332
13333 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13334
13335 * gnutls.c: Remove unused macros.
13336 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13337 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13338 Remove macros that are defined and never used.
13339 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13340
13341 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13342
13343 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13344 (Fx_get_selection_internal): Minor cleanup.
13345 (Fx_own_selection_internal): Rename arguments for consistency with
13346 select.el.
13347
13348 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13349
13350 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13351
13352 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13353
13354 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13355
13356 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13357
13358 * dispnew.c (scrolling_window): Don't exclude the case that the
13359 last enabled row in the desired matrix touches the bottom boundary.
13360
13361 2011-05-21 Glenn Morris <rgm@gnu.org>
13362
13363 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13364 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13365 and add some more files.
13366
13367 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13368
13369 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13370 report_file_error introduced by the change from 2011-05-07.
13371
13372 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13373
13374 * systime.h (Time): Define only if emacs is defined.
13375 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13376 where the include path doesn't have X11/X.h by default. See
13377 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13378
13379 2011-05-20 Kenichi Handa <handa@m17n.org>
13380
13381 * composite.c (find_automatic_composition): Fix previous change.
13382
13383 2011-05-20 Glenn Morris <rgm@gnu.org>
13384
13385 * lisp.mk: New file, split from Makefile.in.
13386 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13387 (shortlisp): Remove.
13388 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13389
13390 2011-05-19 Glenn Morris <rgm@gnu.org>
13391
13392 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13393 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13394 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13395 (lisp): Set the order to that of loadup.el.
13396 (shortlisp): Make it a copy of $lisp.
13397 (SOME_MACHINE_LISP): Remove.
13398 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13399 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13400
13401 2011-05-18 Kenichi Handa <handa@m17n.org>
13402
13403 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13404 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13405 (find_automatic_composition): Mostly rewrite for efficiency.
13406
13407 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13408
13409 * makefile.w32-in: Update dependencies.
13410
13411 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13412
13413 * menu.c: Include limits.h (fixes the MS-Windows build broken by
13414 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
13415
13416 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
13417
13418 Fix some integer overflow issues, such as string length overflow.
13419
13420 * insdel.c (count_size_as_multibyte): Check for string overflow.
13421
13422 * character.c (lisp_string_width): Check for string overflow.
13423 Use EMACS_INT, not int, for string indexes and lengths; in
13424 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13425 the resulting string length overflows an EMACS_INT; instead,
13426 report a string overflow if no precision given. When checking for
13427 precision exhaustion, use a check that cannot possibly have
13428 integer overflow. (Bug#8675)
13429 * character.h (lisp_string_width): Adjust to new signature.
13430
13431 * alloc.c (string_overflow): New function.
13432 (Fmake_string): Use it. This doesn't change behavior, but saves
13433 a few bytes and will simplify future changes.
13434 * character.c (string_escape_byte8): Likewise.
13435 * lisp.h (string_overflow): New decl.
13436
13437 Fixups, following up to the user-interface timestamp change.
13438 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13439 for UI timestamps, instead of unsigned long.
13440 * msdos.c (mouse_get_pos): Likewise.
13441 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13442 * w32gui.h (Time): Define by including "systime.h" rather than by
13443 declaring it ourselves. (Bug#8664)
13444
13445 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13446 * image.c (clear_image_cache): Likewise.
13447
13448 * term.c (term_mouse_position): Don't assume time_t wraparound.
13449
13450 Be more systematic about user-interface timestamps.
13451 Before, the code sometimes used 'Time', sometimes 'unsigned long',
13452 and sometimes 'EMACS_UINT', to represent these timestamps.
13453 This change causes it to use 'Time' uniformly, as that's what X uses.
13454 This makes the code easier to follow, and makes it easier to catch
13455 integer overflow bugs such as Bug#8664.
13456 * frame.c (Fmouse_position, Fmouse_pixel_position):
13457 Use Time, not unsigned long, for user-interface timestamps.
13458 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13459 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13460 * keyboard.h (last_event_timestamp): Likewise.
13461 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13462 * menu.h (xmenu_show): Likewise.
13463 * term.c (term_mouse_position): Likewise.
13464 * termhooks.h (struct input_event.timestamp): Likewise.
13465 (struct terminal.mouse_position_hook): Likewise.
13466 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13467 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13468 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13469 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13470 what it was before.
13471 * menu.h, termhooks.h: Include "systime.h", for Time.
13472
13473 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13474 Don't assume that the difference between two unsigned long values
13475 can fit into an integer. At this point, we know button_down_time
13476 <= event->timestamp, so the difference must be nonnegative, so
13477 there's no need to cast the result if double-click-time is
13478 nonnegative, as it should be; check that it's nonnegative, just in
13479 case. This bug is triggered when events are more than 2**31 ms
13480 apart (about 25 days). (Bug#8664)
13481
13482 * xselect.c (last_event_timestamp): Remove duplicate decl.
13483 (x_own_selection): Remove needless cast to unsigned long.
13484
13485 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13486 that always fit in int. Use a sentinel instead of a counter, to
13487 avoid a temp and to allay GCC's concerns about possible int overflow.
13488 * frame.h (struct frame): Use int for menu_bar_items_used
13489 instead of EMACS_INT, since it always fits in int.
13490
13491 * menu.c (grow_menu_items): Check for int overflow.
13492
13493 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13494
13495 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13496 Before, the code was not consistent. These values cannot exceed
13497 2**31 - 1 so there's no need to make them unsigned.
13498 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13499 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13500 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13501 as modifiers.
13502 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13503
13504 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13505 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13506 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13507 presumably because the widths might not match.
13508
13509 * window.c (size_window): Avoid needless test at loop start.
13510
13511 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13512
13513 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13514
13515 2011-05-12 Drew Adams <drew.adams@oracle.com>
13516
13517 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13518
13519 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13520
13521 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13522 `width' to `bar_area_x' and `bar_area_width', respectively.
13523 (x_scroll_run): Take account of fringe background extension.
13524
13525 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13526 Rename local vars `left' and `width' to `bar_area_x' and
13527 `bar_area_width', respectively.
13528 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13529 background extension.
13530
13531 2011-05-10 Jim Meyering <meyering@redhat.com>
13532
13533 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13534
13535 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
13536
13537 * image.c (Finit_image_library): Return t for built-in image types,
13538 like pbm and xbm. (Bug#8640)
13539
13540 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13541
13542 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13543
13544 2011-05-07 Eli Zaretskii <eliz@gnu.org>
13545
13546 * w32console.c (Fset_screen_color): Doc fix.
13547 (Fget_screen_color): New function.
13548 (syms_of_ntterm): Defsubr it.
13549
13550 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13551 unlink the temporary file if Fcall_process didn't create it in the
13552 first place.
13553 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13554 child process will be redirected to a file specified with `:file'.
13555 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13556 cue to call_process_cleanup not to close that handle.
13557
13558 2011-05-07 Ben Key <bkey76@gmail.com>
13559
13560 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13561 one of two shell specific rules, either bootstrap-temacs-CMD or
13562 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13563 to the previous implementation of the bootstrap-temacs rule.
13564 The bootstrap-temacs-CMD rule is similar to the previous
13565 implementation of the bootstrap-temacs rule except that it
13566 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13567 variable.
13568
13569 These changes, along with some changes to nt/configure.bat,
13570 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13571 earlier fix to add support for --cflags and --ldflags options
13572 that include quotes so that it works whether make uses cmd or
13573 sh as the shell.
13574
13575 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
13576
13577 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13578 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13579 is a constant.
13580 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13581 a string. Handle both cases.
13582 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13583 (Fdbus_register_method): Use Qinvalid_function.
13584
13585 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13586
13587 * makefile.w32-in: Update dependencies.
13588 (LISP_H): Add inttypes.h and stdin.h.
13589 (PROCESS_H): Add unistd.h.
13590
13591 2011-05-06 Eli Zaretskii <eliz@gnu.org>
13592
13593 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13594 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13595
13596 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13597
13598 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13599
13600 * term.c (vfatal): Remove stray call to va_end.
13601 It's not needed and the C Standard doesn't allow it here anyway.
13602
13603 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13604 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13605
13606 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13607 bytes.
13608
13609 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13610
13611 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13612
13613 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13614
13615 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13616
13617 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13618
13619 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13620 * charset.c (Fdefine_charset_internal): Don't initialize
13621 charset.code_space[15]. The value was garbage, on hosts with
13622 32-bit int (Bug#8600).
13623
13624 * lread.c (read_integer): Be more consistent with string-to-number.
13625 Use string_to_number to do the actual conversion; this avoids
13626 rounding errors and fixes some other screwups. Without this fix,
13627 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13628 (digit_to_number): Move earlier, for benefit of read_integer.
13629 Return -1 if the digit is out of range for the base, -2 if it is
13630 not a digit in any supported base. (Bug#8602)
13631
13632 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13633
13634 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13635 to match comment at start of function. This also removes a
13636 GCC warning about overflow in a 32+64-bit port.
13637
13638 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13639
13640 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13641 Reported by Stefan Monnier in
13642 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13643 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13644 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13645
13646 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13647 (EMACS_UINTPTR): Likewise, with uintptr_t.
13648
13649 * lisp.h: Prefer 64-bit EMACS_INT if available.
13650 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13651 on 32-bit hosts that have 64-bit int, so that they can access
13652 large files.
13653 However, temporarily disable this change unless the temporary
13654 symbol WIDE_EMACS_INT is defined.
13655
13656 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13657
13658 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13659 This removes an assumption that EMACS_INT and long are the same
13660 width as pointers. The assumption is true for Emacs porting targets
13661 now, but we want to make other targets possible.
13662 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13663 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13664 In the rest of the code, change types of integers that hold casted
13665 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13666 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13667 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13668 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13669 No need to cast type when ORing.
13670 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13671 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13672 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13673 assume EMACS_INT is the same width as char *.
13674 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13675 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13676 Remove no-longer-needed casts.
13677 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13678 (xg_tool_bar_help_callback, xg_make_tool_item):
13679 Use EMACS_INTPTR to hold an integer
13680 that will be cast to void *; this can avoid a GCC warning
13681 if EMACS_INT is not the same width as void *.
13682 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13683 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13684 (current_message_1, set_message_1):
13685 Use a local to convert to proper width without a cast.
13686 * xmenu.c (dialog_selection_callback): Likewise.
13687
13688 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13689 Also, don't assume VALBITS / RAND_BITS is less than 5,
13690 and don't rely on undefined behavior when shifting a 1 left into
13691 the sign bit.
13692 * lisp.h (get_random): Change signature to match.
13693
13694 * lread.c (hash_string): Use size_t, not int, for hash computation.
13695 Normally we prefer signed values; but hashing is special, because
13696 it's better to use unsigned division on hash table sizes so that
13697 the remainder is nonnegative. Also, size_t is the natural width
13698 for hashing into memory. The previous code used 'int', which doesn't
13699 retain enough info to hash well into very large tables.
13700 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13701
13702 * dbusbind.c: Don't possibly lose pointer info when converting.
13703 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13704 Use XPNTR rather than XHASH, so that the high-order bits of
13705 the pointer aren't lost when converting through void *.
13706
13707 * eval.c (Fautoload): Don't double-shift a pointer.
13708
13709 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13710
13711 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13712
13713 * gnutls.c (DEF_GNUTLS_FN):
13714 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13715
13716 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13717
13718 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13719 marker. (Bug#8610)
13720
13721 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13722
13723 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13724 New version that can reserve upto 2GB of heap space.
13725
13726 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13727
13728 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13729
13730 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13731
13732 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13733 `gnutls_certificate_set_x509_key_file'.
13734
13735 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13736
13737 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13738 Update dependencies.
13739
13740 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13741
13742 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13743 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13744 Remove unused parameter `fildes'.
13745 * process.c (read_process_output, send_process): Don't pass it.
13746
13747 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13748
13749 Fix previous change: the library cache is defined in w32.c.
13750 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13751 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13752
13753 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13754
13755 Implement dynamic loading of GnuTLS on Windows.
13756
13757 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13758 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13759 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13760 Declare.
13761
13762 * gnutls.c (Qgnutls_dll): Define.
13763 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13764 (gnutls_*): Declare function pointers.
13765 (init_gnutls_functions): New function to initialize function pointers.
13766 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13767 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13768 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13769 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13770 (emacs_gnutls_write, emacs_gnutls_read)
13771 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13772 (Fgnutls_available_p): New function.
13773 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13774 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13775 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13776
13777 * image.c: Include w32.h.
13778 (Vimage_type_cache): Delete.
13779 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13780 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13781 (w32_delayed_load): Move to w32.c.
13782
13783 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13784
13785 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13786 (w32_delayed_load): Move from image.c. When loading a library, record
13787 its filename in the :loaded-from property of the library id.
13788 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13789 Initialize and staticpro them.
13790 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13791
13792 * process.c: Include lisp.h before w32.h, not after.
13793 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13794 instead of gnutls_record_check_pending.
13795
13796 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13797
13798 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13799
13800 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13801 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13802 as passed in.
13803
13804 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13805
13806 * xterm.c (x_set_frame_alpha): Do not set property on anything
13807 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13808
13809 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13810
13811 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13812
13813 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13814
13815 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13816 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13817 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13818 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13819 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13820 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13821 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13822 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13823 (Qgnutls_bootprop_callbacks_verify): Make static.
13824
13825 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13826
13827 * callproc.c: Indentation fixup.
13828
13829 * sysdep.c (wait_for_termination_1): Make static.
13830 (wait_for_termination, interruptible_wait_for_termination):
13831 Move after wait_for_termination_1.
13832
13833 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13834
13835 * sysdep.c (interruptible_wait_for_termination): New function
13836 which is like wait_for_termination, but allows keyboard
13837 interruptions.
13838
13839 * callproc.c (Fcall_process): Add (:file "file") as an option for
13840 the STDOUT buffer.
13841 (Fcall_process_region): Ditto.
13842
13843 2011-04-30 Eli Zaretskii <eliz@gnu.org>
13844
13845 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13846 rather than `XVECTOR (FOO)->size'.
13847
13848 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13849 inttypes.h, as a gnulib replacement is used if it not available in
13850 system headers.
13851
13852 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13853
13854 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13855 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13856 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13857
13858 * coding.c (coding_alloc_by_realloc): Error out if destination
13859 will grow beyond MOST_POSITIVE_FIXNUM.
13860 (decode_coding_emacs_mule): Abort if there isn't enough place in
13861 charbuf for the composition carryover bytes. Reserve an extra
13862 space for up to 2 characters produced in a loop.
13863 (decode_coding_iso_2022): Abort if there isn't enough place in
13864 charbuf for the composition carryover bytes.
13865
13866 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13867
13868 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13869 aborting when %lld or %lll format is passed.
13870 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13871 %llo or %llx format is passed. (Bug#8545)
13872
13873 * window.c (window_scroll_line_based): Use a marker instead of
13874 simple variables to record original value of point. (Bug#7952)
13875
13876 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13877 produced by %s or %c overflows available buffer space. (Bug#8545)
13878
13879 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13880
13881 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
13882 (SIZE_MAX): Move defn after all includes, as they might #define it.
13883
13884 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13885
13886 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13887
13888 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13889
13890 * keyboard.c (Qdelayed_warnings_hook): Define.
13891 (command_loop_1): Run `delayed-warnings-hook'
13892 if Vdelayed_warnings_list is non-nil.
13893 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13894 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13895
13896 2011-04-28 Eli Zaretskii <eliz@gnu.org>
13897
13898 * doprnt.c (doprnt): Don't return value smaller than the buffer
13899 size if the message was truncated. (Bug#8545).
13900
13901 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13902
13903 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13904 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13905
13906 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13907
13908 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13909
13910 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
13911
13912 * makefile.w32-in: Update dependencies.
13913
13914 2011-04-27 Eli Zaretskii <eliz@gnu.org>
13915
13916 Improve `doprnt' and its usage. (Bug#8545)
13917 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13918 `format_end'. Remove support for %l as a conversion specifier.
13919 Don't use xrealloc. Improve diagnostics when the %l size modifier
13920 is used. Update the commentary.
13921
13922 * eval.c (verror): Simplify calculation of size_t.
13923
13924 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13925 messages.
13926
13927 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13928
13929 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13930 change.
13931
13932 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13933
13934 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13935 This makes this file independent of the recent pseudovector change.
13936
13937 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
13938
13939 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13940
13941 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
13942 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
13943 Remove unused local.
13944 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
13945
13946 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
13947 GCC 4.6.0 optimizes based on type-based alias analysis.
13948 For example, if b is of type struct buffer * and v of type struct
13949 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13950 != &v->size, and therefore "v->size = 1; b->size = 2; return
13951 v->size;" must therefore return 1. This assumption is incorrect
13952 for Emacs, since it type-puns struct Lisp_Vector * with many other
13953 types. To fix this problem, this patch adds a new type struct
13954 vectorlike_header that documents the constraints on layout of vectors
13955 and pseudovectors, and helps optimizing compilers not get fooled
13956 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13957 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
13958 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13959 the size member.
13960 (XSETPVECTYPE): Rewrite in terms of new macro.
13961 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13962 This is a bit clearer, and further avoids the possibility of
13963 undesirable aliasing.
13964 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
13965 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
13966 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13967 since Lisp_Subr is a special case (no "next" field).
13968 (ASIZE): Now uses header.size rather than size.
13969 All previous uses of XVECTOR (foo)->size replaced to use this macro,
13970 to avoid the hassle of writing XVECTOR (foo)->header.size.
13971 (struct vectorlike_header): New type.
13972 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13973 object, to help avoid aliasing.
13974 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13975 (SUBRP): Likewise, since Lisp_Subr is a special case.
13976 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13977 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13978 (struct Lisp_Hash_Table): Combine first two members into a single
13979 struct vectorlike_header member. All uses of "size" and "next" members
13980 changed to be "header.size" and "header.next".
13981 * buffer.h (struct buffer): Likewise.
13982 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13983 * frame.h (struct frame): Likewise.
13984 * process.h (struct Lisp_Process): Likewise.
13985 * termhooks.h (struct terminal): Likewise.
13986 * window.c (struct save_window_data, struct saved_window): Likewise.
13987 * window.h (struct window): Likewise.
13988 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13989 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13990 * buffer.c (init_buffer_once): Likewise.
13991 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13992 special case.
13993 * process.c (Fformat_network_address): Use local var for size,
13994 for brevity.
13995
13996 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13997
13998 Make the Lisp reader and string-to-float more consistent (Bug#8525)
13999 * data.c (atof): Remove decl; no longer used or needed.
14000 (digit_to_number): Move to lread.c.
14001 (Fstring_to_number): Use new string_to_number function, to be
14002 consistent with how the Lisp reader treats infinities and NaNs.
14003 Do not assume that floating-point numbers represent EMACS_INT
14004 without losing information; this is not true on most 64-bit hosts.
14005 Avoid double-rounding errors, by insisting on integers when
14006 parsing non-base-10 numbers, as the documentation specifies.
14007 * lisp.h (string_to_number): New decl, replacing ...
14008 (isfloat_string): Remove.
14009 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14010 (read1): Do not accept +. and -. as integers; this
14011 appears to have been a coding error. Similarly, do not accept
14012 strings like +-1e0 as floating point numbers. Do not report
14013 overflow for integer overflows unless the base is not 10 which
14014 means we have no simple and reliable way to continue.
14015 Break out the floating-point parsing into a new
14016 function string_to_number, so that Fstring_to_number parses
14017 floating point numbers consistently with the Lisp reader.
14018 (digit_to_number): Move here from data.c. Make it static inline.
14019 (E_CHAR, EXP_INT): Remove, replacing with ...
14020 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14021 (string_to_number): New function, replacing isfloat_string.
14022 This function checks for valid syntax and produces the resulting
14023 Lisp float number too. Rework it so that string-to-number
14024 no longer mishandles examples like "1.0e+". Use strtoumax,
14025 so that overflow for non-base-10 numbers is reported only when
14026 there's no portable and simple way to convert to floating point.
14027
14028 * textprop.c (set_text_properties_1): Rewrite for clarity,
14029 and to avoid GCC warning about integer overflow.
14030
14031 * intervals.h (struct interval): Use EMACS_INT for members
14032 where EMACS_UINT might cause problems. See
14033 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14034 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14035 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14036 All uses changed.
14037 (offset_intervals): Tell GCC not to worry about length overflow
14038 when negating a negative length.
14039
14040 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14041 (overrun_check_free): Likewise.
14042
14043 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14044 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14045 word size.
14046
14047 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14048 (gnutls_make_error): Rename local to avoid shadowing.
14049 (gnutls_emacs_global_deinit): ifdef out; not used.
14050 (Fgnutls_boot): Use const for pointer to readonly storage.
14051 Comment out unused local. Fix pointer signedness problems.
14052
14053 * lread.c (openp): Don't stuff size_t into an 'int'.
14054 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14055 about possible signed overflow.
14056
14057 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14058 (GDK_KEY_g): Don't define if already defined.
14059 (xg_prepare_tooltip): Avoid pointer signedness problem.
14060 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14061
14062 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14063 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14064
14065 * xfns.c (Fx_window_property): Simplify a bit,
14066 to make a bit faster and to avoid GCC 4.6.0 warning.
14067 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14068
14069 * fns.c (internal_equal): Don't assume size_t fits in int.
14070
14071 * alloc.c (compact_small_strings): Tighten assertion a little.
14072
14073 Replace pEd with more-general pI, and fix some printf arg casts.
14074 * lisp.h (pI): New macro, generalizing old pEd macro to other
14075 conversion specifiers. For example, use "...%"pI"d..." rather
14076 than "...%"pEd"...".
14077 (pEd): Remove. All uses replaced with similar uses of pI.
14078 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14079 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14080 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14081 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14082 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14083 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14084 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14085 64-bit hosts.
14086 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14087 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14088 * print.c (safe_debug_print, print_object): Likewise.
14089 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14090 to int.
14091 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14092 avoiding the 0 flag, which is not portable.
14093 * process.c (Fmake_network_process): Use pI to avoid cast.
14094 * region-cache.c (pp_cache): Likewise.
14095 * xdisp.c (decode_mode_spec): Likewise.
14096 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14097 behavior on 64-bit hosts with printf arg.
14098 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14099 (x_stop_queuing_selection_requests): Likewise.
14100 (x_get_window_property): Don't truncate byte count to an 'int'
14101 when tracing.
14102
14103 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14104 here, since it parses constructs like leading '-' and spaces,
14105 which are not wanted; and it overflows with large numbers.
14106 Instead, simply match F[0-9]+, which is what is wanted anyway.
14107
14108 * alloc.c: Remove unportable assumptions about struct layout.
14109 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14110 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14111 (allocate_vectorlike, make_pure_vector): Use the new macros,
14112 plus offsetof, to remove unportable assumptions about struct layout.
14113 These assumptions hold on all porting targets that I know of, but
14114 they are not guaranteed, they're easy to remove, and removing them
14115 makes further changes easier.
14116
14117 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14118 This doesn't fix a bug but makes the code clearer.
14119 (string_overrun_cookie): Now const. Use initializers that
14120 don't formally overflow signed char, to avoid warnings.
14121 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14122 can cause Emacs to crash when string overrun checking is enabled.
14123 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14124 multiple of sizeof (EMACS_INT); it need not be, if
14125 alignof(EMACS_INT) < sizeof (EMACS_INT).
14126 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14127
14128 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14129
14130 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14131
14132 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14133
14134 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14135 supposed to be handshaking. (Bug#8556)
14136 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14137
14138 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14139
14140 * lisp.h (Qdebug): List symbol.
14141 * eval.c (Qdebug): Restore global linkage.
14142 * keyboard.c (debug-on-event): New variable.
14143 (handle_user_signal): Break into debugger when debug-on-event
14144 matches the current signal symbol.
14145
14146 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14147
14148 * alloc.c (check_sblock, check_string_bytes)
14149 (check_string_free_list): Convert to standard C.
14150
14151 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14152
14153 * w32.c (emacs_gnutls_push): Fix typo.
14154
14155 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14156
14157 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14158 "cast to pointer from integer of different size".
14159
14160 Improve doprnt and its use in verror. (Bug#8545)
14161 * doprnt.c (doprnt): Document the set of format control sequences
14162 supported by the function. Use SAFE_ALLOCA instead of always
14163 using `alloca'.
14164
14165 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14166 is one byte too soon. Don't use xrealloc; instead xfree and
14167 xmalloc anew.
14168
14169 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14170
14171 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14172 callbacks stage.
14173
14174 * gnutls.c: Renamed global_initialized to
14175 gnutls_global_initialized. Added internals for the
14176 :verify-hostname-error, :verify-error, and :verify-flags
14177 parameters of `gnutls-boot' and documented those parameters in the
14178 docstring. Start callback support.
14179 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14180 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14181 on error. Return error code.
14182 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14183 (emacs_gnutls_read): Likewise.
14184 (Fgnutls_boot): Return handshake error code.
14185 (emacs_gnutls_handle_error): New function.
14186 (wsaerror_to_errno): Likewise.
14187
14188 * w32.h (emacs_gnutls_pull): Add prototype.
14189 (emacs_gnutls_push): Likewise.
14190
14191 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14192 (emacs_gnutls_push): Likewise.
14193
14194 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14195
14196 * process.c (wait_reading_process_output): Check if GnuTLS
14197 buffered some data internally if no FDs are set for TLS
14198 connections.
14199
14200 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14201 (LIBS): Link to USER_LIBS.
14202 ($(BLD)/gnutls.$(0)): New target.
14203
14204 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14205
14206 * xdisp.c (handle_single_display_spec): Rename the
14207 display_replaced_before_p argument into display_replaced_p, to
14208 make it consistent with the commentary. Fix typos in the
14209 commentary.
14210
14211 * textprop.c (syms_of_textprop): Remove dead code.
14212 (copy_text_properties): Delete obsolete commentary about an
14213 interface that was deleted long ago. Fix typos in the description
14214 of arguments.
14215
14216 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14217 to changes in oldXMenu/XMenu.h from 2011-04-16.
14218 <menu_help_message, prev_menu_help_message>: Constify.
14219 (IT_menu_make_room): menu->help_text is now `const char **';
14220 adjust.
14221
14222 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14223 to changes in oldXMenu/XMenu.h from 2011-04-16.
14224 (struct XMenu): Declare `help_text' `const char **'.
14225
14226 * xfaces.c <Qunspecified>: Make extern again.
14227
14228 * syntax.c: Include sys/types.h before including regex.h, as
14229 required by POSIX.
14230
14231 * doc.c (get_doc_string): Improve the format passed to `error'.
14232
14233 * doprnt.c (doprnt): Improve commentary.
14234
14235 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14236
14237 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14238 them with etags.
14239
14240 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14241 changes in globals.h immediately force recompilation.
14242 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14243 $(CURDIR)/s/ms-w32.h.
14244 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14245
14246 * character.c (Fchar_direction): Function deleted.
14247 (syms_of_character): Don't defsubr it.
14248 <char-direction-table>: Deleted.
14249
14250 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14251
14252 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14253 * doprnt.c: Include limits.h.
14254 (SIZE_MAX): New macro.
14255 (doprnt): Return a size_t value. 2nd arg is now size_t.
14256 Many local variables are now size_t instead of int or unsigned.
14257 Improve overflow protection. Support `l' modifier for integer
14258 conversions. Support %l conversion. Don't assume an EMACS_INT
14259 argument for integer conversions and for %c.
14260
14261 * lisp.h (doprnt): Restore prototype.
14262
14263 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14264 $(SRC)/character.h.
14265
14266 * Makefile.in (base_obj): Add back doprnt.o.
14267
14268 * deps.mk (doprnt.o): Add back prerequisites.
14269 (callint.o): Depend on character.h.
14270
14271 * eval.c (internal_lisp_condition_case): Include the handler
14272 representation in the error message.
14273 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14274 when breaking from the loop.
14275
14276 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14277
14278 * callint.c (Fcall_interactively): When displaying error message
14279 about invalid control letter, pass the character's codepoint, not
14280 a pointer to its multibyte form. Improve display of the character
14281 in octal and display also its hex code.
14282
14283 * character.c (char_string): Use %x to display the (unsigned)
14284 codepoint of an invalid character, to avoid displaying a bogus
14285 negative value.
14286
14287 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14288 `error', not SYMBOL_NAME itself.
14289
14290 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14291 character arguments to `error'.
14292
14293 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14294 to `error' in error message about FINAL_CHAR argument. Make sure
14295 FINAL_CHAR is a character, and use %c when it is passed as
14296 argument to `error'.
14297
14298 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14299
14300 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14301
14302 * w32.c: Include <time.h>.
14303 (sys_localtime): New function.
14304
14305 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14306
14307 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14308
14309 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14310
14311 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14312
14313 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14314 zombies (Bug#8467).
14315
14316 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14317
14318 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14319 gl_state.e_property when gl_state.object is Qt.
14320
14321 * insdel.c (make_gap_larger): Remove limitation of buffer size
14322 to <= INT_MAX.
14323
14324 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14325
14326 * xdisp.c (lookup_glyphless_char_display)
14327 (produce_glyphless_glyph): Handle cons cell entry in
14328 glyphless-char-display.
14329 (Vglyphless_char_display): Document it.
14330
14331 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14332 glyphless-char-display.
14333
14334 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14335
14336 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14337
14338 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14339
14340 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14341 definition for no-X builds.
14342
14343 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14344
14345 Static checks with GCC 4.6.0 and non-default toolkits.
14346
14347 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14348
14349 * process.c (keyboard_bit_set): Define only if SIGIO.
14350 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14351 (send_process): Repair possible setjmp clobbering.
14352
14353 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14354
14355 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14356
14357 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14358
14359 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14360 Define only if needed.
14361
14362 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14363 by pacifying GCC about it. Maybe it's time to retire it?
14364 * xfaces.c (USG, __TIMEVAL__): Likewise.
14365
14366 * dispextern.h (struct redisplay_interface): Rename param
14367 to avoid shadowing.
14368 * termhooks.h (struct terminal): Likewise.
14369 * xterm.c (xembed_send_message): Likewise.
14370
14371 * insdel.c (make_gap_smaller): Define only if
14372 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14373
14374 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14375 it.
14376
14377 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14378 so that we aren't warned about unused symbols.
14379
14380 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14381
14382 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14383
14384 * xfns.c (x_real_positions): Mark locals as initialized.
14385
14386 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14387
14388 * xterm.c: Fix problems found by static analysis with other toolkits.
14389 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14390 (x_dispatch_event): Declare static if USE_GTK, and
14391 define if USE_GTK || USE_X_TOOLKIT.
14392 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14393 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14394 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14395 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14396
14397 * xmenu.c (menu_help_callback): Pointer type fixes.
14398 Use const pointers when pointing at readonly data. Avoid pointer
14399 signedness clashes.
14400 (FALSE): Remove unused macro.
14401 (update_frame_menubar): Remove unused decl.
14402
14403 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14404
14405 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14406 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14407 (single_menu_item): Rename local to avoid shadowing.
14408
14409 * keyboard.c (make_lispy_event): Remove unused local var.
14410
14411 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14412 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14413
14414 * bitmaps: Change bitmaps from unsigned char back to the X11
14415 compatible char. Avoid the old compiler warnings about
14416 out-of-range initializers by using, for example, '\xab' rather
14417 than 0xab.
14418
14419 * xgselect.c (xgselect_initialize): Check vs interface
14420 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14421
14422 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14423
14424 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14425 to read-only memory.
14426
14427 * fns.c (vector): Remove; this old hack is no longer needed.
14428
14429 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14430 Remove unused var.
14431 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14432
14433 * xrdb.c (x_load_resources): Omit unused local.
14434
14435 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14436 (x_window): Rename locals to avoid shadowing.
14437 (USG): Use the kludged USG macro, to pacify gcc.
14438
14439 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14440 (x_term_init): Remove local to avoid shadowing.
14441
14442 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14443
14444 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14445 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14446
14447 2011-04-16 Eli Zaretskii <eliz@gnu.org>
14448
14449 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14450
14451 Fix regex.c, syntax.c and friends for buffers > 2GB.
14452 * syntax.h (struct gl_state_s): Declare character position members
14453 EMACS_INT.
14454
14455 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14456
14457 * textprop.c (verify_interval_modification, interval_of):
14458 Declare arguments EMACS_INT.
14459
14460 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14461 EMACS_INT.
14462
14463 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14464
14465 * indent.c (Fvertical_motion): Local variable it_start is now
14466 EMACS_INT.
14467
14468 * regex.c (re_match, re_match_2, re_match_2_internal)
14469 (bcmp_translate, regcomp, regexec, print_double_string)
14470 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14471 (re_compile_pattern, re_exec): Declare arguments and local
14472 variables `size_t' and `ssize_t' and return values `regoff_t', as
14473 appropriate.
14474 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14475 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14476 <compile_stack_type>: `size' and `avail' are now `size_t'.
14477
14478 * regex.h <regoff_t>: Use ssize_t, not int.
14479 (re_search, re_search_2, re_match, re_match_2): Arguments that
14480 specify buffer/string position and length are now ssize_t and
14481 size_t. Return type is regoff_t.
14482
14483 2011-04-16 Ben Key <bkey76@gmail.com>
14484
14485 * nsfont.m: Fixed bugs in ns_get_family and
14486 ns_descriptor_to_entity that were caused by using free to
14487 deallocate memory blocks that were allocated by xmalloc (via
14488 xstrdup). This caused Emacs to crash when compiled with
14489 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14490 --enable-checking=xmallocoverrun). xfree is now used to
14491 deallocate these memory blocks.
14492
14493 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14496
14497 emacs_write: Accept and return EMACS_INT for sizes.
14498 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14499 et seq.
14500 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14501 Accept and return EMACS_INT.
14502 (emacs_gnutls_write): Return the number of bytes written on
14503 partial writes.
14504 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14505 (emacs_read, emacs_write): Remove check for negative size, as the
14506 Emacs source code has been audited now.
14507 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14508 (emacs_read, emacs_write): Use it.
14509 * process.c (send_process): Adjust to the new signatures of
14510 emacs_write and emacs_gnutls_write. Do not attempt to store
14511 a byte offset into an 'int'; it might overflow.
14512 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14513
14514 * sound.c: Don't assume sizes fit in 'int'.
14515 (struct sound_device.period_size, alsa_period_size):
14516 Return EMACS_INT, not int.
14517 (struct sound_device.write, vox_write, alsa_write):
14518 Accept EMACS_INT, not int.
14519 (wav_play, au_play): Use EMACS_INT to store sizes and to
14520 record read return values.
14521
14522 2011-04-15 Ben Key <bkey76@gmail.com>
14523
14524 * keyboard.c (Qundefined): Don't declare static since it is used
14525 in nsfns.m.
14526 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14527 static since they are used in nsfont.m.
14528
14529 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14530
14531 * process.c (Qprocessp): Don't declare static.
14532 * lisp.h (Qprocessp): Declare again.
14533
14534 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
14535
14536 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14537
14538 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14539
14540 Improve C-level modularity by making more things 'static'.
14541
14542 Don't publish debugger-only interfaces to other modules.
14543 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14544 (verify_bytepos, count_markers): Move decls to the only modules
14545 that need them.
14546 * region-cache.h (pp_cache): Likewise.
14547 * window.h (check_all_windows): Likewise.
14548 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14549
14550 * sysdep.c (croak): Now static, if
14551 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14552 * syssignal.h (croak): Declare only if not static.
14553
14554 * alloc.c (refill_memory_reserve): Now static if
14555 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14556 * lisp.h (refill_memory_reserve): Declare only if not static.
14557
14558 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14559 Define only if USE_LUCID.
14560
14561 * xrdb.c (x_customization_string, x_rm_string): Now static.
14562
14563 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14564 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14565
14566 * xdisp.c (draw_row_with_mouse_face): Now static.
14567 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14568
14569 * window.h (check_all_windows): Mark externally visible.
14570
14571 * window.c (window_deletion_count): Now static.
14572
14573 * undo.c: Make symbols static if they're not exported.
14574 (last_undo_buffer, last_boundary_position, pending_boundary):
14575 Now static.
14576
14577 * textprop.c (interval_insert_behind_hooks): Now static.
14578 (interval_insert_in_front_hooks): Likewise.
14579
14580 * term.c: Make symbols static if they're not exported.
14581 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14582 (max_frame_lines, tty_set_terminal_modes):
14583 (tty_reset_terminal_modes, tty_turn_off_highlight):
14584 (get_tty_terminal): Now static.
14585 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14586 * termhooks.h (term_mouse_moveto): Do not declare if
14587 HAVE_WINDOW_SYSTEM.
14588 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14589 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14590
14591 * sysdep.c: Make symbols static if they're not exported.
14592 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14593 Now static.
14594 (sigprocmask_set, full_mask): Remove; unused.
14595 (wait_debugging): Mark as visible.
14596 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14597 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14598
14599 * syntax.c (syntax_temp): Define only if !__GNUC__.
14600
14601 * sound.c (current_sound_device, current_sound): Now static.
14602
14603 * search.c (searchbufs, searchbuf_head): Now static.
14604
14605 * scroll.c (scroll_cost): Remove; unused.
14606 * dispextern.h (scroll_cost): Remove decl.
14607
14608 * region-cache.h (pp_cache): Mark as externally visible.
14609
14610 * process.c: Make symbols static if they're not exported.
14611 (process_tick, update_tick, create_process, chan_process):
14612 (Vprocess_alist, proc_buffered_char, datagram_access):
14613 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14614 (deactivate_process): Mark defn as static, as well as decl.
14615 * lisp.h (create_process): Remove decl.
14616 * process.h (chan_process, Vprocess_alist): Remove decls.
14617
14618 * print.c: Make symbols static if they're not exported.
14619 (print_depth, new_backquote_output, being_printed, print_buffer):
14620 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14621 (print_interval, print_number_index, initial_stderr_stream):
14622 Now static.
14623 * lisp.h (Fprinc): Remove decl.
14624 (debug_output_compilation_hack): Mark as externally visible.
14625
14626 * sysdep.c (croak): Move decl from here to syssignal.h.
14627 * syssignal.h (croak): Put it here, so the API can be checked when
14628 'croak' is called from dissociate_if_controlling_tty.
14629
14630 * minibuf.c: Make symbols static if they're not exported.
14631 (minibuf_save_list, choose_minibuf_frame): Now static.
14632 * lisp.h (choose_minibuf_frame): Remove decl.
14633
14634 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14635
14636 * lread.c: Make symbols static if they're not exported.
14637 (read_objects, initial_obarray, oblookup_last_bucket_number):
14638 Now static.
14639 (make_symbol): Remove; unused.
14640 * lisp.h (initial_obarray, make_symbol): Remove decls.
14641
14642 * keyboard.c: Make symbols static if they're not exported.
14643 (single_kboard, recent_keys_index, total_keys, recent_keys):
14644 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14645 (this_single_command_key_start, echoing, last_auto_save):
14646 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14647 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14648 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14649 (Vlispy_mouse_stem, double_click_count):
14650 Now static.
14651 (force_auto_save_soon): Define only if SIGDANGER.
14652 (ignore_mouse_drag_p): Now static if
14653 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14654 (print_help): Remove; unused.
14655 (stop_character, last_timer_event): Mark as externally visible.
14656 * keyboard.h (ignore_mouse_drag_p): Declare only if
14657 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14658 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14659 * lisp.h (echoing): Remove decl.
14660 (force_auto_save_soon): Declare only if SIGDANGER.
14661 * xdisp.c (redisplay_window): Simplify code, to make it more
14662 obvious that ignore_mouse_drag_p is not accessed if !defined
14663 USE_GTK && !defined HAVE_NS.
14664
14665 * intervals.c: Make symbols static if they're not exported.
14666 (merge_properties_sticky, merge_interval_right, delete_interval):
14667 Now static.
14668 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14669
14670 * insdel.c: Make symbols static if they're not exported.
14671 However, leave prepare_to_modify_buffer alone. It's never
14672 called from outside this function, but that appears to be a bug.
14673 (combine_after_change_list, combine_after_change_buffer):
14674 (adjust_after_replace, signal_before_change): Now static.
14675 (adjust_after_replace_noundo): Remove; unused.
14676 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14677 (signal_before_change): Remove decls.
14678
14679 * indent.c (val_compute_motion, val_vmotion): Now static.
14680
14681 * image.c: Make symbols static if they're not exported.
14682 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14683 if USE_GTK.
14684 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14685 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14686
14687 * fringe.c (standard_bitmaps): Now static.
14688 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14689
14690 * frame.c: Make symbols static if they're not exported.
14691 (x_report_frame_params, make_terminal_frame): Now static.
14692 (get_frame_param): Now static, unless HAVE_NS.
14693 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14694 (x_get_resource_string): Remove; not used.
14695 * frame.h (make_terminal_frame, x_report_frame_params):
14696 (x_get_resource_string); Remove decls.
14697 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14698 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14699
14700 * font.c, fontset.c: Make symbols static if they're not exported.
14701 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14702 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14703 * font.c (font_close_object): Now static.
14704 * font.h (font_close_object): Remove.
14705 * fontset.c (FONTSET_OBJLIST): Remove.
14706 (free_realized_fontset) #if-0 the body, which does nothing.
14707 (face_suitable_for_char_p): #if-0, as it's never called.
14708 * fontset.h (face_suitable_for_char_p): Remove decl.
14709 * xfaces.c (face_at_string_position):
14710 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14711 since 0 is always ASCII.
14712
14713 * fns.c (weak_hash_tables): Now static.
14714
14715 * fileio.c: Make symbols static if they're not exported.
14716 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14717 (Vwrite_region_annotation_buffers): Now static.
14718
14719 * eval.c: Make symbols static if they're not exported.
14720 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14721 * lisp.h (backtrace_list): Remove decl.
14722
14723 * emacs.c: Make symbols static if they're not exported.
14724 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14725 (fatal_error_code, fatal_error_signal_hook, standard_args):
14726 Now static.
14727 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14728 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14729 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14730 * lisp.h (fatal_error_signal_hook): Remove decl.
14731 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14732
14733 * editfns.c: Move a (normally-unused) function to its only use.
14734 * editfns.c, lisp.h (get_operating_system_release): Remove.
14735 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14736 worth the hassle of breaking this out.
14737
14738 * xterm.c: Make symbols static if they're not exported.
14739 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14740 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14741 (x_destroy_window, x_delete_display):
14742 Now static.
14743 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14744 (x_mouse_leave): Remove; unused.
14745 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14746 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14747 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14748 Remove decls.
14749 (x_mouse_leave): Declare only if WINDOWSNT.
14750 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14751 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14752 USE_X_TOOLKIT.
14753
14754 * ftxfont.c: Make symbols static if they're not exported.
14755 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14756 HAVE_FREETYPE.
14757 * font.h (ftxfont_driver): Likewise.
14758
14759 * xfns.c: Make symbols static if they're not exported.
14760 (x_last_font_name, x_display_info_for_name):
14761 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14762 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14763 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14764 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14765 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14766 (last_show_tip_args): Now static.
14767 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14768 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14769 (x_screen_planes): Remove; unused.
14770 * dispextern.h (x_screen_planes): Remove decl.
14771
14772 * dispnew.c: Make symbols static if they're not exported.
14773 * dispextern.h (redraw_garbaged_frames, scrolling):
14774 (increment_row_positions): Remove.
14775 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14776 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14777 Now static.
14778 (redraw_garbaged_frames): Remove; unused.
14779
14780 * xfaces.c: Make symbols static if they're not exported.
14781 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14782 Remove decls.
14783 * xterm.h (defined_color): Remove decls.
14784 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14785 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14786 (menu_face_changed_default, defined_color, free_realized_face):
14787 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14788 (ascii_face_of_lisp_face): Remove; unused.
14789
14790 * xdisp.c: Make symbols static if they're not exported.
14791 * dispextern.h (scratch_glyph_row, window_box_edges):
14792 (glyph_to_pixel_coords, set_cursor_from_row):
14793 (get_next_display_element, set_iterator_to_next):
14794 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14795 (show_mouse_face): Remove decls
14796 * frame.h (message_buf_print): Likewise.
14797 * lisp.h (pop_message, set_message, check_point_in_composition):
14798 Likewise.
14799 * xterm.h (set_vertical_scroll_bar): Likewise.
14800 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14801 (message_buf_print, scratch_glyph_row, displayed_buffer):
14802 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14803 (get_next_display_element, show_mouse_face, window_box_edges):
14804 (frame_to_window_pixel_xy, check_point_in_composition):
14805 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14806 (glyph_to_pixel_coords): Remove; unused.
14807
14808 * dired.c (file_name_completion): Now static.
14809
14810 * dbusbind.c (xd_in_read_queued_messages): Now static.
14811
14812 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14813 * data.c (circular_list_error): Remove.
14814
14815 * commands.h (last_point_position, last_point_position_buffer):
14816 (last_point_position_window): Remove decls.
14817 * keyboard.c: Make these variables static.
14818
14819 * coding.h (coding, code_convert_region, encode_coding_gap):
14820 Remove decls.
14821 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14822 (iso_code_class, detect_coding, code_convert_region): Now static.
14823 (encode_coding_gap): Remove; unused.
14824
14825 * chartab.c (chartab_chars, chartab_bits): Now static.
14826
14827 * charset.h (charset_iso_8859_1): Remove decl.
14828 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14829 Now static.
14830
14831 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14832 * ccl.c (Vccl_program_table): Now static.
14833 (check_ccl_update): Remove; unused.
14834
14835 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14836 * category.h: ... from here.
14837 * category.c (check_category_table, set_category_set): Now static.
14838
14839 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14840 * lisp.h: Remove these decls.
14841
14842 * buffer.c (buffer_count): Remove unused var.
14843
14844 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14845 so that it's not optimized away.
14846 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14847 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14848 exported only to the debugger.
14849
14850 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
14851 * atimer.h (run_all_atimers): Remove; not exported.
14852
14853 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14854 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14855 was inaccessible from Lisp.
14856 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14857 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14858
14859 alloc.c: Import and export fewer symbols, and remove unused items.
14860 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14861 is defined.
14862 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14863 it's not optimized away by whole-program optimization.
14864 (message_enable_multibyte, free_misc): Remove.
14865 (catchlist, handlerlist, mark_backtrace):
14866 Declare only if BYTE_MARK_STACK.
14867 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14868 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14869 (message_enable_multibyte): Remove decl.
14870 (free_misc, interval_free_list, float_block, float_block_index):
14871 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14872 (cons_free_list, last_marked_index):
14873 Now static.
14874 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14875 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14876 (mark_backtrace): Define only if BYTE_MARK_STACK.
14877 * xdisp.c (message_enable_multibyte): Now static.
14878
14879 Declare Lisp_Object Q* variables to be 'static' if not exported.
14880 This makes it easier for human readers (and static analyzers)
14881 to see whether these variables are used from other modules.
14882 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14883 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14884 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14885 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14886 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14887 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14888 * xmenu.c, xselect.c:
14889 Declare Q* vars static if they are not used in other modules.
14890 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14891 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14892 Remove decls of unexported vars.
14893 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14894
14895 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14896
14897 Make Emacs functions such as Fatom 'static' by default.
14898 This makes it easier for human readers (and static analyzers)
14899 to see whether these functions can be called from other modules.
14900 DEFUN now defines a static function. To make the function external
14901 so that it can be used in other C modules, use the new macro DEFUE.
14902 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14903 (Finit_image_library):
14904 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14905 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14906 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14907 Remove decls, since these functions are now static.
14908 (Funintern, Fget_internal_run_time): New decls, since these functions
14909 were already external.
14910
14911 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14912 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14913 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14914 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14915 * keyboard.c, keymap.c, lread.c:
14916 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14917 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14918 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14919 Mark functions with DEFUE instead of DEFUN,
14920 if they are used in other modules.
14921 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14922 decls for now-static functions.
14923 * buffer.h (Fdelete_overlay): Remove decl.
14924 * callproc.c (Fgetenv_internal): Mark as internal.
14925 * composite.c (Fremove_list_of_text_properties): Remove decl.
14926 (Fcomposition_get_gstring): New forward static decl.
14927 * composite.h (Fcomposite_get_gstring): Remove decl.
14928 * dired.c (Ffile_attributes): New forward static decl.
14929 * doc.c (Fdocumntation_property): New forward static decl.
14930 * eval.c (Ffetch_bytecode): New forward static decl.
14931 (Funintern): Remove extern decl; now in .h file where it belongs.
14932 * fileio.c (Fmake_symbolic_link): New forward static decl.
14933 * image.c (Finit_image_library): New forward static decl.
14934 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14935 * intervals.h (Fprevious_property_change):
14936 (Fremove_list_of_text_properties): Remove decls.
14937 * keyboard.c (Fthis_command_keys): Remove decl.
14938 (Fcommand_execute): New forward static decl.
14939 * keymap.c (Flookup_key): New forward static decl.
14940 (Fcopy_keymap): Now static.
14941 * keymap.h (Flookup_key): Remove decl.
14942 * process.c (Fget_process): New forward static decl.
14943 (Fprocess_datagram_address): Mark as internal.
14944 * syntax.c (Fsyntax_table_p): New forward static decl.
14945 (skip_chars): Remove duplicate decl.
14946 * textprop.c (Fprevious_property_change): New forward static decl.
14947 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14948 Now internal.
14949 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14950 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14951
14952 * editfns.c (Fformat): Remove unreachable code.
14953
14954 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14955
14956 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14957 change. (Bug#8496)
14958
14959 2011-04-13 Eli Zaretskii <eliz@gnu.org>
14960
14961 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14962 when at ZV. (Bug#8487)
14963
14964 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14965
14966 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14967 (Bug#8437)
14968 * keyboard.c (parse_tool_bar_item): Likewise.
14969 * sound.c (sound_cleanup, alsa_close): Likewise.
14970 * termcap.c (tgetent): Likewise.
14971 * xfns.c (x_default_font_parameter): Likewise.
14972 * xsettings.c (read_and_apply_settings): Likewise.
14973
14974 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14975 (overrun_check_free): Protoize.
14976
14977 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14978
14979 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14980 since callers should never pass a negative size.
14981 Change the signature to match that of plain 'read' and 'write'; see
14982 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14983 * lisp.h: Update prototypes of emacs_write and emacs_read.
14984
14985 2011-04-11 Eli Zaretskii <eliz@gnu.org>
14986
14987 * xdisp.c (redisplay_window): Don't try to determine the character
14988 position of the scroll margin if the window start point w->startp
14989 is outside the buffer's accessible region. (Bug#8468)
14990
14991 2011-04-10 Eli Zaretskii <eliz@gnu.org>
14992
14993 Fix write-region and its subroutines for buffers > 2GB.
14994 * fileio.c (a_write, e_write): Modify declaration of arguments and
14995 local variables to support buffers larger than 2GB.
14996 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14997
14998 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14999 argument, local variables, and return value.
15000
15001 * lisp.h: Update prototypes of emacs_write and emacs_read.
15002
15003 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15004
15005 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15006
15007 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15008
15009 Fix more problems found by GCC 4.6.0's static checks.
15010
15011 * xdisp.c (vmessage): Use a better test for character truncation.
15012
15013 * charset.c (load_charset_map): <, not <=, for optimization,
15014 and to avoid potential problems with integer overflow.
15015 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15016 * casetab.c (set_identity, shuffle): Likewise.
15017 * editfns.c (Fformat): Likewise.
15018 * syntax.c (skip_chars): Likewise.
15019
15020 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15021 This also lets GCC 4.6.0 generate slightly better loop code.
15022
15023 * callint.c (Fcall_interactively): <, not <=, for optimization.
15024 (Fcall_interactively): Count the number of arguments produced,
15025 not the number of arguments given. This is simpler and lets GCC
15026 4.6.0 generate slightly better code.
15027
15028 * ftfont.c: Distingish more carefully between FcChar8 and char.
15029 The previous code passed unsigned char * to a functions like
15030 strlen and xstrcasecmp that expect char *, which does not
15031 conform to the C standard.
15032 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15033 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15034 char * when the C standard requires it.
15035
15036 * keyboard.c (read_char): Remove unused var.
15037
15038 * eval.c: Port to Windows vsnprintf (Bug#8435).
15039 Include <limits.h>.
15040 (SIZE_MAX): Define if the headers do not.
15041 (verror): Do not give up if vsnprintf returns a negative count.
15042 Instead, grow the buffer. This ports to Windows vsnprintf, which
15043 does not conform to C99. Problem reported by Eli Zaretskii.
15044 Also, simplify the allocation scheme, by avoiding the need for
15045 calling realloc, and removing the ALLOCATED variable.
15046
15047 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15048
15049 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15050 But keep the doprint source code for now, as we might revamp it
15051 and use it again (Bug#8435).
15052 * lisp.h (doprnt): Remove.
15053 * Makefile.in (base_obj): Remove doprnt.o.
15054 * deps.mk (doprnt.o): Remove.
15055
15056 error: Print 32- and 64-bit integers portably (Bug#8435).
15057 Without this change, on typical 64-bit hosts error ("...%d...", N)
15058 was used to print both 32- and 64-bit integers N, which relied on
15059 undefined behavior.
15060 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15061 * lisp.h (error, verror): Mark as printf-like functions.
15062 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15063 Report overflow in size calculations when allocating printf buffer.
15064 Do not truncate output string at its first null byte.
15065 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15066 Truncate the output at a character boundary, since vsnprintf does not
15067 do that.
15068 * charset.c (check_iso_charset_parameter): Convert internal
15069 character to string before calling 'error', since %c now has the
15070 printf meaning.
15071 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15072 overflow when computing char to be passed to 'error'. Do not
15073 pass Lisp_Object to 'error'; pass the integer instead.
15074 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15075 formatted with plain %d.
15076
15077 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15078
15079 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15080
15081 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15082
15083 * xterm.c (x_catch_errors): Remove duplicate declaration.
15084
15085 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15086
15087 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15088
15089 2011-04-10 Jim Meyering <meyering@redhat.com>
15090
15091 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15092 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15093 return ssize_t not "int", and use size_t as the buffer length.
15094 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15095 * gnutls.h: Update declarations.
15096 * process.c (read_process_output): Use ssize_t, to match.
15097 (send_process): Likewise.
15098
15099 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15100
15101 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15102
15103 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15104
15105 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15106 Use unsigned char, to match FcChar8 type definition.
15107
15108 * xterm.c (handle_one_xevent):
15109 * xmenu.c (create_and_show_popup_menu):
15110 * xselect.c (x_decline_selection_request)
15111 (x_reply_selection_request): Avoid type-punned deref of X events.
15112
15113 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15114
15115 Fix some uses of `int' instead of EMACS_INT.
15116 * search.c (string_match_1, fast_string_match)
15117 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15118 (scan_buffer, find_next_newline_no_quit)
15119 (find_before_next_newline, search_command, Freplace_match)
15120 (Fmatch_data): Make some `int' variables be EMACS_INT.
15121
15122 * xdisp.c (display_count_lines): 3rd argument and return value now
15123 EMACS_INT. All callers changed.
15124 (pint2hrstr): Last argument is now EMACS_INT.
15125
15126 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15127 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15128 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15129 (decode_coding_utf_16, decode_coding_emacs_mule)
15130 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15131 (decode_coding_ccl, decode_coding_charset)
15132 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15133 (decode_coding_iso_2022, decode_coding_emacs_mule)
15134 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15135 <char_offset, last_offset>: Declare EMACS_INT.
15136 (encode_coding_utf_8, encode_coding_utf_16)
15137 (encode_coding_emacs_mule, encode_invocation_designation)
15138 (encode_designation_at_bol, encode_coding_iso_2022)
15139 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15140 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15141 Declare EMACS_INT.
15142 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15143 (encode_invocation_designation): Last argument P_NCHARS is now
15144 EMACS_INT.
15145 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15146 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15147
15148 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15149 All users changed.
15150
15151 * ccl.c (Fccl_execute_on_string): Declare some variables
15152 EMACS_INT.
15153
15154 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15155
15156 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15157
15158 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15159
15160 * process.c (Fformat_network_address): Doc fix.
15161
15162 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15163
15164 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15165
15166 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15167
15168 * keyboard.c (read_char): Call Lisp function help-form-show,
15169 instead of using internal_with_output_to_temp_buffer.
15170 (Qhelp_form_show): New var.
15171 (syms_of_keyboard): Use DEFSYM macro.
15172
15173 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15174
15175 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15176
15177 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15178
15179 * process.c (Flist_processes): Remove to Lisp.
15180 (list_processes_1): Delete.
15181
15182 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15183
15184 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15185
15186 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15187
15188 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15189
15190 Fix more problems found by GCC 4.6.0's static checks.
15191
15192 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15193
15194 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15195
15196 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15197
15198 * xdisp.c (vmessage): Mark as a printf-like function.
15199
15200 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15201
15202 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15203
15204 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15205 printf-like functions.
15206 (tiff_load): Add casts to remove these marks before passing them
15207 to system-supplied API.
15208
15209 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15210
15211 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15212 This avoids several warnings with gcc -Wstrict-overflow.
15213 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15214 directly, rather than having caller test rule sign. This avoids
15215 some unnecessary tests.
15216 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15217 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15218 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15219
15220 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15221 (xfont_open): Avoid unnecessary tests.
15222
15223 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15224
15225 * composite.h, composite.c (composition_gstring_put_cache):
15226 Use EMACS_INT, not int, for length.
15227
15228 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15229 breaking out part of COMPOSITION_DECODE_RULE.
15230 (COMPOSITION_DECODE_RULE): Use it.
15231 * composite.c (get_composition_id): Remove unused local vars,
15232 by using the new macro.
15233
15234 * textprop.c (set_text_properties_1): Change while to do-while,
15235 since the condition is always true at first.
15236
15237 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15238 (interval_deletion_adjustment): Return unsigned value.
15239 All uses changed.
15240
15241 * process.c (list_processes_1, create_pty, read_process_output):
15242 (exec_sentinel): Remove vars that were set but not used.
15243 (create_pty): Remove unnecessary "volatile"s.
15244 (Fnetwork_interface_info): Avoid possibility of int overflow.
15245 (read_process_output): Do adaptive read buffering even if carryover.
15246 (read_process_output): Simplify nbytes computation if buffered.
15247
15248 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15249
15250 * syntax.c (scan_words): Remove var that was set but not used.
15251 (update_syntax_table): Use unsigned instead of int.
15252
15253 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15254 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15255 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15256
15257 * print.c (print_error_message): Avoid int overflow.
15258
15259 * font.c (font_list_entities): Redo for clarity,
15260 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15261
15262 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15263 (font_score): Avoid potential overflow in diff calculation.
15264
15265 * fns.c (substring_both): Remove var that is set but not used.
15266 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15267
15268 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15269
15270 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15271 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15272 can always succeed if overflow has undefined behavior.
15273
15274 * search.c (boyer_moore, wordify): Remove vars set but not used.
15275 (wordify): Omit three unnecessary tests.
15276
15277 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15278 All callers changed. This avoids the need for an unused var.
15279
15280 * casefiddle.c (casify_region): Remove var that is set but not used.
15281
15282 * dired.c (file_name_completion): Remove var that is set but not used.
15283
15284 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15285
15286 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15287 (Finsert_file_contents): Remove unnecessary code checking fd.
15288
15289 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15290 Check for integer overflow on size calculations.
15291
15292 * buffer.c (Fprevious_overlay_change): Remove var that is set
15293 but not used.
15294
15295 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15296 Remove vars that are set but not used.
15297 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15298 (timer_check_2): Mark vars as initialized.
15299
15300 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15301
15302 * image.c (lookup_image): Remove var that is set but not used.
15303 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15304
15305 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15306 that are set but not used.
15307
15308 * xfns.c (make_invisible_cursor): Don't return garbage
15309 if XCreateBitmapFromData fails (Bug#8410).
15310
15311 * xselect.c (x_get_local_selection, x_handle_property_notify):
15312 Remove vars that are set but not used.
15313
15314 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15315 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15316
15317 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15318 Remove var that is set but not used.
15319 (scroll_bar_windows_size): Now size_t, not int.
15320 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15321 Check for overflow.
15322
15323 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15324 (map_tty_color) [!defined MSDOS]: Likewise.
15325
15326 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15327
15328 * coding.c: Remove vars that are set but not used.
15329 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15330 All callers changed.
15331 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15332 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15333 (decode_coding_charset): Remove vars that are set but not used.
15334
15335 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15336 that is set but not used.
15337
15338 * print.c (print_object): Remove var that is set but not used.
15339
15340 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15341 The gnulib version avoids calling malloc in the usual case,
15342 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15343 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15344 * filelock.c (current_lock_owner): Likewise.
15345 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15346 * sysdep.c: Include allocator.h, careadlinkat.h.
15347 (emacs_no_realloc_allocator): New static constant.
15348 (emacs_readlink): New function.
15349 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15350 ../lib/careadlinkat.h.
15351
15352 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15353
15354 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15355 first non-nil return value).
15356
15357 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15358
15359 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15360 if not defined (Bug#8403).
15361
15362 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15363
15364 * xdisp.c (display_count_lines): Remove parameter `start',
15365 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15366 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15367 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15368 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15369 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15370 and thereabouts. All callers changed.
15371 (get_per_char_metric): Remove parameter `f', unused since
15372 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15373
15374 2011-04-02 Jim Meyering <meyering@redhat.com>
15375
15376 do not dereference NULL upon failed strdup
15377 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15378 (ns_get_family): Likewise.
15379
15380 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15381
15382 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15383
15384 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15385
15386 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15387 later (Bug#8403).
15388
15389 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15390
15391 Add lexical binding.
15392
15393 * window.c (Ftemp_output_buffer_show): New fun.
15394 (Fsave_window_excursion):
15395 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15396
15397 * lread.c (lisp_file_lexically_bound_p): New function.
15398 (Fload): Bind Qlexical_binding.
15399 (readevalloop): Remove `evalfun' arg.
15400 Bind Qinternal_interpreter_environment.
15401 (Feval_buffer): Bind Qlexical_binding.
15402 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15403 Mark as dynamic.
15404 (syms_of_lread): Declare `lexical-binding'.
15405
15406 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15407
15408 * keyboard.c (eval_dyn): New fun.
15409 (menu_item_eval_property): Use it.
15410
15411 * image.c (parse_image_spec): Use Ffunctionp.
15412
15413 * fns.c (concat, mapcar1): Accept byte-code-functions.
15414
15415 * eval.c (Fsetq): Handle lexical vars.
15416 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15417 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15418 (FletX, Flet): Obey lexical binding.
15419 (Fcommandp): Handle closures.
15420 (Feval): New `lexical' arg.
15421 (eval_sub): New function extracted from Feval. Use it almost
15422 everywhere where Feval was used. Look up vars in lexical env.
15423 Handle closures.
15424 (Ffunctionp): Move from subr.el.
15425 (Ffuncall): Handle closures.
15426 (apply_lambda): Remove `eval_flags'.
15427 (funcall_lambda): Handle closures and new byte-code-functions.
15428 (Fspecial_variable_p): New function.
15429 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15430 but without exporting it to Lisp.
15431
15432 * doc.c (Fdocumentation, store_function_docstring):
15433 * data.c (Finteractive_form): Handle closures.
15434
15435 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15436 interactive spec.
15437
15438 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15439 New byte-codes.
15440 (exec_byte_code): New function extracted from Fbyte_code to handle new
15441 calling convention for byte-code-functions. Add new byte-codes.
15442
15443 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15444
15445 * alloc.c (Fmake_symbol): Init new `declared_special' field.
15446
15447 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15448
15449 * xdisp.c (redisplay_internal): Fix prototype.
15450
15451 2011-03-31 Eli Zaretskii <eliz@gnu.org>
15452
15453 * xdisp.c (SCROLL_LIMIT): New macro.
15454 (try_scrolling): Use it when setting scroll_limit.
15455 Limit scrolling to 100 screen lines.
15456 (redisplay_window): Even when falling back on "recentering",
15457 position point in the window according to scroll-conservatively,
15458 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15459
15460 (try_scrolling): When point is above the window, allow searching
15461 as far as scroll_max, or one screenful, to compute vertical
15462 distance from PT to the scroll margin position. This prevents
15463 try_scrolling from unnecessarily failing when
15464 scroll-conservatively is set to a value slightly larger than the
15465 window height. Clean up the case of PT below the margin at bottom
15466 of window: scroll_max can no longer be INT_MAX. When aggressive
15467 scrolling is in use, don't let point enter the opposite scroll
15468 margin as result of the scroll.
15469 (syms_of_xdisp) <scroll-conservatively>: Document the
15470 threshold of 100 lines for never-recentering scrolling.
15471
15472 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
15473
15474 * dispextern.h (move_it_by_lines):
15475 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15476 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15477 (message_log_check_duplicate): Remove parameters `prev_bol' and
15478 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15479 (redisplay_internal): Remove parameter `preserve_echo_area',
15480 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15481
15482 * indent.c (Fvertical_motion):
15483 * window.c (window_scroll_pixel_based, Frecenter):
15484 Don't pass `need_y_p' to `move_it_by_lines'.
15485
15486 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15487
15488 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15489 steal a few bits to be more compact.
15490 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15491 Remove unneeded casts.
15492
15493 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15494
15495 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15496
15497 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15498 binding" message (bug#7967).
15499
15500 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15501
15502 Fix more problems found by GCC 4.6.0's static checks.
15503
15504 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15505 Remove unused local var.
15506
15507 * editfns.c (Fmessage_box): Remove unused local var.
15508
15509 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15510 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15511 Omit unused local vars.
15512 * window.c (shrink_windows): Omit unused local var.
15513 * menu.c (digest_single_submenu): Omit unused local var.
15514 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15515 Omit unused local var.
15516
15517 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15518 Don't assume string length fits in int.
15519 (keyremap_step, read_key_sequence): Use size_t for sizes.
15520 (read_key_sequence): Don't check last_real_key_start redundantly.
15521
15522 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15523 instead of alloca (Bug#8344).
15524
15525 * eval.c (Fbacktrace): Don't assume nargs fits in int.
15526 (Fbacktrace_frame): Don't assume nframes fits in int.
15527
15528 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15529
15530 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15531 concerns.
15532
15533 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15534
15535 * cm.c (calccost): Turn while-do into do-while, for clarity.
15536
15537 * keyboard.c (syms_of_keyboard): Use the same style as later
15538 in this function when indexing through an array. This also
15539 works around GCC bug 48267.
15540
15541 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15542
15543 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15544
15545 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15546 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15547
15548 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15549 This avoids undefined behavior on integer overflow, and is a bit
15550 more convenient anyway since it is compared to a size_t variable.
15551
15552 Variadic C functions now count arguments with size_t, not int.
15553 This avoids an unnecessary limitation on 64-bit machines, which
15554 caused (substring ...) to crash on large vectors (Bug#8344).
15555 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15556 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15557 All variadic functions and their callers changed accordingly.
15558 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15559 * data.c (arith_driver, float_arith_driver): Likewise.
15560 * editfns.c (general_insert_function): Likewise.
15561 * eval.c (struct backtrace.nargs, interactive_p)
15562 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15563 (funcall_lambda, mark_backtrace): Likewise.
15564 * fns.c (concat): Likewise.
15565 * frame.c (x_set_frame_parameters): Likewise.
15566 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15567 0 if not found, not -1. All callers changed.
15568
15569 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15570 (stack_copy_size): Now size_t, not int.
15571 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15572
15573 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15574
15575 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15576 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15577 All callers changed.
15578
15579 * lisp.h (multibyte_char_to_unibyte):
15580 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15581 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15582 * character.h (CHAR_TO_BYTE8):
15583 * cmds.c (internal_self_insert):
15584 * editfns.c (general_insert_function):
15585 * keymap.c (push_key_description):
15586 * search.c (Freplace_match):
15587 * xdisp.c (message_dolog, set_message_1): All callers changed.
15588
15589 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15590
15591 * keyboard.c (safe_run_hook_funcall): New function.
15592 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15593 don't set the hook to nil, but remove the offending function instead.
15594 (Qcommand_hook_internal): Remove, unused.
15595 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15596 Vcommand_hook_internal.
15597
15598 * eval.c (enum run_hooks_condition): Remove.
15599 (funcall_nil, funcall_not): New functions.
15600 (run_hook_with_args): Call each function through a `funcall' argument.
15601 Remove `cond' argument, now redundant.
15602 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15603 (Frun_hook_with_args_until_failure): Adjust accordingly.
15604 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15605
15606 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15607
15608 * dispextern.h (string_buffer_position): Remove declaration.
15609
15610 * print.c (strout): Remove parameter `multibyte', unused since
15611 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15612
15613 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15614 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15615 All callers changed.
15616
15617 * w32.c (_wsa_errlist): Use braces for struct initializers.
15618
15619 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15620 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15621 All callers changed.
15622 (string_buffer_position): Likewise. Also, make static (it's never
15623 used outside xdisp.c).
15624 (cursor_row_p): Remove parameter `w', unused since
15625 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15626 (decode_mode_spec): Remove parameter `precision', introduced during
15627 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15628 All callers changed.
15629
15630 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15631
15632 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15633
15634 2011-03-27 Anders Lindgren <andlind@gmail.com>
15635
15636 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15637 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15638 (ns_update_auto_hide_menu_bar): New functions.
15639 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15640 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15641 ns_constrain_all_frames.
15642 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15643 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15644
15645 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15646
15647 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15648
15649 2011-03-27 Glenn Morris <rgm@gnu.org>
15650
15651 * syssignal.h: Replace RETSIGTYPE with void.
15652 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15653 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15654 Replace SIGTYPE with void everywhere.
15655 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15656 * s/template.h (SIGTYPE): Remove commented out definition.
15657
15658 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15659
15660 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15661 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15662
15663 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15664
15665 * w32.c (read_unc_volume): Use parameter `henum', instead of
15666 global variable `wget_enum_handle'.
15667
15668 * keymap.c (describe_vector): Remove parameters `indices' and
15669 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15670 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15671
15672 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15673
15674 * keyboard.c (timer_check): Remove parameter `do_it_now',
15675 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15676 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15677 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15678
15679 * keyboard.c (read_char):
15680 * w32menu.c (w32_menu_display_help):
15681 * xmenu.c (show_help_event, menu_help_callback):
15682 Adjust calls to `show_help_echo'.
15683
15684 * gtkutil.c (xg_maybe_add_timer):
15685 * keyboard.c (readable_events):
15686 * process.c (wait_reading_process_output):
15687 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15688
15689 * insdel.c (adjust_markers_gap_motion):
15690 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15691 (gap_left, gap_right): Don't call it.
15692
15693 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15694
15695 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15696 incurred during fontification.
15697
15698 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15699
15700 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15701 (DEFVAR_PER_BUFFER): Don't pass it.
15702
15703 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15704 (scrolling_window): Don't pass it.
15705
15706 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15707
15708 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15709
15710 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15711 and `suffix'.
15712 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15713 of variables specific to SELinux and computation of `encoded_absname'.
15714
15715 * image.c (XPutPixel): Remove unused variable `height'.
15716
15717 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15718
15719 * unexw32.c (get_section_info): Remove unused variable `section'.
15720
15721 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15722 (system_process_attributes): Remove unused variable `sess'.
15723 (sys_read): Remove unused variable `err'.
15724
15725 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15726 (w32_wnd_proc): Remove unused variable `isdead'.
15727 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15728 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15729 (x_create_tip_frame): Remove unused variable `tem'.
15730
15731 * w32inevt.c (w32_console_read_socket):
15732 Remove unused variable `no_events'.
15733
15734 * w32term.c (x_draw_composite_glyph_string_foreground):
15735 Remove unused variable `width'.
15736
15737 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15738
15739 * w32term.c (x_set_glyph_string_clipping):
15740 Don't pass uninitialized region to CombineRgn.
15741
15742 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15743
15744 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15745 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15746 (Fx_close_connection): Remove unused variable `i'.
15747
15748 * w32font.c (w32font_draw): Return number of glyphs.
15749 (w32font_open_internal): Remove unused variable `i'.
15750 (w32font_driver): Add missing initializer.
15751
15752 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15753 (fill_in_menu): Remove unused variable `items_added'.
15754
15755 * w32term.c (last_mouse_press_frame): Remove static global variable.
15756 (w32_clip_to_row): Remove unused variable `f'.
15757 (x_delete_terminal): Remove unused variable `i'.
15758
15759 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15760 (NOTHING): Remove unused static global variable.
15761 (uniscribe_check_otf): Remove unused variable `table'.
15762 (uniscribe_font_driver): Add missing initializers.
15763
15764 2011-03-23 Julien Danjou <julien@danjou.info>
15765
15766 * term.c (Fsuspend_tty, Fresume_tty):
15767 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15768 * window.c (temp_output_buffer_show):
15769 * insdel.c (signal_before_change):
15770 * frame.c (Fhandle_switch_frame):
15771 * fileio.c (Fdo_auto_save):
15772 * emacs.c (Fkill_emacs):
15773 * editfns.c (save_excursion_restore):
15774 * cmds.c (internal_self_insert):
15775 * callint.c (Fcall_interactively):
15776 * buffer.c (Fkill_all_local_variables):
15777 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15778 Use Frun_hooks.
15779 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15780 unconditionally since it does the check itself.
15781
15782 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15783
15784 Fix more problems found by GCC 4.5.2's static checks.
15785
15786 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15787 the first time through the loop, since we know p0 < p1 then.
15788 This also avoids a gcc -Wstrict-overflow warning.
15789
15790 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15791 leading to a memory leak, possible in functions like
15792 load_charset_map_from_file that can allocate an unbounded number
15793 of objects (Bug#8318).
15794
15795 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15796 that could (at least in theory) be that large.
15797
15798 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15799 This is less likely to overflow, and avoids undefined behavior if
15800 overflow does occur. All callers changed. Use strtoul to scan
15801 for the unsigned long integer.
15802 (pint2hrstr): Simplify and tune code slightly.
15803 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
15804
15805 * scroll.c (do_scrolling): Work around GCC bug 48228.
15806 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15807
15808 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15809 This also avoids a warning with gcc -Wstrict-overflow.
15810 (validate_x_resource_name): Simplify count usage.
15811 This also avoids a warning with gcc -Wstrict-overflow.
15812
15813 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15814 fail (Bug#8306).
15815
15816 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
15817
15818 * process.c (Fmake_network_process): Use socklen_t, not int,
15819 where POSIX says socklen_t is required in portable programs.
15820 This fixes a porting bug on hosts like 64-bit HP-UX, where
15821 socklen_t is wider than int (Bug#8277).
15822 (Fmake_network_process, server_accept_connection):
15823 (wait_reading_process_output, read_process_output):
15824 Likewise.
15825
15826 * process.c: Rename or move locals to avoid shadowing.
15827 (list_processes_1, Fmake_network_process):
15828 (read_process_output_error_handler, exec_sentinel_error_handler):
15829 Rename or move locals.
15830 (Fmake_network_process): Define label "retry_connect" only if needed.
15831 (Fnetwork_interface_info): Fix pointer signedness.
15832 (process_send_signal): Add cast to avoid pointer signedness problem.
15833 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
15834 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
15835
15836 Make tparam.h and terminfo.c consistent.
15837 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15838 Include tparam.h instead, since it declares them.
15839 * cm.h (PC): Remove extern decl; tparam.h now does this.
15840 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15841 * terminfo.c: Include tparam.h, to check interfaces.
15842 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15843 (tparam): Adjust signature to match interface in tparam.h;
15844 this removes some undefined behavior. Check that outstring and len
15845 are zero, which they always are with Emacs.
15846 * tparam.h (PC, BC, UP): New extern decls.
15847
15848 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
15849 (xftfont_open): Rename locals to avoid shadowing.
15850
15851 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
15852 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15853 (OTF_TAG_SYM): Omit macro if not needed.
15854 (ftfont_list): Remove unused local.
15855 (get_adstyle_property, ftfont_pattern_entity):
15856 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15857 Rename locals to avoid shadowing.
15858
15859 * xfont.c (xfont_list_family): Mark var as initialized.
15860
15861 * xml.c (make_dom): Now static.
15862
15863 * composite.c (composition_compute_stop_pos): Rename local to
15864 avoid shadowing.
15865 (composition_reseat_it): Remove unused locals.
15866 (find_automatic_composition, composition_adjust_point): Likewise.
15867 (composition_update_it): Mark var as initialized.
15868 (find_automatic_composition): Mark vars as initialized,
15869 with a FIXME (Bug#8290).
15870
15871 character.h: Rename locals to avoid shadowing.
15872 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15873 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15874 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15875 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15876 to avoid shadowing.
15877
15878 * textprop.c (property_change_between_p): Remove; unused.
15879
15880 * intervals.c (interval_start_pos): Now static.
15881
15882 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15883
15884 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15885 Rename locals to avoid shadowing.
15886
15887 * sound.c (wav_play, au_play, Fplay_sound_internal):
15888 Fix pointer signedness.
15889 (alsa_choose_format): Remove unused local var.
15890 (wav_play): Initialize a variable to 0, to prevent undefined
15891 behavior (Bug#8278).
15892
15893 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15894
15895 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15896
15897 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15898 clobbering (Bug#8298).
15899 * sysdep.c (sys_subshell): Likewise.
15900 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
15901
15902 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15903 This should get cleaned up, so that child_setup has the
15904 same signature on all platforms.
15905
15906 * callproc.c (call_process_cleanup): Now static.
15907 (relocate_fd): Rename locals to avoid shadowing.
15908
15909 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
15910
15911 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15912 not to be necessary, and produces flickering.
15913
15914 2011-03-20 Glenn Morris <rgm@gnu.org>
15915
15916 * config.in: Remove file.
15917
15918 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
15919
15920 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15921 are now in src/globals.h.
15922 (syms_of_minibuf): Remove spurious & from previous change.
15923
15924 2011-03-20 Leo Liu <sdl.web@gmail.com>
15925
15926 * minibuf.c (completing-read-function): New variable.
15927 (completing-read-default): Rename from completing-read.
15928 (completing-read): Call completing-read-function.
15929
15930 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15931
15932 * xfaces.c (Fx_load_color_file):
15933 Read color file from absolute filename (bug#8250).
15934
15935 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15936
15937 * makefile.w32-in: Update dependencies.
15938
15939 2011-03-17 Eli Zaretskii <eliz@gnu.org>
15940
15941 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15942
15943 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15944
15945 Fix more problems found by GCC 4.5.2's static checks.
15946
15947 * process.c (make_serial_process_unwind, send_process_trap):
15948 (sigchld_handler): Now static.
15949
15950 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15951 That way, the code declares only the vars that it needs.
15952 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15953 * s/cygwin.h (PTY_ITERATION): Likewise.
15954 * s/darwin.h (PTY_ITERATION): Likewise.
15955 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15956
15957 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15958 * process.c (allocate_pty): Don't declare stb unless it's needed.
15959
15960 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
15961 (CONSTANTLIM): Remove; unused.
15962 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15963 Define only if needed.
15964
15965 * unexelf.c (unexec): Name an expression,
15966 to avoid gcc -Wbad-function-cast warning.
15967 Use a different way to cause a compilation error if anyone uses
15968 n rather than nn, a way that does not involve shadowing.
15969 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
15970
15971 * deps.mk (unexalpha.o): Remove; unused.
15972
15973 New file unexec.h, the (simple) interface for unexec (Bug#8267).
15974 * unexec.h: New file.
15975 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15976 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15977 Depend on unexec.h.
15978 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15979 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15980 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
15981 Change as necessary to match prototype in unexec.h.
15982
15983 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15984 shadowing.
15985 (back_comment, skip_chars): Mark vars as initialized.
15986
15987 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15988 Rename locals to avoid shadowing.
15989
15990 * lread.c (read1): Rewrite so as not to use empty "else".
15991 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
15992
15993 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15994
15995 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15996 warning when compiling print.c.
15997
15998 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15999 instead of using an uninitialized var.
16000 (font_sort_entities): Mark var as initialized.
16001
16002 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16003
16004 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16005 pointers to constants.
16006 (font_parse_fcname): Remove unused vars.
16007 (font_delete_unmatched): Now static.
16008 (font_get_spec): Remove; unused.
16009 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16010 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16011 Rename or move locals to avoid shadowing.
16012
16013 * fns.c (require_nesting_list, require_unwind): Now static.
16014 (Ffillarray): Rename locals to avoid shadowing.
16015
16016 * floatfns.c (domain_error2): Define only if needed.
16017 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16018
16019 * alloc.c (mark_backtrace): Move decl from here ...
16020 * lisp.h: ... to here, so that it can be checked.
16021
16022 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16023 (Fdefvar): Rewrite so as not to use empty "else".
16024 (lisp_indirect_variable): Name an expression,
16025 to avoid gcc -Wbad-function-cast warning.
16026 (Fdefvar): Rename locals to avoid shadowing.
16027
16028 * callint.c (quotify_arg, quotify_args): Now static.
16029 (Fcall_interactively): Rename locals to avoid shadowing.
16030 Use const pointer when appropriate.
16031
16032 * lisp.h (get_system_name, get_operating_system_release):
16033 Move decls here, to check interfaces.
16034 * process.c (get_operating_system_release): Move decl to lisp.h.
16035 * xrdb.c (get_system_name): Likewise.
16036 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16037 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16038 some of which prompt warnings from gcc -Wbad-function-cast.
16039 (Fformat_time_string, Fencode_time, Finsert_char):
16040 (Ftranslate_region_internal, Fformat):
16041 Rename or remove local vars to avoid shadowing.
16042 (Ftranslate_region_internal): Mark var as initialized.
16043
16044 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16045 avoid shadowing.
16046
16047 * lisp.h (eassert): Check that the argument compiles, even if
16048 ENABLE_CHECKING is not defined.
16049
16050 * data.c (Findirect_variable): Name an expression, to avoid
16051 gcc -Wbad-function-cast warning.
16052 (default_value, arithcompare, arith_driver, arith_error): Now static.
16053 (store_symval_forwarding): Rename local to avoid shadowing.
16054 (Fmake_variable_buffer_local, Fmake_local_variable):
16055 Mark variables as initialized.
16056 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16057
16058 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16059 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16060 Rename locals to avoid shadowing.
16061 (mark_stack): Move local variables into the #ifdef region where
16062 they're used.
16063 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16064 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16065 needed otherwise.
16066 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16067 (GC_STRING_CHARS): Remove; not used.
16068 (Fmemory_limit): Cast sbrk's returned value to char *.
16069
16070 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16071 avoids undefined behavior in theory.
16072
16073 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16074
16075 Use functions, not macros, for up- and down-casing (Bug#8254).
16076 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16077 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16078 to use the following functions instead of these macros.
16079 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16080 EMACS_INT, since callers assume the returned value fits in int.
16081 (upcase1): Likewise, for UPCASE_TABLE.
16082 (uppercasep, lowercasep, upcase): New static inline functions.
16083 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16084 the race-condition problem in the old DOWNCASE.
16085
16086 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16087 Rename locals to avoid shadowing.
16088 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16089 (regex_compile, re_search_2, re_match_2_internal):
16090 Remove unused local vars.
16091 (FREE_VAR): Rewrite so as not to use empty "else",
16092 which gcc can warn about.
16093 (regex_compile, re_match_2_internal): Mark locals as initialized.
16094 (RETALLOC_IF): Define only if needed.
16095 (WORDCHAR_P): Likewise. This one is never needed, but is used
16096 only in a comment talking about a compiler bug, so put inside
16097 the #if 0 of that comment.
16098 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16099 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16100 Remove; unused.
16101
16102 * search.c (boyer_moore): Rename locals to avoid shadowing.
16103 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16104 (PREV_CHAR_BOUNDARY): Likewise.
16105
16106 * search.c (simple_search): Remove unused var.
16107
16108 * dired.c (compile_pattern): Move decl from here ...
16109 * lisp.h: ... to here, so that it can be checked.
16110 (struct re_registers): New forward decl.
16111
16112 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16113
16114 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16115 All uses changed.
16116 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16117 Rename locals to avoid shadowing.
16118 (Fvertical_motion): Mark locals as initialized.
16119
16120 * casefiddle.c (casify_object, casify_region): Now static.
16121 (casify_region): Mark local as initialized.
16122
16123 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16124
16125 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16126 New macros, so that the caller can use some names other than
16127 gcpro1, gcpro2, etc.
16128 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16129 of the new macros.
16130 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16131 argument, for consistency with GCPRO2_VAR, etc: it is now the
16132 prefix of the variable, not the variable itself. All uses
16133 changed.
16134 * dired.c (directory_files_internal, file_name_completion):
16135 Rename locals to avoid shadowing.
16136
16137 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16138 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16139 dired.c's scmp function, had undefined behavior.
16140 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16141 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16142 * buffer.h: ... to here, because these macros use current_buffer,
16143 and the new implementation with inline functions needs to have
16144 current_buffer in scope now, rather than later when the macros
16145 are used.
16146 (downcase, upcase1): New static inline functions.
16147 (DOWNCASE, UPCASE1): Reimplement using these functions.
16148 This avoids undefined behavior in expressions like
16149 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16150 from race conditions in accessing the global variables
16151 case_temp1 and case_temp2.
16152 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16153 * lisp.h (case_temp1, case_temp2): Remove their decls.
16154 * character.h (ASCII_CHAR_P): Move from here ...
16155 * lisp.h: ... to here, so that the inline functions mentioned
16156 above can use them.
16157
16158 * dired.c (directory_files_internal_unwind): Now static.
16159
16160 * fileio.c (file_name_as_directory, directory_file_name):
16161 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16162 Now static.
16163 (file_name_as_directory): Use const pointers when appropriate.
16164 (Fexpand_file_name): Likewise. In particular, newdir might
16165 point at constant storage, so make it a const pointer.
16166 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16167 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16168 signedness issues.
16169 (Fset_file_times, Finsert_file_contents, auto_save_error):
16170 Rename locals to avoid shadowing.
16171
16172 * minibuf.c (choose_minibuf_frame_1): Now static.
16173 (Ftry_completion, Fall_completions): Rename or remove locals
16174 to avoid shadowing.
16175
16176 * marker.c (bytepos_to_charpos): Remove; unused.
16177
16178 * lisp.h (verify_bytepos, count_markers): New decls,
16179 so that gcc does not warn that these functions aren't declared.
16180
16181 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16182 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16183 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16184 (copy_text): Remove unused local var.
16185
16186 * filelock.c (within_one_second): Now static.
16187 (lock_file_1): Rename local to avoid shadowing.
16188
16189 * buffer.c (fix_overlays_before): Mark locals as initialized.
16190 (fix_start_end_in_overlays): Likewise. This function should be
16191 simplified by using pointers-to-pointers, but that's a different
16192 matter.
16193 (switch_to_buffer_1): Now static.
16194 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16195 (report_overlay_modification): Rename locals to avoid shadowing.
16196
16197 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16198 Fix pointer signedness issue.
16199 (sys_subshell): Mark local as volatile if checking for lint,
16200 to suppress a gcc -Wclobbered warning that does not seem to be right.
16201 (MAXPATHLEN): Define only if needed.
16202
16203 * process.c (serial_open, serial_configure): Move decls from here ...
16204 * systty.h: ... to here, so that they can be checked.
16205
16206 * fns.c (get_random, seed_random): Move extern decls from here ...
16207 * lisp.h: ... to here, so that they can be checked.
16208
16209 * sysdep.c (reset_io): Now static.
16210 (wait_for_termination_signal): Remove; unused.
16211
16212 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16213 (copy_keymap_item, append_key, push_text_char_description):
16214 Now static.
16215 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16216 (DENSE_TABLE_SIZE): Remove; unused.
16217 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16218 (describe_map_tree):
16219 Rename locals to avoid shadowing.
16220
16221 * keyboard.c: Declare functions static if they are not used elsewhere.
16222 (echo_char, echo_dash, cmd_error, top_level_2):
16223 (poll_for_input, handle_async_input): Now static.
16224 (read_char, kbd_buffer_get_event, make_lispy_position):
16225 (make_lispy_event, make_lispy_movement, apply_modifiers):
16226 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16227 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16228 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16229 (read_key_sequence, read_char): Mark locals as initialized.
16230 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16231
16232 * keyboard.h (make_ctrl_char): New decl.
16233 (mark_kboards): Move decl here ...
16234 * alloc.c (mark_kboards): ... from here.
16235
16236 * lisp.h (force_auto_save_soon): New decl.
16237
16238 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16239 (DEFINE_DUMMY_FUNCTION): New macro.
16240 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16241 Use it.
16242 (main): Add casts to avoid warnings
16243 if GCC considers string literals to be constants.
16244
16245 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16246
16247 * dbusbind.c: Pointer signedness fixes.
16248 (xd_signature, xd_append_arg, xd_initialize):
16249 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16250 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16251 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16252 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16253
16254 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16255 if GCC considers string literals to be constants.
16256 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16257
16258 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16259
16260 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16261 (print_preprocess, print_object): New macro to fix last change.
16262
16263 * print.c (print_preprocess): Don't forget font objects.
16264
16265 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16266
16267 * emacs.c (USAGE3): Doc fixes.
16268
16269 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16270
16271 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16272 structure.
16273
16274 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16275
16276 * lisp.h (VWindow_system, Qfile_name_history):
16277 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16278 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16279 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16280
16281 * w32select.c: Don't #include "keyboard.h".
16282 (run_protected): Add extern declaration for waiting_for_input.
16283
16284 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16285 * w32console.c (detect_input_pending, read_input_pending)
16286 (encode_terminal_code):
16287 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16288 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16289 (w32_system_caret_y, Qfile_name_history):
16290 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16291 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16292 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16293 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16294 * w32proc.c (Qlocal, report_file_error):
16295 * w32term.c (Vwindow_system, updating_frame):
16296 * w32uniscribe.c (initialized, uniscribe_font_driver):
16297 Remove unneeded extern declarations.
16298
16299 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16300
16301 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16302
16303 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16304
16305 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16306 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16307 These macros can no longer be used for assignment.
16308
16309 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16310 Assign struct members directly, instead of using BUF_BEGV etc.
16311 (record_buffer_markers, fetch_buffer_markers): New functions for
16312 recording and fetching special buffer markers.
16313 (set_buffer_internal_1, set_buffer_temp): Use them.
16314
16315 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16316
16317 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16318
16319 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16320 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16321
16322 * xdisp.c (hscroll_window_tree):
16323 (reconsider_clip_changes): Use PT instead of BUF_PT.
16324
16325 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16326
16327 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16328 $(EMACS_ROOT)/lib/intprops.h.
16329
16330 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16331
16332 Fix more problems found by GCC 4.5.2's static checks.
16333
16334 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16335 to unsigned char * to avoid compiler diagnostic.
16336 (xg_free_frame_widgets): Make it clear that a local variable is
16337 needed only if USE_GTK_TOOLTIP.
16338 (gdk_window_get_screen): Make it clear that this macro is needed
16339 only if USE_GTK_TOOLTIP.
16340 (int_gtk_range_get_value): New function, which avoids a diagnostic
16341 from gcc -Wbad-function-cast.
16342 (xg_set_toolkit_scroll_bar_thumb): Use it.
16343 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16344 diagnostic from gcc -Wbad-function-cast.
16345 (get_utf8_string, xg_get_file_with_chooser):
16346 Rename locals to avoid shadowing.
16347 (create_dialog): Move locals to avoid shadowing.
16348
16349 * xgselect.c (xg_select): Remove unused var.
16350
16351 * image.c (four_corners_best): Mark locals as initialized.
16352 (gif_load): Initialize transparent_p to zero (Bug#8238).
16353 Mark another local as initialized.
16354 (my_png_error, my_error_exit): Mark with NO_RETURN.
16355
16356 * image.c (clear_image_cache): Now static.
16357 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16358 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16359 (x_edge_detection): Remove unnecessary cast that
16360 gcc -Wbad-function-cast diagnoses.
16361 (gif_load): Fix pointer signedness.
16362 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16363 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16364
16365 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16366
16367 Improve quality of tests for time stamp overflow.
16368 For example, without this patch (encode-time 0 0 0 1 1
16369 1152921504606846976) returns the obviously-bogus value (-948597
16370 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16371 reports time overflow. See
16372 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16373 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16374 * editfns.c: Include limits.h and intprops.h.
16375 (TIME_T_MIN, TIME_T_MAX): New macros.
16376 (time_overflow): Move earlier, to before first use.
16377 (hi_time, lo_time): New functions, for an accurate test for
16378 out-of-range times.
16379 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16380 (Fget_internal_run_time): Don't assume time_t fits in int.
16381 (make_time): Use list2 instead of Fcons twice.
16382 (Fdecode_time): More accurate test for out-of-range times.
16383 (check_tm_member): New function.
16384 (Fencode_time): Use it, to test for out-of-range times.
16385 (lisp_time_argument): Don't rely on undefined left-shift and
16386 right-shift behavior when checking for time stamp overflow.
16387
16388 * editfns.c (time_overflow): New function, refactoring common code.
16389 (Fformat_time_string, Fdecode_time, Fencode_time):
16390 (Fcurrent_time_string): Use it.
16391
16392 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16393 * dired.c (make_time): Move to ...
16394 * editfns.c (make_time): ... here.
16395 * systime.h: Note the move.
16396
16397 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16398
16399 * fringe.c (update_window_fringes): Remove unused variables.
16400
16401 * unexmacosx.c (copy_data_segment): Also copy __got section.
16402 (Bug#8223)
16403
16404 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16405
16406 * termcap.c [MSDOS]: Include "msdos.h".
16407 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16408 Constify `char *' arguments and their references according to
16409 prototypes in tparam.h.
16410
16411 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16412
16413 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16414 Adapt all references accordingly.
16415
16416 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16417
16418 2011-03-11 Tom Tromey <tromey@redhat.com>
16419
16420 * buffer.c (syms_of_buffer): Remove obsolete comment.
16421
16422 2011-03-11 Eli Zaretskii <eliz@gnu.org>
16423
16424 * termhooks.h (encode_terminal_code): Declare prototype.
16425
16426 * msdos.c (encode_terminal_code): Don't declare prototype.
16427
16428 * term.c (encode_terminal_code): Now external again, used by
16429 w32console.c and msdos.c.
16430
16431 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16432 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
16433
16434 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
16435
16436 Fix some minor problems found by GCC 4.5.2's static checks.
16437
16438 * fringe.c (update_window_fringes): Mark locals as initialized
16439 (Bug#8227).
16440 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16441
16442 * alloc.c (mark_fringe_data): Move decl from here ...
16443 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16444 to check its interface.
16445 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16446
16447 * fontset.c (free_realized_fontset): Now static.
16448 (Fset_fontset_font): Rename local to avoid shadowing.
16449 (fontset_font): Mark local as initialized.
16450 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16451
16452 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16453
16454 * xselect.c (x_disown_buffer_selections): Remove; not used.
16455 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16456 (x_own_selection, Fx_disown_selection_internal): Rename locals
16457 to avoid shadowing.
16458 (x_handle_dnd_message): Remove local to avoid shadowing.
16459
16460 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16461 so that the caller can use some name other than gcpro1.
16462 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16463 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16464 (Fx_backspace_delete_keys_p):
16465 Use them to avoid shadowing, and rename vars to avoid shadowing.
16466 (x_decode_color, x_set_name, x_window): Now static.
16467 (Fx_create_frame): Add braces to silence GCC warning.
16468 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16469 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16470 Remove unused locals.
16471 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16472 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16473 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16474 macros.
16475
16476 * xterm.h (x_mouse_leave): New decl.
16477
16478 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16479 Remove unused functions.
16480 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16481 (x_calc_absolute_position): Now static.
16482 (XTread_socket): Don't define label "out" unless it's used.
16483 Don't declare local "event" unless it's used.
16484 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16485 unless they are used.
16486 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16487 (x_fatal_error_signal): Remove; not used.
16488 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16489 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16490 (x_error_catcher, x_connection_closed, x_error_handler):
16491 (x_error_quitter, xembed_send_message, x_iconify_frame):
16492 (my_log_handler): Rename locals to avoid shadowing.
16493 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16494 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16495
16496 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16497 Rename or move locals to avoid shadowing.
16498 (tty_defined_color, merge_face_heights): Now static.
16499 (free_realized_faces_for_fontset): Remove; not used.
16500 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16501 does not deduce is never used uninitialized.
16502 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16503 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16504
16505 * terminal.c (store_terminal_param): Now static.
16506
16507 * xmenu.c (menu_highlight_callback): Now static.
16508 (set_frame_menubar): Remove unused local.
16509 (xmenu_show): Rename parameter to avoid shadowing.
16510 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16511 since they might point to immutable storage.
16512 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16513 since it's unused otherwise.
16514
16515 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16516 Add a FIXME, since the code still doesn't look right. (Bug#8215)
16517 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16518 avoids a gcc -Wuninitialized diagnostic.
16519 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16520 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16521 does not deduce are never used uninitialized.
16522
16523 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16524
16525 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16526 * window.c (window_loop, size_window):
16527 (run_window_configuration_change_hook, enlarge_window): Likewise.
16528
16529 * window.c (display_buffer): Now static.
16530 (size_window): Mark variables that gcc -Wuninitialized
16531 does not deduce are never used uninitialized.
16532 * window.h (check_all_windows): New decl, to forestall
16533 gcc -Wmissing-prototypes diagnostic.
16534 * dispextern.h (bidi_dump_cached_states): Likewise.
16535
16536 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16537 shadowing.
16538 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16539 Include <limits.h>.
16540 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16541 and to avoid gcc -Wuninitialized warning.
16542 (load_charset_map): Mark variables that gcc -Wuninitialized
16543 does not deduce are never used uninitialized.
16544 (load_charset): Abort instead of using uninitialized var (Bug#8229).
16545
16546 * coding.c (coding_set_source, coding_set_destination):
16547 Use "else { /* comment */ }" rather than "else /* comment */;"
16548 for clarity, and to avoid gcc -Wempty-body warning.
16549 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16550 a block, when the outer 'i' will do.
16551 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16552 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16553 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16554 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16555 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16556 Rename locals to avoid shadowing.
16557 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16558 * coding.c (emacs_mule_char, encode_invocation_designation):
16559 Now static, since they're not used elsewhere.
16560 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16561 (decode_coding_object, encode_coding_object, detect_coding_system):
16562 (decode_coding_emacs_mule): Mark variables that gcc
16563 -Wuninitialized does not deduce are never used uninitialized.
16564 (detect_coding_iso_2022): Initialize a local variable that might
16565 be used uninitialized. Leave a FIXME because it's not clear that
16566 this initialization is needed. (Bug#8211)
16567 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16568 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16569 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16570 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16571 Remove unused macros.
16572
16573 * category.c (hash_get_category_set): Remove unused local var.
16574 (copy_category_table): Now static, since it's not used elsewhere.
16575 * character.c (string_count_byte8): Likewise.
16576
16577 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16578 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16579
16580 * chartab.c (copy_sub_char_table): Now static, since it's not used
16581 elsewhere.
16582 (sub_char_table_ref_and_range, char_table_ref_and_range):
16583 Rename locals to avoid shadowing.
16584 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16585
16586 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16587 (BIDI_BOB): Remove unused macro.
16588
16589 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16590 deduce are never used uninitialized.
16591 * term.c (encode_terminal_code): Likewise.
16592
16593 * term.c (encode_terminal_code): Now static. Remove unused local.
16594
16595 * tparam.h: New file.
16596 * term.c, tparam.h: Include it.
16597 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16598 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16599 Move these decls to tparam.h, and make them agree with what
16600 is actually in tparam.c. The previous trick of using incompatible
16601 decls in different modules does not conform to the C standard.
16602 All callers of tparam changed to use tparam's actual API.
16603 * tparam.c (tparam1, tparam, tgoto):
16604 Use const pointers where appropriate.
16605
16606 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16607 * cm.h (struct cm): Likewise.
16608 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16609 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16610 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16611 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16612 (turn_on_face, init_tty): Likewise.
16613 * termchar.h (struct tty_display_info): Likewise.
16614
16615 * term.c (term_mouse_position): Rename local to avoid shadowing.
16616
16617 * alloc.c (mark_ttys): Move decl from here ...
16618 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16619
16620 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16621
16622 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16623
16624 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16625
16626 * search.c (compile_pattern_1): Remove argument regp, unused since
16627 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16628 (compile_pattern): Don't pass it.
16629
16630 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16631
16632 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16633 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16634 for ! HAVE_GTK3.
16635 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16636
16637 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16638
16639 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16640 gdk_window_get_screen, gdk_window_get_geometry,
16641 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16642 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16643 (xg_get_pixbuf_from_pixmap): New function.
16644 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16645 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16646 Call xg_get_pixbuf_from_pixmap instead of
16647 gdk_pixbuf_get_from_drawable.
16648 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16649 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16650 (xg_check_special_colors): Use GtkStyleContext and its functions
16651 for HAVE_GTK3.
16652 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16653 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16654 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16655 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16656 Call gtk_widget_get_preferred_size.
16657 (xg_frame_resized): gdk_window_get_geometry only takes 5
16658 parameters.
16659 (xg_win_to_widget, xg_event_is_for_menubar):
16660 Call gdk_x11_window_lookup_for_display.
16661 (xg_set_widget_bg): New function.
16662 (delete_cb): New function.
16663 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16664 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16665 (xg_set_background_color): Call xg_set_widget_bg.
16666 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16667 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16668 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16669 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16670 if ! HAVE_GTK3.
16671 (update_frame_tool_bar): Call gtk_widget_hide.
16672 (xg_initialize): Use GDK_KEY_g.
16673
16674 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16675 if ! HAVE_GTK3
16676 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16677
16678 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16679 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16680 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16681
16682 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16683
16684 * w32xfns.c (select_palette): Check success of RealizePalette against
16685 GDI_ERROR, not zero.
16686
16687 See ChangeLog.11 for earlier changes.
16688
16689 ;; Local Variables:
16690 ;; coding: utf-8
16691 ;; End:
16692
16693 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16694
16695 This file is part of GNU Emacs.
16696
16697 GNU Emacs is free software: you can redistribute it and/or modify
16698 it under the terms of the GNU General Public License as published by
16699 the Free Software Foundation, either version 3 of the License, or
16700 (at your option) any later version.
16701
16702 GNU Emacs is distributed in the hope that it will be useful,
16703 but WITHOUT ANY WARRANTY; without even the implied warranty of
16704 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16705 GNU General Public License for more details.
16706
16707 You should have received a copy of the GNU General Public License
16708 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.